Teach PR-workflow agents to watch CI and fix failed checks before reporting done #744

Closed
opened 2026-07-09 02:36:01 +00:00 by coilyco-ops · 11 comments
Member

PR-workflow headless agents currently appear to treat 'branch pushed and pull request opened' as the done-condition. The seed mentions the review gate should run only after CI is green, but it does not clearly instruct the agent to watch the newly opened PR checks and keep fixing failures until the PR is green before posting WARD-OUTCOME done.\n\nAcceptance criteria:\n\n* For pull-request workflows, the seeded instructions explicitly require the agent to monitor PR CI/checks after opening the PR.\n* A failing check is not a done state. The agent must fetch logs/status, patch the branch, push updates, and repeat until checks are green or the failure is genuinely blocked.\n* The final WARD-OUTCOME done marker is only allowed after the workflow-specific target has been reached and required CI is green.\n* The review gate wording composes with this behavior instead of implying the agent can stop immediately after opening the PR.\n* Tests pin the PR workflow seed text so this regression is visible.

PR-workflow headless agents currently appear to treat 'branch pushed and pull request opened' as the done-condition. The seed mentions the review gate should run only after CI is green, but it does not clearly instruct the agent to watch the newly opened PR checks and keep fixing failures until the PR is green before posting WARD-OUTCOME done.\n\nAcceptance criteria:\n\n* For pull-request workflows, the seeded instructions explicitly require the agent to monitor PR CI/checks after opening the PR.\n* A failing check is not a done state. The agent must fetch logs/status, patch the branch, push updates, and repeat until checks are green or the failure is genuinely blocked.\n* The final WARD-OUTCOME done marker is only allowed after the workflow-specific target has been reached and required CI is green.\n* The review gate wording composes with this behavior instead of implying the agent can stop immediately after opening the PR.\n* Tests pin the PR workflow seed text so this regression is visible.
Author
Member

🔒 Reserved by ward agent --harness codex — container engineer-codex-ward-744 on host kais-macbook-pro-2.local is carrying this issue (reserved 2026-07-09T02:36:07Z). Concurrent ward agent runs are blocked until it finishes or the reservation goes stale (1h TTL); --force overrides.

