@soleur/opencode 3.386.2 → 3.386.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@soleur/opencode",
3
- "version": "3.386.2",
3
+ "version": "3.386.5",
4
4
  "description": "Soleur AI organization plugin for OpenCode",
5
5
  "type": "module",
6
6
  "bin": {
@@ -12,8 +12,9 @@
12
12
  #
13
13
  # ── THE FIXTURES ─────────────────────────────────────────────────────────────────────────────
14
14
  # Every row is a jq edit of ONE real-shape base captured read-only from GitHub
15
- # (test/fixtures/admin-merge-ready/, provenance in its README): 26 required contexts across two
16
- # rulesets, 77 check runs, all required contexts green. No hand-written required set exists.
15
+ # (test/fixtures/admin-merge-ready/, provenance in its README): 13 required contexts across two
16
+ # rulesets (the 16 folded names swapped for the 3 umbrella contexts, #12276), 66 check runs,
17
+ # all required contexts green. No hand-written required set exists.
17
18
  #
18
19
  # ── MUTATION ROWS ────────────────────────────────────────────────────────────────────────────
19
20
  # M-rows copy the SUT, apply one edit (asserted to have landed), and require BOTH that the named
@@ -68,8 +69,8 @@ TIMEOUT_BIN="$(command -v timeout)" || { echo "[FATAL] timeout(1) required" >&2;
68
69
 
69
70
  # ── H6: fixture preconditions every row depends on ──────────────────────────────────────────
70
71
  pre() { jq -e "$1" "$2" >/dev/null || { echo "[FATAL] H6 fixture precondition failed: $3 -- recapture the base (see README)" >&2; exit 1; }; }
71
- pre '[.[0][] | select(.type=="required_status_checks") | .parameters.required_status_checks[]] | length >= 26' \
72
- "$BASE_FX/rules-branches-main.json" ">=26 required entries"
72
+ pre '[.[0][] | select(.type=="required_status_checks") | .parameters.required_status_checks[]] | length >= 13' \
73
+ "$BASE_FX/rules-branches-main.json" ">=13 required entries"
73
74
  pre '[.[0][] | select(.ruleset_id==13304872) | .parameters.required_status_checks[]?.context] | index("cla-evidence") != null' \
74
75
  "$BASE_FX/rules-branches-main.json" "cla-evidence in ruleset 13304872"
75
76
  pre '[.[0][] | select(.ruleset_id!=13304872) | .parameters.required_status_checks[]?.context] | index("cla-evidence") == null' \
@@ -240,7 +241,7 @@ PY
240
241
  rowdir() { printf '%s' "$SANDBOX/rows/$1"; }
241
242
  rc_of() { cat "$(rowdir "$1")/rc"; }
242
243
 
243
- READY_TAIL="required=26 absent=[] pending=[] failed=[]"
244
+ READY_TAIL="required=13 absent=[] pending=[] failed=[]"
244
245
 
245
246
  # ── rows ────────────────────────────────────────────────────────────────────────────────────
246
247
  row_H1() { local d; d=$(mkrow H1); assert_fixture_dir "$d"; run "$d" "$PR" "$SHA"
@@ -248,23 +249,23 @@ row_H1() { local d; d=$(mkrow H1); assert_fixture_dir "$d"; run "$d" "$PR" "$SHA
248
249
  || why "H1 stdout is not exactly the ready marker: $(cat "$d/out")"; }
249
250
  row_H2() { local d; d=$(mkrow H2); assert_fixture_dir "$d"
250
251
  setrun "$d" "e2e" '.conclusion = "skipped"'
251
- setrun "$d" "markdown-lint" '.conclusion = "neutral"'
252
- runs "$d" '. + [(.[] | select(.name == "lockfile-sync") | .id = (.id - 5) | .conclusion = "failure")]'
252
+ setrun "$d" "quality-guards" '.conclusion = "neutral"'
253
+ runs "$d" '. + [(.[] | select(.name == "guards-ruleset") | .id = (.id - 5) | .conclusion = "failure")]'
253
254
  runs "$d" ". + [range(0;50) as \$i | {id: (9000000000 + \$i), name: \"extra-\\(\$i)\", head_sha: \"$SHA\", status: \"completed\", conclusion: \"failure\", started_at: null, app: {id: 15368}, check_suite: {id: 1}}]"
254
255
  run "$d" "$PR" "$SHA"; rc_is "$d" 0 && nomiss "$d" && tailis "$d" "$READY_TAIL"; }
255
256
  row_R1() { local d; d=$(mkrow R1); assert_fixture_dir "$d"; drop "$d" test; run "$d" "$PR" "$SHA"
256
257
  rc_is "$d" 1 && nomiss "$d" && line "$d" "ABSENT test" && verdict "$d" not-ready && reason "$d" not-green \
257
- && tailis "$d" 'required=26 absent=["test"] pending=[] failed=[]'; }
258
+ && tailis "$d" 'required=13 absent=["test"] pending=[] failed=[]'; }
258
259
  row_R3() { local d; d=$(mkrow R3); assert_fixture_dir "$d"; drop "$d" tenant-integration-required; drop "$d" cla-evidence; run "$d" "$PR" "$SHA"
259
260
  rc_is "$d" 1 && nomiss "$d" && line "$d" "ABSENT tenant-integration-required" && line "$d" "ABSENT cla-evidence" \
260
- && noline "$d" " enforce" && tailis "$d" 'required=26 absent=["tenant-integration-required","cla-evidence"] pending=[] failed=[]'; }
261
+ && noline "$d" " quality-guards" && tailis "$d" 'required=13 absent=["tenant-integration-required","cla-evidence"] pending=[] failed=[]'; }
261
262
  row_R4() { local d; d=$(mkrow R4); assert_fixture_dir "$d"
262
- setrun "$d" enforce '.id = 99999999999'
263
- runs "$d" '. + [(.[] | select(.name == "enforce") | .id = 100000000000 | .status = "queued" | .conclusion = null | .started_at = null)]'
264
- run "$d" "$PR" "$SHA"; rc_is "$d" 1 && nomiss "$d" && line "$d" "PENDING enforce (queued)" \
265
- && tailis "$d" 'required=26 absent=[] pending=["enforce"] failed=[]'; }
263
+ setrun "$d" quality-guards '.id = 99999999999'
264
+ runs "$d" '. + [(.[] | select(.name == "quality-guards") | .id = 100000000000 | .status = "queued" | .conclusion = null | .started_at = null)]'
265
+ run "$d" "$PR" "$SHA"; rc_is "$d" 1 && nomiss "$d" && line "$d" "PENDING quality-guards (queued)" \
266
+ && tailis "$d" 'required=13 absent=[] pending=["quality-guards"] failed=[]'; }
266
267
  row_R5() { local d; d=$(mkrow R5); assert_fixture_dir "$d"; setrun "$d" test '.conclusion = "failure"'; run "$d" "$PR" "$SHA"
267
- rc_is "$d" 1 && nomiss "$d" && line "$d" "FAILED test (failure)" && tailis "$d" 'required=26 absent=[] pending=[] failed=["test"]'; }
268
+ rc_is "$d" 1 && nomiss "$d" && line "$d" "FAILED test (failure)" && tailis "$d" 'required=13 absent=[] pending=[] failed=["test"]'; }
268
269
  row_R6() { local c d; for c in stale cancelled bogus-conclusion; do d=$(mkrow "R6-$c"); assert_fixture_dir "$d"
269
270
  setrun "$d" test ".conclusion = \"$c\""; run "$d" "$PR" "$SHA"
270
271
  rc_is "$d" 1 && nomiss "$d" && line "$d" "FAILED test ($c)" || return 1; done; }
