fix(cli): disclose the orphaned raw copy after forget and lint unreferenced raw files - #1278
Merged
Merged
Conversation
…renced raw files (#1262) forget never edits raw/, and purge reaches a Source's raw file only through the concept's resource, so a forgotten Source's raw copy was left on disk and in git history with no command able to erase it. forget now says so and names the verified sequence (git revert of the forget commit, then purge); lint gains an advisory unreferenced-raw finding. purge's contract is unchanged.
jasonssdev
force-pushed
the
fix/1262-forget-raw-orphan
branch
from
October 2, 2026 19:46
c87e462 to
d5ad33b
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
After
forgetremoved a Source, itsraw/copy stayed on disk and in git history with nothing pointing at it:purgefinds a Source's raw file only through theresource:of a concept that still exists, so it refused, andlintdid not report the orphan. This makes the orphan visible and names the working way to erase it.purge's contract is unchanged.forget: when the removed Source'sraw/<name>is still a file, it prints that the raw path remains on disk and in git history, and the sequence that erases it today:git revert <forget-sha>(while it is still the latest commit), thenopenkos purge <id>with the same scope the forget used. When no forget commit was made it says to restore the concept from git first. It is silent when no raw copy remains.lifecycle.pygainsForgetPlan.orphaned_raw; the path validation mirrors purge's check on a Source'sresource.lint: a new advisoryunreferenced-rawfinding ("Unreferenced raw files:") from a names-only walk ofraw/, reusing the already-collected documents and degrading tonot-runonOSError. It is health opinion, not OKF conformance.forget-command("Forget Discloses The Orphaned Raw Copy") andlint("Unreferenced Raw File Scan");docs/cli.mdupdated.A one-command erasure (
purgeby raw path) is deliberately not part of this change; if wanted, it is a separate issue.Related issue
Closes #1262
Type of change
feat— new featurefix— bug fixdocs— documentation onlyrefactor— no behavior changetest— tests onlychore/ci— tooling, build, or CIHow was this tested?
forget's own output, runs the revert and the purge, and checks the raw file is gone from the working tree and fromgit rev-list --objects --all. It and the two lint tests were observed failing first.is_fileguard and the no-commit branch — got their own tests).ruff check,ruff format --check,mypy .,pytest --cov(96.45%),evals/run_self_tests.py(46/46) pass locally.Checklist
ruff,mypy,pytest).