rental-reap-test.sh test 7 leaks ambient REHEARSAL_SLUG — flags instead of keeps when the env pins a non-rehearsal-b slug #1181

Closed
opened 2026-09-03 05:19:28 +00:00 by matou-build-agent · 2 comments

The latent bug

scripts/tests/rental-reap-test.sh test 7 ("both doubly-tagged boxes must be kept AND counted", lines ~210-224) is the ONLY subtest that does not pin REHEARSAL_SLUG. Its fixture boxes are named idss-gateway-rehearsal-b-gg0{7,8} and it relies on the reap helper defaulting REHEARSAL_SLUG="${REHEARSAL_SLUG:-rehearsal-b}". When the ambient environment already exports REHEARSAL_SLUG (e.g. an interactive/executor session with REHEARSAL_SLUG=rehearsal-e), the default never applies, the rehearsal-b boxes read as a RETIRED slug (#991 mismatch), and the sweep reports flagged=2 instead of the expected kept=2 — the test reds.

FAIL: both doubly-tagged boxes must be kept AND counted ...
[..] rental-reap: SWEEP OK: destroyed=0 kept=0 flagged=2 keys=0 tags=0 (rentals seen: 2)

Why it is not (yet) a CI red

The forgejo-runner daemon that runs seam has NO REHEARSAL_* in its environment (verified via /proc/<pid>/environ), so CI passes today. But it is a time-bomb: any runner or wrapper that ever exports REHEARSAL_SLUG into the seam shell will red the whole offline-harness stage — and thus the entire deploy rail (publish / publish-broker / deploy-broker all needs: seam) — on an unrelated fixture-hygiene fault.

Fix shape

Pin REHEARSAL_SLUG explicitly for test 7 the way the other slug-sensitive subtests already do (test 4b/4c/4d set REHEARSAL_SLUG=rehearsal-standing / rehearsal-b), e.g. run it as REHEARSAL_SLUG=rehearsal-b reap. A pure test-hygiene change, no product code.

Discovery

Found while landing #1178 (the broker droplet-create confirm-gate): the offline-harness sweep was being run under a session that exported REHEARSAL_SLUG=rehearsal-e. See commit d1044afc / the #1178 close-report.

## The latent bug `scripts/tests/rental-reap-test.sh` test 7 ("both doubly-tagged boxes must be kept AND counted", lines ~210-224) is the ONLY subtest that does not pin `REHEARSAL_SLUG`. Its fixture boxes are named `idss-gateway-rehearsal-b-gg0{7,8}` and it relies on the `reap` helper defaulting `REHEARSAL_SLUG="${REHEARSAL_SLUG:-rehearsal-b}"`. When the ambient environment already exports `REHEARSAL_SLUG` (e.g. an interactive/executor session with `REHEARSAL_SLUG=rehearsal-e`), the default never applies, the `rehearsal-b` boxes read as a RETIRED slug (#991 mismatch), and the sweep reports `flagged=2` instead of the expected `kept=2` — the test reds. ``` FAIL: both doubly-tagged boxes must be kept AND counted ... [..] rental-reap: SWEEP OK: destroyed=0 kept=0 flagged=2 keys=0 tags=0 (rentals seen: 2) ``` ## Why it is not (yet) a CI red The forgejo-runner daemon that runs seam has NO `REHEARSAL_*` in its environment (verified via `/proc/<pid>/environ`), so CI passes today. But it is a time-bomb: any runner or wrapper that ever exports `REHEARSAL_SLUG` into the seam shell will red the whole offline-harness stage — and thus the entire deploy rail (`publish` / `publish-broker` / `deploy-broker` all `needs: seam`) — on an unrelated fixture-hygiene fault. ## Fix shape Pin `REHEARSAL_SLUG` explicitly for test 7 the way the other slug-sensitive subtests already do (test 4b/4c/4d set `REHEARSAL_SLUG=rehearsal-standing` / `rehearsal-b`), e.g. run it as `REHEARSAL_SLUG=rehearsal-b reap`. A pure test-hygiene change, no product code. ## Discovery Found while landing #1178 (the broker droplet-create confirm-gate): the offline-harness sweep was being run under a session that exported `REHEARSAL_SLUG=rehearsal-e`. See commit d1044afc / the #1178 close-report.
Author
Member

swarm-claim host=matou-dev-server-01 run=16952
(automated multi-host claim — lowest live claim id works this ticket)

swarm-claim host=matou-dev-server-01 run=16952 (automated multi-host claim — lowest live claim id works this ticket)
Author
Member

close-report for #1181 — status success

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

envelope
{
  "issue": 1181,
  "status": "success",
  "commits": [
    "304faa71"
  ],
  "changed_files": [
    "scripts/tests/rental-reap-test.sh"
  ],
  "tests": [
    {
      "command": "bash scripts/tests/rental-reap-test.sh",
      "exit_code": 0
    },
    {
      "command": "REHEARSAL_SLUG=rehearsal-e bash scripts/tests/rental-reap-test.sh",
      "exit_code": 0
    }
  ],
  "criteria": {
    "Test 7 pins REHEARSAL_SLUG like the other slug-sensitive subtests": "commit 304faa71 runs its reap as `REHEARSAL_SLUG=rehearsal-b reap` in scripts/tests/rental-reap-test.sh, matching 4b/4c/4d",
    "Reproduced red under ambient non-rehearsal-b slug, green after fix": "REHEARSAL_SLUG=rehearsal-e run went from exit=1 (flagged=2) before to 16/16 passed after",
    "Clean-env run still passes; no product code touched": "bash scripts/tests/rental-reap-test.sh exits 0 (16/16); only the test file changed"
  },
  "summary": "Pinned REHEARSAL_SLUG=rehearsal-b on the doubly-tagged-box reap in rental-reap test 7 so an ambient exported slug can no longer red the offline-harness stage.",
  "blockers": []
}
**close-report** for #1181 — status `success` :white_check_mark: **close-report gates passed** — every claim verified against main; issue closed. <details><summary>envelope</summary> ```json { "issue": 1181, "status": "success", "commits": [ "304faa71" ], "changed_files": [ "scripts/tests/rental-reap-test.sh" ], "tests": [ { "command": "bash scripts/tests/rental-reap-test.sh", "exit_code": 0 }, { "command": "REHEARSAL_SLUG=rehearsal-e bash scripts/tests/rental-reap-test.sh", "exit_code": 0 } ], "criteria": { "Test 7 pins REHEARSAL_SLUG like the other slug-sensitive subtests": "commit 304faa71 runs its reap as `REHEARSAL_SLUG=rehearsal-b reap` in scripts/tests/rental-reap-test.sh, matching 4b/4c/4d", "Reproduced red under ambient non-rehearsal-b slug, green after fix": "REHEARSAL_SLUG=rehearsal-e run went from exit=1 (flagged=2) before to 16/16 passed after", "Clean-env run still passes; no product code touched": "bash scripts/tests/rental-reap-test.sh exits 0 (16/16); only the test file changed" }, "summary": "Pinned REHEARSAL_SLUG=rehearsal-b on the doubly-tagged-box reap in rental-reap test 7 so an ambient exported slug can no longer red the offline-harness stage.", "blockers": [] } ``` </details>
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#1181
No description provided.