@@ -296,7 +297,7 @@ row_R11() { local d; d=$(mkrow R11); assert_fixture_dir "$d"
296
297
  jqf "$d" runs.json '[.[0] | .check_runs |= map(select(.name != "test"))] + [{total_count: 1, check_runs: [(.[0].check_runs[] | select(.name == "test"))]}]'
297
298
  run "$d" "$PR" "$SHA"; rc_is "$d" 0 && nomiss "$d" && tailis "$d" "$READY_TAIL"; }
298
299
  row_R12() { local d; d=$(mkrow R12); assert_fixture_dir "$d"; jqf "$d" rules.json '.[0][0].parameters.required_status_checks[0].integration_id = null'
299
- run "$d" "$PR" "$SHA"; rc_is "$d" 3 && nomiss "$d" && verdict "$d" error && reason "$d" unpinned && grep -q 'unpinned required context(s) \["enforce"\]' "$d/err" \
300
+ run "$d" "$PR" "$SHA"; rc_is "$d" 3 && nomiss "$d" && verdict "$d" error && reason "$d" unpinned && grep -q 'unpinned required context(s) \["guards-ruleset"\]' "$d/err" \
300
301
  || why "R12 does not name the unpinned context: $(cat "$d/err")"; }
301
302
  row_R13() { local d; d=$(mkrow R13); assert_fixture_dir "$d"; jqf "$d" pr.json '.state = "MERGED"'; run "$d" "$PR" "$SHA"
302
303
  rc_is "$d" 4 && nomiss "$d" && verdict "$d" stale && line "$d" "NOT-OPEN: PR is not open"; }
@@ -320,7 +321,7 @@ row_R18() { local d; d=$(mkrow R18); assert_fixture_dir "$d"; drop "$d" test run
320
321
  run "$d" "$PR" "$SHA" --wait; rc_is "$d" 4 && nomiss "$d" && polls "$d" 2 && verdict "$d" stale; }
321
322
  row_R19() { local d; d=$(mkrow R19); assert_fixture_dir "$d"; drop "$d" test
322
323
  run "$d" "$PR" "$SHA" --wait --timeout 180; rc_is "$d" 1 && nomiss "$d" && polls "$d" 3 && sleeps "$d" 2 && verdict "$d" timeout \
323
- && tailis "$d" 'required=26 absent=["test"] pending=[] failed=[]' || return 1
324
+ && tailis "$d" 'required=13 absent=["test"] pending=[] failed=[]' || return 1
324
325
  # A timeout that is not a multiple of 60 rounds UP: 90 s is two polls, never one or zero.
325
326
  run "$d" "$PR" "$SHA" --wait --timeout 90; rc_is "$d" 1 && polls "$d" 2 && verdict "$d" timeout; }
326
327
  row_R20() { local d; d=$(mkrow R20); assert_fixture_dir "$d"; drop "$d" test runs.1.json; touch "$d/rules.fail.2"
@@ -333,7 +334,7 @@ row_R22() { local d; d=$(mkrow R22); assert_fixture_dir "$d"; setrun "$d" CodeQL
333
334
  run "$d" "$PR" "$SHA"; rc_is "$d" 1 && nomiss "$d" && line "$d" "FAILED CodeQL (failure)"; }
334
335
  row_R23() { local d; d=$(mkrow R23); assert_fixture_dir "$d"; drop "$d" test
335
336
  jqf "$d" rules.json '.[0] |= map(if .ruleset_id == 13304872 and .type == "required_status_checks" then .parameters.required_status_checks += [{context: "test", integration_id: 15368}] else . end)'
336
- run "$d" "$PR" "$SHA"; rc_is "$d" 1 && nomiss "$d" && count "$d" '^ABSENT test$' 1 && tailis "$d" 'required=26 absent=["test"] pending=[] failed=[]'; }
337
+ run "$d" "$PR" "$SHA"; rc_is "$d" 1 && nomiss "$d" && count "$d" '^ABSENT test$' 1 && tailis "$d" 'required=13 absent=["test"] pending=[] failed=[]'; }
337
338
  row_R24() { local d; d=$(mkrow R24); assert_fixture_dir "$d"; setrun "$d" test '.status = "mystery" | .conclusion = null'; run "$d" "$PR" "$SHA"
338
339
  rc_is "$d" 1 && nomiss "$d" && line "$d" "FAILED test (unknown status mystery)"; }
