PhasePr models the CI wait as two exclusive Booleans guarded at runtime, not as one disposition #569

Open
opened 2026-09-16 09:02:12 +00:00 by claude · 4 comments
Member

Found while working IW-566.

PhasePrOptions and its Resolved form carry batch and noWait as two independent Booleans, but only three of the four combinations are legal. The fourth (--batch --no-wait) is refused by a runtime guard in PhasePr.run, which means the type permits a state the command then rejects, and the guard has to be remembered by anyone who adds a third wait-related flag.

PROPOSED FIX. Replace the two Booleans with one sum type naming the three real dispositions — gate only, gate and merge, hand the wait to the caller. The illegal pair becomes unrepresentable and the runtime guard, plus its test, can be deleted.

Not urgent: the guard is tested and correct today. This is about keeping it correct without anyone having to know it exists.

Found while working IW-566. `PhasePrOptions` and its `Resolved` form carry `batch` and `noWait` as two independent Booleans, but only three of the four combinations are legal. The fourth (`--batch --no-wait`) is refused by a runtime guard in `PhasePr.run`, which means the type permits a state the command then rejects, and the guard has to be remembered by anyone who adds a third wait-related flag. PROPOSED FIX. Replace the two Booleans with one sum type naming the three real dispositions — gate only, gate and merge, hand the wait to the caller. The illegal pair becomes unrepresentable and the runtime guard, plus its test, can be deleted. Not urgent: the guard is tested and correct today. This is about keeping it correct without anyone having to know it exists.
Author
Member

Found during IW-513. Two more items in the same PhasePr wait-flag code — the resume lines rebuild the CI-wait flags by hand, so they belong with the disposition change:

  • The pre-gate resume line of phase-pr repeats only --batch and --no-wait; a non-default --timeout, --poll-interval or --body is lost on resume. — IW-513 FOLLOW-UPS.md
  • The gate's own exit-3 resume line omits --batch and does not use resumeCommand (PhasePr.finish, Unreadable report: double quotes, not the shell-safe single quotes). — IW-513 FOLLOW-UPS.md
Found during IW-513. Two more items in the same `PhasePr` wait-flag code — the resume lines rebuild the CI-wait flags by hand, so they belong with the disposition change: - [ ] The pre-gate resume line of `phase-pr` repeats only `--batch` and `--no-wait`; a non-default `--timeout`, `--poll-interval` or `--body` is lost on resume. — IW-513 FOLLOW-UPS.md - [ ] The gate's own exit-3 resume line omits `--batch` and does not use `resumeCommand` (`PhasePr.finish`, `Unreadable` report: double quotes, not the shell-safe single quotes). — IW-513 FOLLOW-UPS.md
Author
Member

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

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

Implement: needs-human
Reason: batch-implement exit 1 — the kanon plugin does not compile against iw-cli core at main: lib/batch/ForgeCatchUp.scala:143 expects Either[String, Option[ForgeState]], but the tracker port on main returns Either[TrackerError, ...] since #778–#780. No phase ran. This blocks every iw-cli item until the plugin is updated, not only this issue.

[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-569/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
exit=1
Implement: needs-human Reason: batch-implement exit 1 — the kanon plugin does not compile against iw-cli core at main: lib/batch/ForgeCatchUp.scala:143 expects Either[String, Option[ForgeState]], but the tracker port on main returns Either[TrackerError, ...] since #778–#780. No phase ran. This blocks every iw-cli item until the plugin is updated, not only this issue. ``` [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-569/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 exit=1 ```
Author
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
1 participant
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#569
No description provided.