fix(cli): stage discard could not discard an edge deletion - #96
Conversation
It summarised the stage without the pulled index, while status and diff both go through summarize_workdir, which loads it. Any delta whose rendering needs a lookup then failed — an edge deletion above all: hydrate: a staged edge deletion targets an edge that isn't in the pulled index So the verb could not undo the thing a reader is most likely to want undone: the deletion they made a moment ago. It exited 1 and left the work staged, which is the state the verb exists to escape. Found by using the product — authoring the example graph through the CLI, deleting an edge to see the coherence finding, then trying to put it back. The module's own doc already said the summary must come from the same projection status and diff use; the code called a different one. A missing index is still fine (nothing to look up); a corrupt one still fails loud, which is why an older test's malformed fixture had to become well-formed. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
|
Superseded — the fix this PR carries is already on
It arrived via #97 ( The problem with merging this now is mechanical rather than conceptual: this branch predates #97 and #98, so Nothing is lost. If you want the history, the commit is |
Found by using the product, not by reading it: authoring a graph through the CLI, deleting an edge to see the coherence finding, then trying to put it back.
stage discardsummarised the stage withsummarize(&stage, None)— no index — whilestatusanddiffboth usesummarize_workdir, which loads it. Any delta whose rendering needs a lookup then fails, and a staged edge deletion is exactly that.So the verb could not undo the thing a reader is most likely to want undone, and left the work staged: the state it exists to escape. The module's own doc already said the summary must come from "the same
OpSummaryprojectionstatusanddiffuse" — the code called a different one.Verified against the real service after the fix:
A missing index is still fine — there is nothing to look up. A corrupt one still fails loud, which is why an older test's malformed
{"version":1}fixture had to become well-formed; that test was passing only becausediscardnever read the file.Mutation-verified: restoring
summarize(&stage, None)fails the new test.440 tests,
fmtandclippy -D warningsclean.