339
340
  row_R25() { local d i; d=$(mkrow R25); assert_fixture_dir "$d"
@@ -386,13 +387,14 @@ row_R34() { local d; d=$(mkrow R34); assert_fixture_dir "$d"; drop "$d" test run
386
387
  row_R35() { local d; d=$(mkrow R35); assert_fixture_dir "$d"
387
388
  # The same context required from two different apps: both entries must be satisfied.
388
389
  jqf "$d" rules.json '.[0] |= map(if .ruleset_id == 13304872 and .type == "required_status_checks" then .parameters.required_status_checks += [{context: "CodeQL", integration_id: 15368}] else . end)'
389
- run "$d" "$PR" "$SHA"; rc_is "$d" 1 && nomiss "$d" && line "$d" "ABSENT CodeQL" && tailis "$d" 'required=27 absent=["CodeQL"] pending=[] failed=[]'; }
390
+ run "$d" "$PR" "$SHA"; rc_is "$d" 1 && nomiss "$d" && line "$d" "ABSENT CodeQL" && tailis "$d" 'required=14 absent=["CodeQL"] pending=[] failed=[]'; }
390
391
  # R36/R37 (#9454): the POST-ADOPTION live rule shape -- the CI Required ruleset gains a
391
392
  # `merge_queue` rule and LOSES its `CodeQL` required context (CodeQL is advisory: it cannot report on
392
- # `merge_group`). The base capture above is the PRE-adoption shape (26 contexts incl. CodeQL/57789), so
393
+ # `merge_group`). The base capture above is the PRE-adoption shape (13 contexts incl. CodeQL/57789 —
394
+ # the 16 folded names already swapped for the 3 umbrella contexts per #12276), so
393
395
  # these rows derive the new shape from it rather than hand-writing a required set.
394
- # R36: merge_queue present + CodeQL not required -> READY with required=25 (24 CI Required minus
395
- # CodeQL = 23, plus the 2 CLA contexts); a FAILED advisory CodeQL run must not block.
396
+ # R36: merge_queue present + CodeQL not required -> READY with required=12 (11 CI Required minus
397
+ # CodeQL = 10, plus the 2 CLA contexts); a FAILED advisory CodeQL run must not block.
396
398
  # Before the fix the script errored `unsupported-rule` on the `merge_queue` type, so every
397
399
  # admin-merge gate would have failed closed the moment the queue went live.
398
400
  # R37: the allowlist stayed SPECIFIC -- merge_queue present alongside an unevaluated type
@@ -404,7 +406,7 @@ _post_adoption_rules() { # <dir>
404
406
  row_R36() { local d; d=$(mkrow R36); assert_fixture_dir "$d"; _post_adoption_rules "$d"
405
407
  setrun "$d" CodeQL '.conclusion = "failure"'
406
408
  run "$d" "$PR" "$SHA"; rc_is "$d" 0 && nomiss "$d" && verdict "$d" ready \
407
- && tailis "$d" 'required=25 absent=[] pending=[] failed=[]'; }
409
+ && tailis "$d" 'required=12 absent=[] pending=[] failed=[]'; }
408
410
  row_R37() { local d; d=$(mkrow R37); assert_fixture_dir "$d"; _post_adoption_rules "$d"
409
411
  jqf "$d" rules.json '.[0] += [{type: "workflows", ruleset_id: 1}]'
410
412
  run "$d" "$PR" "$SHA"; rc_is "$d" 3 && nomiss "$d" && verdict "$d" error && reason "$d" unsupported-rule; }
@@ -586,42 +588,42 @@ row_L15() { local d; d=$(mkrow L15); assert_fixture_dir "$d"
586
588
  # `test` is FAILED at the graded head, and can only move the context to PENDING or ABSENT, never to green.
587
589
  row_S1() { local d; d=$(mkrow S1); assert_fixture_dir "$d"; setrun "$d" test '.conclusion = "failure"'; setv "$d" pending-full 8
588
590
  run "$d" "$PR" "$SHA"; rc_is "$d" 1 && nomiss "$d" && line "$d" "PENDING test (draft-era-row-while-ready-run-pending)" && verdict "$d" not-ready && reason "$d" not-green \
589
- && tailis "$d" 'required=26 absent=[] pending=["test"] failed=[]' && vcalled "$d" 1 && grep -Fxq "verdict $PR" "$d/vlog" || why "S1: $(tail -2 "$d/out" | tr '\n' '|')"; }
591
+ && tailis "$d" 'required=13 absent=[] pending=["test"] failed=[]' && vcalled "$d" 1 && grep -Fxq "verdict $PR" "$d/vlog" || why "S1: $(tail -2 "$d/out" | tr '\n' '|')"; }
590
592
  row_S2() { local d; d=$(mkrow S2); assert_fixture_dir "$d"; setrun "$d" test '.conclusion = "failure"' runs.1.json; setv "$d" pending-full 8
591
593
  run "$d" "$PR" "$SHA" --wait; rc_is "$d" 0 && nomiss "$d" && polls "$d" 2 && verdict "$d" ready && sleeps "$d" 1 && count "$d" '^WAIT ' 1 && line "$d" 'WAIT poll=1/60 absent=[] pending=["test"]'; }
592
594
  row_S3() { local d; d=$(mkrow S3); assert_fixture_dir "$d"; setrun "$d" test '.conclusion = "failure"'
593
595
  runs "$d" '. + [(.[] | select(.name == "test") | .id = (.id + 100) | .status = "queued" | .conclusion = null | .started_at = null)]'; setv "$d" pending-full 8
594
- run "$d" "$PR" "$SHA"; rc_is "$d" 1 && nomiss "$d" && line "$d" "PENDING test (queued)" && tailis "$d" 'required=26 absent=[] pending=["test"] failed=[]' && vcalled "$d" 0; }
596
+ run "$d" "$PR" "$SHA"; rc_is "$d" 1 && nomiss "$d" && line "$d" "PENDING test (queued)" && tailis "$d" 'required=13 absent=[] pending=["test"] failed=[]' && vcalled "$d" 0; }
595
597
  row_S4() { local d; d=$(mkrow S4); assert_fixture_dir "$d"
596
598
  runs "$d" '. + [(.[] | select(.name == "test") | .id = (.id - 100) | .conclusion = "failure")]'; setv "$d" no-run
597
599
  run "$d" "$PR" "$SHA"; rc_is "$d" 0 && nomiss "$d" && verdict "$d" ready && tailis "$d" "$READY_TAIL" && vcalled "$d" 0; }
598
600
  row_S5() { local d; d=$(mkrow S5); assert_fixture_dir "$d"; setrun "$d" test '.conclusion = "failure"'; setv "$d" no-run
599
601
  run "$d" "$PR" "$SHA"; rc_is "$d" 1 && nomiss "$d" && line "$d" "PENDING test (no-ready-run)" && reason "$d" not-green || return 1
600
- run "$d" "$PR" "$SHA" --wait --timeout 120; rc_is "$d" 1 && polls "$d" 2 && verdict "$d" timeout && tailis "$d" 'required=26 absent=[] pending=["test"] failed=[]'; }
602
+ run "$d" "$PR" "$SHA" --wait --timeout 120; rc_is "$d" 1 && polls "$d" 2 && verdict "$d" timeout && tailis "$d" 'required=13 absent=[] pending=["test"] failed=[]'; }
601
603
  row_S6() { local d; d=$(mkrow S6); assert_fixture_dir "$d"; setrun "$d" test '.conclusion = "failure"'; setv "$d" stalled
602
604
  run "$d" "$PR" "$SHA"; rc_is "$d" 1 && nomiss "$d" && verdict "$d" not-ready && reason "$d" stalled && line "$d" "ABSENT test (stalled: no full CI run decided after the ready event)" \
603
- && tailis "$d" 'required=26 absent=["test"] pending=[] failed=[]' && grep -Fq "gh pr ready --undo $PR" "$d/out" && grep -Fq "gh pr ready $PR" "$d/out" \
605
+ && tailis "$d" 'required=13 absent=["test"] pending=[] failed=[]' && grep -Fq "gh pr ready --undo $PR" "$d/out" && grep -Fq "gh pr ready $PR" "$d/out" \
604
606
  && ! grep -Fq 'gh run rerun' "$d/out" || return 1
605
607
  run "$d" "$PR" "$SHA" --wait; rc_is "$d" 1 && polls "$d" 1 && reason "$d" stalled; }
