IW-690: ci-gate --expected-head #763

Merged
mph merged 15 commits from IW-690 into main 2026-10-08 06:21:51 +00:00
Member

Summary

iw ci-gate gets an optional flag, --expected-head SHA. The caller gives the full commit id of the head that it pushed. The gate then judges only that head: a reading of any other head is not judged, the gate keeps waiting, and the wait times out if the forge never reports that head. Without the flag, the behaviour does not change.

This lets kanon awaitCi stop a stale-head judgement after a ci-fix push, so a stale red does not use up a recovery attempt.

Changes

  • core/model/CiGate.scala: pure fullCommitId validation (40 or 64 hex characters, any case, normalised to lower case).
  • core/commands/CiGateCommand.scala: the flag, validation as the first step of resolve (exit 1 with a clear error, no other work), value passed into CiGateTarget.expectedHead; help and exit-code text updated.
  • docs/api/CiGate.md: flag documented.
  • Tests: unit (CiGateTest), harness (CiGateCommandHarnessTest), BATS smoke (test/ci-gate.bats).

Testing

  • Phase PR #761 passed CI on its head.
  • Pre-push checks on this branch: core compile (no warnings), scalafix, core unit tests, command compilation — all pass.

Review packet: project-management/issues/IW-690/review-packet.md.
Follow-up filed: #762.

Release notes

See project-management/issues/IW-690/release-notes.md (Czech).

🤖 Generated with Claude Code

Closes #690

## Summary `iw ci-gate` gets an optional flag, `--expected-head SHA`. The caller gives the full commit id of the head that it pushed. The gate then judges only that head: a reading of any other head is not judged, the gate keeps waiting, and the wait times out if the forge never reports that head. Without the flag, the behaviour does not change. This lets kanon `awaitCi` stop a stale-head judgement after a ci-fix push, so a stale red does not use up a recovery attempt. ## Changes - `core/model/CiGate.scala`: pure `fullCommitId` validation (40 or 64 hex characters, any case, normalised to lower case). - `core/commands/CiGateCommand.scala`: the flag, validation as the first step of `resolve` (exit 1 with a clear error, no other work), value passed into `CiGateTarget.expectedHead`; help and exit-code text updated. - `docs/api/CiGate.md`: flag documented. - Tests: unit (`CiGateTest`), harness (`CiGateCommandHarnessTest`), BATS smoke (`test/ci-gate.bats`). ## Testing - Phase PR #761 passed CI on its head. - Pre-push checks on this branch: core compile (no warnings), scalafix, core unit tests, command compilation — all pass. Review packet: `project-management/issues/IW-690/review-packet.md`. Follow-up filed: #762. ## Release notes See `project-management/issues/IW-690/release-notes.md` (Czech). 🤖 Generated with [Claude Code](https://claude.com/claude-code) Closes #690
ci-gate has no way to take an expected head, so kanon awaitCi cannot stop a stale-head judgement

Artifacts:
- analysis.md
- issue.md

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01B8ZD5foFWAE2zV1xYojPMa
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01B8ZD5foFWAE2zV1xYojPMa
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01B8ZD5foFWAE2zV1xYojPMa
ci-gate has no way to take an expected head, so kanon awaitCi cannot stop a stale-head judgement

Artifacts:
- tasks.md
- review-state.json (tasks_ready)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01B8ZD5foFWAE2zV1xYojPMa
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01B8ZD5foFWAE2zV1xYojPMa
Issue: IW-690
Phase: 1 - ci-gate --expected-head

This commit marks the checkpoint for phase 1 context generation.
Use wf-implement IW-690 to return to this point.

🤖 Generated with Claude Code

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
ci-gate --expected-head

Artifacts:
- phase-01-tasks.md

🤖 Generated with Claude Code

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
docs(IW-690): review packet and release notes
All checks were successful
CI / changes (pull_request) Successful in 5s
CI / contract (pull_request) Has been skipped
CI / format (pull_request) Successful in 11s
CI / lint (pull_request) Successful in 13s
CI / compile (pull_request) Successful in 1m35s
CI / dashboard-build (pull_request) Successful in 1m26s
CI / test (pull_request) Successful in 18m33s
7a7fd8e12e
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
mph merged commit 3abaf3e323 into main 2026-10-08 06:21:51 +00:00
Sign in to join this conversation.
No description provided.