offline suite: 3 lister/stages tests read the live /run/host-signals/fleet-pick when run in-sandbox (green on CI host) #330

Closed
opened 2026-11-05 08:30:48 +00:00 by matou-build-agent · 3 comments

Symptom

Run inside a worker sandbox, three offline tests red that are green on the CI
host — because they read the sandbox's live fleet-pick signal, not a shim:

  • tests/list-ready-tasks-test.sh
  • tests/run-swarm-ready-list-test.sh
  • tests/run-swarm-stages-test.sh

They fail only when /run/host-signals/fleet-pick exists (it does inside every
worker sandbox — it carries THIS run's claimed ticket). On the CI host that file
is absent, so the full-page lister path runs and the tests pass. Found while
working #326 (both this run's claim #326 landed in the signal, so the
single-issue fast path narrowed every listing to a ticket the fixtures don't
carry → 404/503 → wrong stand-down/verdict).

Cause

list-ready-tasks.sh reads the fleet pick from
${SWARM_FLEET_PICK_SIGNAL:-/run/host-signals/fleet-pick} (idss#2145 in-sandbox
single-issue fast path, commit 7f9d8e1). These three tests drive the lister /
schedule_list_ready_or_verdict / a full run-swarm.sh with a shimmed curl +
fixture, but do NOT pin SWARM_FLEET_PICK_SIGNAL, so inside a sandbox the real
signal leaks in. None of the three source tests/test-env.sh, so the #326
helper redirect (HOST_CAPACITY_STATE_DIR) does not reach them, and the helper's
lint set (run-swarm|session-runner|run-triage|heal) does not cover the lister.

Proven on this host, in-sandbox at main:

$ bash tests/run-swarm-ready-list-test.sh                               # exit 1
$ SWARM_FLEET_PICK_SIGNAL=/no/such bash tests/run-swarm-ready-list-test.sh   # passes
$ SWARM_FLEET_PICK_SIGNAL=/no/such bash tests/list-ready-tasks-test.sh      # passes
$ SWARM_FLEET_PICK_SIGNAL=/no/such HOST_CAPACITY_STATE_DIR=$tmp bash tests/run-swarm-stages-test.sh  # passes

(run-swarm-stages-test.sh needs both the signal and HOST_CAPACITY_STATE_DIR
pinned.)

Suggested fix

