Appearance
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: truein its frontmatter. It is loaded viaReadby the parentnp-criticspawn as the Tests audit-surface —lib/agents.cjs::loadAgentrejects it for spawning, andloop-audit-tool-use --agent np-critic-testsis also rejected.
| Attribute | Value |
|---|---|
Frontmatter module: | true |
| Tier metadata | sonnet (legacy — informational only) |
| Loaded by | np-critic as one of three audit-surface modules |
| Defines | the 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
| Check | Detail |
|---|---|
| Coverage of production change | every new public function / endpoint / class / method introduced has at least one test |
| Edge cases | for each public surface: empty input, boundary input (off-by-one), overflow, malformed input, concurrent access, explicit failure path |
| Assertion quality | assertions check observable state, not implementation incidentals; vacuous assert(result) is a finding |
| No silenced failures | no try { } catch {} swallowing assertions, no it.skip(…), no commented-out asserts, no if (false) guards |
| Test naming | names describe observable behaviour, not implementation incidentals |
| Determinism | tests don't depend on wall-clock, network, or unseeded randomness without explicit injection |
| Verify-output sanity | the 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
| Rule | Why this critic enforces it |
|---|---|
| Rule 1 — Do the whole thing | Edge cases (empty, boundary, overflow, concurrent, failure-path) are part of "done" |
| Rule 3 — Do it with tests | Production code without a test is the most important finding |
| Rule 10 — Test before shipping | A passing test that doesn't actually assert behaviour is worse than no test |
Stop conditions
| Condition | Behaviour |
|---|---|
| Verify output missing or unparseable | Emit single critic-error finding describing the gap (routes to stuck) |
| Critic timeout exhausted | Emit findings collected so far + a critic-error finding for the timeout |
Source
agents/np-critic-tests.md in the source tree.
