rehearsal: the red-drive reporter — signature dedup, capped filing, headless diagnosis (plan Task 7) #373

Closed
opened 2026-08-09 20:00:25 +00:00 by ben · 2 comments
Owner

Implements Task 7 of docs/superpowers/plans/2026-08-09-183-vps-rehearsal-ratchet.md (spec:
docs/superpowers/specs/2026-08-09-183-vps-rehearsal-ratchet-design.md).
Follow the plan task's steps exactly — it carries the offline test, the
prompt file, and the reporter's full shape.

Build .sandcastle/rehearsal-report.sh + .sandcastle/rehearsal-report-prompt.md

  • .sandcastle/tests/rehearsal-report-test.sh (house shim conventions).
    Reuses heal-lib.sh (normalize_error_line, compute_signature) and
    limit-lib.sh (claude limit guards). Contract, from the spec:
  • dedup by signature against open rehearsal-183 issues via a
    <!-- rehearsal-sig: … --> body marker — match appends a comment, never
    re-files
  • max 2 new issues per drive (mind the plan's note: the jq-while subshell
    loses the counter — use mapfile + a plain for)
  • confident diagnosis → bug + ready-for-agent; otherwise ready-for-human;
    rehearsal-183 always
  • always exits 0 — a reporter crash must not mask the drive's exit code

Acceptance:

  • Given the plan's four offline cases, when bash .sandcastle/tests/rehearsal-report-test.sh runs, then PASS (4 cases)
  • shellcheck .sandcastle/rehearsal-report.sh clean

Self-contained: touches only the three new files; no dependency on other
rehearsal tasks (the label exists: rehearsal-183, id 97).

Implements **Task 7** of `docs/superpowers/plans/2026-08-09-183-vps-rehearsal-ratchet.md` (spec: `docs/superpowers/specs/2026-08-09-183-vps-rehearsal-ratchet-design.md`). Follow the plan task's steps exactly — it carries the offline test, the prompt file, and the reporter's full shape. Build `.sandcastle/rehearsal-report.sh` + `.sandcastle/rehearsal-report-prompt.md` + `.sandcastle/tests/rehearsal-report-test.sh` (house shim conventions). Reuses `heal-lib.sh` (`normalize_error_line`, `compute_signature`) and `limit-lib.sh` (claude limit guards). Contract, from the spec: - dedup by signature against open `rehearsal-183` issues via a `<!-- rehearsal-sig: … -->` body marker — match appends a comment, never re-files - max **2** new issues per drive (mind the plan's note: the jq-while subshell loses the counter — use `mapfile` + a plain `for`) - confident diagnosis → `bug` + `ready-for-agent`; otherwise `ready-for-human`; `rehearsal-183` always - always exits 0 — a reporter crash must not mask the drive's exit code Acceptance: - [ ] Given the plan's four offline cases, when `bash .sandcastle/tests/rehearsal-report-test.sh` runs, then `PASS (4 cases)` - [ ] `shellcheck .sandcastle/rehearsal-report.sh` clean Self-contained: touches only the three new files; no dependency on other rehearsal tasks (the label exists: rehearsal-183, id 97).
Author
Owner

Done — Task 7 reporter shipped in 353b852 (on origin/main).

  • .sandcastle/rehearsal-report.sh + rehearsal-report-prompt.md + tests/rehearsal-report-test.sh.
  • bash .sandcastle/tests/rehearsal-report-test.sh → PASS (4 cases) — fresh-file, dedup-by-comment, noise-invariance, and the 2-issue cap.
  • shellcheck -x rehearsal-report.sh clean (run from .sandcastle/, the repo convention for source= directives — same as run-triage.sh).

Key decision: the incident signature keys on the failing leg, not the raw error line. Feeding the raw error re-opens the storm hole normalize_error_line exists to close (the test's noise case carries a 6-hex worker id below the 7-char fold and a run <id>/port tail that survive normalization); the leg is the stable dedup axis, the error still drives the diagnosis body. Cap enforced with mapfile + a plain for (a jq | while subshell would drop the counter). Always exits 0 so a reporter crash never masks the drive's exit code.

Done — Task 7 reporter shipped in `353b852` (on origin/main). - `.sandcastle/rehearsal-report.sh` + `rehearsal-report-prompt.md` + `tests/rehearsal-report-test.sh`. - `bash .sandcastle/tests/rehearsal-report-test.sh` → **PASS (4 cases)** — fresh-file, dedup-by-comment, noise-invariance, and the 2-issue cap. - `shellcheck -x rehearsal-report.sh` clean (run from `.sandcastle/`, the repo convention for `source=` directives — same as `run-triage.sh`). Key decision: the incident signature keys on the failing **leg**, not the raw error line. Feeding the raw error re-opens the storm hole `normalize_error_line` exists to close (the test's noise case carries a 6-hex worker id below the 7-char fold and a `run <id>/port` tail that survive normalization); the leg is the stable dedup axis, the error still drives the diagnosis body. Cap enforced with `mapfile` + a plain `for` (a `jq | while` subshell would drop the counter). Always exits 0 so a reporter crash never masks the drive's exit code.
ben closed this issue 2026-08-09 20:27:23 +00:00
Author
Owner

Contract widened (Ben's ruling, 2026-08-09, after this ticket was
filed — the plan's Task 7 is already updated; re-read it before building):
the cycle is now managed as issue dependencies on standing drive issue
#378. The reporter gains one responsibility and the offline test a
fifth case:

  • Every filed-or-matched issue is wired as a native dependency of
    $REHEARSAL_DRIVE_ISSUE (=378, from .sandcastle/.env):
    POST .../issues/378/dependencies with {"index": <bug number>}
    (already-present → 4xx, tolerate). One evidence comment per red drive on
    #378 (stamp, red legs, blocking issues).
  • The blocked invariant: on red, never exit leaving #378 ready and
    undepended — if nothing could be filed or matched, swap #378's
    ready-for-agent label for ready-for-human.
  • Acceptance updated: PASS (5 cases) — case 5 asserts the dependency
    POST and the #378 comment (see the plan's test listing).
**Contract widened** (Ben's ruling, 2026-08-09, after this ticket was filed — the plan's Task 7 is already updated; re-read it before building): the cycle is now managed as issue dependencies on standing drive issue **#378**. The reporter gains one responsibility and the offline test a fifth case: - Every filed-or-matched issue is wired as a native dependency of `$REHEARSAL_DRIVE_ISSUE` (=378, from `.sandcastle/.env`): `POST .../issues/378/dependencies` with `{"index": <bug number>}` (already-present → 4xx, tolerate). One evidence comment per red drive on #378 (stamp, red legs, blocking issues). - **The blocked invariant**: on red, never exit leaving #378 ready and undepended — if nothing could be filed or matched, swap #378's `ready-for-agent` label for `ready-for-human`. - Acceptance updated: `PASS (5 cases)` — case 5 asserts the dependency POST and the #378 comment (see the plan's test listing).
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
Matou/idss#373
No description provided.