Same class as #326's Fault 2, one mechanism over: pin SWARM_FLEET_PICK_SIGNAL
to an absent sandbox path in each test (or, broader, redirect it in
tests/test-env.sh's test_env_hermetic and have these three source the
helper — then extend the helper's exec-by-path lint to the lister). Weigh the
per-test pin (small, closes today's in-sandbox red) against the helper change
(closes the class but needs the three wired to source it).

Why not folded into #326

#326's stated Fault 2 is the HOST_CAPACITY_STATE_DIR / fleet-queue cache
read in run-swarm-notify-guard-test.sh; that fix landed. This is a distinct
signal
(/run/host-signals/fleet-pick) in different tests that do not
source the helper — out of #326's scope, filed as a follow-up.

## Symptom Run inside a worker sandbox, three offline tests red that are green on the CI host — because they read the sandbox's live fleet-pick signal, not a shim: - `tests/list-ready-tasks-test.sh` - `tests/run-swarm-ready-list-test.sh` - `tests/run-swarm-stages-test.sh` They fail only when `/run/host-signals/fleet-pick` exists (it does inside every worker sandbox — it carries THIS run's claimed ticket). On the CI host that file is absent, so the full-page lister path runs and the tests pass. Found while working #326 (both this run's claim `#326` landed in the signal, so the single-issue fast path narrowed every listing to a ticket the fixtures don't carry → 404/503 → wrong stand-down/verdict). ## Cause `list-ready-tasks.sh` reads the fleet pick from `${SWARM_FLEET_PICK_SIGNAL:-/run/host-signals/fleet-pick}` (idss#2145 in-sandbox single-issue fast path, commit 7f9d8e1). These three tests drive the lister / `schedule_list_ready_or_verdict` / a full `run-swarm.sh` with a shimmed curl + fixture, but do NOT pin `SWARM_FLEET_PICK_SIGNAL`, so inside a sandbox the real signal leaks in. None of the three source `tests/test-env.sh`, so the #326 helper redirect (HOST_CAPACITY_STATE_DIR) does not reach them, and the helper's lint set (`run-swarm|session-runner|run-triage|heal`) does not cover the lister. Proven on this host, in-sandbox at `main`: ``` $ bash tests/run-swarm-ready-list-test.sh # exit 1 $ SWARM_FLEET_PICK_SIGNAL=/no/such bash tests/run-swarm-ready-list-test.sh # passes $ SWARM_FLEET_PICK_SIGNAL=/no/such bash tests/list-ready-tasks-test.sh # passes $ SWARM_FLEET_PICK_SIGNAL=/no/such HOST_CAPACITY_STATE_DIR=$tmp bash tests/run-swarm-stages-test.sh # passes ``` (`run-swarm-stages-test.sh` needs both the signal and HOST_CAPACITY_STATE_DIR pinned.) ## Suggested fix Same class as #326's Fault 2, one mechanism over: pin `SWARM_FLEET_PICK_SIGNAL` to an absent sandbox path in each test (or, broader, redirect it in `tests/test-env.sh`'s `test_env_hermetic` and have these three source the helper — then extend the helper's exec-by-path lint to the lister). Weigh the per-test pin (small, closes today's in-sandbox red) against the helper change (closes the class but needs the three wired to source it). ## Why not folded into #326 #326's stated Fault 2 is the `HOST_CAPACITY_STATE_DIR` / fleet-queue **cache** read in `run-swarm-notify-guard-test.sh`; that fix landed. This is a **distinct signal** (`/run/host-signals/fleet-pick`) in **different tests** that do not source the helper — out of #326's scope, filed as a follow-up.
Author
Member

swarm-claim host=bens-mac-04 run=26332
(automated multi-host claim — lowest live claim id works this ticket)

swarm-claim host=bens-mac-04 run=26332 (automated multi-host claim — lowest live claim id works this ticket)
Author
Member

⏩ independent reviewer for #330 — verdict unauthenticated

review JSON
{
  "verdict": "unauthenticated",
  "findings": []
}
:fast_forward: **independent reviewer** for #330 — verdict `unauthenticated` <details><summary>review JSON</summary> ```json { "verdict": "unauthenticated", "findings": [] } ``` </details>
Author
Member

close-report for #330 — status success

✅ close-report gates passed — every claim verified against the pushed worker branch sandcastle/worker/20261105-033507-997386 (pre-land — the host promotes it to main only after its post-run verify, #193/#283); issue closed.

envelope
{
  "issue": 330,
  "status": "success",
  "commits": [
    "107020c4b4d26bebcc3f5b1644ace83d0a55f18d"
  ],
  "changed_files": [
    "tests/test-env.sh",
    "tests/list-ready-tasks-test.sh",
    "tests/run-swarm-ready-list-test.sh",
    "tests/run-swarm-stages-test.sh"
  ],
  "tests": [
    {
      "command": "bash tests/list-ready-tasks-test.sh",
      "exit_code": 0
    },
    {
      "command": "bash tests/run-swarm-ready-list-test.sh",
      "exit_code": 0
    },
    {
      "command": "bash tests/run-swarm-stages-test.sh",
      "exit_code": 0
    },
    {
      "command": "bash tests/test-env.sh",
      "exit_code": 0
    },
    {
      "command": "for t in tests/*.sh onboarding/tests/*.sh; do case \"$t\" in *fakebin*|*fixtures*) continue;; esac; bash \"$t\" || echo FAIL $t; done",
      "exit_code": 0
    }
  ],
  "criteria": {
    "tests/list-ready-tasks-test.sh green in-sandbox with live fleet-pick present": "pinned SWARM_FLEET_PICK_SIGNAL to an absent path (tests/list-ready-tasks-test.sh); verified exit 0 with /run/host-signals/fleet-pick present",
    "tests/run-swarm-ready-list-test.sh green in-sandbox": "pinned SWARM_FLEET_PICK_SIGNAL absent (tests/run-swarm-ready-list-test.sh); verified exit 0 in-sandbox",
    "tests/run-swarm-stages-test.sh green in-sandbox": "pinned SWARM_FLEET_PICK_SIGNAL and HOST_CAPACITY_STATE_DIR in run_swarm env (tests/run-swarm-stages-test.sh); verified exit 0 in-sandbox",
    "class closed for helper-sourcing tests": "SWARM_FLEET_PICK_SIGNAL now redirected in test_env_hermetic with a self-test absence assert (tests/test-env.sh)"
  },
  "summary": "Three lister/stages offline tests now pin the in-sandbox fleet-pick signal (and stages pins the fleet-queue cache dir), and the hermetic seam redirects it too, so they pass in-sandbox as on CI.",
  "blockers": []
}
**close-report** for #330 — status `success` :white_check_mark: **close-report gates passed** — every claim verified against the pushed worker branch `sandcastle/worker/20261105-033507-997386` (pre-land — the host promotes it to `main` only after its post-run verify, #193/#283); issue closed. <details><summary>envelope</summary> ```json { "issue": 330, "status": "success", "commits": [ "107020c4b4d26bebcc3f5b1644ace83d0a55f18d" ], "changed_files": [ "tests/test-env.sh", "tests/list-ready-tasks-test.sh", "tests/run-swarm-ready-list-test.sh", "tests/run-swarm-stages-test.sh" ], "tests": [ { "command": "bash tests/list-ready-tasks-test.sh", "exit_code": 0 }, { "command": "bash tests/run-swarm-ready-list-test.sh", "exit_code": 0 }, { "command": "bash tests/run-swarm-stages-test.sh", "exit_code": 0 }, { "command": "bash tests/test-env.sh", "exit_code": 0 }, { "command": "for t in tests/*.sh onboarding/tests/*.sh; do case \"$t\" in *fakebin*|*fixtures*) continue;; esac; bash \"$t\" || echo FAIL $t; done", "exit_code": 0 } ], "criteria": { "tests/list-ready-tasks-test.sh green in-sandbox with live fleet-pick present": "pinned SWARM_FLEET_PICK_SIGNAL to an absent path (tests/list-ready-tasks-test.sh); verified exit 0 with /run/host-signals/fleet-pick present", "tests/run-swarm-ready-list-test.sh green in-sandbox": "pinned SWARM_FLEET_PICK_SIGNAL absent (tests/run-swarm-ready-list-test.sh); verified exit 0 in-sandbox", "tests/run-swarm-stages-test.sh green in-sandbox": "pinned SWARM_FLEET_PICK_SIGNAL and HOST_CAPACITY_STATE_DIR in run_swarm env (tests/run-swarm-stages-test.sh); verified exit 0 in-sandbox", "class closed for helper-sourcing tests": "SWARM_FLEET_PICK_SIGNAL now redirected in test_env_hermetic with a self-test absence assert (tests/test-env.sh)" }, "summary": "Three lister/stages offline tests now pin the in-sandbox fleet-pick signal (and stages pins the fleet-queue cache dir), and the hermetic seam redirects it too, so they pass in-sandbox as on CI.", "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/dev-factory#330
No description provided.