review-state: the phase key of a checkpoint is unconstrained, so two spellings make two entries #492

Open
opened 2026-09-01 15:32:10 +00:00 by mph · 4 comments
Owner

Found triaging IW-436 (LESSONS.md entry 2).

parseCheckpoint (core/model/ReviewStateCliParser.scala:75-79) splits --checkpoint on the first colon and accepts any string as the phase key. So --checkpoint 1:<sha> and --checkpoint phase-01:<sha> create two separate entries for the same phase, and neither the validator (ReviewStateValidator.scala:365-388) nor the schema constrains the key.

Both spellings are in use in this repository

  • schemas/review-state.schema.json:117-122 gives examples keyed "1" and "2".
  • core/test/ReviewStateCliParserTest.scala:141,321,449 uses "phase-01" and "phase-02".

Nothing decides which is correct, so a revert-to-phase lookup can miss a checkpoint that is present under the other spelling.

Wanted

Settle the phase-key format, then enforce it — in parseCheckpoint, and consistently in the schema examples and the tests.

Scope note

Out of scope for IW-436, which fixed the checkpoint value (#464 SHA validation, #446 merge mode), not the key.

Found triaging IW-436 (LESSONS.md entry 2). `parseCheckpoint` (`core/model/ReviewStateCliParser.scala:75-79`) splits `--checkpoint` on the first colon and accepts **any** string as the phase key. So `--checkpoint 1:<sha>` and `--checkpoint phase-01:<sha>` create two separate entries for the same phase, and neither the validator (`ReviewStateValidator.scala:365-388`) nor the schema constrains the key. ## Both spellings are in use in this repository - `schemas/review-state.schema.json:117-122` gives examples keyed `"1"` and `"2"`. - `core/test/ReviewStateCliParserTest.scala:141,321,449` uses `"phase-01"` and `"phase-02"`. Nothing decides which is correct, so a revert-to-phase lookup can miss a checkpoint that is present under the other spelling. ## Wanted Settle the phase-key format, then enforce it — in `parseCheckpoint`, and consistently in the schema examples and the tests. ## Scope note Out of scope for IW-436, which fixed the checkpoint *value* (#464 SHA validation, #446 merge mode), not the key.
Member

From IW-718 follow-ups:

  • --checkpoint 2:<sha> appended to a card that holds "02" leaves both "2" and "02"; the drop (--drop-checkpoints-after, IW-718) treats both as phase 2, but the duplicate stays. — core/model/ReviewStateUpdater.scala checkpoint union keys on the raw string
From IW-718 follow-ups: - [ ] `--checkpoint 2:<sha>` appended to a card that holds `"02"` leaves both `"2"` and `"02"`; the drop (`--drop-checkpoints-after`, IW-718) treats both as phase 2, but the duplicate stays. — `core/model/ReviewStateUpdater.scala` checkpoint union keys on the raw string
Member

Intake: agent-ready
Workflow: waterfall
Reason: all gates passed
Analysis: project-management/issues/IW-492/analysis.md on branch IW-492

Intake: agent-ready Workflow: waterfall Reason: all gates passed Analysis: project-management/issues/IW-492/analysis.md on branch IW-492
Member

Implement: needs-human
Reason: batch-implement exit 1 — the kanon plugin does not compile against the iw-cli core on main: ForgeCatchUp.scala:143 expects Either[String, …] from fetchPullRequestForBranch, and core now returns Either[TrackerError, …] (#778, #780). No phase ran; nothing in IW-492 is at fault. There is no batch-implement.log, because the command stopped at compile time; the lines below are its output.

[warn]  Using directives detected in multiple files:
- /home/mph/.local/share/iw/plugins/kanon/lib/deps.scala:1:1-7:41
It is recommended to keep them centralized in the /home/mph/Devel/iw/iw-cli-IW-492/core/project.scala file.

[error] /home/mph/.local/share/iw/plugins/kanon/lib/batch/ForgeCatchUp.scala:143:7
[error] Found:    Either[iw.core.model.TrackerError, Option[batch.ForgeState]]
[error] Required: Either[String, Option[batch.ForgeState]]
Compilation failed
Implement: needs-human Reason: batch-implement exit 1 — the kanon plugin does not compile against the iw-cli core on main: ForgeCatchUp.scala:143 expects Either[String, …] from fetchPullRequestForBranch, and core now returns Either[TrackerError, …] (#778, #780). No phase ran; nothing in IW-492 is at fault. There is no batch-implement.log, because the command stopped at compile time; the lines below are its output. ``` [warn] Using directives detected in multiple files: - /home/mph/.local/share/iw/plugins/kanon/lib/deps.scala:1:1-7:41 It is recommended to keep them centralized in the /home/mph/Devel/iw/iw-cli-IW-492/core/project.scala file. [error] /home/mph/.local/share/iw/plugins/kanon/lib/batch/ForgeCatchUp.scala:143:7 [error] Found: Either[iw.core.model.TrackerError, Option[batch.ForgeState]] [error] Required: Either[String, Option[batch.ForgeState]] Compilation failed ```
Member

Release: the implement loop failed this issue for a reason outside it. The kanon plugin did not compile against iw-cli main, because the tracker port now returns TrackerError (iw-cli #778). The plugin fix is dev-docs #484, and iw-cli 0.22.1 carries the core change. The issue goes back to the implement loop.

Release: the implement loop failed this issue for a reason outside it. The kanon plugin did not compile against iw-cli main, because the tracker port now returns TrackerError (iw-cli #778). The plugin fix is dev-docs #484, and iw-cli 0.22.1 carries the core change. The issue goes back to the implement loop.
Sign in to join this conversation.
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
iterative-works/iw-cli#492
No description provided.