Skip to content

np-critic-tests (audit-surface module)

Module file, not a spawnable agent. Per the Single-Critic Revision (ADR-0010 §2026-05-05) this file carries module: true in its frontmatter. It is loaded via Read by the parent np-critic spawn as the Tests audit-surface — lib/agents.cjs::loadAgent rejects it for spawning, and loop-audit-tool-use --agent np-critic-tests is also rejected.

AttributeValue
Frontmatter module:true
Tier metadatasonnet (legacy — informational only)
Loaded bynp-critic as one of three audit-surface modules
Definesthe Tests category set, severities, and stop conditions

Role

The Tests audit surface scopes whether the executor's diff ships tests for the production code it adds or modifies, whether those tests cover edge cases, and whether the assertions verify the claimed behaviour. The parent np-critic agent emits findings under these categories as part of its merged JSON.

Audit surface

CheckDetail
Coverage of production changeevery new public function / endpoint / class / method introduced has at least one test
Edge casesfor each public surface: empty input, boundary input (off-by-one), overflow, malformed input, concurrent access, explicit failure path
Assertion qualityassertions check observable state, not implementation incidentals; vacuous assert(result) is a finding
No silenced failuresno try { } catch {} swallowing assertions, no it.skip(…), no commented-out asserts, no if (false) guards
Test namingnames describe observable behaviour, not implementation incidentals
Determinismtests don't depend on wall-clock, network, or unseeded randomness without explicit injection
Verify-output sanitythe test count in verify output matches the test count in files_modified

Output schema

The Tests module does not produce its own output — its findings appear inside the parent np-critic's merged JSON. Tests-axis category enum:

missing-test, edge-case-gap, weak-assertion, silenced-failure, test-naming, non-deterministic, verify-mismatch, critic-error.

Each category routes per the findings routing table.

Completeness rules bound

RuleWhy this critic enforces it
Rule 1 — Do the whole thingEdge cases (empty, boundary, overflow, concurrent, failure-path) are part of "done"
Rule 3 — Do it with testsProduction code without a test is the most important finding
Rule 10 — Test before shippingA passing test that doesn't actually assert behaviour is worse than no test

Stop conditions

ConditionBehaviour
Verify output missing or unparseableEmit single critic-error finding describing the gap (routes to stuck)
Critic timeout exhaustedEmit findings collected so far + a critic-error finding for the timeout

Source

agents/np-critic-tests.md in the source tree.