review-state update --drop-checkpoints-after N #718
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#718
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?
Problem
A workflow that reverts a branch to the checkpoint of phase N (kanon
ag-revert:git reset --hard <phase N context sha>) must bring the review-state card back to phase N. The card must keep the checkpoints of phases 1..N and lose those of phases after N: after the reset, those checkpoints name commits that are no longer in the branch history, and a later revert to one of them would reset to an orphaned commit.updatecannot do this in one call.--checkpointand--append-checkpointare synonyms that union into the card (core/model/ReviewStateCliParser.scala:171,unionOnAppend = trueat:281; deliberate sincea16b79fd, "must never lose an earlier phase").--clear-checkpointsdrops all of them and wins over both. So the caller must clear and re-add in two writes, filtering the checkpoints itself — logic that belongs in the tool, and a window where a failed second write leaves the card with no checkpoints.Change
iw review-state update --drop-checkpoints-after Nremoves every entry ofphase_checkpointswhose phase is greater than N, in the same merge and the same atomic write as the other flags of the call."02"and"2"are phase 2;"10"is after"9"). A key that is not a number: decide and document (refuse the update, or keep the entry).--checkpoint/--append-checkpointin the same call still union in; the drop applies to the existing card's entries and to the added ones alike, so the result never holds a phase after N.--clear-checkpointsin the same call: refuse as conflicting flags, or let clear win — decide and document.--checkpointis described as replacing the list, but it unions.Acceptance
update --status context_ready --phase 2 --step context --drop-checkpoints-after 2leaves checkpoints 1 and 2 with their SHAs, and the other fields updated.--drop-checkpoints-after 0leaves no checkpoints."02"and"10"are compared as numbers.Context
Consumer: kanon DEVDOCS-439 Phase 2,
ag-revertStep 5b: oneupdateafter the reset, with no checkpoint filtering in the agent's code (decided by Michal, 2026-10-05). DEVDOCS-439's final PR waits for the iw-cli release that ships this and IW-715.Type: feature
Filed from:
/home/mph/ops/kanon-DEVDOCS-439on branchDEVDOCS-439-phase-02