Skip to content

board-api suite hygiene: rc exit-status helper + BOARD_RUN_TOKEN hermeticity - #78

Merged
SSFSKIM merged 1 commit into
mainfrom
suite-hygiene-rc-hermeticity
Aug 20, 2026
Merged

SSFSKIM merged 1 commit into
mainfrom
suite-hygiene-rc-hermeticity

Conversation

@SSFSKIM

@SSFSKIM SSFSKIM commented Aug 20, 2026

Copy link
Copy Markdown
Owner

Closes #77 — both halves, tests-only (no plugin runtime touched, no version bump).

rc helper

rc <expected-code> <label> <cmd…> beside t/nt in tests/claude-code/board-api/helpers.sh: asserts the exit STATUS and nothing else, same capture idiom (no pipes — the suite's known SIGPIPE trap), same counters and ok/FAIL format. 13 new rc drills in test-agent-grade-reads.sh retire the exit-code paths the PR #76 reviews confirmed by hand: usage/refusals exit 2 (no/empty query, unknown flag, dup positional, gh --states, empty --states value), claim-gate die exit 1, degrade and happy paths exit 0.

Discrimination proven by mutation: flipping the gh-arm refusal exit 2 → 1 and swallowing the API arm's status each left every existing t/nt drill green and failed only the rc drill — exactly the silent-regression class the issue named. Both mutations reverted; the commit touches nothing under skills/.

BOARD_RUN_TOKEN hermeticity

One unset BOARD_RUN_TOKEN at helpers.sh load. The client legitimately branches on the variable (claim-gate guard, board-show degrade), so an ambient token changed what the suites were testing — test-read-verbs.sh and test-client-core.sh failed outright under BOARD_RUN_TOKEN=sneaky before; all 14 mock suites pass under it now. A repo-wide grep shows no drill reads an ambient value: every run-context drill sets the bearer on its own invocation (inline prefix, env in a subshell, or inside its bash -c string), and the two drills that depend on the variable's absence are now guaranteed it.

Verification

54 drills green in test-agent-grade-reads.sh (41 + 13), also green on /bin/bash 3.2.57; BOARD_RUN_TOKEN=sneaky across all 14 board-api mock suites 14/14; full runner 18 passed / 0 failed / 8 ARKHO_DIR-gated skips; shellcheck clean.

…(dp#77)

t/nt read the combined output and tolerate any exit status, so an exit code
that drifts — a refusal from 2 to 1, a die decaying to success — passes them
silently. Exit codes are pinned contract for the read verbs, and this epic
hand-confirmed them live twice; `rc <expected> <label> <cmd…>` retires that
manual pass. Same capture idiom as t/nt (combined output, herestring, no
pipe), same ok/FAIL lines, same counter; it asserts the status alone.

Thirteen rc drills in test-agent-grade-reads.sh pin what the reviews checked
by hand: every board-search refusal arm at 2 (no argv, flags without a query,
empty query, whitespace query, unknown flag, second positional, empty --states
value, the gh arm's --states refusal), the claim-gate die at 1, and the served
paths at 0 (populated search, empty result, gh delegate, board-show's
run-context degrade). Adoption is opportunistic — existing t/nt drills stay.

Two mutations confirm they discriminate where t/nt cannot: flipping the gh
arm's --states refusal to exit 1, and swallowing the API arm's status with
`|| true` before the verb's trailing `exit 0`. Both leave every t/nt drill
green and fail only the rc drill.

The suites also were not hermetic against an ambient BOARD_RUN_TOKEN: the
client legitimately branches on it (claim-gate guard, board-show degrade), so
an operator holding one turned ~17 pre-existing drills red. helpers.sh now
unsets it at load. No drill anywhere reads an ambient value — every run
context is opted into on the invocation itself (an env prefix, an `env VAR=`
in a subshell, or the assignment written into a `bash -c` string), and the two
sites that depend on its ABSENCE (test-edge-verbs' human-principal routes,
test-client-core's "no BOARD_RUN_TOKEN" die) are what the unset guarantees.
@SSFSKIM
SSFSKIM merged commit 21427c7 into main Aug 20, 2026
@SSFSKIM
SSFSKIM deleted the suite-hygiene-rc-hermeticity branch August 20, 2026 18:55
SSFSKIM added a commit that referenced this pull request Oct 16, 2026
…pt, ahead of anything later (Arkho #78, 7.158.3)

bridge: name a manual compaction's rows from the transcript, ahead of anything later (Arkho #78, 7.158.3)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

board-api suite hygiene: exit-status pinning helper + BOARD_RUN_TOKEN hermeticity

1 participant