quickreview / tests
AGENTS.md9 starsChanged 29 days agoMITView on GitHub
- The whole suite: timeout 900 npm test. It is several thousand tests and takes one to two minutes on an idle machine, longer under load. - One file: timeout 120 npx vitest run tests/<file>.test.ts. - Never --reporter=basic. - Unit tests mock all I/O: fake fetch and adapters, StateStore(":memory:"), temp dirs. - Tests where git is the thing under test run against scratch repos in a temp dir, with no network: - worktrees.test.ts - improvements-e2e.test.ts, the improvement channel against a…
Where files are headingNew AGENTS.md files have more rules about keeping secrets out of the code, and fewer about code style.
Of the AGENTS.md files we read, the 31,439 first seen in the last six months, against the older ones: the kind of rule that gained most share, and the kind that lost most. About files like this in general, not this one, and an estimate, since a kind is a pattern in the words.
In this repository36 other files it gives its agents.
- AGENTS.mdAGENTS.md
- scripts/AGENTS.mdAGENTS.md
- scripts/CLAUDE.mdCLAUDE.md
- tests/CLAUDE.mdCLAUDE.md
- ask-mattSkill
- codebase-designSkill
- code-reviewSkill
- diagnosing-bugsSkill
- domain-modelingSkill
- grillingSkill
- grill-meSkill
- grill-with-docsSkill
- handoffSkill
- implementSkill
- improve-codebase-architectureSkill
- prototypeSkill
- researchSkill
- resolving-merge-conflictsSkill
- setup-matt-pocock-skillsSkill
- tddSkill
- teachSkill
- to-questionnaireSkill
- to-specSkill
- to-ticketsSkill
- triageSkill
- wait-whatSkill
- wayfinderSkill
- wizardSkill
- writing-for-agentsSkill
- adjudicateSkill
- evidenceSkill
- landSkill
- replaySkill
- setupSkill
- surveySkill
- selfimproveSkill
The file
We split this AGENTS.md into the rules it gives an agent
7 rules. About 0 are common, 1 is distinctive, and 6 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈1
Distinctive · estimate
This author's own choices. Worth a look.
6
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 14
Tests where git is the thing under test: run against scratch repos in a temp dir, with no network:
- Very specific: line 53
Every file that imports node:child_process must be listed, or the fence fails.
- Very specific: line 59
Never raise the timeout for a whole file: vi.setConfig with a timeout is refused in a unit file.
- Very specific: line 64
Every test that calls dispatchOnce carries it, by rule.
- Very specific: line 65
Prefer a static import to await import() inside a test: a mid-test import puts the module transform on the test's clock.
- Very specific: line 84
To re-measure,: run the suite with --reporter=json --outputFile=… beside a CPU burner such as for i in $(seq $(( $(nproc)*2 ))).
- Very specific: line 87
Run it once with --testTimeout=600000 to see the true durations.
≈ “Common” is an estimate: at least 1 in 5 of the 40,246 AGENTS.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
tests/ — conventions
Running
- The whole suite:
timeout 900 npm test. It is several thousand tests and takes one to two minutes on an idle machine, longer under load. - One file:
timeout 120 npx vitest run tests/<file>.test.ts. - Never
--reporter=basic.
What a test may touch
- Unit tests mock all I/O: fake fetch and adapters,
StateStore(":memory:"), temp dirs. - Tests where git is the thing under test run against scratch repos in a
temp dir, with no network:
worktrees.test.tsimprovements-e2e.test.ts, the improvement channel against a scratch clone with a bare "remote"- one block of
proposals.test.ts, the accept path through realgit apply/commit
- Others shell out to git on the way to something else, each in a scratch
repo or a scratch config home:
deploy,setup-extension,scan-tree,setup-interview,setup-replay.publishabilityandfences-provenancerunls-fileson the checkout to list what they lint. - The private-token denylist lives outside the repo, at
$QCR_PUBLISH_DENYLISTor~/.config/qcr/publish-denylist.txt(format inhelpers/private-tokens.ts); without it the private-token checks skip with the reason. - Other subprocesses are this repo's own shell scripts and CLIs, never a
network service or a VM. For example,
post-shim.test.tsruns the three posting shims against a stub client. - The list drifts. Find the current one with
grep -l child_process tests/*.test.ts tests/helpers/*.ts.
Posting guards
guards.test.ts runs every posting-guard case through the real gate and
GitHubAdapter over a world (a loopback GitHub stub, state.db and config.toml
from helpers/guards-world-rig.ts; the driver is helpers/guards-parity.ts).
The shell route these cases were first pinned against was deleted with
scripts/guards.sh; the answers are the contract on their own.
Timeouts under load
The suite must stay green on a heavily loaded machine without hiding a real
hang. suite-timeouts.test.ts pins the rules, and the constants live in
helpers/suite-timeouts.ts.
- A file that spawns real processes (shell scripts, git, tsc, node
children, stub binaries) is listed in
PROCESS_SUITES. It runs in thespawningvitest project withPROCESS_TIMEOUT_MSper test and per hook, because a child's wall time belongs to the scheduler.- Every file that imports
node:child_processmust be listed, or the fence fails. - A file that spawns only through the code under test is listed by hand, with the reason.
- Every file that imports
- Everything else keeps vitest's 5 s default, so an in-process hang
still fails fast.
- Never raise the timeout for a whole file:
vi.setConfigwith a timeout is refused in a unit file. - A single heavy in-process test carries
{ timeout: HEAVY_TIMEOUT_MS }on the test itself. The bar is a measured 250 ms or more on an ordinary run. - Every test that calls
dispatchOncecarries it, by rule. - Prefer a static import to
await import()inside a test: a mid-test import puts the module transform on the test's clock.
- Never raise the timeout for a whole file:
- The full-
tscfence (fences-gate[T6]) hasTYPECHECK_TIMEOUT_MSand runs tsc incrementally, with its build info undernode_modules/.cache/. - The project names are load-bearing. vitest queues whole projects
alphabetically, and
spawningholds the longest files, so it must sort first. - Leave the worker count at vitest's default. Capping it lowered the suite's share of a loaded CPU and made the wall time worse.
- Load breaks more than timeouts:
- A wait loop is a deadline inside the test's timeout (
pollUntilintui-startup.test.ts), never a count of ticks. - A wait for a real socket or child effect is a deadline loop, never a
fixed
setTimeout. - A scratch repo whose
.gitis copied disables auto-maintenance (-c maintenance.auto=false -c gc.auto=0). - A fake binary fed on stdin reads its stdin before exiting, so the writer's EPIPE cannot race the case under test.
- A wait loop is a deadline inside the test's timeout (
- To re-measure, run the suite with
--reporter=json --outputFile=…beside a CPU burner such asfor i in $(seq $(( $(nproc)*2 ))); do timeout 900 sh -c 'while :; do :; done' & done. Run it once with--testTimeout=600000to see the true durations.
Fences that protect rules
Fix the code, not the test.
seed-integrity.test.tskeeps the frozenagents/andprompts/seeds byte-identical, via a sha256 manifest:RATIFIED_DIVERGENCElists ratified reseeds;NON_SEEDEDlists the files that are ours to edit.
A failure means a seed was edited. Revert it and change pass behaviour through the addendum registry (
PASS_ADDENDAinpackages/pi-plugin/src/include.ts). Never re-pin the manifest.invariant-fences.test.tspins the ratified passages inside the editable prompt files.- Each
<!-- RATIFIED [RULE-N] <slug> — do not edit; owner only -->fence (theRULE-Ncitation only for a hard-rule invariant) is hashed by its contents, and a missing marker fails as loudly as changed text. - A failure names the fence. The fix is a ratification, not a re-pin.
- A fenced frozen seed must also carry a
ratified-divergence.jsonentry. - A marker may record a ratified reseed of its words after the slug —
(reseeded YYYY-MM-DD), that spelling only — and the pin'sreseededmust match it both ways.
- Each
eod-seed-coherence.test.tsrenders the realprompts/eod-sweep.mdwith the sections the daemon renders after it (MEMORY_LAYOUT_NOTE, the curation or no-packet section, the measured lines) and fails when the two halves contradict each other. The seed is frozen: fix the daemon-rendered side. A new variant of the curation section joins thedescribe.eachthere, and a claim a section makes about what the daemon does is driven through the real handler (the receipt goes throughexecuteCommandto wire'srouteCurationReceipt), not read off the text.single-shepherd.test.tspins the single-shepherd invariant (docs/single-shepherd-invariant.md) structurally.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

