docs(agents): add a test-audit procedure with the mutation discipline that worked - #2951
Conversation
… worked Adapts the upstream test-audit card to this repository. The authoring gate, junk patterns, retention bar, candidate-evidence fields, and subagent dispatch plan are its structure; what changes is everything this repo actually enforces. Junk patterns are the shapes that turned up as real findings here rather than a generic list: type pins that survive erasure (`Equal<A, B> = true`, `X ? true : never`, `satisfies` compared after it stops existing at runtime), a lone `typeof x === 'function'` sitting directly above the test that calls `x`, an ordering claim with no ordering assertion, and a `switch` written inside a test body and compared to its own arms. The retention bar is likewise earned: registry and gate-manifest completeness, cross-language source inspection, `@ts-expect-error` directives (an unused one is a compile error, so they do bite), exact-array facets where a membership scan cannot see a duplicate, identity pins where deep-equality does not subsume `toBe`, and vocabulary pins that survive a production-and-fixture co-update. The mutation rule is the part worth keeping: plant the production edit that represents the bug, show the old body green and the new body red with both counts, revert, and show `git status` clean. Arguing detection is not evidence; measuring it is. Validation commands are this repo's — `--project unit-core`/`apple-runner`, `oxlint`, `tsc -b` per package plus the root project, `check:affected --run`, `check:fallow` — and record that the upstream `run-vitest.mjs` and `check-changed.mjs` helpers do not exist here, so nobody goes looking. It also notes the trap found the hard way: `scripts/**` tests are in no `tsconfig` include, so a helper added there needs an explicit type-check. Routed from the AGENTS.md task table, which stays inside its 10 kB budget at 8.0 kB.
Size Report
Startup median (7 runs, lower is better):
|
There was a problem hiding this comment.
All reported issues were addressed across 2 files
Reply with feedback, questions, or to request a fix.
Fix all with cubic | Re-trigger cubic
|
Reviewed 0602822. This is a docs-only change, and I found no wrong claim in the commands and paths it names. I did not check every statement about tool behavior, for example the exact effect of fallow's One question about shape. CI passes; Smoke Tests was still running and does not exercise this diff. There are no conflicts. |
|
…repair its commands
|
Addressed in 4791a65. Shape (your question): agreed — the procedure moved to Cubic findings, checked one by one:
The Validation: |
There was a problem hiding this comment.
All reported issues were addressed across 3 files (changes from recent commits).
Reply with feedback, questions, or to request a fix.
Fix all with cubic | Re-trigger cubic
|
The update at 4791a65 answers the earlier shape question. The procedure now lives in CI is green, and this change is docs-only. Not blocking: should this card live in |
|
Dropped the skill card in 5559b23. Once the procedure moved to Trimming the doc to absorb the freed budget left |
Summary
Adds
docs/agents/test-audit.mdand routes it from the AGENTS.md task table. Adapted from the upstream openclaw test-audit card (https://github.com/openclaw/openclaw/blob/main/.agents/skills/test-audit/SKILL.md). This is the workflow that produced #2930-#2944; capturing it here so the next sweep starts from the repo's own rules instead of rediscovering them.It lives under
docs/agents/rather thanskills/, per AGENTS.md: skills stay minimal routing cards and task procedures go in docs. A test audit is not an app-driving capability the CLI skill routes to, so it does not need a card at all.What is repo-specific versus upstream:
Equal<A,B> = true,X ? true : never,satisfiescompared after it stops existing at runtime), a lonetypeof x === 'function'sitting directly above the test that callsx, an ordering claim with no ordering assertion, aswitchwritten inside a test body and compared to its own arms.@ts-expect-errordirectives (an unused directive is a compile error — they do bite), exact-array facets where a membership scan can't see duplicates, identity pins deep-equal can't subsume, vocabulary pins that survive a production+fixture co-update.git statusclean. Arguing detection is not evidence; measuring it is.node --testscript (test:smoke,check:*:test), native XCTest, or aCHECK_CATALOGgate id. Vitest-project matching alone would have misclassified the healthynode:testintegration and gate suites.pnpm exec vitest --project unit-core/apple-runner,pnpm check:quick,pnpm check:affected --run,git diff --numstat origin/main...HEAD), and the doc records that the upstreamrun-vitest.mjs/check-changed.mjshelpers do not exist here. It also records a trap found the hard way: mostscripts/**tests are in notsconfiginclude, so helpers added there need an explicit check that they execute.Validation
pnpm check:agent-guidance— 5 pass. The doc is 3,943 bytes, inside the 10,000-per-file budget, anddocs/agents/totals 39,897 of 40,000 bytes with AGENTS.md at 7,989 of 10,000.pnpm format,pnpm lint,pnpm check:quickpnpm check:affected --runon the pushed head: selects onlyagent-guidance, passes