From cb13ccecab499ef4c5412f6ee26d20867ed951c7 Mon Sep 17 00:00:00 2001 From: Willem van den Ende Date: Mon, 26 Oct 2026 18:40:57 +0000 Subject: [PATCH] docs: the Lens pass runs each suite before its sensors Same shape in both apps now that coverage is wired: one suite run exports the coverage, then the sensors read it. AGENTS.md said "sensors ... and finally both test suites" and told sensor authors only to list targets in VERIFY_SENSORS; add the export dependency and the "a check must fail when its input is missing" rule, since `mix test.coverage` exits 0 when it finds no export. --- AGENTS.md | 12 ++++++++---- Makefile | 9 +++++---- 2 files changed, 13 insertions(+), 8 deletions(-) diff --git a/AGENTS.md b/AGENTS.md index 2b7ed17..e6d83bd 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -87,9 +87,10 @@ no coverage, about a second. `make precommit` is the same target. Per app, warnings fatal, format, test. Run these as often as you like while working. **Lens pass (every push, and before handing off).** `make verify` runs `check` -first (cheapest), then each app's heavy sensors - sobelow, coverage, CRAP, -mutation, as those yaks land - and finally both test suites. Measured 2026-10-26: -~10s wall (app 178 tests + blogex 156 tests). +first (cheapest), then per app: one suite run that exports its coverage, then +that app's sensors (sobelow, coverage, CRAP, mutation, as those yaks land), which +run cheapest-first and read the export rather than re-running the suite. Measured +2026-11-01: ~11s wall (app 178 tests + blogex 156 tests + coverage floor). `.githooks/pre-push` runs `make verify` and blocks the push when anything fails. Install it once per clone: @@ -115,7 +116,10 @@ work mid-feature: finish and commit what you are building, then run it. - Adding a sensor: implement it as its own make target, add it to that app's `VERIFY_SENSORS` in `app/Makefile` / `blogex/Makefile` (cheapest first), and update the slot comments there. A gate that reports a check it did not run is - worse than no gate - the `VERIFY_SENSORS` list is what gets echoed. + worse than no gate - the `VERIFY_SENSORS` list is what gets echoed. Sensors run + *after* the app's `test.coverage` step, because the coverage export they read is + produced by that suite run; if a check can pass without its input, make it fail + loudly (see the `coverage` target's guard). ### Triage classes diff --git a/Makefile b/Makefile index 8a86275..f4ef9f1 100644 --- a/Makefile +++ b/Makefile @@ -17,10 +17,11 @@ check: # Precommit target for CI/pre-commit hooks precommit: check -# The Lens pass: everything `check` does, plus the heavy sensors and both test -# suites, cheapest first. `.githooks/pre-push` runs this before every push (see -# `make hooks`); run it yourself before handing off. Bypass deliberately with -# `git push --no-verify`. +# The Lens pass: everything `check` does, plus, per app, one suite run (which +# exports its coverage) and that app's sensors reading the export. Sensors run +# cheapest-first among themselves. `.githooks/pre-push` runs this before every +# push (see `make hooks`); run it yourself before handing off. Bypass +# deliberately with `git push --no-verify`. verify: check @echo "==> verify: app" @$(MAKE) -C app MISE_BIN=$(MISE_BIN) verify