tests: 3 more offline suites red on clean main (heal-test, list-ready-tasks-test, session-runner-test) — likely same ambient-env-leak family as #537 #586

Closed
opened 2026-08-15 08:43:55 +00:00 by ben · 3 comments
Owner

Found 2026-08-15 while landing #537 (rehearsal-healer-test + preflight-swarm-test
hermeticity/staleness fixes). The #531 close-report's sweep already flagged
heal-test.sh and list-ready-tasks-test.sh as pre-existing reds on clean
main; this run adds a third in the same family and pins down the likely
shared root cause.

  1. list-ready-tasks-test.sh — fails the standing drive issue #492 must not be surfaced to the swarm. The fixture/assertion hardcodes #492 as
    the drive issue, but this host's ambient REHEARSAL_DRIVE_ISSUE (from
    .sandcastle/.env, independently re-minted per #493) is a different
    number today — the same "hardcoded fixture vs ambient env" shape #537
    just fixed in rehearsal-healer-test.sh. Likely fix: pin
    REHEARSAL_DRIVE_ISSUE=492 (or whatever the fixture assumes) explicitly
    in the test's invocation env.

  2. session-runner-test.sh — fails, but non-deterministically: one run
    failed a failover must retry the session once, a re-run of the same
    unmodified suite failed exactly one claude session expected at a
    different case. Looks racy rather than a simple stale assertion — needs
    its own diagnosis pass, possibly also ambient-env-sensitive
    (session-runner.sh also defaults/reads REHEARSAL_DRIVE_ISSUE).

  3. heal-test.sh — fails a limit without a standby must defer as before. Not yet diagnosed against the "ambient env leak" hypothesis;
    needs its own look — may be a genuine stale assertion rather than an env
    leak.

Both list-ready-tasks-test.sh and session-runner-test.sh reproduce on
clean main (stash-baselined), so this is not caused by #537's diff.

Acceptance: all three suites green on clean main, hermetic to whatever
REHEARSAL_DRIVE_ISSUE the host's .sandcastle/.env currently carries.

Why human

Nothing — ready-for-agent; found while landing #537 under ADR 0174, kept
out of that ticket's diff to stay scoped.

Found 2026-08-15 while landing #537 (rehearsal-healer-test + preflight-swarm-test hermeticity/staleness fixes). The #531 close-report's sweep already flagged `heal-test.sh` and `list-ready-tasks-test.sh` as pre-existing reds on clean `main`; this run adds a third in the same family and pins down the likely shared root cause. 1. **`list-ready-tasks-test.sh`** — fails `the standing drive issue #492 must not be surfaced to the swarm`. The fixture/assertion hardcodes `#492` as the drive issue, but this host's ambient `REHEARSAL_DRIVE_ISSUE` (from `.sandcastle/.env`, independently re-minted per #493) is a different number today — the same "hardcoded fixture vs ambient env" shape #537 just fixed in `rehearsal-healer-test.sh`. Likely fix: pin `REHEARSAL_DRIVE_ISSUE=492` (or whatever the fixture assumes) explicitly in the test's invocation env. 2. **`session-runner-test.sh`** — fails, but non-deterministically: one run failed `a failover must retry the session once`, a re-run of the same unmodified suite failed `exactly one claude session expected` at a different case. Looks racy rather than a simple stale assertion — needs its own diagnosis pass, possibly also ambient-env-sensitive (`session-runner.sh` also defaults/reads `REHEARSAL_DRIVE_ISSUE`). 3. **`heal-test.sh`** — fails `a limit without a standby must defer as before`. Not yet diagnosed against the "ambient env leak" hypothesis; needs its own look — may be a genuine stale assertion rather than an env leak. Both `list-ready-tasks-test.sh` and `session-runner-test.sh` reproduce on clean `main` (stash-baselined), so this is not caused by #537's diff. Acceptance: all three suites green on clean `main`, hermetic to whatever `REHEARSAL_DRIVE_ISSUE` the host's `.sandcastle/.env` currently carries. ## Why human Nothing — `ready-for-agent`; found while landing #537 under ADR 0174, kept out of that ticket's diff to stay scoped.
Author
Owner

swarm-claim host=elitebook-distributed-server-03 run=6859
(automated multi-host claim — lowest live claim id works this ticket)

swarm-claim host=elitebook-distributed-server-03 run=6859 (automated multi-host claim — lowest live claim id works this ticket)
Author
Owner

Routing to ready-for-session — this ticket's whole scope is a protected .sandcastle/ change a swarm worker cannot make (ADR 0174 rule 5).