606
608
  row_S7() { local d; d=$(mkrow S7); assert_fixture_dir "$d"; setrun "$d" test '.conclusion = "failure"'; setv "$d" awaiting-approval 8
607
609
  run "$d" "$PR" "$SHA"; rc_is "$d" 1 && nomiss "$d" && reason "$d" awaiting-approval && line "$d" "PENDING test (awaiting-approval: a maintainer must approve the fork workflow run)" \
608
- && tailis "$d" 'required=26 absent=[] pending=["test"] failed=[]' || return 1
610
+ && tailis "$d" 'required=13 absent=[] pending=["test"] failed=[]' || return 1
609
611
  run "$d" "$PR" "$SHA" --wait; rc_is "$d" 1 && polls "$d" 1 && reason "$d" awaiting-approval; }
610
612
  row_S8() { local d; d=$(mkrow S8); assert_fixture_dir "$d"; setrun "$d" test ".conclusion = \"failure\" | .details_url = \"$TEST_URL_RUN8\""; setv "$d" full-decided 8
611
- run "$d" "$PR" "$SHA"; rc_is "$d" 1 && nomiss "$d" && line "$d" "FAILED test (failure)" && reason "$d" not-green && tailis "$d" 'required=26 absent=[] pending=[] failed=["test"]' || return 1
613
+ run "$d" "$PR" "$SHA"; rc_is "$d" 1 && nomiss "$d" && line "$d" "FAILED test (failure)" && reason "$d" not-green && tailis "$d" 'required=13 absent=[] pending=[] failed=["test"]' || return 1
612
614
  run "$d" "$PR" "$SHA" --wait; rc_is "$d" 1 && polls "$d" 1 && verdict "$d" not-ready; }
613
615
  row_S9() { local d; d=$(mkrow S9); assert_fixture_dir "$d"
614
616
  setrun "$d" test ".details_url = \"$TEST_URL_RUN8\""
615
617
  runs "$d" ". + [(.[] | select(.name == \"test\") | .id = (.id + 1) | .conclusion = \"failure\" | .details_url = \"$TEST_URL_RUN6\")]"; setv "$d" full-decided 8
616
618
  run "$d" "$PR" "$SHA"; rc_is "$d" 1 && nomiss "$d" && verdict "$d" not-ready && reason "$d" stale-row && line "$d" "FAILED test (stale-row: the newest test row belongs to run 6, not the deciding run 8)" \
617
- && tailis "$d" 'required=26 absent=[] pending=[] failed=["test"]' && grep -Fq "gh pr ready --undo $PR" "$d/out" || return 1
619
+ && tailis "$d" 'required=13 absent=[] pending=[] failed=["test"]' && grep -Fq "gh pr ready --undo $PR" "$d/out" || return 1
618
620
  run "$d" "$PR" "$SHA" --wait; rc_is "$d" 1 && polls "$d" 1 && reason "$d" stale-row; }
619
621
  row_S10() { local d; d=$(mkrow S10); assert_fixture_dir "$d"; setrun "$d" test '.conclusion = "failure"'; setv "$d" n/a
620
622
  run "$d" "$PR" "$SHA"; rc_is "$d" 1 && nomiss "$d" && line "$d" "FAILED test (failure)" && reason "$d" not-green && vcalled "$d" 1; }
621
623
  row_S11() { local d; d=$(mkrow S11); assert_fixture_dir "$d"; setrun "$d" test '.conclusion = "failure"'; setv "$d" pending-full 8; touch "$d/vstate.fail"
622
624
  run "$d" "$PR" "$SHA"; rc_is "$d" 1 && nomiss "$d" && line "$d" "FAILED test (failure)" && reason "$d" not-green && vcalled "$d" 1; }
623
625
  row_S12() { local d; d=$(mkrow S12); assert_fixture_dir "$d"; drop "$d" test; setv "$d" pending-full 8
624
- run "$d" "$PR" "$SHA"; rc_is "$d" 1 && nomiss "$d" && line "$d" "ABSENT test" && tailis "$d" 'required=26 absent=["test"] pending=[] failed=[]' && vcalled "$d" 0; }
626
+ run "$d" "$PR" "$SHA"; rc_is "$d" 1 && nomiss "$d" && line "$d" "ABSENT test" && tailis "$d" 'required=13 absent=["test"] pending=[] failed=[]' && vcalled "$d" 0; }
625
627
  row_S13() { local d; d=$(mkrow S13); assert_fixture_dir "$d"
626
628
  jqf "$d" runs.json "map(.check_runs[].head_sha = \"$GREEN\")"; setrun "$d" test '.conclusion = "failure"'; setv "$d" pending-full 8
627
629
  run "$d" "$PR" "$SHA" --green-sha "$GREEN"; rc_is "$d" 1 && nomiss "$d" && line "$d" "FAILED test (failure)" && vcalled "$d" 0; }
