rehearsal: deploy-pending state + deploy-verified close — a blocker whose fix is on main but not yet live must stop routing to agents and must close itself when the deploy rail installs it #1187

Closed
opened 2026-09-03 15:20:05 +00:00 by ben · 2 comments
Owner

The defect (phase-7 first drive, 2026-09-03)

#1178's fix (0fc29770) landed on main 11 min after the healer filed it. The drive then stayed blocked for 10 h 05: 2 h 43 while the broker deploy rail was stranded (#1180/#1182/#1183), then 7 h 04 with the fix LIVE on broker.idss.nz (binary mtime 07:31Z) and #1178 still open until a human ran the ancestry check and closed it at 14:35Z. Meanwhile the session-runner picked the same ready-for-session ticket up twice for its residue — a deploy wait, not code — and spent 25 min / $8.00 babysitting a CI rail before flagging agent-blocked.

Nothing in the loop can tell that a blocker's remaining work is 'is the binary live?', and nothing closes it when it is.

The ruling this ticket lands (report: Phase 7, Healer First — changes 1 + 2)

  1. New label deploy-pending — a blocker whose fix commit is on main but lives in a deployed-service tree (broker/**, go.mod, go.sum — the publish-broker path set) and is not yet installed. The session-runner and swarm never see it (they filter on ready-for-session / ready-for-agent, which the swap removes). Documented in docs/agents/triage-labels.md.
  2. Executor tick swap (scripts/rehearsal-executor.sh, the blocked branch): for each open blocker of the drive issue, if a commit on origin/main mentions #<n> and touches the broker path set, the blocker is swapped to deploy-pending (ready-* labels dropped) with one comment naming the fix commit. Pure core in scripts/lib/rehearsal-deploy-pending-lib.sh, offline-tested.
  3. Deploy-verified close (scripts/deploy-verified-close.sh <deployed-sha>): closes every open deploy-pending issue whose fix commit is an ancestor of the deployed sha, with a comment carrying the ancestry proof. Run by ci.yml's deploy-broker job after a successful install and by broker-deploy.yml's manual/rollback door. The drive re-fires on that close.

Acceptance

  • offline: fix-on-main → pending; fix ∈ ancestors(deployed) → deployed; no broker fix → none; a swap posts exactly one comment and drops ready-* labels; a close names the fix sha and the deployed sha.
  • the deploy-broker job runs the closer with the repo checked out at full depth.
  • ready-for-session / ready-for-agent and deploy-pending are mutually exclusive on a blocker.

Origin: the phase-7 first-11-hours report (2026-09-03). Claimed by the reporting session (agent-working).

## The defect (phase-7 first drive, 2026-09-03) #1178's fix (`0fc29770`) landed on main 11 min after the healer filed it. The drive then stayed blocked for **10 h 05**: 2 h 43 while the broker deploy rail was stranded (#1180/#1182/#1183), then **7 h 04 with the fix LIVE on broker.idss.nz** (binary mtime 07:31Z) and #1178 still open until a human ran the ancestry check and closed it at 14:35Z. Meanwhile the session-runner picked the same `ready-for-session` ticket up twice for its residue — a deploy wait, not code — and spent 25 min / $8.00 babysitting a CI rail before flagging `agent-blocked`. Nothing in the loop can tell that a blocker's remaining work is 'is the binary live?', and nothing closes it when it is. ## The ruling this ticket lands (report: Phase 7, Healer First — changes 1 + 2) 1. **New label `deploy-pending`** — a blocker whose fix commit is on main but lives in a deployed-service tree (`broker/**`, `go.mod`, `go.sum` — the publish-broker path set) and is not yet installed. The session-runner and swarm never see it (they filter on `ready-for-session` / `ready-for-agent`, which the swap removes). Documented in `docs/agents/triage-labels.md`. 2. **Executor tick swap** (`scripts/rehearsal-executor.sh`, the blocked branch): for each open blocker of the drive issue, if a commit on origin/main mentions `#<n>` and touches the broker path set, the blocker is swapped to `deploy-pending` (ready-* labels dropped) with one comment naming the fix commit. Pure core in `scripts/lib/rehearsal-deploy-pending-lib.sh`, offline-tested. 3. **Deploy-verified close** (`scripts/deploy-verified-close.sh <deployed-sha>`): closes every open `deploy-pending` issue whose fix commit is an ancestor of the deployed sha, with a comment carrying the ancestry proof. Run by ci.yml's `deploy-broker` job after a successful install and by broker-deploy.yml's manual/rollback door. The drive re-fires on that close. ## Acceptance - offline: fix-on-main → `pending`; fix ∈ ancestors(deployed) → `deployed`; no broker fix → `none`; a swap posts exactly one comment and drops ready-* labels; a close names the fix sha and the deployed sha. - the deploy-broker job runs the closer with the repo checked out at full depth. - `ready-for-session` / `ready-for-agent` and `deploy-pending` are mutually exclusive on a blocker. Origin: the phase-7 first-11-hours report (2026-09-03). Claimed by the reporting session (agent-working).

This was generated by AI during triage.

Ruled by agent under ADR 0174 — veto anytime

Ruling: ready-for-session (category enhancement already present).

Why this state. The change edits .forgejo/workflows/ci.yml (the deploy-broker job, ci.yml:207) and .forgejo/workflows/broker-deploy.yml — both under .forgejo/, a protected path (.sandcastle/swarm-policy.sh:49). Rule 9 of .sandcastle/prompt-enrichments/rules.md forbids a swarm worker from editing protected paths and routes them to ready-for-session. The ticket's scripts (scripts/rehearsal-executor.sh, scripts/lib/rehearsal-deploy-pending-lib.sh, scripts/deploy-verified-close.sh, docs/agents/triage-labels.md) and the new deploy-pending label are swarm-safe on their own, but the protected-path CI edits make the whole ticket session work. Not ready-for-agent.

Why a two-way door. A state label change is revertible; no data destroyed, no posture widened. Provable by the protected-path predicate (.forgejo/ ∈ PROTECTED_PATHS) and the offline tests the acceptance list specifies (fix-on-main→pending, ∈ancestors→deployed, no-broker-fix→none, exactly-one-comment, deploy-pending mutually exclusive with ready-* labels). Not on the one-way-door list.

Note: already agent-working (self-claimed by the filing session); this backfills the state role beneath the claim.

> *This was generated by AI during triage.* ## Ruled by agent under ADR 0174 — veto anytime **Ruling:** `ready-for-session` (category `enhancement` already present). **Why this state.** The change edits `.forgejo/workflows/ci.yml` (the `deploy-broker` job, `ci.yml:207`) and `.forgejo/workflows/broker-deploy.yml` — both under `.forgejo/`, a **protected path** (`.sandcastle/swarm-policy.sh:49`). Rule 9 of `.sandcastle/prompt-enrichments/rules.md` forbids a swarm worker from editing protected paths and routes them to `ready-for-session`. The ticket's scripts (`scripts/rehearsal-executor.sh`, `scripts/lib/rehearsal-deploy-pending-lib.sh`, `scripts/deploy-verified-close.sh`, `docs/agents/triage-labels.md`) and the new `deploy-pending` label are swarm-safe on their own, but the protected-path CI edits make the whole ticket session work. **Not** `ready-for-agent`. **Why a two-way door.** A state label change is revertible; no data destroyed, no posture widened. Provable by the protected-path predicate (`.forgejo/` ∈ `PROTECTED_PATHS`) and the offline tests the acceptance list specifies (fix-on-main→`pending`, ∈ancestors→`deployed`, no-broker-fix→`none`, exactly-one-comment, `deploy-pending` mutually exclusive with ready-* labels). Not on the one-way-door list. Note: already `agent-working` (self-claimed by the filing session); this backfills the state role beneath the claim.
Author
Owner

Close report — landed 04aa72df on main (Ruled by session under ADR 0174 — veto anytime). Two-way: labels, shell libs and a rail step after a successful install, all revertible by one commit; no spend, no posture change.

What landed

  • Label deploy-pending created (id 228) and documented in docs/agents/triage-labels.md.
  • scripts/lib/rehearsal-deploy-pending-lib.sh: pure git core — rehearsal_deploy_fix_commits (commits on a ref naming #<n> with a non-digit boundary, touching broker/ go.mod go.sum), rehearsal_deploy_pending_state → none | pending | deployed by merge-base --is-ancestor; candidates = open deps still on ready-for-session/ready-for-agent; the swap adds deploy-pending, drops only the ready-* labels the issue carries, comments once naming the fix sha; the verified close comments the ancestry proof and PATCHes closed.
  • scripts/rehearsal-executor.sh blocked branch: fetches origin/main and runs rehearsal_deploy_pending_sweep every blocked tick, beside the needs-design page.
  • scripts/deploy-verified-close.sh <installed-sha>: lists open deploy-pending, verifies against the checkout, closes; tokenless / unknown-sha / shallow are named loud, rc 0 always.
  • ci.yml deploy-broker and broker-deploy.yml: full-depth checkout + the closer step AFTER the install step (step order = only a successful install closes).

Acceptance (offline, scripts/tests/rehearsal-deploy-pending-test.sh, 8 cases): fix-on-main → pending; installed carries fix → deployed; #11780 never reads as #1178; scripts-only commit → none; swap = 1 label POST + 1 DELETE (ready-for-session only) + 1 comment, missing label WARNs and touches nothing; sweep swaps #1178 and leaves the no-fix and already-pending blockers alone; verified close closes exactly the carried fixes with the proof, none when the installed sha predates them; the closer SCRIPT end to end against a throwaway repo; wiring greps on the executor and both rails, closer after install.

Live proof owed to the next deploy: the next deploy-broker run closes whatever deploy-pending issue it carries — the first real instance will be the first broker fix after this lands. Not yet exercised live.

**Close report — landed `04aa72df` on main (Ruled by session under ADR 0174 — veto anytime).** Two-way: labels, shell libs and a rail step after a successful install, all revertible by one commit; no spend, no posture change. **What landed** - Label `deploy-pending` created (id 228) and documented in `docs/agents/triage-labels.md`. - `scripts/lib/rehearsal-deploy-pending-lib.sh`: pure git core — `rehearsal_deploy_fix_commits` (commits on a ref naming `#<n>` with a non-digit boundary, touching `broker/ go.mod go.sum`), `rehearsal_deploy_pending_state` → none | pending | deployed by `merge-base --is-ancestor`; candidates = open deps still on `ready-for-session`/`ready-for-agent`; the swap adds `deploy-pending`, drops only the ready-* labels the issue carries, comments once naming the fix sha; the verified close comments the ancestry proof and PATCHes closed. - `scripts/rehearsal-executor.sh` blocked branch: fetches origin/main and runs `rehearsal_deploy_pending_sweep` every blocked tick, beside the needs-design page. - `scripts/deploy-verified-close.sh <installed-sha>`: lists open `deploy-pending`, verifies against the checkout, closes; tokenless / unknown-sha / shallow are named loud, rc 0 always. - `ci.yml` `deploy-broker` and `broker-deploy.yml`: full-depth checkout + the closer step AFTER the install step (step order = only a successful install closes). **Acceptance (offline, `scripts/tests/rehearsal-deploy-pending-test.sh`, 8 cases):** fix-on-main → pending; installed carries fix → deployed; `#11780` never reads as `#1178`; scripts-only commit → none; swap = 1 label POST + 1 DELETE (ready-for-session only) + 1 comment, missing label WARNs and touches nothing; sweep swaps #1178 and leaves the no-fix and already-pending blockers alone; verified close closes exactly the carried fixes with the proof, none when the installed sha predates them; the closer SCRIPT end to end against a throwaway repo; wiring greps on the executor and both rails, closer after install. **Live proof owed to the next deploy:** the next `deploy-broker` run closes whatever `deploy-pending` issue it carries — the first real instance will be the first broker fix after this lands. Not yet exercised live.
ben closed this issue 2026-09-03 15:50:56 +00:00
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
Matou/idss#1187
No description provided.