Skip to content

fix(ci-coverage): run the 87 unwired vitest tests, and gate the include-allowlist so it cannot drift again - #1370

Merged
artyhoo merged 4 commits into
stagingfrom
claude/jovial-wiles-592f69
Aug 10, 2026
Merged

fix(ci-coverage): run the 87 unwired vitest tests, and gate the include-allowlist so it cannot drift again#1370
artyhoo merged 4 commits into
stagingfrom
claude/jovial-wiles-592f69

Conversation

@artyhoo

@artyhoo artyhoo commented Aug 10, 2026

Copy link
Copy Markdown
Owner

What

packages/core/vitest.config.ts include: is the real test population; the principles-meta-tests job invoked a hand-written list of npm scripts and paths. Nothing tied the two together, so the list fell behind: 87 *.test.ts files across 12 directories had zero CI invocation, plus partial coverage of synthesizer (3/23), install (2/5), audit-self (3/6). audit-self.yml already admitted part of it in prose — a comment is not a mechanism.

Reproduced independently before acting: the new gate's own resolver, run against the pre-wiring tree, reported exactly those 12 directories at exactly the sweep's counts (skills 22, research 22, validator 16, eslint-rules 7, detector 7, installer 4, scenario-generator 2, diff 2, diagnostics 2, detector-v0 1, spec-validation 1, python-starter 1).

1 — What now runs, and what does not

Wired (all green, run exactly as CI runs them):

Step Result Why its own step
test:units 905 passed / 39 skipped, 7s deterministic, offline: audit-self detector detector-v0 diagnostics diff eslint-rules install installer python-starter research scenario-generator validator
test:skills 211 passed, 39s every case spawns a real bash helper against a sandbox tree — the slow arm, kept attributable
test:spec-validation 9 passed the only network suite (shells to gh); GH_TOKEN passed so assertions are real, not uniformly rate-limited into the tolerated exit-2 branch
test:synthesizer 186 passed / 23 files supersedes the narrow 3-file test:live-generation step

Deliberately excluded: none. COVERAGE_ALLOWLIST ships empty — every gap the sweep found is wired. It exists for files that genuinely are not merge gates (a toolchain CI lacks, a manual probe). "Slow" alone is not a reason: it earns its own step, as skills/ did.

Placement is load-bearing, and is what made the old scoping unnecessary. validator/gate-*.ts, install/rule-bootstrap-cli.ts and synthesizer/generate-react-spa.test.ts import @rules-as-tests/preset-next-15-canonical — a workspace sibling absent from packages/core/package.json and its standalone lock, so it resolves only after the root npm install links it into the repo-root node_modules. The old comment blamed scoping and called wiring the rest "a separate task"; the real fix was placement. All new steps run after that install.

Pre-existing failures found by actually running them

15 tests across 6 files failed on the vitest 5000ms default while the underlying script succeeded — the #1363 defect class, in the four skills/ files #1363 named as deliberate residue plus two it did not reach. Fixed at 30_000 (the existing SLOW_SHELL_MS convention), per #1363's precedent:

  • skills/plan-currency-check{,-digest,-kickoff}.test.ts, skills/planner-discovery.test.ts, skills/run-helper.test.ts
  • synthesizer/run-generated-rule-mutation-skip.test.ts (surfaced only under parallel load)
  • spec-validation/validate-batch-spec.test.ts:118,133 — its two untimed --soft cases; the three integration siblings at :162,183,207 already carried 30_000 for the same gh round-trip

