rehearsal: healer-first, ticket-on-refusal — every red heals in-lane unless a refusal rule fires; cap 200→400 (Ben ruled 2026-09-02) #1144

Closed
opened 2026-09-02 06:25:20 +00:00 by ben · 1 comment
Owner

Ruled by Ben (2026-09-02): restructure the drive loop to healer-first, ticket-on-refusal

This supersedes the narrower "widen the healer's rail signatures" finding from the phase-5 retrospective: with no signature gate, the refusal rules ARE the rails.

Why

Phase-5 data: the healer self-fixed 18 of 61 reds at ~170k output tokens each — roughly a tenth of the swarm's per-fix token cost — with zero reverted commits, and a healer fix re-fires the drive on the next 2-minute tick where a ticketed fix waits on the swarm queue (median ticket time-to-close 18 min, but queue + drive re-fire latency is much larger in practice). The signature gate is what kept the healer to 18: every unrecognized red went to the reporter → ticket → swarm even when mechanical.

The counter-lesson the restructure must respect: the arc's two most valuable finds (#1114, #1134) were product defects needing design rulings. A healer whose goal is "make the drive green" and meets such a red has one cheap move — weaken the assertion (the #1113 lesson: a red that is inconvenient is not a red that is wrong). The refusal rules below exist to force those reds onto the ticket path with the paper trail intact.

What

  1. Healer-first, no signature gate. Every red drive goes to the healer before the reporter. Known-signature rails and their fixes carry over unchanged.
  2. Three hard refusal rules. The healer must refuse (not attempt) when a candidate fix would:
    • touch an assertion/expectation line, or delete/skip a leg or test — the healer may never weaken what a check proves;
    • exceed the line cap — raised 200 → 400 non-test lines (Ben, this ticket);
    • change product behaviour surfaces (anything under internal/ or app/src that alters what a community sees or what a deploy does — harness, fixtures, scripts/, wiring and test plumbing are fair game).
  3. Ticket-on-refusal. A refusing healer files the blocker ticket itself — the reporter's format, PLUS the healer's own diagnosis section (what it found, why it refused, which rule fired). The reporter's evidence-attachment behaviour (screenshots, wire states) moves into or is invoked by this path so nothing is lost against today's tickets.
  4. The filing cap and its page apply to healer-filed tickets exactly as to reporter-filed ones (#1138).
  5. Rail-6 lockout semantics survive: a healer fix that reds the SAME leg::error again is a failed heal — the second red for one signature goes straight to ticket-on-refusal, never a second heal attempt (no heal loops).

Acceptance

  • A mechanical red (e.g. fixture wait ceiling, selector drift) heals in-lane with no ticket, drive re-fires next tick.
  • A red whose fix would edit an expect(...)/assertion line produces a ticket with a "healer refused: assertion rule" diagnosis, and no commit.
  • A red needing >400 non-test lines produces a ticket with the cap diagnosis.
  • A red at standing that the healer refuses carries priority on its ticket (composes with the retro-5 reporter change).
  • Same signature red twice in a row → ticket, not a second heal.
  • Offline tests cover the three refusal rules and the loop-guard; healer commit-message format unchanged (rehearsal healer: … (sig …)).

Evidence: phase-5 retrospective (18/61 self-fixes, zero reverts, token ratios); #1113 correction on the tracker; healer cap history 09d2ea0e (GOTCHAS #115).

## Ruled by Ben (2026-09-02): restructure the drive loop to healer-first, ticket-on-refusal This supersedes the narrower "widen the healer's rail signatures" finding from the phase-5 retrospective: with no signature gate, the refusal rules ARE the rails. ## Why Phase-5 data: the healer self-fixed 18 of 61 reds at ~170k output tokens each — roughly a tenth of the swarm's per-fix token cost — with zero reverted commits, and a healer fix re-fires the drive on the next 2-minute tick where a ticketed fix waits on the swarm queue (median ticket time-to-close 18 min, but queue + drive re-fire latency is much larger in practice). The signature gate is what kept the healer to 18: every unrecognized red went to the reporter → ticket → swarm even when mechanical. The counter-lesson the restructure must respect: the arc's two most valuable finds (#1114, #1134) were product defects needing design rulings. A healer whose goal is "make the drive green" and meets such a red has one cheap move — weaken the assertion (the #1113 lesson: a red that is inconvenient is not a red that is wrong). The refusal rules below exist to force those reds onto the ticket path with the paper trail intact. ## What 1. **Healer-first, no signature gate.** Every red drive goes to the healer before the reporter. Known-signature rails and their fixes carry over unchanged. 2. **Three hard refusal rules.** The healer must refuse (not attempt) when a candidate fix would: - touch an assertion/expectation line, or delete/skip a leg or test — the healer may never weaken what a check proves; - exceed the line cap — **raised 200 → 400 non-test lines** (Ben, this ticket); - change product behaviour surfaces (anything under `internal/` or `app/src` that alters what a community sees or what a deploy does — harness, fixtures, `scripts/`, wiring and test plumbing are fair game). 3. **Ticket-on-refusal.** A refusing healer files the blocker ticket itself — the reporter's format, PLUS the healer's own diagnosis section (what it found, why it refused, which rule fired). The reporter's evidence-attachment behaviour (screenshots, wire states) moves into or is invoked by this path so nothing is lost against today's tickets. 4. **The filing cap and its page apply to healer-filed tickets** exactly as to reporter-filed ones (#1138). 5. **Rail-6 lockout semantics survive**: a healer fix that reds the SAME leg::error again is a failed heal — the second red for one signature goes straight to ticket-on-refusal, never a second heal attempt (no heal loops). ## Acceptance - A mechanical red (e.g. fixture wait ceiling, selector drift) heals in-lane with no ticket, drive re-fires next tick. - A red whose fix would edit an `expect(...)`/assertion line produces a ticket with a "healer refused: assertion rule" diagnosis, and no commit. - A red needing >400 non-test lines produces a ticket with the cap diagnosis. - A red at `standing` that the healer refuses carries `priority` on its ticket (composes with the retro-5 reporter change). - Same signature red twice in a row → ticket, not a second heal. - Offline tests cover the three refusal rules and the loop-guard; healer commit-message format unchanged (`rehearsal healer: … (sig …)`). Evidence: phase-5 retrospective (18/61 self-fixes, zero reverts, token ratios); #1113 correction on the tracker; healer cap history 09d2ea0e (GOTCHAS #115).

Close report — #1144 landed (Ruled by agent under ADR 0174 — veto anytime)

The drive loop is now healer-first with ticket-on-refusal. Landed upstream in Matou/dev-factory first (the healer/reporter/prompt are factory-vendored, ADR 0180), then re-vendored into idss (check-harness-drift green).

Two-way door (revertible code, offline-proven, and the rehearsal loop is DISARMED on every host so this is inert until a human re-arms): no personal credentials, no security-posture widening — the refusal rules NARROW the healer's reach — no member-facing trust, no data destruction, no spend.

What landed

dev-factory (Matou/dev-factory): 07d779e (restructure) + 2d7a089 (noglob fix), on main.
idss: 10657340 on main (re-vendor + idss product-surface declaration + STATUS).

  • The refusal rules ARE the rails — rehearsal-heal-lib.sh's heal_rails gained three hard backstops that reset the checkout and name the rule in HEAL_RAIL_REASON:
    1. Never weaken a check — a diff that removes/rewrites an expect(...)/assert line, or deletes/skips a leg or test, refuses (the #1113 guard). A selector-drift heal editing a locator/action line (not an assertion) still heals in-lane.
    2. Line cap 200→400 non-test lines (test files still excluded).
    3. Never change a product-behaviour surface — consumer-declared HEAL_PRODUCT_SURFACE_GLOBS (factory ships it empty; IDSS sets internal/* app/src/* in its own non-vendored .sandcastle/report-guard.sh). Harness/fixtures/scripts//test-plumbing stay healable.
  • Ticket-on-refusal — rehearsal-report.sh's try_heal files the blocker ITSELF on a refusal, reusing the healer's single claude call and naming the rule + the healer's own finding. HEAL_RAIL_SWARMABLE routes a too-big-but-mechanical refusal to the swarm (ready-for-agent), and a weaken-a-check / product-surface refusal to a ruling (ready-for-session). Filing flows through the existing cap/priority/dependency-wiring path (so #1138's cap and the priority float apply, and a standing-leg refusal carries priority).
  • Loop-guard (rail-6) — a fault healed on a prior drive that reds again goes straight to ticket-on-refusal via heal_healed_* marks; never a second heal (no heal loops).
  • Heal-prompt skeleton rewritten to the healer-first framing + the three rules; render goldens regenerated. Commit-message format unchanged (rehearsal healer: … (sig …)).

Acceptance criteria — all met, offline-proven

  • Mechanical red heals in-lane, no ticket — ✅ (rehearsal-healer-test heal path; selector-drift rehearsal-heal-lib R1d passes the rails).
  • expect(...)/assertion edit → ticket "healer refused (assertion rule)", no commit — ✅ (rehearsal-heal-lib R1a/b/c, rehearsal-healer case 13).
  • 400 non-test lines → ticket with the cap diagnosis — ✅ (rehearsal-heal-lib case 3 + the 400/401 boundary 3f; cap-breach files via ticket-on-refusal).

  • Standing refusal carries priority — ✅ (funnelled through the shared touched→priority float).
  • Same signature twice → ticket, not a second heal — ✅ (rehearsal-heal-lib 9b, rehearsal-healer case 16).
  • Offline tests cover the three refusal rules + loop-guard; commit format unchanged — ✅.

Proof

  • dev-factory: whole offline suite green (tests/*.sh + onboarding/tests/*.sh) + bash -n all scripts. Render goldens re-generated (onboard-lib-test 234, judgement-call-prompts-test 33).
  • idss (post re-vendor): rehearsal-heal-lib 26, rehearsal-healer 17, rehearsal-report 41, claim-next-task 28, list-ready-tasks 18; check-harness-drift OK @ 2d7a089.

Notes / residue for the next session

  • A latent glob bug was caught and fixed (2d7a089): for g in $surfaces pathname-expands, so internal/* glob-matched the drive repo's real internal/ dir instead of staying a literal case pattern — the product-surface rule silently no-opped in exactly the product repos it exists for. Fixed with set -f around the split; the test now runs its R3 cases from a decoy cwd so the regression is caught everywhere.
  • The FACTORY_REF bump also carried factory #120 (claim-path prompt-expansion headroom) — normal for a ref-based re-vendor; its idss tests are green.
  • The rehearsal loop stays DISARMED; re-arming to see the new regime drive a live alternation is a human act (not done here).
## Close report — #1144 landed (Ruled by agent under ADR 0174 — veto anytime) The drive loop is now **healer-first with ticket-on-refusal**. Landed **upstream in `Matou/dev-factory` first** (the healer/reporter/prompt are factory-vendored, ADR 0180), then **re-vendored into idss** (`check-harness-drift` green). **Two-way door** (revertible code, offline-proven, and the rehearsal loop is DISARMED on every host so this is inert until a human re-arms): no personal credentials, no security-posture widening — the refusal rules NARROW the healer's reach — no member-facing trust, no data destruction, no spend. ### What landed **dev-factory** (`Matou/dev-factory`): `07d779e` (restructure) + `2d7a089` (noglob fix), on `main`. **idss**: `10657340` on `main` (re-vendor + idss product-surface declaration + STATUS). - **The refusal rules ARE the rails** — `rehearsal-heal-lib.sh`'s `heal_rails` gained three hard backstops that reset the checkout and name the rule in `HEAL_RAIL_REASON`: 1. **Never weaken a check** — a diff that removes/rewrites an `expect(...)`/assert line, or deletes/skips a leg or test, refuses (the #1113 guard). A selector-drift heal editing a locator/action line (not an assertion) still heals in-lane. 2. **Line cap 200→400** non-test lines (test files still excluded). 3. **Never change a product-behaviour surface** — consumer-declared `HEAL_PRODUCT_SURFACE_GLOBS` (factory ships it empty; IDSS sets `internal/* app/src/*` in its own non-vendored `.sandcastle/report-guard.sh`). Harness/fixtures/`scripts/`/test-plumbing stay healable. - **Ticket-on-refusal** — `rehearsal-report.sh`'s `try_heal` files the blocker ITSELF on a refusal, reusing the healer's single claude call and naming the rule + the healer's own finding. `HEAL_RAIL_SWARMABLE` routes a too-big-but-mechanical refusal to the swarm (`ready-for-agent`), and a weaken-a-check / product-surface refusal to a ruling (`ready-for-session`). Filing flows through the existing cap/priority/dependency-wiring path (so #1138's cap and the priority float apply, and a standing-leg refusal carries `priority`). - **Loop-guard** (rail-6) — a fault healed on a prior drive that reds again goes straight to ticket-on-refusal via `heal_healed_*` marks; never a second heal (no heal loops). - **Heal-prompt skeleton** rewritten to the healer-first framing + the three rules; render goldens regenerated. Commit-message format unchanged (`rehearsal healer: … (sig …)`). ### Acceptance criteria — all met, offline-proven - Mechanical red heals in-lane, no ticket — ✅ (`rehearsal-healer-test` heal path; selector-drift `rehearsal-heal-lib` R1d passes the rails). - `expect(...)`/assertion edit → ticket "healer refused (assertion rule)", no commit — ✅ (`rehearsal-heal-lib` R1a/b/c, `rehearsal-healer` case 13). - >400 non-test lines → ticket with the cap diagnosis — ✅ (`rehearsal-heal-lib` case 3 + the 400/401 boundary 3f; cap-breach files via ticket-on-refusal). - Standing refusal carries `priority` — ✅ (funnelled through the shared touched→priority float). - Same signature twice → ticket, not a second heal — ✅ (`rehearsal-heal-lib` 9b, `rehearsal-healer` case 16). - Offline tests cover the three refusal rules + loop-guard; commit format unchanged — ✅. ### Proof - dev-factory: whole offline suite green (`tests/*.sh` + `onboarding/tests/*.sh`) + `bash -n` all scripts. Render goldens re-generated (`onboard-lib-test` 234, `judgement-call-prompts-test` 33). - idss (post re-vendor): `rehearsal-heal-lib` 26, `rehearsal-healer` 17, `rehearsal-report` 41, `claim-next-task` 28, `list-ready-tasks` 18; `check-harness-drift` OK @ `2d7a089`. ### Notes / residue for the next session - A **latent glob bug** was caught and fixed (`2d7a089`): `for g in $surfaces` pathname-expands, so `internal/*` glob-matched the drive repo's real `internal/` dir instead of staying a literal `case` pattern — the product-surface rule silently no-opped in exactly the product repos it exists for. Fixed with `set -f` around the split; the test now runs its R3 cases from a decoy cwd so the regression is caught everywhere. - The FACTORY_REF bump also carried factory **#120** (claim-path prompt-expansion headroom) — normal for a ref-based re-vendor; its idss tests are green. - The rehearsal loop stays **DISARMED**; re-arming to see the new regime drive a live alternation is a human act (not done here).
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#1144
No description provided.