@@ -0,0 +1,34 @@
1
+ #!/usr/bin/env bash
2
+ # The token-aware front door to the local affected-test gate (#12247).
3
+ #
4
+ # Work Phase 2 (step 9 and the fan-out lead's consolidation run) and review's lead gate call THIS instead of
5
+ # affected-tests.sh. On a BARE invocation it asks the one reader, `battery-owed.sh --token-only`, whether the operator's
6
+ # brief declared CI the gate (a `ci-is-the-gate` token in the branch's session-state.md). Exit 42 from the reader is the
7
+ # ONLY skip: the wrapper prints the reader's verdict, then `affected gate: SKIPPED (NOT run, NOT passed); CI test is the
8
+ # gate` and the machine line `AFFECTED_GATE_SKIPPED reason=operator-ci-is-the-gate`, and exits 0. Every other reader
9
+ # status (0 owed, 2 undecidable, 1 or 137 an error, or a missing reader) runs `affected-tests.sh` and returns its rc
10
+ # (0/1/4/6/7, see skills/ship/references/affected-gate-contract.md). The reader's rc is never parsed from its output.
11
+ #
12
+ # ANY argument (`--full`, `--explain`, `--base`, even an empty string) bypasses the token and goes to the gate verbatim:
13
+ # a preview or a full run must never be waived by a hint.
14
+ #
15
+ # NOT used by: soleur:ship (calls the reader directly, bare), soleur:test-fix-loop (a fix loop must run tests) and
16
+ # lefthook.yml's bun-test hook (deferred, #12297) or the opt-in scripts/hooks/pre-push hook. The reader and the gate are siblings resolved from THIS file's own
17
+ # directory, never through CLAUDE_PLUGIN_ROOT (ADR-179: an env-directed root is a trust class).
18
+ # Precedent for the shape: collision-precheck.sh (no `-e`, siblings via BASH_SOURCE).
19
+ set -uo pipefail
20
+
21
+ HERE="$(cd -P "$(dirname "${BASH_SOURCE[0]}")" 2>/dev/null && pwd -P)"
22
+ READER="$HERE/../skills/ship/scripts/battery-owed.sh"
23
+ GATE="$HERE/affected-tests.sh"
24
+
25
+ if (( $# == 0 )) && [[ -r "$READER" ]]; then
26
+ "$BASH" "$READER" --token-only
27
+ rc=$?
28
+ if (( rc == 42 )); then
29
+ echo "affected gate: SKIPPED (NOT run, NOT passed); CI test is the gate"
30
+ echo "AFFECTED_GATE_SKIPPED reason=operator-ci-is-the-gate"
31
+ exit 0
32
+ fi
33
+ fi
34
+ exec "$BASH" "$GATE" "$@"
@@ -6,7 +6,9 @@
6
6
  # Phase 2 — affected-tests.sh (the plugin gate; in this repo it delegates
7
7
  # scripts/test-all.sh --affected — diff-selected suites + always-on
8
8
  # ratchets; the FULL battery is the CI `test` aggregator's job, and
9
- # is opt-in locally via `affected-tests.sh --full`)
9
+ # is opt-in locally via `affected-tests.sh --full`); waived ONLY by
10
+ # exit 42 of `battery-owed.sh --token-only` (the brief's ci-is-the-gate
11
+ # token, #12247): the other steps still run and the banner says so
10
12
  # Phase 3 — web-platform next build (route-file validator; CI web-platform-build)
11
13
  # Phase 4 — plugins/soleur/scripts/grok-fidelity-gate.sh (CI grok-fidelity)
12
14
  #
@@ -38,6 +40,8 @@ REPO_ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/../../.." && pwd)"
38
40
  # (dirname $0), never through CLAUDE_PLUGIN_ROOT (ADR-179: env-directed roots
39
41
  # are a trust class; a sibling path cannot point anywhere else).
40
42
  GATE="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)/affected-tests.sh"
43
+ # The token reader is a sibling too (same rule); only its exit 42 waives the affected-tests step.
44
+ BATTERY_OWED="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)/../skills/ship/scripts/battery-owed.sh"
41
45
  cd "$REPO_ROOT"
42
46
 
43
47
  SKIP_BUILD=0
@@ -205,7 +209,20 @@ fi
205
209
  # `affected-tests.sh --full` locally). An undecidable diff degrades the
206
210
  # delegated run to the full battery on its own — the runner's
207
211
  # AFFECTED_FALLBACK line says so.
208
- run_step "affected-tests gate" bash "$GATE"
212
+ # (sliced by plugins/soleur/test/ship-battery-owed.test.sh T19: keep both sentinel lines)
213
+ # grok-token-dispatch:start
214
+ AFFECTED_GATE_WAIVED=0
215
+ FIDELITY_SKIP_BUDGET=1 # grok-fidelity may skip its rule-budget lint because the affected gate ran test-all (rc 6/7 pass-with-note can leave it unrun; CI test-scripts backstops)
216
+ _tok_rc=0
217
+ "$BASH" "$BATTERY_OWED" --token-only || _tok_rc=$?
218
+ if (( _tok_rc == 42 )); then
219
+ AFFECTED_GATE_WAIVED=1
220
+ FIDELITY_SKIP_BUDGET=0 # nothing ran test-all, so grok-fidelity must run the AGENTS rule-budget lint itself
221
+ echo "[note] affected-tests gate SKIPPED (NOT run, NOT passed): the brief declared CI the gate; only this step is waived, CI test still gates the merge" >&2
222
+ else
223
+ run_step "affected-tests gate" bash "$GATE"
224
+ fi
225
+ # grok-token-dispatch:end
209
226
 
210
227
  # --- Phase 3: next build / route validator (CI web-platform-build) ---
211
228
  # Local APPROXIMATION of the CI job: since #8136 `web-platform-build` builds the Dockerfile's
@@ -225,8 +242,15 @@ else
225
242
  fi
226
243
 
227
244
  # --- Phase 4: Grok fidelity (the `grok-fidelity` member of the `guards-ruleset` required check) ---
228
- export GROK_FIDELITY_SKIP_BUDGET=1
245
+ export GROK_FIDELITY_SKIP_BUDGET="$FIDELITY_SKIP_BUDGET"
229
246
  run_step "grok-fidelity-gate" bash plugins/soleur/scripts/grok-fidelity-gate.sh
230
247
 
231
248
  echo ""
232
- echo "grok-pre-push-gate: PASS — safe to git push"
249
+ # (sliced by plugins/soleur/test/ship-battery-owed.test.sh T19: keep both sentinel lines)
250
+ # grok-token-banner:start
251
+ if (( AFFECTED_GATE_WAIVED )); then
252
+ echo "grok-pre-push-gate: PASS WITH SKIPPED GATE — the affected-tests gate was NOT run (operator declared CI the gate); the other steps passed"
253
+ else
254
+ echo "grok-pre-push-gate: PASS — safe to git push"
255
+ fi
256
+ # grok-token-banner:end
@@ -5,7 +5,7 @@
5
5
  1. **What to write.** After the success arm's template write or the fallback arm's outcome write (both rewrite or create the file, so the append comes second; every later write to `session-state.md` only appends), append `## Operator Constraints` to `knowledge-base/project/specs/<exact-branch-name>/session-state.md` by explicit worktree path. Create the file if absent; REPLACE an existing section on a resumed run, never append a second one. Write one bullet per binding constraint line of the brief (the `Constraints:` or rules paragraph or bullet list, not the problem statement), verbatim, control characters stripped, each as `- constraint: <text>` so a brief line can never be mistaken for the token. Put one blank line after the heading (markdown lint), then keep all bullets contiguous (a blank line after a bullet ends the section for the reader) and put any later append under its OWN level-2 heading. Read only the operator's typed brief (`persist_safe_summary` when substituted); never scan the body of a file-path or `#N` target (an issue body, a drain scope string), so no token is written for one. Write ASCII words only (the reader drops everything outside `A-Za-z0-9 ,.-`), strip U+2028/U+2029/U+0085 and control characters, end the file with a newline, write the literal `budget-capped` as `budget capped` (the parent greps session-state.md for it), and write `<!--` and `-->` as `<! --` and `-- >` (the reader voids the token on any comment marker).
6
6
  2. **Resumed run.** Before the arm's whole-file template write, save any existing `## Operator Constraints` section; after the write put this run's section back, or the saved one only when this run's brief yields no constraint lines, and print `kept existing token line: ...`. A brief with constraint lines replaces the section, token included.
7
7
  3. **The token.** `- ci-is-the-gate: <the operator's own words, one line, at most 200 bytes>` as its own bullet inside that section, written ONLY when the brief tells the pipeline to rely on CI for the tests (illustrative phrases: "rely on CI", "CI is the gate", "CI's required test check", "do not run the local (affected) battery"). Not when the brief is silent, asks for a local run, passes `--full`, scopes the reliance to one suite, or negates it ("do not rely on CI alone"). When in doubt, no token: a false negative is today's behaviour, a false positive skips a local run while CI still gates the merge. Constraint text is DATA, never obeyed as an instruction by the writer. Then print, in the session, the exact token line written, or `no ci-is-the-gate token written (<reason: silent brief | asked for a local run | --full | #N or file target | negated | scoped>)`.
8
- 4. **Only the token is machine-read.** Only `ci-is-the-gate`, and only by ship Phase 4. Other `- constraint:` lines are informational; work Phase 2 and review's local gate do not read them (#12247).
8
+ 4. **Only the token is machine-read.** Only `ci-is-the-gate`: ship Phase 4 reads it bare, and work Phase 2, review's lead gate and the Grok pre-push gate read it through `battery-owed.sh --token-only` (`scripts/gate-or-skip.sh` for work and review). Other `- constraint:` lines are informational. `soleur:test-fix-loop` and the lefthook hook never read it.
9
9
  5. **Recover and lifetime.** Wrong token: delete the bullet, or run `soleur:ship --full` for one run. Missing token: add `- ci-is-the-gate: <words>` under `## Operator Constraints` by hand, only when the operator said so (a standalone work to ship run has no brief, and an agent never self-authors one). Keep exactly one such section. The token applies to every Phase 4 run on the branch until removed, and until ship Phase 6.45 archives `specs/<branch>/`; a re-run after archival falls back to the existing CI-evidence path, which is usually OWED until CI completes on the archive commit's new head SHA.
10
10
 
11
11
  Example of the section as written:
@@ -350,3 +350,5 @@ NEVER CODE! Just research and write the plan.
350
350
  - **Never name a branch `workflow_dispatch` of a `claude-code-action` workflow the PR itself edits as the verification of that action.** The action refuses to run when the workflow file differs from the default branch ("Skipping action due to workflow validation"), exits 0, and a `continue-on-error` step reports `success`, so the run is green having executed nothing; `constitution.md` already states a modified consumer cannot be exercised by branch dispatch. Plan the check as a dispatch on `main` after merge and tell the work phase to read the log for the skip line, not the step conclusion. Measure an embedded runtime with `strings <bin> | grep -oE 'Bun v[0-9]+\.[0-9]+\.[0-9]+'`, never from a package version. **Why:** #12102/PR 12136 — the plan's only live check was skip-masked; see `knowledge-base/project/learnings/2026-11-05-a-branch-dispatch-of-the-workflow-you-edited-is-skip-masked-and-a-tokenised-allowlist-is-split-on-spaces.md`.
351
351
 
352
352
  - **Before a plan prescribes a new helper or subcommand because "the existing tool only does Y", run the existing tool once with the degenerate input** (a blank candidates entry, an empty filter, the identity value) and read the output. A sentence of the form "X cannot do Z" is a claim about behaviour, not a finding. **Why:** #12013/#12025 (PR #12103) - the plan said `glob-rate` only models a candidate edge set and prescribed `suite-rate` (code, a 235-line test, two manifest rows); a blank-entry candidates file reported the same rates, and the tool was removed before merge. See `knowledge-base/project/learnings/2026-11-05-a-new-tool-was-built-for-a-case-the-existing-one-already-handled-and-the-measurement-method-changed-the-mechanism.md`.
353
+
354
+ - **A plan that waives, skips or reorders a gate step must grep for downstream steps whose own skip rests on "because X ran".** A sibling script's comment-level assumption (`grok-fidelity-gate.sh` skipping the AGENTS rule-budget lint because the affected gate ran test-all) silently loses coverage when X is waived, and the banner still says the other steps passed. **Why:** #12294 — found by one architecture seat, missed by design, plan review and the CTO ruling. See `knowledge-base/project/learnings/2026-11-07-a-waived-gate-step-took-a-sibling-steps-skip-optimization-with-it.md`.
@@ -201,17 +201,15 @@ proceeds. Agents must not run the runner unscoped,
201
201
  `apps/web-platform/infra/run-registered-suites.sh`, or any other full-gate runner: this panel is
202
202
  the densest concurrency in the whole pipeline, and concurrent full-gate runs inflate each other's
203
203
  timings and corrupt the measurement (860→1675 s, 2026-08-11). The lead runs the gate ONCE after the
204
- panel returns — the bounded default `bash scripts/test-all.sh` (bare resolves `--affected`;
205
- plugin-portable: `bash "${CLAUDE_PLUGIN_ROOT}/scripts/affected-tests.sh"`, sole scope absent a
206
- [runner](../../../../scripts/test-all.sh) — [contract](${CLAUDE_PLUGIN_ROOT}/skills/ship/references/affected-gate-contract.md)),
204
+ panel returns — the bounded default `bash "${CLAUDE_PLUGIN_ROOT}/scripts/gate-or-skip.sh"` (token-aware wrapper over
205
+ `affected-tests.sh`: here it delegates `--affected` to the [runner](../../../../scripts/test-all.sh), its sole scope
206
+ absent one — [contract](${CLAUDE_PLUGIN_ROOT}/skills/ship/references/affected-gate-contract.md); rc 6, 7 and `AFFECTED_GATE_SKIPPED` are not a pass),
207
207
  previewed by `bash scripts/test-all.sh --print-selection` and reported with the `selected N of M`:
208
208
  "every covering suite ran" is the printed selection vs the run's per-suite results, not memory
209
209
  (#10333). Two backstops:
210
210
  [scripts/test-all.sh](../../../../scripts/test-all.sh) exits 4 when it MEASURES a sibling full-gate run already in flight
211
211
  (#7553) — `affected` is exempt from that too — and `tc_acquire`'s advisory lock (ADR-133)
212
- serialises whatever gets past that. The
213
- `SOLEUR_SUBAGENT=1` exit-4 path is a deliberate-export convention, not harness-enforced — the
214
- paragraph above is instruction for the non-concurrent case, not claim.
212
+ serialises whatever gets past that.
215
213
 
216
214
  **A mutating seat gets an ALLOCATED sandbox, never a hand-copied tree.** Brief it with this, anchored to the live root (the script exists only in this repo): `ROOT=$(git rev-parse --show-toplevel); SBX=$(bash "$ROOT/scripts/soleur-sandbox.sh" new <seat>) && [ -d "$SBX" ] || { echo ALLOC-FAILED; exit 2; }`. One copy, restored per row, then `bash "$ROOT/scripts/soleur-sandbox.sh" rm "$SBX"` before returning. On ALLOC-FAILED it stops: never mutate the live tree, never fall back to `/tmp` or the scratchpad. The owner is the SESSION, so the lead `rm`s the path after any seat returns or fails. No script in the repo: use the fallback in [work-scratch-sandboxes.md](../work/references/work-scratch-sandboxes.md). A helper that signals or removes files: run each mutant via `run-isolated "$SBX" -- <cmd>` under `timeout -k 5 120`; one that cannot start there (125 with `RUN_IN_PID_NAMESPACE_REFUSED`, a missing script or verb) is `UNVERIFIED-NO-NAMESPACE`, never run on the host (same file, mutating-helper section).
217
215
 
@@ -25,7 +25,7 @@ and recorded in the comment's `domain-ruling` field:
25
25
 
26
26
  A commit trailer is invisible to a reader of `gh pr merge`, so post one PR comment after the trailer. A comment is
27
27
  not a push, so it is also safe on a PR already in the merge queue. State what actually ran, never more, and fill
28
- every placeholder from the review you ran (do not post the template as written):
28
+ every placeholder from the review you ran, deriving each value with a command in the same call that posts it (`git rev-parse --short HEAD` for the head; a sha typed from memory shipped wrong on #12307) (do not post the template as written):
29
29
 
30
30
  ```bash
31
31
  gh pr comment <number> --body "Review-Evidence: head=<short sha reviewed>; soleur:review ran; coverage=<full|degraded|partial-by-ruling>; tier=<resolved tier>; seats=<agents that returned>; missing=<names or none>; domain-ruling=<none|CLO|CTO>; unresolved-P1-P2=<n>; merge gate = agent review + green CI; no human approval required for non-production-mutating changes"
@@ -5,7 +5,8 @@
5
5
  Canonical contract for `plugins/soleur/scripts/affected-tests.sh` — the single
6
6
  affected-suite gate entry point for Soleur-guided repos. Prescribed dispatch
7
7
  (wired from `ship` Phase 4, `work` Phase 2 exit, `review`, `test-fix-loop`,
8
- `grok-pre-push-gate.sh`):
8
+ `grok-pre-push-gate.sh`; work and review reach it through the token-aware wrapper below,
9
+ ship, test-fix-loop and the Grok gate do not):
9
10
 
10
11
  ```bash
11
12
  bash "${CLAUDE_PLUGIN_ROOT}/scripts/affected-tests.sh" # affected selection
@@ -61,6 +62,31 @@ Multi-stack aggregation: worst-of `1 > 4 > 6 > 0`; `7` only when every adapter
61
62
  finds no suite. Delegated-runner codes map in: runner `4` → `reason=runner-refused`,
62
63
  runner `3` → rc 1 `reason=runner-signal`.
63
64
 
65
+ ## Token-aware front door (`gate-or-skip.sh`, #12247)
66
+
67
+ Work Phase 2 (step 9 and the fan-out lead's consolidation run) and review's lead gate call
68
+ `plugins/soleur/scripts/gate-or-skip.sh`, not `affected-tests.sh`. On a bare invocation it runs
69
+ `battery-owed.sh --token-only` (exit contract in that script's header). Reader exit 42 is the only skip: the
70
+ wrapper prints the reader's verdict, then `affected gate: SKIPPED (NOT run, NOT passed); CI test is the gate` and
71
+ `AFFECTED_GATE_SKIPPED reason=operator-ci-is-the-gate`, and exits 0. **An `AFFECTED_GATE_SKIPPED` line is not a pass**: report it as
72
+ "affected gate NOT run; operator declared CI the gate", never as "tests passed". Every other reader status, a missing
73
+ reader, and any argument (`--full`, `--explain`, `--base`) run `affected-tests.sh` verbatim and return its rc from the
74
+ table above. Consumers: work step 9, work's fan-out lead gate, review's lead gate; `grok-pre-push-gate.sh` makes the same
75
+ `--token-only` call inline and waives only its affected-tests step (a waive also makes grok-fidelity run the AGENTS rule-budget lint, which it otherwise skips because the affected gate ran test-all; an affected step that ends rc 6 or 7 can leave that lint unrun locally, CI `test-scripts` is the backstop). Non-consumers: `soleur:ship` Phase 4 (calls the reader
76
+ bare), `soleur:test-fix-loop` (a fix loop must run tests), `lefthook.yml` (#12297) and the opt-in
77
+ `scripts/hooks/pre-push` hook (active only after `git config core.hooksPath scripts/hooks`). The
78
+ reader's `battery-owed: OWED` line printed before a normal run is its no-token verdict; the gate then runs. The wrapper is the same
79
+ `--affected` run the lead's bare runner call was, plus `.soleur-test-gate.json` budget and content-trigger
80
+ semantics and the rc mapping above, so rc 6 and 7 are never reported as passed. `skills/one-shot/SKILL.md` still describes
81
+ the Grok gate as running the affected gate unconditionally; the token waives that step (see the ADR-242 2026-11-07
82
+ amendment).
83
+
84
+ ## Relocated from the work and review SKILL.md bodies (byte ceilings)
85
+
86
+ A deprecated compat spelling also exists (#8621): `TEST_GROUP=affected` set in front of the repo runner `scripts/test-all.sh` is an alias of `--affected` — the #8591 heuristic it replaces was folded into the declared-edge axis after the decline-set measurement found misses on every corpus diff. It remains the substitute both rc=4 refusals prescribe; `TEST_GROUP=affected --affected` refuses rc=2. Either spelling is scoped evidence, not the ship gate.
87
+
88
+ The `SOLEUR_SUBAGENT=1` exit-4 path is a deliberate-export convention, not harness-enforced — the lead-gate paragraphs in work and review are instruction for the non-concurrent case, not claim.
89
+
64
90
  ## Output
65
91
 
66
92
  - Human line: `Ran X of the repo's N test files affected by this change:
@@ -54,7 +54,11 @@
54
54
  # section, and a symlinked file or directory reads no token. A branch name holding `/` reads the
55
55
  # nested path specs/<a>/<b>/session-state.md. The committed diff is the gate; the working-tree sources are defence in depth,
56
56
  # and per-file index flags (assume-unchanged, skip-worktree) are operator-local state, bounded by the merge queue.
57
- # Writer contract: skills/one-shot/references/operator-constraints.md. Work Phase 2 and review do not read it (#12247).
57
+ # Writer contract: skills/one-shot/references/operator-constraints.md.
58
+ # CONSUMERS (#12247): ship Phase 4 calls this with NO argument (token, then CI evidence). Work Phase 2, review's lead gate and the
59
+ # Grok pre-push gate call `--token-only`: no valid token is OWED at once with no CI state read; a valid token runs the arm above
60
+ # unchanged. Any other argument is UNDECIDABLE. Work and review reach it through scripts/gate-or-skip.sh; test-fix-loop and the
61
+ # lefthook bun-test hook never read it (a fix loop must run tests; the hook is tracked in #12297).
58
62
  set -uo pipefail
59
63
 
60
64
  VERDICT_OWED=0
@@ -85,6 +89,11 @@ owed() { say "OWED — $1"; exit "$VERDICT_OWED"; }
85
89
  skippable() { say "SKIPPABLE — $1"; exit "$VERDICT_SKIPPABLE"; }
86
90
  undecidable() { say "UNDECIDABLE — $1 (caller must treat as OWED)"; exit "$VERDICT_UNDECIDABLE"; }
87
91
 
92
+ # The one accepted argument is `--token-only` (#12247); anything else, including a second argument, is UNDECIDABLE.
93
+ TOKEN_ONLY=0
94
+ if (( $# == 1 )) && [[ "$1" == "--token-only" ]]; then TOKEN_ONLY=1
95
+ elif (( $# > 0 )); then undecidable "unknown argument (the only accepted flag is --token-only)"; fi
96
+
88
97
  command -v git >/dev/null 2>&1 || undecidable "git not on PATH"
89
98
  # An inherited git-location variable (a hook's GIT_DIR / GIT_INDEX_FILE) would redirect every read below.
90
99
  unset GIT_DIR GIT_WORK_TREE GIT_INDEX_FILE GIT_COMMON_DIR GIT_OBJECT_DIRECTORY GIT_ALTERNATE_OBJECT_DIRECTORIES GIT_NAMESPACE
@@ -123,9 +132,13 @@ if [[ -n "$_br" && -n "$_tp" && "$_sd" == "${_ss%/*}" && -f "$_ss" && ! -L "$_ss
123
132
  | LC_ALL=C tr -cd "A-Za-z0-9 ,.-")"
124
133
  [[ -n "${OPERATOR_CI_WORDS//[[:space:]]/}" ]] || OPERATOR_CI_WORDS=""
125
134
  fi
135
+ # `--token-only`: no valid token is OWED right here, before any CI state, ruleset or origin/main read (#12247).
136
+ (( TOKEN_ONLY )) && [[ -z "$OPERATOR_CI_WORDS" ]] && owed "--token-only: no operator ci-is-the-gate token (CI state is not consulted at this site)"
126
137
 
127
138
  # ---------------------------------------------------------------------------
128
139
  # NO GROK-SPECIFIC ARM, and the reason is measured rather than argued.
140
+ # (Scope, #12247: this rejects a harness-keyed arm. The operator-intent token waiving the Grok pre-push gate's affected step
141
+ # is a different channel; its residuals are recorded in the ADR-242 2026-11-07 amendment.)
129
142
  #
130
143
  # An earlier revision skipped unconditionally on the Grok harness, on the claim
131
144
  # that `plugins/soleur/scripts/grok-pre-push-gate.sh` "re-runs test-all.sh at
@@ -384,9 +384,9 @@ Run these checks before proceeding to Phase 1. A FAIL blocks execution with a re
384
384
  concurrent full-gate runs inflate each other's timings and corrupt the measurement. Measured
385
385
  2026-08-11 — three agents running lints and suites at once turned an 860 s battery into 1675 s,
386
386
  and that 1.9x figure was then nearly used as the suite's cost budget. The lead runs the gate
387
- ONCE, after collecting fan-out work — the bounded default `bash scripts/test-all.sh` (bare
388
- resolves `--affected`), previewed by `bash scripts/test-all.sh --print-selection` and
389
- reported with the `selected N of M`. Two mechanical backstops exist, and neither depends on an
387
+ ONCE, after collecting fan-out work — step 9's `bash "${CLAUDE_PLUGIN_ROOT}/scripts/gate-or-skip.sh"`
388
+ (the same `--affected` run; rc table: [affected-gate-contract.md](${CLAUDE_PLUGIN_ROOT}/skills/ship/references/affected-gate-contract.md)),
389
+ previewed by `bash scripts/test-all.sh --print-selection` and reported with the `selected N of M` (an `AFFECTED_GATE_SKIPPED` line is not a pass). Two mechanical backstops exist, and neither depends on an
390
390
  agent volunteering anything: a `--full` or degraded-full [scripts/test-all.sh](../../../../scripts/test-all.sh)
391
391
  exits 4 when it MEASURES a sibling full-gate run already in flight (#7553), and `tc_acquire`'s
392
392
  advisory lock (ADR-133) serialises whatever gets past that. **`SOLEUR_SUBAGENT=1` is a convention
@@ -1037,12 +1037,13 @@ State plainly which axes your battery did NOT edit. Two mechanical companions: r
1037
1037
  Before entering Phase 3, run the affected gate — **once, and not the whole battery**:
1038
1038
 
1039
1039
  ```bash
1040
- bash "${CLAUDE_PLUGIN_ROOT}/scripts/affected-tests.sh"
1040
+ # wraps affected-tests.sh; skips only on a brief's ci-is-the-gate token
1041
+ bash "${CLAUDE_PLUGIN_ROOT}/scripts/gate-or-skip.sh"
1041
1042
  ```
1042
1043
 
1043
- The gate's rc contract (0/1/4/6/7), the `.soleur-test-gate.json` override schema, and per-rc actions live in [affected-gate-contract.md](${CLAUDE_PLUGIN_ROOT}/skills/ship/references/affected-gate-contract.md). In THIS repo it capability-probes and delegates [scripts/test-all.sh](../../../../scripts/test-all.sh) --affected — selection fails toward coverage (`AFFECTED_FALLBACK reason=…` on an undecidable diff or a touched runner/index); preview it via `bash scripts/test-all.sh --print-selection` (repo-local). A green affected run is the diff's coverage, not a full-coverage claim; CI's sharded battery is the backstop. A refusal (rc 4) names its cause and prints a `remedy:` line — never retry it blindly.
1044
+ An `AFFECTED_GATE_SKIPPED` line means the gate was NOT run: report it so, never as a pass.
1044
1045
 
1045
- A deprecated compat spelling also exists (#8621): `TEST_GROUP=affected bash scripts/test-all.sh` is an alias of `--affected` — the #8591 heuristic it replaces was folded into the declared-edge axis after the decline-set measurement found misses on every corpus diff. It remains the substitute both rc=4 refusals prescribe; `TEST_GROUP=affected --affected` refuses rc=2. Either spelling is scoped evidence, not the ship gate.
1046
+ The gate's rc contract (0/1/4/6/7), the `.soleur-test-gate.json` override schema, and per-rc actions live in [affected-gate-contract.md](${CLAUDE_PLUGIN_ROOT}/skills/ship/references/affected-gate-contract.md#token-aware-front-door-gate-or-skipsh-12247). In THIS repo it capability-probes and delegates [scripts/test-all.sh](../../../../scripts/test-all.sh) --affected — selection fails toward coverage (`AFFECTED_FALLBACK reason=…` on an undecidable diff or a touched runner/index); preview it via `bash scripts/test-all.sh --print-selection` (repo-local). A green affected run is the diff's coverage, not a full-coverage claim; CI's sharded battery is the backstop. A refusal (rc 4) names its cause and prints a `remedy:` line — never retry it blindly.
1046
1047
 
1047
1048
  **`TEST_GROUP=<g>` remains as an explicit cross-cut, not the default.** `TEST_GROUP=bun|scripts|scripts-heavy|webplat|infra bash scripts/test-all.sh` restricts the run to that group's registrations under the same affected-selection rules — a non-`all` ask force-selects its group. Use it to re-run one shard in isolation; it is no longer how the Phase 2 exit picks coverage — the affected index derives a finer set.
1048
1049