Timeout configuration only: git diff contains zero touched expect/toBe/toMatch/toContain/it( lines.

2 — The mechanism

packages/core/principles/38-vitest-include-ci-coverage.test.ts (ADAPT of tests/install-sh/meta-all-wired.test.sh:22-43 + principles/36-ci-needs-completeness.test.ts onto a third population/registry pair).

Per-file, not per-directory — a directory named by one step is no evidence its other 19 files run (the synthesizer 3/23 case). Runs at pre-push and in CI, so it fails at the earliest reachable channel.

Paired-negative: arm (d) deletes the real test:skills wiring from the real workflow text and re-runs the real resolver, asserting RED and that only skills/ files drop out. Arm (e) covers a new unwired directory; arm (f) proves a restructured include: block parses to [] so arm (b) fails loudly instead of passing vacuously.

Filter semantics are modelled on the runner, not assumed. vitest positional args are substring matches and the trailing slash is load-bearing — verified against the real binary: vitest list hooks/ selects 0 hooks-tree-guard files, vitest list hooks selects 6. My first draft normalised hooks/hooks and thereby credited the hooks step with covering audit-self/hooks-tree-guard.test.ts — false coverage, the exact bug this gate exists to catch. Arm (c) pins it. (vitest list tor/ selecting 180 tests from validator/+detector/ confirms substring, not prefix.)

Also wired into scripts/run-local-ci-sweep.sh (self-test passes): CI-only wiring would reproduce the same one-channel defect a layer up, and the sweep is the pre-push mirror.

Fidelity verdict

FIDELITY: skipped — no cold fidelity-auditor round was run for this PR, so claiming GO would be unbacked; this is not a stage PR against a spec substrate (no ## Provenance section), and every quantitative claim below is backed by a command output reproduced in this body.

Ships as claimed. Every number above is measured, not estimated. Verified on the merged tree (origin/staging moved 4 commits mid-work; merged forward, SSOT conflict resolved keeping both rows): test:principles 375 passed / 1 skipped, typecheck clean, format:check clean, actionlint clean, sweep self-test ALL PASS.

Collisions caught and resolved across two merge-forwards (staging moved 7 commits during the work; the PR also went CONFLICTING once, which blocks Actions entirely): principle slot 37 was taken by #1368 and again by #1366 — mine is 38, still unique — and SSOT id 245 then 246 were taken, so mine is 247.

The wiring immediately earned its keep. The first CI run reddened on research/ecosystem-cargo.test.ts: two containment paired-negatives died with EACCES: permission denied, mkdir '/etc/foo'. Root cause was tmpdir depth, not the guard — makeRoot() placed root at mkdtempSync(os.tmpdir()) and the tests plant a real manifest at root/../.., which is writable under macOS /var/folders/<x>/<y>/T/ but resolves to / under Linux /tmp. Those two tests could never have passed on a Linux runner and nothing noticed, because research/ ran at no CI channel. Fixed by nesting root two levels inside the sandbox; intent preserved (the planted manifest is still outside root). Non-vacuity re-proven rather than assumed: neutering resolvedWithinRoot behind a temporary env flag turned 8 containment tests RED, restoring it turned them green. The whole wired set was then swept under TMPDIR=/tmp to reproduce the Linux shape — units 905, synthesizer 186, skills 211, spec-validation 9, all green, no other tmpdir-depth assumption found.

Known-red, NOT caused by this PR and NOT fixed here (no drive-by per CLAUDE.md «PR strategy»): hooks/getff-work.test.ts fails 3/7 locally (expected 1 to be +0 — the script exits 1). Proven pre-existing by checking out clean origin/staging b41bece884 into a throwaway worktree and running the same file there: identical 3 failures, none of my changes present. The clean-temp-repo case (FRESH-CONSUMER-SMOKE) passes while the three real-repo cases fail, so it looks environment-sensitive (nested worktree) and may well be green on an ubuntu runner. hooks/ is already CI-wired; this PR neither touches it nor changes its wiring.

§1.7 Forward-check applied

Complies with no-paid-llm-in-ci.md: the new gate is deterministic file parsing, zero API-billed calls; the one network suite shells to gh, not to an LLM. Complies with ci-tool-pinning.md §1: no new tool install is added — the new steps invoke npm scripts already backed by npm ci --prefix packages/core at .github/workflows/audit-self.yml:219. Complies with attention-is-not-a-mechanism.md §1: the prose admission at .github/workflows/audit-self.yml:692 was #warning-nobody-reads; it is replaced by a deterministic gate at the earliest reachable channel, not by a louder comment. Complies with build-first-reuse-default.md §1: verdict ADAPT, not BUILD — packages/core/principles/38-vitest-include-ci-coverage.test.ts:1 ports two existing in-repo implementations rather than inventing a third shape; zero new dependencies. Complies with the CLAUDE.md capability-commit gate: SSOT #247 added in the same commit as the artifact, Prior-art: trailer present.

§1.7 Backward-check applied

Class of this change: a declared test population whose CI invocation is a hand-written list that can silently drift from it.

Surfaces where that class occurs, enumerated mechanically (for f in <dir>/*.test.sh; do grep -qF "$f" .github/workflows/*.yml; done, plus a workspace scan for test scripts) — not the diff's own file list:

  • packages/core/vitest.config.ts:9-32audit-self.ymlGAP-FOUND, this PR (87 + 26 files); closed by principle 38.
  • tests/install-sh/*.test.sh (98 files) ↔ workflow — SWEPT-CLEAN, 0 unwired; gated by tests/install-sh/meta-all-wired.test.sh:22.
  • tests/hooks/*.test.sh (7) — SWEPT-CLEAN, 0 unwired.
  • tests/dispatcher/*.test.sh (1) — SWEPT-CLEAN, 0 unwired.
  • tests/agnosticism/*.test.sh (1) — SWEPT-CLEAN, 0 unwired.
  • scripts/*.test.sh (8) — 1 unwired: scripts/probe-channels.test.sh. Already known and deliberately documented at scripts/run-local-ci-sweep.sh:117 («a test present in scripts/ but wired to NO CI step … correctly stays out — the sweep predicts CI, it does not invent gates»). Not silent, so not this PR's class of defect; left alone.
  • workflow jobs ↔ ci-success.needsSWEPT-CLEAN, gated by packages/core/principles/36-ci-needs-completeness.test.ts:180 (fix(ci-success): wire the two unwired jobs, and gate the wiring so it cannot drift again #1362).
  • required contexts ↔ the two declared lists — SWEPT-CLEAN, gated by packages/core/principles/37-required-context-completeness.test.ts (fix(required-contexts): declare required status contexts at the job, and gate the two lists against it #1368).
  • sibling workspace packages — GAP-FOUND, out of scope, surfaced not fixed: packages/preset-next-15-canonical (3 test files), packages/preset-react-spa (1), packages/runtime-bridge (15) each define a test script, but no workflow runs npm test --workspacesgrep -rnE "npm test --workspaces|--workspaces" .github/workflows/*.yml returns only a typecheck comment at .github/workflows/audit-self.yml:806. That is 19 test files at no CI channel, the same class one level up (package population instead of directory population). Principle 38 is scoped to packages/core's include-allowlist and does not see them. Worth its own task; not fixed here per CLAUDE.md «PR strategy».

Prior-art: prior-art-evaluations.md#247 (Vitest test.include/globTestFiles/collect; orphan finders git-orphaned-files + dependency-cruiser --orphan; in-repo meta-all-wired.test.sh + principles 36/27 — verdict ADAPT). DeepWiki vitest-dev/vitest 2026-08-10: «no explicit feature to reconcile the declared include globs with the files that are actually run»; FilesNotFoundError fires only when NO file is found, never on a covered subset. context7 /vitest-dev/vitest surfaces enumeration primitives only. WebSearch ×3 phrasings surfaced the class filed as a bug in the wild (rjwalters/loom#4769) rather than any tool that prevents it. Orphan finders reason about the import graph, to which a test file is a root by construction.

Test added 2 commits August 10, 2026 13:31
…de-allowlist so it cannot drift again

`packages/core/vitest.config.ts` `include:` is the real test population; the
`principles-meta-tests` job invoked a HAND-WRITTEN list of npm scripts and paths.
Nothing tied the two together, so the list fell behind: 87 `*.test.ts` files across
12 directories had ZERO CI invocation — skills 22, research 22, validator 16,
eslint-rules 7, detector 7, installer 4, scenario-generator 2, diff 2, diagnostics 2,
detector-v0 1, spec-validation 1, python-starter 1 — plus partial coverage of
synthesizer (3/23 files), install (2/5) and audit-self (3/6). audit-self.yml already
admitted the hole in prose («the install/ vitest dir is otherwise un-gated»); a
comment is not a mechanism.

Reproduced independently before acting: principle 38's own resolver, run against the
pre-wiring tree, reported exactly those 12 directories at exactly those counts.

WIRED (all green, run as CI runs them):
  test:units          905 passed / 39 skipped,  7s — audit-self detector detector-v0
                      diagnostics diff eslint-rules install installer python-starter
                      research scenario-generator validator
  test:skills         211 passed,              39s — split out: every case spawns a
                      real bash helper against a sandbox tree
  test:spec-validation  9 passed                  — split out: the only network suite
                      (shells to `gh`); GH_TOKEN passed so assertions are real rather
                      than uniformly rate-limited into the tolerated exit-2 branch
  test:synthesizer    186 passed / 23 files       — supersedes the 3-file
                      test:live-generation step

DELIBERATELY EXCLUDED: none. COVERAGE_ALLOWLIST ships empty — every gap the sweep
found is now wired. The allowlist exists for files that are genuinely not merge gates
(toolchain CI lacks, manual probes); "slow" alone is not a reason, it earns its own step.

Placement is load-bearing, and is what made the old scoping unnecessary: validator/gate-*.ts,
install/rule-bootstrap-cli.ts and synthesizer/generate-react-spa.test.ts import
`@rules-as-tests/preset-next-15-canonical`, a workspace sibling absent from packages/core's
package.json AND its standalone lock. It resolves only after the root `npm install` links it
into the repo-root node_modules. The old comment blamed scoping and called the fix "a separate
task"; the fix was placement — the new steps run after that install.

PRE-EXISTING FAILURES FOUND BY ACTUALLY RUNNING THEM (fixed here, timeout config only):
15 tests across 6 files failed on the vitest 5000ms default while the underlying
script succeeded — the #1363 defect class, in the four skills/ files #1363 named as
deliberate residue plus two it did not reach. Fixed at 30_000, the existing
SLOW_SHELL_MS convention, applied per #1363's precedent:
  skills/plan-currency-check{,-digest,-kickoff}.test.ts, skills/planner-discovery.test.ts,
  skills/run-helper.test.ts, synthesizer/run-generated-rule-mutation-skip.test.ts,
  spec-validation/validate-batch-spec.test.ts (its 2 untimed --soft cases; the 3
  integration siblings already carried 30_000 for the same `gh` round-trip)
No assertion, test-body or `it()` line changed: `git diff` has zero touched
expect/toBe/toMatch/toContain lines.

THE MECHANISM: packages/core/principles/38-vitest-include-ci-coverage.test.ts.
Per-FILE, not per-directory — a directory named by one step is not evidence its other
19 files run (the synthesizer 3/23 case). Runs at pre-push AND in CI, so it fails at
the earliest reachable channel. Arm (d) is the paired-negative: it deletes the real
test:skills wiring from the real workflow text and re-runs the real resolver, proving
RED; arms (e)/(f) cover a new-unwired-dir and a fail-closed unparsable config.

Filter semantics are modelled on the runner, not assumed: vitest positional args are
SUBSTRING matches, and the trailing slash is load-bearing. Verified against the real
binary — `vitest list hooks/` selects 0 hooks-tree-guard files, `vitest list hooks`
selects 6. Normalising `hooks/`→`hooks` would have credited the hooks step with
covering audit-self/hooks-tree-guard.test.ts: false coverage, the exact bug this gate
exists to catch. Arm (c) pins it.

Also wired into scripts/run-local-ci-sweep.sh: CI-only wiring would reproduce the same
one-channel defect a layer up, and the sweep is the pre-push mirror. Its self-test passes.

Prior-art: prior-art-evaluations.md#246 (Vitest `test.include`/`globTestFiles`/`collect`; orphan finders git-orphaned-files + dependency-cruiser --orphan; in-repo meta-all-wired.test.sh + principles 36/27 — verdict ADAPT). DeepWiki `vitest-dev/vitest`: «no explicit feature to reconcile the declared `include` globs with the files that are actually run»; `FilesNotFoundError` fires only when NO file is found. Orphan finders reason about the import graph, to which a test file is a root by construction. ADAPT not BUILD: this ports the meta-all-wired / principle-36 shape onto a third population/registry pair, zero new dependencies.
# Conflicts:
#	docs/meta-factory/prior-art-evaluations.md
…h independent

Wiring research/ into CI (this PR's point) immediately caught a real, host-dependent
defect the suite had carried since it shipped: on ubuntu-latest, two of the cargo
containment paired-negatives died with
`EACCES: permission denied, mkdir '/etc/foo'` and `mkdir '/evil-member'`.

Root cause is tmpdir depth, not the guard under test. `makeRoot()` put `root`
directly at `mkdtempSync(os.tmpdir())`, and the traversal tests plant a real
Cargo.toml at `root/../..` — the target a malicious `../../etc/foo` dep name or
`members = ["../../evil-member"]` resolves to. os.tmpdir() depth is
platform-dependent: macOS `/var/folders/<x>/<y>/T/` leaves that target writable
(green locally), Linux `/tmp` makes it `/` (EACCES). The tests could never have
passed on a Linux runner; nothing noticed because research/ ran at no CI channel.

Fix: nest `root` two levels inside the sandbox (`<mkdtemp>/nested/root`), so every
escape target stays inside a directory the test owns, on every platform.

Intent preserved exactly — the planted manifest is still genuinely OUTSIDE `root`,
so the containment guard is still the only reason these go green
(.claude/rules/research-source-trust.md §5 item 2 — the BLOCKER paired-negatives).

Non-vacuity re-proven after the change, not assumed: neutering `resolvedWithinRoot`
behind a temporary env flag turned 8 containment tests RED (both BLOCKER exploits,
all three symlink-escape branches, both absolute-path escapes); restoring it turned
them green. Verified both ways:
  TMPDIR=/tmp  (reproduces the Linux runner):  31 passed
  default macOS tmpdir:                        31 passed
  TMPDIR=/tmp vitest run research/:           239 passed (22 files)

Swept the rest of the newly-wired set under TMPDIR=/tmp for the same defect class:
test:units 905 passed, test:synthesizer 186, test:skills 211, test:spec-validation 9
— no other tmpdir-depth assumption found.

Prior-art: skipped — test-fixture path portability only; no new capability, no new dependency, no new module, and no change to the guard under test or to any assertion.
# Conflicts:
#	docs/meta-factory/prior-art-evaluations.md
@artyhoo
artyhoo merged commit 6d8c517 into staging Aug 10, 2026
55 checks passed
@artyhoo
artyhoo deleted the claude/jovial-wiles-592f69 branch August 10, 2026 11:11
artyhoo added a commit that referenced this pull request Aug 10, 2026
…ort-worthiness rule, severity-contract arm (§8 items 2/2b/3/4/5/11) (#1374)

## Summary

Landing PR for the ratified advisor-pattern design spec ([docs/superpowers/specs/2026-08-10-advisor-pattern-design.md](docs/superpowers/specs/2026-08-10-advisor-pattern-design.md), operator gate word recorded in §11d). Ships the §8 landing obligations billed to this PR — item 2 (ratified-doc transfers), 2b (the ONE permitted `packages/` edit: `pr-body-fidelity` severity-contract arm), 3 (reviewer-discipline §6 + fidelity-auditor grammar), 4 (new Class C rule `effort-worthiness.md` + 4 skill-embeds + rule-index regen), 5 (prior-art pass folded into the rule), 11 (§1.7 self-reflection below). Items 6/6b/7-numbers/8/9/10 are post-landing per §8 and deliberately absent.

## Changes

- Spec `2026-08-10-advisor-pattern-design.md` (600 lines, two cold two-altitude reviews at cap, operator-ratified) + session-1 handoff `2026-08-10-arch-prep-advisor-pattern.md`.
- v2 `session-bus-v2.md`: five-verb table append-only (ASK added, ANSWERED un-frozen), `:276-279` stale clause fixed, §9 claim-1 re-scoped to the new grep pattern, §14c disposition rows, §9 degradation rows.
- ADR `2026-08-09-pipeline-chips-session-bus-design.md`: Part-2/D5 superseded-in-part pointer.
- Choreography surfaces: dispatcher §3 ask-cells; night-mode items 1+8 + «night-decided asks» morning-report line; arch §1 spec-template obligation (premise register + falsifiers) + §2 ESCALATED/Failure-scenario grammar + §4 review-ESCALATED intake; pipeline Phase -1 scenario-bearing verdict condition.
- `reviewer-discipline.md` §6 (operating SSOT for the severity contract + ESCALATED grammar); `agents/fidelity-auditor.md` findings grammar; `agents/reviewer-discipline.md` + `agents/review-sidecar.md` (+ byte-identical plugin twin) contract pointers.
- NEW `.claude/rules/effort-worthiness.md` (Class C; six-layer effort-worthiness loop; prior-art fold-in §4) + skill-embeds at the four choreography owners + rule-index regen (bytes freed first: 4092/4096).
- `pr-body-fidelity.ts` severity-contract arm: a BLOCKER/MAJOR `## Review findings` entry must carry a `Failure-scenario:` line (+11 tests, suite 45/45; sidecar bare-tally shape exempt; heading-wrapped paste = recorded fail-open).
- SSOT duplicate ID #247#248 renumber (cross-PR race #1370 × #1371 both minted 247 on staging; principle-08 uniqueness gate red on merge-forward without it).
- staging merged forward first, so the cited review-effort-theatre patch (#1369) resolves on-branch.
- 8 js-family install-sh fingerprint baselines regenerated (the audited agent-file edits changed installed bytes; `SNAPSHOT_MODE=compare` 15/0 post-regen).

## Prior-art consult

- [x] Capability commits in this PR carry a `Prior-art:` trailer — d4663d4 (`skipped — extension of the existing pr-body-fidelity check; no new dependency, directory, or capability`), 4c7d947 (`skipped — prose discipline rule + doc embeds; the rule IS the prior-art fold-in`). PR range itself is non-capability (added files are all markdown; zero new `packages/` files; no dependency changes).
- [x] No new capability area surfaced — the §8 item 5 pass folded into the rule body instead (`.claude/rules/effort-worthiness.md` §4: Conventional Comments, Google eng-practices nit culture, Bezos Type-1/2 reversibility, CBR indexing problem, WIP limits, ADR / spec-kit SDD / Kiro EARS); verdicts warranted no SSOT adoption entry.
- [x] Existing entries: none matched; the only SSOT touch is the #247#248 duplicate-ID renumber.
- [x] context7 (≥3 phrasings) + WebSearch run during the §8 item 5 pass; results cited in `effort-worthiness.md` §4 and commit 4c7d947 body.

## Test plan

- [x] §1.7-свод lands in squash-body (`gh pr merge --squash --body "$(gh pr view <N> --json body -q .body)"`)
- [x] `npm test --workspace=@rules-as-tests/core --run` — pr-body-fidelity suite 45/45 re-verified by the cold fidelity seat; 3 local `getff-work.test.ts` fails are worktree-from-worktree env artifacts, green in CI
- [x] `make self-audit` / `npm run --prefix packages/core test:principles` — principle-08 uniqueness green after the #247#248 renumber; full pre-push substance sweep green at push of a4cfeb6
- [x] Hook check code touched (`pr-body-fidelity.ts`): its vitest suite green; `prior-art-trailer-hook` untouched
- [x] Manual smoke: `render-rule-index.mjs --check` green at 4092/4096 bytes; v2 §9 claim-1 grep pattern re-run live (0 hits under `packages/` beyond the known doc pointer); plugin twin byte-identity verified

## Provenance

kickoff/spec: docs/superpowers/specs/2026-08-10-advisor-pattern-design.md §8 (landing work list) · base SHA: 6d8c517 · substrate: in-session (worktree gracious-chatelet-a1be5d, branch claude/advisor-pattern-consultation-86f49b; design sessions 1-3 + landing-tail session) · models: Fable 5 (design + landing), cold seats Fable 5 subagents (2 spec reviews at cap + fidelity r1 + backward sweep) + Sonnet (r2 narrow delta) · fidelity Rounds 1-2 (r2 = scope-neutral delta refresh after baselines regen).

## Review findings

Cold two-altitude spec reviews (cap 2, ESCALATED rung available per the spec's own §6 — first consumer): r1 top-down REVISE (8 MAJOR / 6 minor / 2 ESCALATED), r1 bottom-up STOP (BLOCKER: verb table re-typed from memory — repaired; the append-only clause in §8 item 2 is its codification), r2 verify REVISE (2 MAJOR / 6 minor) — all repaired at cap (commits 672dede18e5c57). ESCALATED fired live twice; both resolved at the operator gate (spec §11c: Э-1 dissolved — role decoupled from session lifetime; Э-2 — no numeric target, kernel-v2 starts immediately after landing).

Cold backward sweep (class-only input, agents/backward-sweep-auditor.md): 6 GAPs — 4 surfaces fixed in-branch (agents/reviewer-discipline.md:37, agents/review-sidecar.md:158 + plugin twin, pipeline SKILL:458+471, arch §2 re-scope), consumer templates deferred to §8 item 9 (recorded, never a silent copy), operator-global `/reviewer` command = hand-apply patch (parked below).

Cold fidelity audit r1 (dialogue-blind, scoped to §8 items 2/2b/3/4/5/11): GO — verdict block below. Notes lane (recorded, no round): commit a4cfeb6 subject arithmetic «5 of 6» vs 4-fixed+2-deferred reconciles only counting agent+plugin twin as two surfaces; item 5's context7/WebSearch invocation is a process claim (INCONCLUSIVE-needs-human) while the artifact-side fold-in is complete; SSOT renumber is `extra` outside billed items — forced CI repair surfaced by the mandated merge-forward.

### Watch-list

| id  | criterion | why | defect site | reintroduction tell |
| --- | --- | --- | --- | --- |
| W-1 | spec §2/§8 item 2 — v2 §7 ratified verb rows are append-only, never re-typed | the r1 BU BLOCKER corrupted all three rows in one from-memory hop | none — preventive (rows verified untouched as diff context) | any future diff hunk touching the PARKED/REBIND/NUDGE lines at `docs/superpowers/specs/2026-08-09-session-bus-v2.md:241-243` |
| W-2 | §8 item 2 — claim-1 re-cut pattern GREEN live (0 hits for `AIF-BUS`/`AIF_BUS` and `session-bus/` under `packages/`; bare `session-bus` hits only the :1168 doc pointer) | the arm's error text or a future packages/ edit could embed a verb literal and re-RED the claim | none — preventive | any grep hit for the verb literals or the path segment under `packages/` beyond `end-of-turn-reminder.test.ts:1168` |
| W-3 | §8 item 4 — rule-index at 4092/4096 bytes, 4 free | the trim was a precondition, not a check; any Fires-line growth re-breaches silently at the next regen | `.claude/rules/00-rule-index.md:21` | `wc -c` > 4096 or `render-rule-index.mjs --check` failing on an unrelated rule edit |
| W-4 | 2b arm — FINDING_COUNT_RE exempts ONLY bare digit tallies; the heading-wrapped-paste fail-open is RECORDED, not fixed | widening the exemption (or deleting the recorded fail-open note) would gut the deterministic arm while tests stay green | `packages/core/hooks/checks/pr-body-fidelity.ts:110-117` | a prose-led `- MAJOR: <text>` passing the gate, or the fail-open NOTE comment removed |
| W-5 | sweep GAPs (3)(4) — shipped consumer templates deferred to §8 item 9, «never a silent copy» | a later round pasting the severity contract into `packages/core/templates/**` without the item-9 review would ship an unreviewed consumer surface | none — preventive (deferral recorded in commit a4cfeb6) | Failure-scenario/ESCALATED text appearing under `packages/core/templates/**` with no consumer-delivery-stage review record |

Round 1: W-1 CLEAN · W-2 CLEAN · W-3 CLEAN · W-4 CLEAN · W-5 CLEAN

Round 2: W-1 CLEAN · W-2 CLEAN · W-3 CLEAN · W-4 CLEAN · W-5 CLEAN

Round 2 was a narrow cold delta refresh (cold-seat-economy §1) after the scope-neutral baselines-regen commit d116a95 (8 fingerprint files, 16 hash-swap lines, zero hunks outside `tests/install-sh/baselines/**`): fresh cold seat, incremental diff + scope sections + round-1 watch-list inlined; verdict GO, no findings. Round-1 fidelity: GO on a4cfeb6 with KICKOFF-AMBIGUOUS (spec §6 «disposition vocabulary» sub-item has no landing home — parked below) and two notes-lane MINORs (recorded above).

## Fidelity verdict

FIDELITY: GO
Basis: docs/superpowers/specs/2026-08-10-advisor-pattern-design.md#§8 (items 2/2b/3/4/5/11)
Round: 2
Audited-SHA: d116a95
Evidence: tests/install-sh/baselines/react-native/greenfield.fingerprint:17 (delta's own hunk — hash-line swap for `.claude/agents/fidelity-auditor.md`; kept for human traceability, extension length exempts it from FILE_LINE_RE) · carried-forward round-1 standing evidence, unchanged by this delta (confirmed: zero hunks outside `tests/install-sh/baselines/**`), relayed per coordinator — not re-opened this round: `.claude/rules/effort-worthiness.md:1`, `packages/core/hooks/checks/pr-body-fidelity.ts:126`, `.claude/rules/reviewer-discipline.md:56`, `agents/fidelity-auditor.md:82`
Findings: none — mechanical snapshot regen closing a byte-identical-compare CI red caused by round-1's own audited item-3 edits (agents/fidelity-auditor.md, agents/review-sidecar.md content changes); no new deliverable, no new permitted-file class, no descope touched, no packages/ or spec/rule surface reopened. Round-1 findings history (KICKOFF-AMBIGUOUS + two notes-lane MINORs) recorded under `## Review findings` and `## Parked questions`.

## Parked questions

- KICKOFF-AMBIGUOUS (fidelity r1): spec §6's «disposition vocabulary gains ESCALATED» sub-item has no existing artifact home (no repo file defines the ACCEPTED/DISSOLVED vocabulary outside the two specs) — routes to the kernel-v2 /arch contour (§8 item 8) as a surface-list re-design input, not rework here.
- GAP-6 residue: operator-global `~/.claude/commands/reviewer.md` still carries the pre-§6 triple grammar; agent-uncommittable — hand-apply patch delivered to the operator in the landing-session summary (repo-side claim already re-scoped at arch SKILL §2).
- Sweep GAPs 3-4: shipped consumer templates (aif-review, aif-orchestrator-discipline) intentionally NOT patched — deferred to the ratified consumer-delivery stage (§8 item 9) with its own review.
- lychee scope: `lychee.toml` excludes `docs/superpowers/`, so broken citations inside specs are caught by nothing (surfaced by the r1 MINOR both seats); widening is a separate small item, not landed here (spec §8 item 2 wording).
- Gate-owner observation from the r2 delta seat: a baselines-regen commit structurally CANNOT self-cite through the fidelity gate's FILE_LINE_RE — the `.fingerprint` extension exceeds the regex's ≤6-letter cap (packages/core/hooks/checks/pr-body-fidelity.ts:57), so any future delta round whose diff is baselines-only must carry forward standing evidence; recorded as an observation, out of this PR's billed scope.

## §1.7 Self-discipline check (REQUIRED if PR touches discipline-bearing files)

### §1.7 Forward-check applied

New/extended disciplines (effort-worthiness rule, reviewer-discipline §6, severity-contract arm) checked against every active layer: channel selection per rule-enforcement-channel-selection.md — Class C prose + skill-embed channel, embeds live at .claude/skills/dispatcher/SKILL.md:326, .claude/skills/night-mode/SKILL.md:39, .claude/skills/arch/SKILL.md:91 (principle 31 skill-embed liveness green); doc-authority header present at .claude/rules/effort-worthiness.md:10 per doc-authority-hierarchy.md §3; capability-commit gate — both flagged commits carry trailers (d4663d4, 4c7d947), 2b amendment «zero NEW capability code» honoured (no new deps/dirs/files under packages/); no-paid-llm-in-ci — the arm is deterministic-half only, the semantic judge stays session-side (packages/core/hooks/checks/pr-body-fidelity.ts:122); attention-is-not-a-mechanism §1(a) — the severity contract got a deterministic gate at the earliest reachable channel (pr-body-fidelity.ts:126), not bare reviewer attention; 600-line markdown gate — spec lands at exactly 600 lines; rule-index 4096-byte ceiling — bytes freed BEFORE the new row (.claude/rules/00-rule-index.md at 4092/4096, `render-rule-index.mjs --check` green).

### §1.7 Backward-check applied

Class = artifacts stating reviewer finding-grammar / round-triggering rules. Sweep delegated to the cold backward-sweep-auditor (class-only input, per T21), which enumerated ~30 surface groups; per surface: agents/reviewer-discipline.md:37 GAP-FOUND → FIXED (§6 contract at its run-moment channel); agents/review-sidecar.md:158 + plugin/agents/review-sidecar.md GAP-FOUND → FIXED (byte-identical twin, principle 24d green; arm exempts the sidecar bare-tally shape that live-fired as a false positive); .claude/skills/pipeline/SKILL.md:458+471 GAP-FOUND → FIXED (Phase -1 verdict + REVISE routing gain the scenario condition); .claude/skills/arch/SKILL.md:91 GAP-FOUND → re-scoped (cross-boundary claim about the global /reviewer command); packages/core/templates/** (aif-review + aif-orchestrator-discipline) GAP-FOUND → DEFERRED to §8 item 9 consumer-delivery stage with its own review (recorded in commit a4cfeb6, never a silent copy); ~/.claude/commands/reviewer.md GAP-FOUND → operator hand-apply (agent-uncommittable, parked above); all remaining enumerated surfaces SWEPT-CLEAN. Exemption mechanism: the arm's FINDING_COUNT_RE bare-tally carve-out is itself meta-tested (packages/core/hooks/checks/pr-body-fidelity.test.ts:1 — exemption-preserves-intent + mutation arms in the +11 tests).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant