review-state update --checkpoint stores the key inside the value #446
Labels
No labels
agent-ready
bug
contract
documentation
duplicate
enhancement
good first issue
help wanted
invalid
needs-human
needs-input
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
iterative-works/iw-cli#446
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
iw review-state update --checkpoint "<phase>:<key>=<value>"stores the key inside the value: the<key>=prefix is not stripped.Observed
writes
The stored value is not a usable SHA. This is reproducible and long-standing — the same repository's phase 1 entry has the identical shape (
phase_checkpoints.1.context_sha = "context_sha=9271863af..."), so it is not a recent regression.ag-revertpresumably tolerates or re-parses it, but anything reading the field as a bare SHA — a script, a dashboard link, agitinvocation — gets a string that nogitcommand accepts.Expected
phase_checkpoints.4.context_sha == "81a9203fd85e5545e7c71e5d125105aac3f36598"Found during MEDECA-430 (medeca-modul-poptavky); recorded in that issue's
LESSONS.mdentry 15 and promoted at triage.Re-examined while triaging IW-437, which hit the same corruption three times.
The premise here needs correcting.
<phase>:<key>=<value>is not the intended syntax:ReviewStateCliParser.parseCheckpoint(core/model/ReviewStateCliParser.scala:75-79) splits on the first colon and its own error message readsexpected phase:sha.context_shais applied by the updater (core/model/ReviewStateUpdater.scala:198,207).So the correct invocation is
--checkpoint "<phase>:<sha>", and stripping acontext_sha=prefix would make the malformed caller silently work — entrenching the very snippet that produces these cards.The real defects, split by cause:
The caller. The
dx-fixStep 6a snippet says--checkpoint "${PHASE_NUM}:context_sha=${CONTEXT_SHA}". Filed against kanon as dev-docs#187, together with a second defect in the same five lines:--checkpointmerges withArrayMergeMode.Replaceand therefore destroys every earlier phase entry, where--append-checkpointaccumulates. IW-437 lost two checkpoints that way before anyone looked.The silence.
ReviewStateValidator(core/model/ReviewStateValidator.scala:368-378) checks only thatcontext_shais a string, so any value passes and the corruption is invisible until something tries to resolve it. Filed as #464.Superseded by #464. Closing.
Correction to the previous comment: the superseding issue is #436, not #464.
#436 (filed from IW-423) already covers this as its defect 3, and covers the companion defect 4 —
--checkpointreplacing the whole checkpoint map and wiping earlier phases. #464 was filed from IW-437 without checking the tracker first and has been closed as a duplicate of #436.The substance of the earlier comment stands:
<phase>:<key>=<value>is not the intended syntax.parseCheckpoint's own error readsexpected phase:sha(core/model/ReviewStateCliParser.scala:75-79) andcontext_shais applied by the updater (core/model/ReviewStateUpdater.scala:198,207), so stripping the prefix would make the malformed caller silently work.Superseded by #436.