@soleur/opencode 3.400.5 → 3.401.0
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 +1 -1
- package/skills/plan/references/plan-sharp-edges.md +1 -0
- package/skills/review/references/semgrep-custom-rules.yaml +42 -0
- package/skills/review/references/wfs.md +1 -0
- package/skills/ship/references/ci-workflow-authoring.md +1 -0
- package/skills/work/SKILL.md +1 -1
- package/skills/work/references/work-test-harness-sharp-edges.md +9 -0
package/package.json
CHANGED
|
@@ -364,3 +364,4 @@ NEVER CODE! Just research and write the plan.
|
|
|
364
364
|
|
|
365
365
|
- **A copy sentence of the form "X cannot happen unless Y" is an enforcement claim: list every path that can do X before prescribing it.** Enumerate each runner, each flag state (on, off, read failed) and each missing-dependency state, and name the line that enforces Y on each; a path with no such line is a code task or a reworded sentence in the same plan. **Why:** #12197/PR #12567 — `PUSH_DISCLOSURE` said nothing is pushed without Owner approval; the legacy runner's in-memory card let a member approve their own push whenever the approval queue gave no verdict. See `knowledge-base/project/learnings/2026-11-10-a-copy-sentence-that-promises-enforcement-must-be-checked-on-every-runner-and-flag-state.md`.
|
|
366
366
|
- **Before a plan names a shipped literal (a port, IP, hostname, token, sentinel URL), grep the repo's TEST FIXTURES for it — a value fixtures use as the deliberately-wrong constant poisons the suite when shipped.** `grep -rn '8444' apps/web-platform` showed the port is the assume-invalid sentinel in `apps/web-platform/infra/` firewall fixtures, so the receiver bound 8445 instead of the plan's first-draft "e.g. 8444". Same class for dispatch conditions that mirror an upstream SDK: route on the SDK's TRUTHINESS test (`get("probe")` falsy on `""`), never key presence — an empty `?probe=` is a run request, and `has()` vs `Boolean(get())` differ on exactly the input nobody hand-types. **Why:** #9137/PR #12554 — the presence-gate P1 was caught only by the sequential-fallback review's fix round; the fixture-collision was caught by the work phase's own grep. See `knowledge-base/project/learnings/logic-errors/2026-11-10-empty-probe-param-is-a-run-request-sdk-truthiness-parity.md`.
|
|
367
|
+
- **A plan that proposes a flag or argv as an implementation lever on a repo script must read the script's actual argv first — "the flag that should exist" is a capability claim verified against the parser, not inferred from the suite's shape.** Grep the script's argument handling (`--only`, `getopts`, the `usage`/help text) or run `--help`; it settles in seconds what a wrong claim costs a ruling cycle to catch. **Why:** #12626 — the plan prescribed a `--rows` row-splitting lever on `approval-guard1-mutation`; the battery's argv is `[--only|--list|--check-anchors]`, and only the batched CTO ruling caught it. See `knowledge-base/project/learnings/2026-11-11-a-completed-but-failing-leg-filed-as-did-not-complete.md` SE#4.
|
|
@@ -73,6 +73,48 @@ rules:
|
|
|
73
73
|
mirrors: "CodeQL: js/file-system-race"
|
|
74
74
|
soleur-origin: "PR #2463"
|
|
75
75
|
|
|
76
|
+
# Mirrors CodeQL js/file-system-race for the SYNC, named-import, module-scope shape the two rules above miss
|
|
77
|
+
# (they need the `fs.` namespace, the async API, or an enclosing `function`).
|
|
78
|
+
# Origin: PR #12536 — `try { st = lstatSync(p) } catch { continue }` then `readFileSync(p)` inside a top-level
|
|
79
|
+
# `for` loop in a test file; CodeQL flagged it high in CI, local semgrep (custom + p/javascript + p/typescript)
|
|
80
|
+
# reported 0. Measured when added: 1 finding on the pre-fix file, 0 on the fixed one, 0 across apps/web-platform,
|
|
81
|
+
# plugins/soleur, scripts and .github (1185 files). `existsSync`/`accessSync` and `createReadStream` were left
|
|
82
|
+
# out on purpose: including them added 13 hits CodeQL does not raise on main.
|
|
83
|
+
- id: soleur.js-file-system-race-sync-check-then-read
|
|
84
|
+
patterns:
|
|
85
|
+
- pattern: $READ($PATH, ...)
|
|
86
|
+
- pattern-either:
|
|
87
|
+
- pattern-inside: |
|
|
88
|
+
try { ... $X = $CHECK($PATH, ...); ... } catch ($E) { ... }
|
|
89
|
+
...
|
|
90
|
+
- pattern-inside: |
|
|
91
|
+
try { ... $X = $CHECK($PATH, ...); ... } catch { ... }
|
|
92
|
+
...
|
|
93
|
+
- pattern-inside: |
|
|
94
|
+
<... $CHECK($PATH, ...) ...>;
|
|
95
|
+
...
|
|
96
|
+
- pattern-inside: |
|
|
97
|
+
if (<... $CHECK($PATH, ...) ...>) { ... }
|
|
98
|
+
- pattern-inside: |
|
|
99
|
+
if (<... $CHECK($PATH, ...) ...>) $S;
|
|
100
|
+
- metavariable-regex:
|
|
101
|
+
metavariable: $CHECK
|
|
102
|
+
regex: ^(fs\.)?l?statSync$
|
|
103
|
+
- metavariable-regex:
|
|
104
|
+
metavariable: $READ
|
|
105
|
+
regex: ^(fs\.)?(readFileSync|openSync)$
|
|
106
|
+
message: |
|
|
107
|
+
Possible TOCTOU race: $CHECK($PATH) then $READ($PATH) on the same path (CodeQL js/file-system-race).
|
|
108
|
+
The file can be swapped between the check and the read. Open once with
|
|
109
|
+
openSync(path, O_RDONLY | O_NOFOLLOW), then fstatSync and readFileSync on that descriptor.
|
|
110
|
+
severity: WARNING
|
|
111
|
+
languages: [javascript, typescript]
|
|
112
|
+
metadata:
|
|
113
|
+
category: security
|
|
114
|
+
cwe: "CWE-367: Time-of-check to Time-of-use"
|
|
115
|
+
mirrors: "CodeQL: js/file-system-race"
|
|
116
|
+
soleur-origin: "PR #12536"
|
|
117
|
+
|
|
76
118
|
# Mirrors CodeQL js/incomplete-url-substring-sanitization.
|
|
77
119
|
# Origin: PR #4573 — a test assertion `html.includes("https://soleur.ai")`
|
|
78
120
|
# tripped CodeQL in CI (local semgrep auto/p-packs did not catch it). Checking
|
|
@@ -6,3 +6,4 @@ Loaded from the Defect Classes list in [SKILL.md](../SKILL.md) (Defect Classes)
|
|
|
6
6
|
- **A gate's WIRING is not pinned by regex over its workflow text: execute the extracted `run:` block against a stub that REFUSES any other argv, with a control case proving a changed selector flips the verdict, and keep `absent`/`unknown` apart from `skipped` when classifying run records.** Regex pins stayed green with a case arm replaced by `:`, a changed `--event`, a swapped `--jq` field order and a post-scan reassignment; a classifier that read an absent or conclusion-less step as "skipped" read the plan's own cited failed rotate (a pre-rename step name) as nothing-happened. **Why:** #10166/PR #10184. See `knowledge-base/project/learnings/2026-10-13-a-classifier-that-reads-absent-as-skip-fails-open-on-name-drift.md`.
|
|
7
7
|
|
|
8
8
|
- **A guard whose property is CONTROL FLOW cannot be pinned by pattern greps over the body — pin the flow skeleton, and refuse substitution inside the lines you drop.** Pattern checks (`if ! cmd; then`, `exit 1`, a ban on `|| true`) are satisfied by dead branches, `echo ... # exit 1`, `trap 'exit 0' EXIT`, `if: ${{ false }}`, an early unconditional `exit 0`, and by `env:` (`BASH_ENV`, `NODE_OPTIONS`, `PATH`) at step, job or workflow level. Reduce the body to its flow (drop only inert `echo "..."` lines with no `$(`, `${`, backtick or backslash) and compare to a pinned golden, count publishes of every spelling (`pnpm publish`, a `\`-continued `npm publish`, a `uses:` action), and pin the env and `working-directory` of the step. **Why:** #11688 — ten distinct bypasses of a pattern-based `diagnose-on-failure` member, then two P1s in its first skeleton (an echo dropper that accepted `echo "$(printf x >> .npmrc)"`, unconstrained env). See `knowledge-base/project/learnings/2026-10-31-a-pattern-grep-guard-is-satisfied-by-dead-branches-pin-the-control-flow-skeleton.md`.
|
|
9
|
+
- **A leg that invokes a test battery DIRECTLY (not via `scripts/test-all.sh`) tees a capture carrying none of the runner's verdict tokens — check the leg's capture against the downstream classifier's token set per terminal state.** The issue filer's `cap_fail` gate recognizes only `"^RED "`, `"^UNACCOUNTED "`, a `=== N suites:` failed breakdown, or the `[FAIL]`+short-terminal pairing; a completed-but-failing direct-invocation leg contains none and files as "did not complete" (censored-leg semantics on a verdict-bearing capture). The fix is a CONDITIONAL verdict emit (`RED <path>` on `rc != 0`) at the step tail — an unconditional emit would file a censored leg as "tests failing" and erase the complete-vs-timeout split. **Why:** #12626/PR #12654 — P2 found in sequential-fallback review; the mut leg had to bypass `test-all.sh` because its `VITEST_SHARD`-gated `skip_suite` declines the registrations. See `knowledge-base/project/learnings/2026-11-11-a-completed-but-failing-leg-filed-as-did-not-complete.md`.
|
|
@@ -59,6 +59,7 @@ The transform is **one context-aware tokenizing pass**, not two string passes. S
|
|
|
59
59
|
When wiring the converter, guard the call so a non-zero exit cannot fail the release: `if ! BODY=$(node scripts/md-to-mrkdwn.mjs --max 3000 < "$F"); then …sed-escape fallback…; fi`. The `if !` form is load-bearing — a bare `BODY=$(node …)` assignment masks the exit code under `bash -e`. The fallback is for **availability**, not safety (safety lives in the converter's escaping + the keystone invariant).
|
|
60
60
|
|
|
61
61
|
- **A checkout gated on a lane output (`if: needs.<job>.outputs.<lane> == 'true'`) is unexercised until the first PR on that lane, so give it the depth its consumers need.** `actions/checkout` defaults to depth 1, where `origin/main` is not a ref and any `git diff origin/main...HEAD` in the job's scripts fails; set `fetch-depth: 0` and pin it with a test. **Why:** #12262 — the oracle-only lane's `oracle-index-check` first ran on a docs-only PR and went red on `undecidable-diff`. See `knowledge-base/project/learnings/2026-11-06-a-lane-gated-checkout-hid-a-shallow-clone-until-the-first-docs-only-pr.md`.
|
|
62
|
+
- **Adding a CI leg/job means mirroring every `test-webplat`-naming surface in the same diff — `git grep -n 'test-webplat' -- .github/workflows scripts plugins/soleur/test` enumerates the ~10 lockstep pin sites.** Aggregator `needs:`/`env:`/`entries:`/`oracle_re` grammar, push-dedupe GATED/DL/OR pinned sets, draft-light HEAVY/OR/LEGS census, oracle-lane SKIP_SET/leg grammar, monitor `LEG_JOBS`/`EXPECTED_LEGS`/`R_*` env/filer/closer arms, `ci.yml` comment censuses (re-read them — the diff is what falsifies them), and terraform-parity fixtures all pin leg membership; the guards make a miss loud, so grep first and mirror all of them. Two leg-shape rules ride along: a leg invoking a battery DIRECTLY (not via `scripts/test-all.sh`) must emit the runner's verdict token (`RED <path>`) into its teed capture CONDITIONALLY on `rc != 0` at the step tail, or the monitor filer files a completed-but-failing leg as "did not complete" (an unconditional emit erases the complete-vs-timeout split); and `timeout-minutes` derives as `roundup5(measured_max × 1.5)` with the monitor job ≥ step+15 floor — a dedicated leg with a derived ceiling beats raising a shared leg's fixed ceiling, which races the battery's growth (#12279's 25→35 went stale in ~4 days). **Why:** #12626/PR #12654 — the capture contract missed at implementation was a P2 review catch; the lockstep list spanned ~10 files. See `knowledge-base/project/learnings/2026-11-11-adding-a-ci-leg-means-mirroring-every-test-webplat-naming-surface.md` and `knowledge-base/project/learnings/2026-11-11-a-completed-but-failing-leg-filed-as-did-not-complete.md`.
|
|
62
63
|
|
|
63
64
|
## When to Load This File
|
|
64
65
|
|
package/skills/work/SKILL.md
CHANGED
|
@@ -1181,7 +1181,7 @@ every RED reporting `rc=?`, because the log dir had been removed mid-run; the 12
|
|
|
1181
1181
|
like a flake reproduction and were entirely self-inflicted. **If an edit cannot wait, kill the
|
|
1182
1182
|
run** — a discarded run costs minutes, a misattributed one costs the whole investigation. Same
|
|
1183
1183
|
rule for measurement loops and agent panels: they contend for one machine, so sequence them.
|
|
1184
|
-
**Test-harness sharp edges** — mid-run commits trip the write boundary; new policy hooks touch ~15 ratchet surfaces; nested `test-all.sh` sandboxes need `env -u` scrubs → [work-test-harness-sharp-edges.md](./references/work-test-harness-sharp-edges.md) (#10161).
|
|
1184
|
+
**Test-harness sharp edges** — mid-run commits trip the write boundary; new policy hooks touch ~15 ratchet surfaces; nested `test-all.sh` sandboxes need `env -u` scrubs; markdownlint `0 files` = skipped → [work-test-harness-sharp-edges.md](./references/work-test-harness-sharp-edges.md) (#10161).
|
|
1185
1185
|
|
|
1186
1186
|
**Sibling-worktree contention produces a FALSE RED — the runner now self-identifies it.** Parallel worktrees are this repo's documented workflow, so two sessions can run `test-all.sh` simultaneously. The contended resource is NOT a colliding path — it is CAPACITY: every suite's `mktemp` lands in the same machine-global, RAM-backed 4 GiB `/tmp` tmpfs, so a second run competes for the memory the first is holding, and the failure both implicated suites document in-repo is a TIMEOUT (`skill-security-scan.test.ts` #4096; `vitest.config.ts` #3817/#4128), never a path collision. **The previously-recorded cause — `skill-security-scan`'s `.scan-meta.json` plus the semgrep bootstrap as "the known pair" — was refuted by measurement (#6789):** `run-scan.sh` PID-scopes `.scan-meta.json` since its original commit (cannot collide across worktrees; its real defect was an *unbounded meta_dir* leak, age-reaped), and the semgrep bootstrap is unreachable from any suite `test-all.sh` runs. You no longer run `ps` by hand: `test-all.sh` prints a contention preamble (`/tmp` headroom, sibling runs resolved to their worktrees via `/proc/<pid>/cwd`, machine load) and fires a named `SIBLING_RUN_DETECTED` / `SIBLING_SUITE_DETECTED` / `LOW_TMP_HEADROOM` banner when one of those conditions holds (`SIBLING_SUITE_DETECTED`: one level down — a sibling running a single suite directly), and an advisory git-common-dir lock serializes concurrent runs (`LOCK_CONTENDED_PROCEEDING` banner on timeout; never aborts). When a banner fires, confirm three ways (isolated re-run, the matching CI gate's status, a clean full re-run once the sibling exits) rather than accepting "flake"; never delete another session's `/tmp` artifacts — `/tmp` is shared tmpfs; write large logs to `/var/tmp` (`tmpfs-guard.sh`'s cron reaper bounds abandoned-scratch growth only for entries above its size floor; the **count-shaped** class — tens of thousands of few-hundred-byte artifacts, which filled `/tmp` on 2026-07-27 — is **not reclaimed by anything today**; the reclaim tier was measured against the real `/tmp` and **removed before merge** (12,240 entries, ~1,500 authored), so the guard *detects and reports* the count shape, deleting nothing. #7004 rebaselined that report onto growth above a downward-ratcheting watermark, so it alarms on NEW leaks, not the standing backlog. Do not treat the reaper as a general backstop). **Why:** #6726 — 4 `skill-security-scan` failures were pure contention (isolated re-run 22/0, CI green throughout); #6789 re-derived the actual cause and shipped the self-identification above.
|
|
1187
1187
|
|
|
@@ -92,3 +92,12 @@ already carries — see
|
|
|
92
92
|
- **When a verification's VERDICT is the deliverable, do not bound its wall — a timeout kill is `unknown`, never pass or fail.** A `ratchet`/suite verify re-run under a self-imposed `timeout`/bounded exec was killed at 120 s mid-run and could have been misread either direction; re-run unbounded and let it finish. Bound the SUT's per-invocation calls (a `REPLAY_SUT_TIMEOUT`-style knob), never the verification harness itself. **Why:** PR #12419 — see `knowledge-base/project/learnings/performance-issues/mutant-side-runaway-read-as-pristine-site-cost-ci-replay-20261108.md` session error 4.
|
|
93
93
|
|
|
94
94
|
- **A suite run is evidence for the tree it ran on — re-run the touched suites after the LAST edit of the commit, comment-only edits included.** A comment can trip a strict substring pin: a test-all.sh comment naming an array that contains a refused prefix turned the lint's unit suite red at the pushed head, after the suite had run green one edit earlier. **Why:** #12348/PR #12561 — all 11 escalation seats found it; see `knowledge-base/project/learnings/2026-11-11-each-fix-round-found-the-next-sibling-until-the-test-stated-its-residuals.md`.
|
|
95
|
+
|
|
96
|
+
## `0 issues in 0 files` is a skipped lint, not a clean one
|
|
97
|
+
|
|
98
|
+
`markdownlint-cli2` never reads a path matched by `.markdownlintignore` (for
|
|
99
|
+
example `knowledge-base/project/`), and still prints a clean-looking summary.
|
|
100
|
+
Lint a `/var/tmp` copy with the pinned binary and `-c .markdownlint.json`, and
|
|
101
|
+
confirm a known-bad copy fails, before reporting clean. **Why:** #12536 — see
|
|
102
|
+
`knowledge-base/project/learnings/2026-11-10-a-verify-only-key-slot-guard-anchors-on-what-every-signer-needs.md`
|
|
103
|
+
session error 5.
|