Do not comment on or edit this issue to steer the run while it is reserved. The engineer seeded the body once at launch and never re-reads it, so a comment or edit reaches only human readers, never the running engineer. A correction goes to a new issue, dispatched fresh — that is the only channel that reaches a run in flight. Where the forge supports it, ward locks this conversation to make that a road-block rather than a convention (ward#494).

run seed context — what this run is carrying (ward#609)
  • Resolved: coilyco-flight-deck/ward#744 · branch issue-744 · harness codex · workflow pr
  • Run: engineer-codex-ward-744 · ward v0.470.0 · dispatched 2026-07-09T02:36:07Z
  • Comment thread: 0 included in the pre-flight read, 0 stripped (ward's own automated comments).

Static container doctrine and seed boilerplate are identical every run and omitted here (they ride ward v0.470.0).

— Codex, via ward agent

<!-- ward-agent-reservation --> 🔒 Reserved by `ward agent --harness codex` — container `engineer-codex-ward-744` on host `kais-macbook-pro-2.local` is carrying this issue (reserved 2026-07-09T02:36:07Z). Concurrent `ward agent` runs are blocked until it finishes or the reservation goes stale (1h TTL); `--force` overrides. **Do not comment on or edit this issue to steer the run while it is reserved.** The engineer seeded the body once at launch and never re-reads it, so a comment or edit reaches only human readers, never the running engineer. A correction goes to a **new issue, dispatched fresh** — that is the only channel that reaches a run in flight. Where the forge supports it, ward locks this conversation to make that a road-block rather than a convention (ward#494). <details><summary>run seed context — what this run is carrying (ward#609)</summary> - **Resolved:** `coilyco-flight-deck/ward#744` · branch `issue-744` · harness `codex` · workflow `pr` - **Run:** `engineer-codex-ward-744` · ward `v0.470.0` · dispatched `2026-07-09T02:36:07Z` - **Comment thread:** 0 included in the pre-flight read, 0 stripped (ward's own automated comments). Static container doctrine and seed boilerplate are identical every run and omitted here (they ride ward v0.470.0). </details> <!-- ward-agent-signature --> — Codex, via `ward agent`
Author
Member

WARD-OUTCOME: done - PR workflow agents now have an explicit CI-watch loop before they can report done.
review summary: skipped: review gate skipped because --skip-preflight / --no-preflight also skips review
This was mostly straightforward once the seed text was pinned. The only real friction was an unrelated dead const that golangci-lint caught, plus the docs size cap on dispatch-review.md, which I trimmed instead of splitting.
Confidence is high. The remaining rough edge is that the PR workflow guidance now lives across the workflow, review, and FEATURES docs.

WARD-OUTCOME: done - PR workflow agents now have an explicit CI-watch loop before they can report done. review summary: skipped: review gate skipped because --skip-preflight / --no-preflight also skips review This was mostly straightforward once the seed text was pinned. The only real friction was an unrelated dead const that golangci-lint caught, plus the docs size cap on `dispatch-review.md`, which I trimmed instead of splitting. Confidence is high. The remaining rough edge is that the PR workflow guidance now lives across the workflow, review, and FEATURES docs.
Author
Member

⚠️ Reopened: this run's work did not land on main

An ephemeral ward container (codex mode) dispatched for this issue finished but its work was not merged to main, so the reaper preserved it on a branch before teardown and reopened the issue (a closing reference for #744 never reached main). Recover from the salvage branch below.

  • Repo: coilyco-flight-deck/ward
  • Salvage branch: ward-salvage/ward-58aa3fe3
  • Pull request: not opened - PR creation failed: forgejo: parse created pull request: unexpected end of JSON input
  • Reason: run workflow does not land on main (--workflow pr/patch-only)
  • Container uptime at reap: 10m (age of the baked Forgejo PAT snapshot; a long-lived container is likelier to carry a rotated token)

Reap diagnostics

--- reap diagnostics ---
ward version:      v0.470.0
version source:    pinned via WARD_VERSION/--ward-version (v0.470.0)
HEAD:              73df73749099
origin/main:       8cab230822ab
ancestry:          HEAD is NOT yet on origin/main - residual work remains to land
decision gate:     workflow does not land on main (--workflow pr/patch-only)
reason:            run workflow does not land on main (--workflow pr/patch-only)
provenance:        not read (workflow hold)
run-owned landed:  no
working tree:      clean
container uptime:  10m (baked Forgejo PAT age proxy)
--- end reap diagnostics ---

Recover

git fetch https://forgejo.coilysiren.me/coilyco-flight-deck/ward.git ward-salvage/ward-58aa3fe3
git checkout -b ward-salvage/ward-58aa3fe3 FETCH_HEAD

— Codex, via ward agent

## ⚠️ Reopened: this run's work did not land on `main` An ephemeral `ward container` (codex mode) dispatched for this issue finished but its work was **not merged to `main`**, so the reaper preserved it on a branch before teardown and reopened the issue (a closing reference for #744 never reached `main`). Recover from the salvage branch below. - **Repo:** `coilyco-flight-deck/ward` - **Salvage branch:** `ward-salvage/ward-58aa3fe3` - **Pull request:** not opened - PR creation failed: forgejo: parse created pull request: unexpected end of JSON input - **Reason:** run workflow does not land on main (--workflow pr/patch-only) - **Container uptime at reap:** 10m (age of the baked Forgejo PAT snapshot; a long-lived container is likelier to carry a rotated token) ## Reap diagnostics ``` --- reap diagnostics --- ward version: v0.470.0 version source: pinned via WARD_VERSION/--ward-version (v0.470.0) HEAD: 73df73749099 origin/main: 8cab230822ab ancestry: HEAD is NOT yet on origin/main - residual work remains to land decision gate: workflow does not land on main (--workflow pr/patch-only) reason: run workflow does not land on main (--workflow pr/patch-only) provenance: not read (workflow hold) run-owned landed: no working tree: clean container uptime: 10m (baked Forgejo PAT age proxy) --- end reap diagnostics --- ``` ## Recover ```bash git fetch https://forgejo.coilysiren.me/coilyco-flight-deck/ward.git ward-salvage/ward-58aa3fe3 git checkout -b ward-salvage/ward-58aa3fe3 FETCH_HEAD ``` <!-- ward-agent-signature --> — Codex, via `ward agent`
Author
Member

Incident evidence, 2026-07-09 05:46 UTC:

This issue is now directly blocking recovery. During the warded stoppage, PR-workflow runs for ward#760, ward#763, and ward#764 posted WARD-OUTCOME: done while their PR checks were failing or still running:

  • PR #761 (ward#760) - test / test failed at golangci-lint after the done comment.
  • PR #765 (ward#763) - test / test failed at golangci-lint after the done comment.
  • PR #766 (ward#764) - run was still in golangci-lint when checked after the done comment.

That makes the director think work is complete when the merge gate is still red. Please teach PR-workflow agents to wait for the PR check conclusion and either fix failures or report WARD-OUTCOME: blocked, not done. Use --skip-review for this emergency run because the review gate is part of the incident surface.

Incident evidence, 2026-07-09 05:46 UTC: This issue is now directly blocking recovery. During the warded stoppage, PR-workflow runs for `ward#760`, `ward#763`, and `ward#764` posted `WARD-OUTCOME: done` while their PR checks were failing or still running: * PR #761 (`ward#760`) - `test / test` failed at `golangci-lint` after the done comment. * PR #765 (`ward#763`) - `test / test` failed at `golangci-lint` after the done comment. * PR #766 (`ward#764`) - run was still in `golangci-lint` when checked after the done comment. That makes the director think work is complete when the merge gate is still red. Please teach PR-workflow agents to wait for the PR check conclusion and either fix failures or report `WARD-OUTCOME: blocked`, not `done`. Use `--skip-review` for this emergency run because the review gate is part of the incident surface.
Author
Member

🔒 Reserved by ward agent --harness codex — container engineer-codex-ward-744 on host kais-macbook-pro-2.local is carrying this issue (reserved 2026-07-09T05:48:38Z). Concurrent ward agent runs are blocked until it finishes or the reservation goes stale (1h TTL); --force overrides.

Do not comment on or edit this issue to steer the run while it is reserved. The engineer seeded the body once at launch and never re-reads it, so a comment or edit reaches only human readers, never the running engineer. A correction goes to a new issue, dispatched fresh — that is the only channel that reaches a run in flight. Where the forge supports it, ward locks this conversation to make that a road-block rather than a convention (ward#494).

run seed context — what this run is carrying (ward#609)
  • Resolved: coilyco-flight-deck/ward#744 · branch issue-744 · harness codex · workflow pr
  • Run: engineer-codex-ward-744 · ward v0.474.0 · dispatched 2026-07-09T05:48:38Z
  • Comment thread: 3 included in the pre-flight read, 1 stripped (ward's own automated comments).

Static container doctrine and seed boilerplate are identical every run and omitted here (they ride ward v0.474.0).

— Codex, via ward agent

<!-- ward-agent-reservation --> 🔒 Reserved by `ward agent --harness codex` — container `engineer-codex-ward-744` on host `kais-macbook-pro-2.local` is carrying this issue (reserved 2026-07-09T05:48:38Z). Concurrent `ward agent` runs are blocked until it finishes or the reservation goes stale (1h TTL); `--force` overrides. **Do not comment on or edit this issue to steer the run while it is reserved.** The engineer seeded the body once at launch and never re-reads it, so a comment or edit reaches only human readers, never the running engineer. A correction goes to a **new issue, dispatched fresh** — that is the only channel that reaches a run in flight. Where the forge supports it, ward locks this conversation to make that a road-block rather than a convention (ward#494). <details><summary>run seed context — what this run is carrying (ward#609)</summary> - **Resolved:** `coilyco-flight-deck/ward#744` · branch `issue-744` · harness `codex` · workflow `pr` - **Run:** `engineer-codex-ward-744` · ward `v0.474.0` · dispatched `2026-07-09T05:48:38Z` - **Comment thread:** 3 included in the pre-flight read, 1 stripped (ward's own automated comments). - included: @coilyco-ops (2026-07-09T02:46:10Z), @coilyco-ops (2026-07-09T02:46:37Z), @coilyco-ops (2026-07-09T05:48:29Z) - stripped: @coilyco-ops (2026-07-09T02:36:09Z) Static container doctrine and seed boilerplate are identical every run and omitted here (they ride ward v0.474.0). </details> <!-- ward-agent-signature --> — Codex, via `ward agent`
Author
Member

Director recovery note, 2026-07-09T06:21Z:

PR #753 has the right fix direction for this issue, and its original checks were green, but it is now stale against current main after the incident fixes landed. A local merge test of pull/753/head onto current ward main (da447ff4304324fbbb29abbe28b4a938c666a1e4) conflicts in:

  • cmd/ward/agent_workflow.go
  • docs/FEATURES.md
  • docs/agent-workflow.md

The fresh run should reapply the #753 behavior on top of current main, keeping the new #768/#770/#765/#766 changes intact:

  • PR workflow seed says opening the PR is not done.
  • PR workflow done-condition includes required checks green.
  • PR workflow agents must watch CI, fetch failed logs/status, patch the branch, and repeat until green or genuinely blocked.
  • Do not reintroduce the removed reasonWorkflowHold constant.

Use --skip-review for this incident recovery lane; the review gate itself is being repaired in adjacent work.

Director recovery note, 2026-07-09T06:21Z: PR #753 has the right fix direction for this issue, and its original checks were green, but it is now stale against current main after the incident fixes landed. A local merge test of `pull/753/head` onto current ward main (`da447ff4304324fbbb29abbe28b4a938c666a1e4`) conflicts in: * `cmd/ward/agent_workflow.go` * `docs/FEATURES.md` * `docs/agent-workflow.md` The fresh run should reapply the #753 behavior on top of current main, keeping the new #768/#770/#765/#766 changes intact: * PR workflow seed says opening the PR is not done. * PR workflow done-condition includes required checks green. * PR workflow agents must watch CI, fetch failed logs/status, patch the branch, and repeat until green or genuinely blocked. * Do not reintroduce the removed `reasonWorkflowHold` constant. Use `--skip-review` for this incident recovery lane; the review gate itself is being repaired in adjacent work.
Author
Member

🔒 Reserved by ward agent --harness codex — container engineer-codex-ward-744 on host kais-macbook-pro-2.local is carrying this issue (reserved 2026-07-09T06:21:44Z). Concurrent ward agent runs are blocked until it finishes or the reservation goes stale (1h TTL); --force overrides.

Do not comment on or edit this issue to steer the run while it is reserved. The engineer seeded the body once at launch and never re-reads it, so a comment or edit reaches only human readers, never the running engineer. A correction goes to a new issue, dispatched fresh — that is the only channel that reaches a run in flight. Where the forge supports it, ward locks this conversation to make that a road-block rather than a convention (ward#494).

run seed context — what this run is carrying (ward#609)
  • Resolved: coilyco-flight-deck/ward#744 · branch issue-744 · harness codex · workflow pr
  • Run: engineer-codex-ward-744 · ward v0.474.0 · dispatched 2026-07-09T06:21:44Z
  • Comment thread: 4 included in the pre-flight read, 2 stripped (ward's own automated comments).

Static container doctrine and seed boilerplate are identical every run and omitted here (they ride ward v0.474.0).

— Codex, via ward agent

<!-- ward-agent-reservation --> 🔒 Reserved by `ward agent --harness codex` — container `engineer-codex-ward-744` on host `kais-macbook-pro-2.local` is carrying this issue (reserved 2026-07-09T06:21:44Z). Concurrent `ward agent` runs are blocked until it finishes or the reservation goes stale (1h TTL); `--force` overrides. **Do not comment on or edit this issue to steer the run while it is reserved.** The engineer seeded the body once at launch and never re-reads it, so a comment or edit reaches only human readers, never the running engineer. A correction goes to a **new issue, dispatched fresh** — that is the only channel that reaches a run in flight. Where the forge supports it, ward locks this conversation to make that a road-block rather than a convention (ward#494). <details><summary>run seed context — what this run is carrying (ward#609)</summary> - **Resolved:** `coilyco-flight-deck/ward#744` · branch `issue-744` · harness `codex` · workflow `pr` - **Run:** `engineer-codex-ward-744` · ward `v0.474.0` · dispatched `2026-07-09T06:21:44Z` - **Comment thread:** 4 included in the pre-flight read, 2 stripped (ward's own automated comments). - included: @coilyco-ops (2026-07-09T02:46:10Z), @coilyco-ops (2026-07-09T02:46:37Z), @coilyco-ops (2026-07-09T05:48:29Z), @coilyco-ops (2026-07-09T06:21:37Z) - stripped: @coilyco-ops (2026-07-09T02:36:09Z), @coilyco-ops (2026-07-09T05:48:39Z) Static container doctrine and seed boilerplate are identical every run and omitted here (they ride ward v0.474.0). </details> <!-- ward-agent-signature --> — Codex, via `ward agent`
Author
Member

WARD-OUTCOME: done - PR workflow agents now keep watching CI until the PR checks are green before done.
workflow: pr; review summary: skipped: review gate skipped by --skip-review / --no-review-gate

The seed and docs took the expected shape once the merge conflicts were sorted out. The only friction was reconciling older branch history in a few workflow and review files, but the end state is consistent and I’m confident in it.

WARD-OUTCOME: done - PR workflow agents now keep watching CI until the PR checks are green before done. workflow: pr; review summary: skipped: review gate skipped by --skip-review / --no-review-gate The seed and docs took the expected shape once the merge conflicts were sorted out. The only friction was reconciling older branch history in a few workflow and review files, but the end state is consistent and I’m confident in it.
Author
Member

Director review, 2026-07-09T06:44Z:

Do not merge PR #753 yet. Local ward exec test and ward exec lint pass, but the final diff has a docs regression in docs/FEATURES.md: the new workflow bullet changed the ward#707 link to https://forgejo.coilyco-flight-deck/ward/issues/707, which is missing the coilysiren.me/coilyco-flight-deck path.

Please update PR #753 in place from current issue-744, fixing that link to https://forgejo.coilysiren.me/coilyco-flight-deck/ward/issues/707. Keep the existing #753 behavior and do not rebase onto salvage-only history again.

Director review, 2026-07-09T06:44Z: Do not merge PR #753 yet. Local `ward exec test` and `ward exec lint` pass, but the final diff has a docs regression in `docs/FEATURES.md`: the new workflow bullet changed the `ward#707` link to `https://forgejo.coilyco-flight-deck/ward/issues/707`, which is missing the `coilysiren.me/coilyco-flight-deck` path. Please update PR #753 in place from current `issue-744`, fixing that link to `https://forgejo.coilysiren.me/coilyco-flight-deck/ward/issues/707`. Keep the existing #753 behavior and do not rebase onto salvage-only history again.
Author
Member

🔒 Reserved by ward agent --harness codex — container engineer-codex-ward-744 on host kais-macbook-pro-2.local is carrying this issue (reserved 2026-07-09T06:40:10Z). Concurrent ward agent runs are blocked until it finishes or the reservation goes stale (1h TTL); --force overrides.

Do not comment on or edit this issue to steer the run while it is reserved. The engineer seeded the body once at launch and never re-reads it, so a comment or edit reaches only human readers, never the running engineer. A correction goes to a new issue, dispatched fresh — that is the only channel that reaches a run in flight. Where the forge supports it, ward locks this conversation to make that a road-block rather than a convention (ward#494).

run seed context — what this run is carrying (ward#609)
  • Resolved: coilyco-flight-deck/ward#744 · branch issue-744 · harness codex · workflow pr
  • Run: engineer-codex-ward-744 · ward v0.474.0 · dispatched 2026-07-09T06:40:10Z
  • Comment thread: 6 included in the pre-flight read, 3 stripped (ward's own automated comments).

Static container doctrine and seed boilerplate are identical every run and omitted here (they ride ward v0.474.0).

— Codex, via ward agent

<!-- ward-agent-reservation --> 🔒 Reserved by `ward agent --harness codex` — container `engineer-codex-ward-744` on host `kais-macbook-pro-2.local` is carrying this issue (reserved 2026-07-09T06:40:10Z). Concurrent `ward agent` runs are blocked until it finishes or the reservation goes stale (1h TTL); `--force` overrides. **Do not comment on or edit this issue to steer the run while it is reserved.** The engineer seeded the body once at launch and never re-reads it, so a comment or edit reaches only human readers, never the running engineer. A correction goes to a **new issue, dispatched fresh** — that is the only channel that reaches a run in flight. Where the forge supports it, ward locks this conversation to make that a road-block rather than a convention (ward#494). <details><summary>run seed context — what this run is carrying (ward#609)</summary> - **Resolved:** `coilyco-flight-deck/ward#744` · branch `issue-744` · harness `codex` · workflow `pr` - **Run:** `engineer-codex-ward-744` · ward `v0.474.0` · dispatched `2026-07-09T06:40:10Z` - **Comment thread:** 6 included in the pre-flight read, 3 stripped (ward's own automated comments). - included: @coilyco-ops (2026-07-09T02:46:10Z), @coilyco-ops (2026-07-09T02:46:37Z), @coilyco-ops (2026-07-09T05:48:29Z), @coilyco-ops (2026-07-09T06:21:37Z), @coilyco-ops (2026-07-09T06:37:39Z), @coilyco-ops (2026-07-09T06:40:09Z) - stripped: @coilyco-ops (2026-07-09T02:36:09Z), @coilyco-ops (2026-07-09T05:48:39Z), @coilyco-ops (2026-07-09T06:21:45Z) Static container doctrine and seed boilerplate are identical every run and omitted here (they ride ward v0.474.0). </details> <!-- ward-agent-signature --> — Codex, via `ward agent`
Author
Member

WARD-OUTCOME: done - PR workflow agents now keep watching PR checks before they can report done.
workflow: pr; review summary: skipped: review gate skipped by --skip-review / --no-review-gate
This was mostly a rebase onto a branch that already carried the main PR-watch logic. The only extra code I had to land was the teardown wording, and that was straightforward. Confidence is high; the main rough edge is that the behavior now spans seed, docs, tests, and reap wording.

WARD-OUTCOME: done - PR workflow agents now keep watching PR checks before they can report done. workflow: pr; review summary: skipped: review gate skipped by --skip-review / --no-review-gate This was mostly a rebase onto a branch that already carried the main PR-watch logic. The only extra code I had to land was the teardown wording, and that was straightforward. Confidence is high; the main rough edge is that the behavior now spans seed, docs, tests, and reap wording.
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
coilyco-flight-deck/ward#744
No description provided.