vendored tests assume the factory's own layout — session-runner/swarm-db/fleet-tui suites red when run inside a consumer's .sandcastle #87

Closed
opened 2026-08-25 20:48:07 +00:00 by ben · 3 comments
Owner

Found at a consumer (Matou/idss FACTORY_REF bump bd48fd6→343d26f, 2026-08-25)

Running the full vendored tests/ suite inside a consumer's .sandcastle/ (the vendor-manifest layout) reds 3 suites that are green factory-side — each assumes the factory's own root layout:

  1. tests/session-runner-test.sh — computes the prompt path as $here/../.sandcastle/session-runner-prompt.md. Factory-side that resolves through the self-pin; consumer-side it doubles to <repo>/.sandcastle/.sandcastle/… (the harness dir IS .sandcastle) and the runner dies at cat: No such file after group 1 ("ok 1 kill switch" is the only output; exit 1 with no FAIL line — it also dies silently rather than loud).
  2. tests/swarm-db-test.sh — the "issue must fall back to the sibling swarm-identity.sh REPO_SLUG" group (line ~211) picks up the CONSUMER's real swarm-identity.sh (R_IDSS/idsscommit in the dump) instead of its own fixture sibling (faccommit) when run from a consumer checkout.
  3. tests/fleet-tui-test.sh — cd <sandcastle>/fleet-tui unconditionally; fleet-tui/ is factory-root-only and not in the vendor manifest, so all 6 checks fail at a consumer. Either skip loudly when the dir is absent (like tui-test.sh's no-pytest posture) or drop it from the manifest.

(tests/box-vocabulary-test.sh also reports 3/4 at the consumer — "no baseline", 4 waived lines — worth a look under the same lens, but it may be legitimately advisory.)

Why it matters

A consumer bumping the pin wants for t in tests/*-test.sh; do bash "$t"; done as the local proof the vendored copy works with its identity layer. Today that requires knowing which reds are layout artifacts. Consumer-run green (or loud SKIP) for every vendored suite is the useful contract.

Full consumer-side failure detail on Matou/idss#715.

## Found at a consumer (Matou/idss FACTORY_REF bump bd48fd6→343d26f, 2026-08-25) Running the full vendored `tests/` suite inside a consumer's `.sandcastle/` (the vendor-manifest layout) reds 3 suites that are green factory-side — each assumes the factory's own root layout: 1. **`tests/session-runner-test.sh`** — computes the prompt path as `$here/../.sandcastle/session-runner-prompt.md`. Factory-side that resolves through the self-pin; consumer-side it doubles to `<repo>/.sandcastle/.sandcastle/…` (the harness dir IS `.sandcastle`) and the runner dies at `cat: No such file` after group 1 ("ok 1 kill switch" is the only output; exit 1 with no FAIL line — it also dies silently rather than loud). 2. **`tests/swarm-db-test.sh`** — the "issue must fall back to the sibling swarm-identity.sh REPO_SLUG" group (line ~211) picks up the CONSUMER's real `swarm-identity.sh` (`R_IDSS`/`idsscommit` in the dump) instead of its own fixture sibling (`faccommit`) when run from a consumer checkout. 3. **`tests/fleet-tui-test.sh`** — `cd <sandcastle>/fleet-tui` unconditionally; `fleet-tui/` is factory-root-only and not in the vendor manifest, so all 6 checks fail at a consumer. Either skip loudly when the dir is absent (like tui-test.sh's no-pytest posture) or drop it from the manifest. (`tests/box-vocabulary-test.sh` also reports 3/4 at the consumer — "no baseline", 4 waived lines — worth a look under the same lens, but it may be legitimately advisory.) ## Why it matters A consumer bumping the pin wants `for t in tests/*-test.sh; do bash "$t"; done` as the local proof the vendored copy works with its identity layer. Today that requires knowing which reds are layout artifacts. Consumer-run green (or loud SKIP) for every vendored suite is the useful contract. Full consumer-side failure detail on Matou/idss#715.

This was generated by AI during triage.

Ruled by agent under ADR 0174 — veto anytime

Ruling: bug + ready-for-agent.

Why this is a two-way door: each of the three fixes is a local change to
one vendored test script's layout/identity assumptions — reversible by a
follow-up commit, no security, credential, trust, or spend surface, and the
existing cutover-proof discipline (onboarding/tests/onboard-lib-test.sh
class) is exactly the kind of test this repo already uses to prove vendored
byte-identical behavior.

What proves it: I confirmed all three claims by inspection against
current main, so none are stale:

  • tests/session-runner-test.sh still hardcodes
    SESSION_RUNNER_PROMPT_FILE="$here/../.sandcastle/session-runner-prompt.md"
    at three call sites — doubles to <repo>/.sandcastle/.sandcastle/… when
    $here is already inside a consumer's .sandcastle/tests/.
  • tests/swarm-db-test.sh's sibling-fallback group still resolves
    swarm-identity.sh by directory adjacency, so it picks up whichever
    checkout it's run from rather than its own fixture.
  • tests/fleet-tui-test.sh still does an unconditional cd "$fleet"
    (fleet="$repo/fleet-tui"), and onboarding/vendor-manifest vendors
    tests/** but has no fleet-tui entry — so the suite is vendored into
    every consumer's .sandcastle/tests/ but the directory it cds into
    never is.

What's explicitly NOT ruled here: the issue's parenthetical about
tests/box-vocabulary-test.sh ("worth a look... may be legitimately
advisory") is flagged by the reporter as unconfirmed, not a claim. I'm
carrying it as out-of-scope below rather than folding it into this brief —
if it turns out to be the same class, that's a fast follow-up issue, not a
reason to hold this one.

Agent Brief

Category: bug
Summary: Three vendored test suites assume the factory's own root
layout and fail (two loudly, one silently) when run inside a consumer's
.sandcastle/ checkout instead of the factory checkout.

Current behavior:

  • The session-runner suite resolves its prompt file path by walking up from
    its own script location one level and into .sandcastle/. In the factory
    checkout this lands on the self-pinned copy; in a consumer checkout the
    suite's own script location is already inside .sandcastle/, so the
    same relative walk produces a doubled, nonexistent path. The suite dies
    after its first test group with no FAIL line — a silent failure, not a
    loud one.
  • The swarm-db suite's "falls back to the sibling identity file" test group
    locates that sibling by directory adjacency. Run from a consumer checkout,
    adjacency resolves to the CONSUMER's real identity file (its own repo
    slug) instead of the suite's own fixture, so the test observes the wrong
    repo slug and the group's assertion is unreliable.
  • The fleet-tui suite unconditionally changes into the fleet-tui source
    directory before running its checks. That directory is factory-root-only
    and is not part of the vendored file set, so every check in the suite
    fails at a consumer with a directory-not-found style error, even though
    the suite script itself IS vendored there.

Desired behavior:
Every vendored suite under tests/ is green when run from inside a
consumer's .sandcastle/ checkout (the vendor-manifest layout), OR fails
loudly with a clear SKIP/reason line when a factory-root-only dependency is
genuinely absent — never a silent short-circuit and never a false pass/fail
caused by picking up the wrong sibling file. tests/tui-test.sh's posture
(loud SKIP when its optional dependency is absent) is the existing pattern
to match.

Key interfaces:

  • The session-runner suite's prompt-path resolution should account for
    being invoked from within a .sandcastle/ tree already, not assume it is
    always one level above the harness dir.
  • The swarm-db suite's "sibling identity file" fallback test should isolate
    itself from any REAL sibling identity file in the checkout it happens to
    run from — it needs its own fixture to be the only thing resolvable,
    regardless of which checkout invokes it.
  • The fleet-tui suite should either skip loudly (matching the existing
    no-pytest SKIP posture) when its source directory is absent, or the
    vendor manifest should stop shipping this suite to consumers at all —
    whichever keeps a consumer's "run every vendored suite" contract honest.

Acceptance criteria:

  • Running tests/session-runner-test.sh from inside a consumer-shaped
    .sandcastle/tests/ layout passes all groups (or fails loudly with a
    clear reason, never silently after group 1).
  • Running tests/swarm-db-test.sh's sibling-fallback group from inside
    a consumer checkout observes the suite's own fixture identity, not the
    consumer's real swarm-identity.sh.
  • Running tests/fleet-tui-test.sh at a consumer either passes (if
    fleet-tui/ is added to the vendor manifest) or emits a clear loud
    SKIP and a non-failing exit (if it's intentionally factory-root-only),
    with no bare "6 checks failed" outcome either way.
  • The factory-side runs of all three suites stay green (no regression to
    the self-copy).

Out of scope:

  • tests/box-vocabulary-test.sh's "no baseline" / 4 waived lines — flagged
    by the reporter as possibly advisory and unconfirmed; needs its own look.
  • Any change to which files the vendor manifest ships beyond what's needed
    to resolve the fleet-tui suite's own contract (don't vendor fleet-tui/
    source unless that's the chosen fix).
> *This was generated by AI during triage.* **Ruled by agent under ADR 0174 — veto anytime** **Ruling:** `bug` + `ready-for-agent`. **Why this is a two-way door:** each of the three fixes is a local change to one vendored test script's layout/identity assumptions — reversible by a follow-up commit, no security, credential, trust, or spend surface, and the existing cutover-proof discipline (`onboarding/tests/onboard-lib-test.sh` class) is exactly the kind of test this repo already uses to prove vendored byte-identical behavior. **What proves it:** I confirmed all three claims by inspection against current `main`, so none are stale: - `tests/session-runner-test.sh` still hardcodes `SESSION_RUNNER_PROMPT_FILE="$here/../.sandcastle/session-runner-prompt.md"` at three call sites — doubles to `<repo>/.sandcastle/.sandcastle/…` when `$here` is already inside a consumer's `.sandcastle/tests/`. - `tests/swarm-db-test.sh`'s sibling-fallback group still resolves `swarm-identity.sh` by directory adjacency, so it picks up whichever checkout it's run from rather than its own fixture. - `tests/fleet-tui-test.sh` still does an unconditional `cd "$fleet"` (`fleet="$repo/fleet-tui"`), and `onboarding/vendor-manifest` vendors `tests/**` but has no `fleet-tui` entry — so the suite is vendored into every consumer's `.sandcastle/tests/` but the directory it `cd`s into never is. **What's explicitly NOT ruled here:** the issue's parenthetical about `tests/box-vocabulary-test.sh` ("worth a look... may be legitimately advisory") is flagged by the reporter as unconfirmed, not a claim. I'm carrying it as out-of-scope below rather than folding it into this brief — if it turns out to be the same class, that's a fast follow-up issue, not a reason to hold this one. ## Agent Brief **Category:** bug **Summary:** Three vendored test suites assume the factory's own root layout and fail (two loudly, one silently) when run inside a consumer's `.sandcastle/` checkout instead of the factory checkout. **Current behavior:** - The session-runner suite resolves its prompt file path by walking up from its own script location one level and into `.sandcastle/`. In the factory checkout this lands on the self-pinned copy; in a consumer checkout the suite's own script location is *already* inside `.sandcastle/`, so the same relative walk produces a doubled, nonexistent path. The suite dies after its first test group with no `FAIL` line — a silent failure, not a loud one. - The swarm-db suite's "falls back to the sibling identity file" test group locates that sibling by directory adjacency. Run from a consumer checkout, adjacency resolves to the CONSUMER's real identity file (its own repo slug) instead of the suite's own fixture, so the test observes the wrong repo slug and the group's assertion is unreliable. - The fleet-tui suite unconditionally changes into the fleet-tui source directory before running its checks. That directory is factory-root-only and is not part of the vendored file set, so every check in the suite fails at a consumer with a directory-not-found style error, even though the suite script itself IS vendored there. **Desired behavior:** Every vendored suite under `tests/` is green when run from inside a consumer's `.sandcastle/` checkout (the vendor-manifest layout), OR fails loudly with a clear SKIP/reason line when a factory-root-only dependency is genuinely absent — never a silent short-circuit and never a false pass/fail caused by picking up the wrong sibling file. `tests/tui-test.sh`'s posture (loud SKIP when its optional dependency is absent) is the existing pattern to match. **Key interfaces:** - The session-runner suite's prompt-path resolution should account for being invoked from within a `.sandcastle/` tree already, not assume it is always one level above the harness dir. - The swarm-db suite's "sibling identity file" fallback test should isolate itself from any REAL sibling identity file in the checkout it happens to run from — it needs its own fixture to be the only thing resolvable, regardless of which checkout invokes it. - The fleet-tui suite should either skip loudly (matching the existing no-pytest SKIP posture) when its source directory is absent, or the vendor manifest should stop shipping this suite to consumers at all — whichever keeps a consumer's "run every vendored suite" contract honest. **Acceptance criteria:** - [ ] Running `tests/session-runner-test.sh` from inside a consumer-shaped `.sandcastle/tests/` layout passes all groups (or fails loudly with a clear reason, never silently after group 1). - [ ] Running `tests/swarm-db-test.sh`'s sibling-fallback group from inside a consumer checkout observes the suite's own fixture identity, not the consumer's real `swarm-identity.sh`. - [ ] Running `tests/fleet-tui-test.sh` at a consumer either passes (if `fleet-tui/` is added to the vendor manifest) or emits a clear loud SKIP and a non-failing exit (if it's intentionally factory-root-only), with no bare "6 checks failed" outcome either way. - [ ] The factory-side runs of all three suites stay green (no regression to the self-copy). **Out of scope:** - `tests/box-vocabulary-test.sh`'s "no baseline" / 4 waived lines — flagged by the reporter as possibly advisory and unconfirmed; needs its own look. - Any change to which files the vendor manifest ships beyond what's needed to resolve the fleet-tui suite's own contract (don't vendor `fleet-tui/` source unless that's the chosen fix).

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

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

close-report for #87 — status success

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

envelope
{
  "issue": 87,
  "status": "success",
  "commits": [
    "9305fab"
  ],
  "changed_files": [
    "STATUS.md",
    "tests/fleet-tui-test.sh",
    "tests/session-runner-test.sh",
    "tests/swarm-db-test.sh"
  ],
  "tests": [
    {
      "command": "bash tests/session-runner-test.sh",
      "exit_code": 0
    },
    {
      "command": "bash tests/swarm-db-test.sh",
      "exit_code": 0
    },
    {
      "command": "bash tests/fleet-tui-test.sh",
      "exit_code": 0
    },
    {
      "command": "for t in tests/*.sh onboarding/tests/*.sh; do case \"$t\" in *fakebin*|*fixtures*) continue;; esac; bash \"$t\"; done",
      "exit_code": 0
    },
    {
      "command": "consumer-shaped sim: bash <sim>/.sandcastle/tests/{session-runner,swarm-db,fleet-tui}-test.sh (divergent Acme/widget slug)",
      "exit_code": 0
    }
  ],
  "criteria": {
    "session-runner-test.sh from a consumer-shaped .sandcastle/tests/ passes all groups (or fails loudly, never silently after group 1)": "prompt path now resolves whichever of ../.sandcastle/ or ../ rendered copy exists, failing loudly if neither (tests/session-runner-test.sh:10-19); consumer-shaped sim reports '18 groups passed'; pre-fix it died silently after 'ok 1 kill switch'",
    "swarm-db-test.sh sibling-fallback observes the suite's own fixture identity, not the consumer's real swarm-identity.sh": "the group now runs the reader from an isolated sibdir whose only swarm-identity.sh is a Matou/dev-factory fixture (tests/swarm-db-test.sh); consumer-shaped sim with a divergent Acme/widget checkout slug still observes faccommit, '13 groups passed'",
    "fleet-tui-test.sh at a consumer passes or emits a loud SKIP + non-failing exit, never a bare 6-checks-failed": "loud SKIP with exit 0 when fleet-tui/ is absent (tests/fleet-tui-test.sh); consumer-shaped sim exits 0 with the skip banner; pre-fix it exited 1",
    "factory-side runs of all three suites stay green (no self-copy regression)": "full offline suite loop green factory-side; the three suites report 18 groups / 13 groups / structural checks passed"
  },
  "summary": "Made the three layout-coupled vendored suites green (or a loud SKIP) inside a consumer's .sandcastle/ checkout while keeping them green factory-side.",
  "blockers": []
}
**close-report** for #87 — status `success` :white_check_mark: **close-report gates passed** — every claim verified against main; issue closed. <details><summary>envelope</summary> ```json { "issue": 87, "status": "success", "commits": [ "9305fab" ], "changed_files": [ "STATUS.md", "tests/fleet-tui-test.sh", "tests/session-runner-test.sh", "tests/swarm-db-test.sh" ], "tests": [ { "command": "bash tests/session-runner-test.sh", "exit_code": 0 }, { "command": "bash tests/swarm-db-test.sh", "exit_code": 0 }, { "command": "bash tests/fleet-tui-test.sh", "exit_code": 0 }, { "command": "for t in tests/*.sh onboarding/tests/*.sh; do case \"$t\" in *fakebin*|*fixtures*) continue;; esac; bash \"$t\"; done", "exit_code": 0 }, { "command": "consumer-shaped sim: bash <sim>/.sandcastle/tests/{session-runner,swarm-db,fleet-tui}-test.sh (divergent Acme/widget slug)", "exit_code": 0 } ], "criteria": { "session-runner-test.sh from a consumer-shaped .sandcastle/tests/ passes all groups (or fails loudly, never silently after group 1)": "prompt path now resolves whichever of ../.sandcastle/ or ../ rendered copy exists, failing loudly if neither (tests/session-runner-test.sh:10-19); consumer-shaped sim reports '18 groups passed'; pre-fix it died silently after 'ok 1 kill switch'", "swarm-db-test.sh sibling-fallback observes the suite's own fixture identity, not the consumer's real swarm-identity.sh": "the group now runs the reader from an isolated sibdir whose only swarm-identity.sh is a Matou/dev-factory fixture (tests/swarm-db-test.sh); consumer-shaped sim with a divergent Acme/widget checkout slug still observes faccommit, '13 groups passed'", "fleet-tui-test.sh at a consumer passes or emits a loud SKIP + non-failing exit, never a bare 6-checks-failed": "loud SKIP with exit 0 when fleet-tui/ is absent (tests/fleet-tui-test.sh); consumer-shaped sim exits 0 with the skip banner; pre-fix it exited 1", "factory-side runs of all three suites stay green (no self-copy regression)": "full offline suite loop green factory-side; the three suites report 18 groups / 13 groups / structural checks passed" }, "summary": "Made the three layout-coupled vendored suites green (or a loud SKIP) inside a consumer's .sandcastle/ checkout while keeping them green factory-side.", "blockers": [] } ``` </details>
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/dev-factory#87
No description provided.