A verification harness is a set of sensors

A verification harness is a local set of repeatable checks that turns assumptions about change safety into measurable signals. It reveals formatting, type, compilation, test, static-analysis, or obvious security-pattern problems.

A sensor must be deterministic: the same code state should produce the same result. An unstable test is not a reliable basis for a refactoring decision.

SensorWhat it detects
FormatterStyle and formatting-structure problems
LinterCommon mistakes and questionable patterns
Type-checkBroken type contracts and signatures
Build / assembleCompilation, dependency, and module problems
Unit / integration testsLocal logic and component interaction
Coverage / static analysisBlind spots and deeper quality signals
Code intelligenceDeclarations, usages, call chain, and impact size

Fast and full checks

You do not need to run the entire CI after every file save, but do not postpone every check until the end either. A formatter can show correct style, but it does not prove correct behavior.

GroupExamplesWhen to run
FastFormatter, light lint, type-check, targeted unit testAfter every small step
MediumIntegration test, build of one moduleAfter changing the relevant layer
FullFull test run, coverage, broad static analysisBefore a PR or stage completion

Map the harness before editing

  1. Read CLAUDE.md and project rules.
  2. Check package.json, build.gradle, README, and existing scripts.
  3. Separate fast checks from full checks.
  4. Do not add a new toolchain when the necessary tools already exist.
  5. Find usages, the call chain, related tests, and public contracts.
  6. Record unknown commands instead of inventing them.

A controlled harness cycle

  1. Make one bounded change.
  2. Run the appropriate targeted sensor.
  3. Review the diff and file list.
  4. Before the PR, run a broader set of checks.
  5. Save the actual commands, results, and limitations.
Signals after one step
one approved change
  -> targeted sensor
  -> diff review
  -> record command and result
  -> broader harness before PR

Example for a local refactoring

Before changing OrderService.finalizeOrder, find all calls and tests. After moving validation into a private helper, run a targeted test, read the diff, and run a fuller check before the PR. The tester-agent and reviewer-agent should use the same harness instead of inventing their own criteria.

  • Mark an unknown script as unknown.
  • A failed sensor is a diagnosis signal, not a reason to weaken a test immediately.
  • Record what actually ran when the work is complete.
  • Do not call a check successful without an actual result.

Canonical lesson source · JavaRush

Open JavaRush material