Skip to content

np-critic-economy (audit-surface module)

Module file, not a spawnable agent, and opt-in. Like the other critic modules it carries module: true in its frontmatter and is loaded via Read by the parent np-critic spawn. Unlike them, it is conditional: the orchestrator injects it only when the resolved Economy mode is full or ultra. At off or lite the module never loads and the critic produces no economy findings. lib/agents.cjs::loadAgent rejects it for direct spawning, and loop-audit-tool-use --agent np-critic-economy is rejected too.

AttributeValue
Frontmatter module:true
Tier metadatahaiku (legacy — informational only, no spawn happens)
Tier overrideswarm.critic.economy_tier (default haiku)
Loaded bynp-critic, but only at economy mode full/ultra
Definesthe Economy category set, severities, the ultra escalation, and the completeness boundaries

Role

The Economy axis is the "wrote-too-much" reviewer. The other three axes guard against under-delivery — is the code correct, tested, and complete? This one guards against the opposite: code that should not exist as written. It reads the executor's diff and the task's files_modified and flags speculative abstraction, hand-rolled stdlib, duplicated platform or dependency capability, and verbose logic that condenses without losing clarity.

It is one half of the broader Economy axis. The other half is prevention: the climb-the-ladder discipline that np-executor applies before it writes, which is on from lite upward. This module is the after check, and it costs a round, so it stays opt-in (full/ultra).

Audit surface

CheckDetail
Over-engineeringSpeculative flexibility, options, or layers the task did not ask for; abstraction with a single call site
Stdlib-reinventionHand-rolled logic the language standard library already provides (Array.reduce, optional chaining, built-in validators)
Native-duplicationRe-implementing a framework helper or an installed dependency that already does the job
ShrinkableVerbose logic that collapses to a clearer form without losing readability or an edge case

Output schema

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

over-engineering, stdlib-reinvention, native-duplication, shrinkable, critic-error.

Each category routes to the Executor / Build-Fixer for simplification per the findings routing table. critic-error is reserved for hard-stop conditions and routes to stuck.

Completeness boundaries

This is the part that keeps economy honest. Trimming code is dangerous if it deletes the things completeness requires, so the module never treats any of these as removable:

Never flagWhy
Tests and assertionsCoverage is completeness (Rule 3), not bloat. Test code belongs to np-critic-tests, not here.
Input validation at trust boundariesA guarded boundary is doing Rule 1, not over-building.
Error handling and edge casesHandling the unhappy path is the whole point of Rule 1.
Security and access-control checksThese are correctness, owned by the security review.

When economy and completeness conflict, completeness wins. The axis removes what was over-built; it never removes what completeness needs.

Ultra mode

At ultra, the orchestrator appends Economy mode: ultra to the spawn prompt and the module raises its sensitivity: it lowers the shrinkable bar, hunts for reuse across the whole repo rather than just the diff, and flags single-use abstractions harder. The trade is more rounds for a leaner result. Dial back to full (or lite) when the extra rounds cost more than they save.

Relation to /np:simplify-review

/np:simplify-review is the manual twin of this axis. The np-simplifier agent applies the same rubric and the same boundaries to a diff or a whole worktree on demand, without running the loop. The two stay in lockstep: a finding the manual command surfaces is a finding this critic would have raised at full/ultra, and the reverse.

Source

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