rehearsal: page the silent park — ready-for-human flips on a drive issue page Mattermost; filing cap becomes per-arc #1138

Closed
opened 2026-09-02 05:59:17 +00:00 by ben · 2 comments
Owner

Why (from the #854 phase-5 retrospective)

The reporter's filing cap flips a drive issue to ready-for-human and walks away. The lane then shows "blockers: none" — to every watcher, human and agent, it looks healthy while nothing drives. This parked the #854 arc three times (drives 20260826T220705Z, 20260901T064809Z, 20260901T093209Z), twice overnight; silent parks plus deep-fix waits account for 71 of the arc's 96 idle hours against 53.8 h of actual driving. The needs-design pager (08-29 speedups) already proves the page mechanism live on both hosts.

What

  1. Page the flip. In the executor's blocked-branch (where the needs-design page already fires), also page Mattermost whenever a drive issue's labels gain ready-for-human — same channel, message naming the drive issue, the last drive id, and the reason if the cap comment is found.
  2. Per-arc cap. Lift the reporter's filing-cap constant into REHEARSAL_FILING_CAP (read from rehearsal-env.sh, current value as default) so an arc expected to run overnight can raise it without a code change.
  3. The cap-flip comment pages too — the moment the reporter gives up is the moment a human is needed; don't wait for the next executor tick to notice.

Acceptance

  • Flipping ready-for-human onto a drive issue (by reporter cap or by hand) produces a Mattermost page within one executor tick, on both hosts.
  • REHEARSAL_FILING_CAP=NN in rehearsal-env.sh changes the cap; unset keeps today's behaviour.
  • No page storm: one page per flip, not per tick (marker file, same pattern as the needs-design page).

Evidence: phase-5 report (62 drives / 96 h idle), #854 comments of the three cap-flip drives.

## Why (from the #854 phase-5 retrospective) The reporter's filing cap flips a drive issue to `ready-for-human` and walks away. The lane then shows **"blockers: none"** — to every watcher, human and agent, it looks healthy while nothing drives. This parked the #854 arc **three times** (drives `20260826T220705Z`, `20260901T064809Z`, `20260901T093209Z`), twice overnight; silent parks plus deep-fix waits account for **71 of the arc's 96 idle hours** against 53.8 h of actual driving. The needs-design pager (08-29 speedups) already proves the page mechanism live on both hosts. ## What 1. **Page the flip.** In the executor's blocked-branch (where the needs-design page already fires), also page Mattermost whenever a drive issue's labels gain `ready-for-human` — same channel, message naming the drive issue, the last drive id, and the reason if the cap comment is found. 2. **Per-arc cap.** Lift the reporter's filing-cap constant into `REHEARSAL_FILING_CAP` (read from `rehearsal-env.sh`, current value as default) so an arc expected to run overnight can raise it without a code change. 3. **The cap-flip comment pages too** — the moment the reporter gives up is the moment a human is needed; don't wait for the next executor tick to notice. ## Acceptance - Flipping `ready-for-human` onto a drive issue (by reporter cap or by hand) produces a Mattermost page within one executor tick, on both hosts. - `REHEARSAL_FILING_CAP=NN` in `rehearsal-env.sh` changes the cap; unset keeps today's behaviour. - No page storm: one page per flip, not per tick (marker file, same pattern as the needs-design page). Evidence: phase-5 report (62 drives / 96 h idle), #854 comments of the three cap-flip drives.

Executor half LANDED (commit 0d55eaa9bf64d564ee022fcf246e0114cbfd070c on main); reporter half handed to a session

Shipped (acceptance clauses 1 & 3): the silent-park page's executor half.
The moment the standing drive issue's OWN labels gain ready-for-human — the
reporter's filing cap flipping it, or a human by hand — rehearsal-executor.sh
pages Mattermost once per flip (marker under test-results/flip-pages/,
cleared when the flip is undone so a re-park re-pages). The page names the drive,
its last drive id, and the reporter's flip reason. It fires before the
ready-for-agent gate, because the cap flip removes ready-for-agent so a
flipped drive never reaches the blocked branch that carries the needs-design
page. Offline-proven: scripts/tests/rehearsal-flip-page-test.sh (5 checks).
Both hosts run this executor on the */2 cron, so the page fires within one
tick on both.

  • scripts/lib/rehearsal-flip-page-lib.sh (new — pure rehearsal_flip_gated + thin pager, sibling of rehearsal-design-page-lib.sh)
  • scripts/rehearsal-executor.sh (wired)
  • scripts/tests/rehearsal-flip-page-test.sh (new)

Blocked → a session (acceptance clause 2 + item 3's reporter-side page):
both edits land in .sandcastle/rehearsal-report.sh, a protected path
(the #445 tree-fingerprint boundary — a sandcastle agent may not touch it; every
prior edit to that file is by session-runner/human). Per CLAUDE.md Rule 9 /
ADR 0174 this is a ready-for-session machinery change:

  1. Per-arc cap (item 2): replace the hardcoded new_filed -ge 2 filing cap
    with ${REHEARSAL_FILING_CAP:-2} so an overnight arc can raise it via the
    host rehearsal-env.sh without a code change (default keeps today's 2).
  2. Cap-flip pages immediately (item 3): have flip_drive_to_human call the
    new rehearsal_flip_page (already on main, in scripts/lib/) at the moment
    it flips, so the page does not wait for the next executor tick. (Clause 1/3's
    "within one executor tick" is already met by the executor half above; this is
    the "don't wait a tick" refinement.)

Relabeled ready-for-agent → ready-for-session. A session finishes the two
reporter edits above and closes; the executor half is already merged.

### Executor half LANDED (commit `0d55eaa9bf64d564ee022fcf246e0114cbfd070c` on `main`); reporter half handed to a session **Shipped (acceptance clauses 1 & 3):** the silent-park page's **executor half**. The moment the standing drive issue's OWN labels gain `ready-for-human` — the reporter's filing cap flipping it, or a human by hand — `rehearsal-executor.sh` pages Mattermost **once per flip** (marker under `test-results/flip-pages/`, cleared when the flip is undone so a re-park re-pages). The page names the drive, its last drive id, and the reporter's flip reason. It fires **before** the `ready-for-agent` gate, because the cap flip *removes* `ready-for-agent` so a flipped drive never reaches the blocked branch that carries the needs-design page. Offline-proven: `scripts/tests/rehearsal-flip-page-test.sh` (5 checks). Both hosts run this executor on the `*/2` cron, so the page fires within one tick on both. - `scripts/lib/rehearsal-flip-page-lib.sh` (new — pure `rehearsal_flip_gated` + thin pager, sibling of `rehearsal-design-page-lib.sh`) - `scripts/rehearsal-executor.sh` (wired) - `scripts/tests/rehearsal-flip-page-test.sh` (new) **Blocked → a session (acceptance clause 2 + item 3's reporter-side page):** both edits land in **`.sandcastle/rehearsal-report.sh`**, a **protected path** (the #445 tree-fingerprint boundary — a sandcastle agent may not touch it; every prior edit to that file is by `session-runner`/human). Per CLAUDE.md Rule 9 / ADR 0174 this is a `ready-for-session` machinery change: 1. **Per-arc cap (item 2):** replace the hardcoded `new_filed -ge 2` filing cap with `${REHEARSAL_FILING_CAP:-2}` so an overnight arc can raise it via the host `rehearsal-env.sh` without a code change (default keeps today's 2). 2. **Cap-flip pages immediately (item 3):** have `flip_drive_to_human` call the new `rehearsal_flip_page` (already on `main`, in `scripts/lib/`) at the moment it flips, so the page does not wait for the next executor tick. (Clause 1/3's "within one executor tick" is already met by the executor half above; this is the "don't wait a tick" refinement.) Relabeled `ready-for-agent` → `ready-for-session`. A session finishes the two reporter edits above and closes; the executor half is already merged.

Close report — #1138 reporter half landed (both halves now complete)

Ruled by agent under ADR 0174 — two-way doors only, veto anytime. The executor half already shipped (drive 0d55eaa9); this session lands the reporter half, which lives in the PROTECTED, dev-factory-vendored .sandcastle/rehearsal-report.sh — so fixed upstream and re-vendored (no in-repo edit surface; a local edit would red check-harness-drift.sh).

What landed

1. Per-arc filing cap (acceptance clause 2) — the reporter's hardcoded 2-new-issues cap becomes REHEARSAL_FILING_CAP (default 2), an env default. The host's rehearsal-env.sh can raise it for an arc expected to run overnight without a code change; unset keeps today's 2. The reporter inherits it from the environment exactly as it already does REHEARSAL_DRIVE_TARGET (sourced by rehearsal-cycle.sh, which invokes the reporter as a child).

2. The cap-flip pages immediately (item 3 + acceptance clause 1) — flip_drive_to_human() now calls a new page_silent_park() the instant it parks the drive on a human, rather than waiting for the next executor tick to notice the quiet lane. It posts through the reporter's own notify-mattermost.sh (the healer-refusal page idiom — this file is vendored byte-identical into every consumer, #53, so it stays layout-agnostic instead of sourcing the idss-side lib) and names the drive + the flip reason + the issue link.

3. No page storm (acceptance clause 3) — the reporter SHARES the executor's one-page-per-flip marker (test-results/flip-pages/<drive>.paged under REHEARSAL_FLIP_PAGE_ROOT, default the repo root exactly as the executor derives it): whichever half fires first writes the marker, the other skips; the executor clears it on re-arm so a later re-park pages afresh. A failed post writes no marker → retries on the executor's next tick.

Proof

  • .sandcastle/tests/rehearsal-report-test.sh — 44 cases pass (+3 new): REHEARSAL_FILING_CAP=1 files at most 1 new issue; the flip pages and writes the marker; a re-park with the marker present does NOT re-page. The offline test now unsets MATTERMOST_* so it degrades to stderr and never posts to the live channel (a real hazard the previous test never exercised, since the old reporter's flip did not page).
  • dev-factory full onboarding test suite + bash -n clean; check-harness-drift: OK after re-vendor.

Commits / audit trail

  • dev-factory de2f190 — the reporter change, pushed to Matou/dev-factory@main (host FORGEJO_TOKEN write; anonymous re-vendor fetch, no token in the tree).
  • idss 4aaca1d8 — re-vendored (FACTORY_REF → de2f190), STATUS.md header updated. advances #1138.

On "both hosts" (acceptance clause 1)

The reporter is one vendored file; both hosts run it from the idss checkout, so both get the page the tick after they sync origin/main. The mechanism is proven offline; a live-host page is the ordinary drive path (two-way, reversible). No one-way door was needed anywhere in this ticket — all changes are revertible commits + config, proven by the offline suite.

## Close report — #1138 reporter half landed (both halves now complete) Ruled by agent under ADR 0174 — two-way doors only, veto anytime. The executor half already shipped (drive `0d55eaa9`); this session lands the **reporter half**, which lives in the PROTECTED, dev-factory-vendored `.sandcastle/rehearsal-report.sh` — so fixed **upstream** and re-vendored (no in-repo edit surface; a local edit would red `check-harness-drift.sh`). ### What landed **1. Per-arc filing cap (acceptance clause 2)** — the reporter's hardcoded 2-new-issues cap becomes `REHEARSAL_FILING_CAP` (default 2), an env default. The host's `rehearsal-env.sh` can raise it for an arc expected to run overnight **without a code change**; unset keeps today's 2. The reporter inherits it from the environment exactly as it already does `REHEARSAL_DRIVE_TARGET` (sourced by `rehearsal-cycle.sh`, which invokes the reporter as a child). **2. The cap-flip pages immediately (item 3 + acceptance clause 1)** — `flip_drive_to_human()` now calls a new `page_silent_park()` the instant it parks the drive on a human, rather than waiting for the next executor tick to notice the quiet lane. It posts through the reporter's own `notify-mattermost.sh` (the healer-refusal page idiom — this file is vendored byte-identical into every consumer, #53, so it stays layout-agnostic instead of sourcing the idss-side lib) and names the drive + the flip reason + the issue link. **3. No page storm (acceptance clause 3)** — the reporter SHARES the executor's one-page-per-flip marker (`test-results/flip-pages/<drive>.paged` under `REHEARSAL_FLIP_PAGE_ROOT`, default the repo root exactly as the executor derives it): whichever half fires first writes the marker, the other skips; the executor clears it on re-arm so a later re-park pages afresh. A failed post writes no marker → retries on the executor's next tick. ### Proof - `.sandcastle/tests/rehearsal-report-test.sh` — **44 cases pass** (+3 new): `REHEARSAL_FILING_CAP=1` files at most 1 new issue; the flip pages and writes the marker; a re-park with the marker present does NOT re-page. The offline test now unsets `MATTERMOST_*` so it degrades to stderr and **never posts to the live channel** (a real hazard the previous test never exercised, since the old reporter's flip did not page). - dev-factory full onboarding test suite + `bash -n` clean; `check-harness-drift: OK` after re-vendor. ### Commits / audit trail - dev-factory `de2f190` — the reporter change, pushed to `Matou/dev-factory@main` (host `FORGEJO_TOKEN` write; anonymous re-vendor fetch, no token in the tree). - idss `4aaca1d8` — re-vendored (`FACTORY_REF` → `de2f190`), `STATUS.md` header updated. advances #1138. ### On "both hosts" (acceptance clause 1) The reporter is one vendored file; both hosts run it from the idss checkout, so both get the page the tick after they sync `origin/main`. The mechanism is proven offline; a live-host page is the ordinary drive path (two-way, reversible). No one-way door was needed anywhere in this ticket — all changes are revertible commits + config, proven by the offline suite.
matou-build-agent 2026-09-02 11:10:13 +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#1138
No description provided.