@soleur/opencode 3.357.15 → 3.357.17

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.
@@ -52,9 +52,9 @@ gate probes registration, not presence.
52
52
  | rc | Meaning | Skill action |
53
53
  |----|---------|--------------|
54
54
  | 0 | Selected tests passed, or `NO_TESTS_AFFECTED` (all-inert diff) | proceed |
55
- | 1 | A selected test failed / runner signal-killed | stop; report failures |
55
+ | 1 | A selected test failed / runner signal-killed / the content-trigger command failed (`reason=content-trigger-failed`) | stop; report failures (for `content-trigger-failed`, re-run the `content_trigger_command` directly) |
56
56
  | 4 | `AFFECTED_GATE_REFUSED reason=<no-stack\|bad-config\|vacuous-test-command\|no-base-ref\|not-a-repo\|toolchain-missing\|runner-refused>` + a `remedy:` line | stop; fix the named cause — never retry blindly |
57
- | 6 | `AFFECTED_GATE_BUDGET_DEFERRED` — budget expired AND a CI test workflow exists | proceed to CI; record CI as the authoritative gate; never label the run passed |
57
+ | 6 | `AFFECTED_GATE_BUDGET_DEFERRED` — budget expired AND a CI test workflow exists (with `content_trigger=deferred` the selected tests passed and only the content-trigger command is owed to CI) | proceed to CI; record CI as the authoritative gate; never label the run passed |
58
58
  | 7 | No test suite detected at all | proceed with the disclosed note; never label passed |
59
59
 
60
60
  Multi-stack aggregation: worst-of `1 > 4 > 6 > 0`; `7` only when every adapter
@@ -70,7 +70,9 @@ runner `3` → rc 1 `reason=runner-signal`.
70
70
  `affected-suite gate passed.`).
71
71
  - Machine line: `AFFECTED_GATE ran=X of=N skipped=Y mode=<selected|full|custom|explain|none|help> reason=… stack=… ci=<file|none>`