Diagnosis confirmed for suite 1: list-ready-tasks-test.sh builds a mock feed containing #492 and asserts the standing drive issue is excluded (lines 41, 53–54). But it invokes list-ready-tasks.sh without pinning REHEARSAL_DRIVE_ISSUE on that first call, so the host's ambient REHEARSAL_DRIVE_ISSUE (from .sandcastle/.env, independently re-minted per #493 — not 492 today) leaks in and #492 surfaces. Line 76 already pins the override (REHEARSAL_DRIVE_ISSUE=999) for the second invocation — the fix is the same shape applied to the first: REHEARSAL_DRIVE_ISSUE=492 bash "$here/../list-ready-tasks.sh". This is exactly the "hardcoded fixture vs ambient env" family #537 fixed in rehearsal-healer-test.sh. Suites 2 (session-runner-test.sh) and 3 (heal-test.sh) still need their own diagnosis passes as the ticket notes.

All three suites live under .sandcastle/tests/, which is inside the fingerprinted protected set (.sandcastle, .forgejo) enforced by protected-paths-lib.sh (#445): any edit a swarm worker makes there is attributed, rolled back, and fails the run loud. So the fixes cannot land from the ready-for-agent swarm queue at all — they need an interactive session's standing.

ADR 0174 rule 5 mints exactly this case: "ready-for-session is minted for work that needs an interactive agent session's standing (host credentials, protected .sandcastle/ paths per #445, live droplet doors, design-tier runs) but not Ben. Swarm workers skip it exactly as they skip ready-for-human."

Action taken: swapped ready-for-agent → ready-for-session and released this run's swarm claim. No code changed (a swarm worker editing here would only be rolled back). A session can pick this up and land all three suite fixes directly.

— sandcastle run 6855

**Routing to `ready-for-session` — this ticket's whole scope is a protected `.sandcastle/` change a swarm worker cannot make (ADR 0174 rule 5).** Diagnosis confirmed for suite 1: `list-ready-tasks-test.sh` builds a mock feed containing `#492` and asserts the standing drive issue is excluded (lines 41, 53–54). But it invokes `list-ready-tasks.sh` **without pinning `REHEARSAL_DRIVE_ISSUE`** on that first call, so the host's ambient `REHEARSAL_DRIVE_ISSUE` (from `.sandcastle/.env`, independently re-minted per #493 — not `492` today) leaks in and `#492` surfaces. Line 76 already pins the override (`REHEARSAL_DRIVE_ISSUE=999`) for the *second* invocation — the fix is the same shape applied to the first: `REHEARSAL_DRIVE_ISSUE=492 bash "$here/../list-ready-tasks.sh"`. This is exactly the "hardcoded fixture vs ambient env" family #537 fixed in `rehearsal-healer-test.sh`. Suites 2 (`session-runner-test.sh`) and 3 (`heal-test.sh`) still need their own diagnosis passes as the ticket notes. All three suites live under `.sandcastle/tests/`, which is inside the fingerprinted **protected** set (`.sandcastle`, `.forgejo`) enforced by `protected-paths-lib.sh` (#445): any edit a swarm worker makes there is attributed, **rolled back, and fails the run loud**. So the fixes cannot land from the `ready-for-agent` swarm queue at all — they need an interactive session's standing. ADR 0174 rule 5 mints exactly this case: *"`ready-for-session` is minted for work that needs an interactive agent session's standing (host credentials, **protected `.sandcastle/` paths per #445**, live droplet doors, design-tier runs) but not Ben. Swarm workers skip it exactly as they skip `ready-for-human`."* Action taken: swapped `ready-for-agent` → `ready-for-session` and released this run's swarm claim. No code changed (a swarm worker editing here would only be rolled back). A session can pick this up and land all three suite fixes directly. — sandcastle run 6855
Author
Owner

close-report for #586 — status success

✅ close-report gates passed — every claim verified against main; closing.

envelope
{
  "issue": 586,
  "status": "success",
  "commits": [
    "9da4d70"
  ],
  "changed_files": [
    ".sandcastle/tests/heal-test.sh",
    ".sandcastle/tests/list-ready-tasks-test.sh",
    ".sandcastle/tests/session-runner-test.sh",
    "STATUS.md"
  ],
  "tests": [
    {
      "command": "bash .sandcastle/tests/list-ready-tasks-test.sh",
      "exit_code": 0
    },
    {
      "command": "bash .sandcastle/tests/session-runner-test.sh",
      "exit_code": 0
    },
    {
      "command": "bash .sandcastle/tests/heal-test.sh",
      "exit_code": 0
    },
    {
      "command": "REHEARSAL_DRIVE_ISSUE=523 CLAUDE_CODE_OAUTH_TOKEN_B=hostB bash .sandcastle/tests/list-ready-tasks-test.sh",
      "exit_code": 0
    },
    {
      "command": "REHEARSAL_DRIVE_ISSUE=523 CLAUDE_CODE_OAUTH_TOKEN_B=hostB bash .sandcastle/tests/session-runner-test.sh",
      "exit_code": 0
    },
    {
      "command": "REHEARSAL_DRIVE_ISSUE=523 CLAUDE_CODE_OAUTH_TOKEN_B=hostB bash .sandcastle/tests/heal-test.sh",
      "exit_code": 0
    }
  ],
  "criteria": {
    "list-ready-tasks-test.sh green on clean main, hermetic to ambient REHEARSAL_DRIVE_ISSUE": "Pinned REHEARSAL_DRIVE_ISSUE=492 in the suite env (commit 9da4d70, .sandcastle/tests/list-ready-tasks-test.sh); verified PASS under ambient drive=523/999/unset — the ambient leak that surfaced the hardcoded-#492 drive issue.",
    "session-runner-test.sh green on clean main, deterministic": "Fake curl now drains the `-d @-` body so jq no longer races to a SIGPIPE under set -o pipefail (commit 9da4d70, .sandcastle/tests/session-runner-test.sh); verified 12/12 green where it previously red non-deterministically on 'exactly one claude session expected' / 'a failover must retry the session once'.",
    "heal-test.sh green on clean main, hermetic to whatever the host env carries": "run_heal now env -u's CLAUDE_CODE_OAUTH_TOKEN and _B so a host's #510 two-account standby no longer leaks into the 'limit without a standby must defer' scenario (commit 9da4d70, .sandcastle/tests/heal-test.sh); reproduced the red with ambient CLAUDE_CODE_OAUTH_TOKEN_B=hostB, then verified PASS with the fix under that same env.",
    "all three hermetic to the host's .sandcastle/.env drive number": "All three verified green under a hostile ambient env (REHEARSAL_DRIVE_ISSUE=523 + CLAUDE_CODE_OAUTH_TOKEN_B=hostB) — see the tests block; no script under test changed."
  },
  "summary": "Pinned the three remaining offline suites (list-ready-tasks, session-runner, heal) green and hermetic to the host's ambient REHEARSAL_DRIVE_ISSUE, standby token, and a jq/pipefail SIGPIPE race.",
  "reason": "",
  "blockers": [],
  "no_code_change": ""
}
**close-report** for #586 — status `success` :white_check_mark: **close-report gates passed** — every claim verified against main; closing. <details><summary>envelope</summary> ```json { "issue": 586, "status": "success", "commits": [ "9da4d70" ], "changed_files": [ ".sandcastle/tests/heal-test.sh", ".sandcastle/tests/list-ready-tasks-test.sh", ".sandcastle/tests/session-runner-test.sh", "STATUS.md" ], "tests": [ { "command": "bash .sandcastle/tests/list-ready-tasks-test.sh", "exit_code": 0 }, { "command": "bash .sandcastle/tests/session-runner-test.sh", "exit_code": 0 }, { "command": "bash .sandcastle/tests/heal-test.sh", "exit_code": 0 }, { "command": "REHEARSAL_DRIVE_ISSUE=523 CLAUDE_CODE_OAUTH_TOKEN_B=hostB bash .sandcastle/tests/list-ready-tasks-test.sh", "exit_code": 0 }, { "command": "REHEARSAL_DRIVE_ISSUE=523 CLAUDE_CODE_OAUTH_TOKEN_B=hostB bash .sandcastle/tests/session-runner-test.sh", "exit_code": 0 }, { "command": "REHEARSAL_DRIVE_ISSUE=523 CLAUDE_CODE_OAUTH_TOKEN_B=hostB bash .sandcastle/tests/heal-test.sh", "exit_code": 0 } ], "criteria": { "list-ready-tasks-test.sh green on clean main, hermetic to ambient REHEARSAL_DRIVE_ISSUE": "Pinned REHEARSAL_DRIVE_ISSUE=492 in the suite env (commit 9da4d70, .sandcastle/tests/list-ready-tasks-test.sh); verified PASS under ambient drive=523/999/unset — the ambient leak that surfaced the hardcoded-#492 drive issue.", "session-runner-test.sh green on clean main, deterministic": "Fake curl now drains the `-d @-` body so jq no longer races to a SIGPIPE under set -o pipefail (commit 9da4d70, .sandcastle/tests/session-runner-test.sh); verified 12/12 green where it previously red non-deterministically on 'exactly one claude session expected' / 'a failover must retry the session once'.", "heal-test.sh green on clean main, hermetic to whatever the host env carries": "run_heal now env -u's CLAUDE_CODE_OAUTH_TOKEN and _B so a host's #510 two-account standby no longer leaks into the 'limit without a standby must defer' scenario (commit 9da4d70, .sandcastle/tests/heal-test.sh); reproduced the red with ambient CLAUDE_CODE_OAUTH_TOKEN_B=hostB, then verified PASS with the fix under that same env.", "all three hermetic to the host's .sandcastle/.env drive number": "All three verified green under a hostile ambient env (REHEARSAL_DRIVE_ISSUE=523 + CLAUDE_CODE_OAUTH_TOKEN_B=hostB) — see the tests block; no script under test changed." }, "summary": "Pinned the three remaining offline suites (list-ready-tasks, session-runner, heal) green and hermetic to the host's ambient REHEARSAL_DRIVE_ISSUE, standby token, and a jq/pipefail SIGPIPE race.", "reason": "", "blockers": [], "no_code_change": "" } ``` </details>
ben closed this issue 2026-08-15 08:57:43 +00:00
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#586
No description provided.