72
72
  on every verdict path, including refusals and non-run paths (`explain`,
73
- `help`, `self-check`) — counts are `-` where no honest count exists.
73
+ `help`, `self-check`) — counts are `-` where no honest count exists. An armed
74
+ content trigger appends one trailing field `content_trigger=<state>` (see
75
+ [Content trigger](#content-trigger)); parse the line by field name.
74
76
  - `NO_TESTS_AFFECTED` + `No tests ran: docs-only change.` for an all-inert diff
75
77
  (adapter arm only — a capability-positive runner decides inertness itself).
76
78
  - `--explain` prints the selection and per-path reasons without running; under
@@ -100,6 +102,61 @@ runner `3` → rc 1 `reason=runner-signal`.
100
102
  | `budget_seconds` | number | Wall-clock cap; enforced only when CI detected; default 900; must be a positive integer |
101
103
  | `max_workers` | number | Overrides `max(1, ncpu/2) / (1 + running gate processes)`; positive integer |
102
104
  | `budget_ci` | boolean | Forces CI-deferral eligibility |
105
+ | `content_trigger_pattern`, `content_trigger_paths`, `content_trigger_command` | string, string[], string | The content trigger below. All three or none: a partial or empty group, a multi-line pattern, an empty, whitespace-bearing or match-everything glob (`*`, `**/*`, `[!p]*`: any glob matching one of a few improbable probe paths), a glob that can never match a repo-relative path (leading `./`, `/` or `!`; trailing `/`; `//`; a `.`/`..` segment; `{a,b}`, which `[[ == ]]` does not expand), or an empty or vacuous command (same denylist as `test_command`) is `bad-config key=<the offending key>` |
106
+
107
+ ## Content trigger
108
+
109
+ Selection by path cannot see a test file that merely NAMES a path (a fixture whose text
110
+ contains a repo directory). The trigger covers that class from config, so the plugin stays
111
+ repo-agnostic: when the diff **adds** a line (tracked files) or any file **holds** a line
112
+ (untracked files) containing the fixed string `content_trigger_pattern`, in a file matching
113
+ one of `content_trigger_paths`, a passing run ALSO runs `content_trigger_command` (via
114
+ `bash -c` from the repo root with the gate's environment — the same trust level as
115
+ `test_command`; a PR can edit the config and the code together, so CI stays the independent
116
+ gate). Its exit status is the only failure signal.
117
+
118
+ - **Order and scope.** It runs after the primary run, on any passing verdict the operator
119
+ did not make `--full`: delegated, adapter, an inert diff, and a gate-side escalation to
120
+ full (global paths, empty diff, degraded census, no selector — the stack adapter's full
121
+ run never runs the repo-declared command). An operator's own `--full`, `test_command`,
122
+ `--self-check`, help, refusals, and `rc 7` (no test suite) never run it, and neither does
123
+ `--explain` (it only reports; under an operator's `--full` it prints nothing). On a repo with no
124
+ runner an operator's `--full` is the stack's full command only: it does not cover the trigger. A failed primary (marker field `skipped`) owns the verdict.
125
+ The command runs under the same remaining wall-clock budget: with a detected CI workflow
126
+ an expiry is rc 6 (field `deferred`), else rc 1.
127
+ - **What counts.** Added lines only, taken from one `git diff -U0 --text` of the working tree
128
+ against `merge-base(<base>, HEAD)` (renames are a delete plus an add, so moving a file that
129
+ already names the string into the globs fires) plus untracked files (read as text; symlinks
130
+ skipped). The
131
+ base is `--base`, else `origin/main`, else `origin/master` — never the upstream ref, which on
132
+ a pushed branch would hide every pushed fixture. A path or removal line that names the
133
+ string never fires. The string is matched as a
134
+ fixed string, not a regex. Globs: a pattern with a `/` matches the whole path (and `*`
135
+ crosses `/`, `**/` also matches zero directories); a bare name matches the basename.
136
+ - **Fail direction.** A scan that cannot decide runs the command and says so
137
+ (`content_trigger=scan-error`, with `leg=` on stdout): no base ref, a failing `git`, a path
138
+ git C-quotes (a name holding a quote, backslash or control byte), a `--base` that looks
139
+ like an option, or an untracked tree past 20000 listed paths or 500 candidate files.
140
+ A miss is a CI-only red, a spurious run is minutes.
141
+ - **Marker.** One trailing field on the `AFFECTED_GATE` line, only when armed and only on an
142
+ eligible exit: `content_trigger=<clear|ran|failed|deferred|skipped|scan-error>`. `failed` is
143
+ the command exiting non-zero (rc 1 `reason=content-trigger-failed`, with a
144
+ `CONTENT_TRIGGER_FAILED rc=N` line and a remedy); `deferred` is the command hitting the
145
+ shared budget with CI authoritative (rc 6); `skipped` is a primary that did not pass. An
146
+ inert diff that ran it reports `mode=selected` with `-` counts and `reason=inert-content-trigger`
147
+ on a pass (no "docs-only" claim). An unarmed gate's line is unchanged.
148
+ - **`--explain`** prints `CONTENT_TRIGGER armed=1 state=<none|fired|scan-error> paths=<n>`
149
+ and runs nothing (the `test_command` explain arm prints nothing: `test_command`
150
+ bypasses selection, so an armed trigger beside it is inert).
151
+ - **Double run.** When the primary run already selected the same suite, it runs twice; this
152
+ is accepted (about a minute and a half for this repo's ratchet) rather than deduplicated.
153
+ - **Choosing `content_trigger_paths`.** Keep the globs to trees where a fixture legitimately
154
+ names the string; the trigger rate over recent history should stay small (this repo's
155
+ set was held to about 10 percent of first-parent commits). Re-measure when the globs
156
+ change: count commits whose diff adds the string to a file under the globs.
157
+ - **Known limits.** A tracked file that git filters (clean/smudge, LFS pointers) is diffed
158
+ after the filter; a file in a nested repository is not read; a command that swallows its
159
+ own exit status (`cmd | cat`, a trailing `&`) is outside the vacuity denylist.
103
160
 
104
161
  ## Worked examples
105
162
 
@@ -349,11 +349,11 @@ Run these checks before proceeding to Phase 1. A FAIL blocks execution with a re
349
349
 
350
350
  ### Phase 2: Execute
351
351
 
352
- **Output discipline (all tiers).** Long execution phases blow the response-token ceiling and truncate mid-pipeline, losing the thread. Keep inline output bounded: when a command's output is large (full diffs, build logs, test dumps), write it to a file and reference the path rather than pasting it — never echo a diff over ~200 lines inline (`d="$(mktemp -d -t soleur-run.$$.XXXXXXXX)/d"; git diff > "$d"; echo "DIFF=$d"` then summarize, citing the path). After each task or logical unit, emit a one-line `## Work Phase <N> complete` checkpoint marker so an interrupted run has a clear resume point. This complements hard rule `hr-never-run-commands-with-unbounded-output` (which forbids unbounded *commands*); this is about bounding your own *narration* of them.
352
+ **Output discipline (all tiers).** Long execution phases blow the response-token ceiling and truncate mid-pipeline, losing the thread. Keep inline output bounded: when a command's output is large (full diffs, build logs, test dumps), write it to a file and reference the path rather than pasting it — never echo a diff over ~200 lines inline (`d="$(mktemp -d -t soleur-run.$$.XXXXXXXX)/d"; git diff > "$d"; echo "DIFF=$d"` then summarize, citing the path). After each task or logical unit, emit a one-line `## Work Phase <N> complete` checkpoint marker so an interrupted run has a clear resume point. This bounds your *narration* of commands; `hr-never-run-commands-with-unbounded-output` bounds the commands.
353
353
 
354
354
  1. **Execution Mode Selection** (HARD GATE — must complete before executing ANY task)
355
355
 
356
- **Do NOT execute any task before completing this analysis.** Analyze independence first, select the execution tier, then begin. Starting sequential execution "because the first tasks feel simple" is a workflow violation — it forfeits parallelization savings on the remaining tasks.
356
+ **Analyze independence first, select the tier, then begin** — sequential-by-default because "the first tasks feel simple" forfeits the remaining tasks' parallelization savings.
357
357
 
358
358
  Before starting the sequential task loop, check for parallelization opportunities:
359
359
 
@@ -365,7 +365,7 @@ Run these checks before proceeding to Phase 1. A FAIL blocks execution with a re
365
365
  - If yes (pipeline mode): auto-select Tier 0 without prompting
366
366
  - If declined or ineligible: fall through to Step 1 below
367
367
 
368
- **Read `plugins/soleur/skills/work/references/work-lifecycle-parallel.md` now** for the full Tier 0 protocol (offer/auto-select, generate contract, spawn 2 agents, collect/commit, test-fix-loop, docs). If Tier 0 executes, proceed directly to Phase 3 after completing Step 06 of the protocol. If declined, fall through to Step 1.
368
+ **Read `plugins/soleur/skills/work/references/work-lifecycle-parallel.md` now** for the Tier 0 protocol; on execute go to Phase 3 after its Step 06, on decline fall through to Step 1.
369
369
 
370
370
  ---
371
371
 
@@ -373,16 +373,20 @@ Run these checks before proceeding to Phase 1. A FAIL blocks execution with a re
373
373
 
374
374
  **Standing constraint for EVERY tier — a spawned agent never runs the FULL gate.**
375
375
  Spawned agents run only the suites targeting the files they were given — mechanically,
376
- either scoped form works: `test-all.sh --affected` (the #8322 declared-edge gate) or
377
- `TEST_GROUP=affected bash scripts/test-all.sh` (the #8591 heuristic selector). Both register
378
- every suite and decline those the diff cannot reach, both are exempt from both refusal arms,
379
- so the spawn prompt needs no hand-derived suite list. What a spawned agent must not run is a
376
+ `test-all.sh --affected` (the #8322 declared-edge gate); one handed an EXPLICIT file list
377
+ may instead run `TEST_GROUP=affected bash scripts/test-all.sh` (the #8591 heuristic
378
+ selector — a DIFFERENT selector: an undecidable diff prints `[affected] MODE=full` and
379
+ runs nearly everything, 2026-10-15 on `apps/web-platform/infra/` still running after an
380
+ hour). Both are exempt from both refusal arms, so the spawn prompt needs no hand-derived
381
+ suite list. What a spawned agent must not run is a
380
382
  full-gate-shaped invocation: `test-all.sh --full`,
381
383
  `apps/web-platform/infra/run-registered-suites.sh`, or any other full-battery runner —
382
384
  concurrent full-gate runs inflate each other's timings and corrupt the measurement. Measured
383
385
  2026-08-11 — three agents running lints and suites at once turned an 860 s battery into 1675 s,
384
386
  and that 1.9x figure was then nearly used as the suite's cost budget. The lead runs the gate
385
- ONCE, after collecting fan-out work. Two mechanical backstops exist, and neither depends on an
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
386
390
  agent volunteering anything: a `--full` or degraded-full [scripts/test-all.sh](../../../../scripts/test-all.sh)
387
391
  exits 4 when it MEASURES a sibling full-gate run already in flight (#7553), and `tc_acquire`'s
388
392
  advisory lock (ADR-133) serialises whatever gets past that. **`SOLEUR_SUBAGENT=1` is a convention
@@ -409,21 +413,19 @@ Run these checks before proceeding to Phase 1. A FAIL blocks execution with a re
409
413
 
410
414
  **Tier A: Agent Teams** (highest capability, ~7x token cost)
411
415
 
412
- **Read `plugins/soleur/skills/work/references/work-agent-teams.md` now** for the full Agent Teams protocol (offer, activate, spawn teammates, monitor/commit/shutdown). If declined or failed, fall through to Tier B.
416
+ **Read `plugins/soleur/skills/work/references/work-agent-teams.md` now** for the Agent Teams protocol; on decline or failure fall through to Tier B.
413
417
 
414
418
  ---
415
419
 
416
420
  **Tier B: Subagent Fan-Out** (fire-and-gather, moderate cost)
417
421
 
418
- **Read `plugins/soleur/skills/work/references/work-subagent-fanout.md` now** for the full Subagent Fan-Out protocol (offer, group/spawn, collect/integrate). If declined **or failed**, fall through to Tier C.
422
+ **Read `plugins/soleur/skills/work/references/work-subagent-fanout.md` now** for the Subagent Fan-Out protocol; on decline **or failure** fall through to Tier C.
419
423
 
420
424
  The `or failed` is load-bearing and was missing: Tier 0 and Tier A both read "If
421
- declined **or failed**, fall through", so a spawn FAILURE at those tiers has a defined
422
- next step. Tier B said only "If declined" — leaving a spawn failure (agent tool
423
- withheld, `529 Overloaded`, headless run with no agent surface) with no prescribed
424
- behavior at the LAST tier that can degrade. Tier C is always available because it is
425
- sequential execution in the main context, so the fall-through costs nothing and closes
426
- the gap. When it fires, say so: "Tier B fan-out unavailable (<reason>) — executing
425
+ declined **or failed**, fall through", so a spawn FAILURE has a defined next step.
426
+ Tier B said only "If declined" — leaving a spawn failure (agent tool withheld, `529
427
+ Overloaded`, headless run with no agent surface) undefined at the LAST tier that can
428
+ degrade. When it fires, say so: "Tier B fan-out unavailable (<reason>) — executing
427
429
  sequentially" rather than silently running Tier C as though it were the chosen tier.
428
430
 
429
431
  ---
@@ -434,15 +436,9 @@ Run these checks before proceeding to Phase 1. A FAIL blocks execution with a re
434
436
 
435
437
  2. **Task Execution Loop**
436
438
 
437
- **Design Artifact Gate (before first UI task):** If `DESIGN_ARTIFACTS` was set in Phase 0.5, spawn the `soleur:product:design:ux-design-lead` agent with the artifact paths and ask it to produce an **implementation brief** (see soleur:product:design:ux-design-lead "Wireframe-to-Implementation Handoff" workflow). The brief is a structured description of every section, its content, and its layout — this becomes the binding input for all UI tasks. Do not write any markup until the brief is received.
439
+ **Design Artifact Gate (before first UI task):** If `DESIGN_ARTIFACTS` was set in Phase 0.5, spawn the `soleur:product:design:ux-design-lead` agent with the artifact paths for an **implementation brief** (its "Wireframe-to-Implementation Handoff" workflow) — the binding input for all UI tasks. Do not write markup before it arrives.
438
440
 
439
- **UX artifact commit checkpoint (after Design Artifact Gate):** After the implementation brief is received, commit before proceeding to UI tasks:
440
-
441
- 1. Run `git status --short` to discover the implementation brief and any generated design files
442
- 2. Stage output files: `git add <discovered files>`
443
- 3. Commit: `git commit -m "wip: UX implementation brief for <feature-name>"`
444
-
445
- This checkpoint ensures the implementation brief survives session crashes.
441
+ **UX artifact commit checkpoint (after Design Artifact Gate):** commit the brief and any generated design files (`git add` them, `git commit -m "wip: UX implementation brief for <feature-name>"`) so it survives session crashes.
446
442
 
447
443
  For each task in priority order:
448
444
 
@@ -1046,7 +1042,7 @@ State plainly which axes your battery did NOT edit. Two mechanical companions: r
1046
1042
 
1047
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.
1048
1044
 
1049
- A second, heuristic scoped selector also exists (#8591): `TEST_GROUP=affected bash scripts/test-all.sh` — chokepoint declines on argv paths, content references, stems, and an always-run census backstop, with no declared index to maintain. It is the substitute both rc=4 refusals prescribe; an undeterminable diff runs everything. `TEST_GROUP=affected --affected` refuses rc=2. Both are scoped evidence, not the ship gate.
1045
+ A second, heuristic scoped selector also exists (#8591): `TEST_GROUP=affected bash scripts/test-all.sh` — chokepoint declines on argv paths, content references, stems, and an always-run census backstop, with no declared index to maintain. It is the substitute both rc=4 refusals prescribe, and the spawned-agent-with-explicit-file-list form; an undeterminable diff prints `[affected] MODE=full` and runs everything (2026-10-15 on `apps/web-platform/infra/`: still running after an hour), so never the lead's gate. `TEST_GROUP=affected --affected` refuses rc=2. Both are scoped evidence, not the ship gate.
1050
1046
 
1051
1047
  **`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.
1052
1048
 
@@ -1054,7 +1050,7 @@ State plainly which axes your battery did NOT edit. Two mechanical companions: r
1054
1050
 
1055
1051
  **The full battery is not the gate here — CI owns it, and `soleur:ship` Phase 4 runs the same affected gate.** The MERGE gate is CI's required `test` context, which still runs the FULL battery on the PR head (bar ADR-262's PR-gated five); no local run is the merge gate, and calling one that is the over-claim that would license a future PR to shard it. This ordering is [ADR-183](../../../../knowledge-base/engineering/architecture/decisions/ADR-183-full-suite-runs-at-ship-not-at-implementation-exit.md); do not re-add a full local run at this position without reading it.
1056
1052
 
1057
- **A run's summary is not a completeness claim — read the BREAKDOWN line.** Since ADR-181 a suite may DECLINE (relevance-gated), and since #8322 it may also be `not-affected` (selection-gated); both are counted in the denominator, so `N/N` is not the ordinary local green spelling: a healthy affected run commonly reads `N-k/N`. A shard narrows coverage a second way the runner does NOT announce (the coverage NOTE exists for `infra` only). **State which mode and which shards ran when you report the gate green** — an affected run is the diff's coverage, not the battery's. This is the definite-article trap #6969 named, one level down: a green `test-all.sh` was read as the exit gate for a diff half of which it never executed.
1053
+ **A run's summary is not a completeness claim — read the BREAKDOWN line.** Since ADR-181 a suite may DECLINE (relevance-gated), and since #8322 it may also be `not-affected` (selection-gated); both are counted in the denominator, so `N/N` is not the ordinary local green spelling: a healthy affected run commonly reads `N-k/N`. A shard narrows coverage a second way the runner does NOT announce (the coverage NOTE exists for `infra` only). **State which mode and which shards ran when you report the gate green** — an affected run is the diff's coverage, not the battery's. This is the definite-article trap #6969 named, one level down: a green `test-all.sh` was read as the exit gate for a diff half of which it never executed. And never write "all covering suites ran" without the `--print-selection` output AND the run's per-suite result list — compare the two; a hand-picked list omits the meta-guards that react to file SHAPE (`guard-vacuity-floor`, `test-all-weight-drift`), which is exactly what reddened on #10322.
1058
1054
 
1059
1055
  **Ask before you launch: `bash scripts/test-all.sh --capacity`.** It answers "can this box
1060
1056
  absorb another full gate?" in **~3 s** (measured p50, 16 cores / ~640 pids — it walks `/proc`