config-audit/tests/commands
Kjell Tore Guttormsen acd1cf1248 fix(commands): stop writing files no later step can read, and payloads nobody asked for
Dogfooding the four read commands (posture, tokens, manifest, whats-active)
surfaced four defect classes, all in the seam between what a command template
promises and what the scanner behind it actually does.

M-BUG-40, fifth arm: posture wrote four temp files it could never read back.
#49 closed the $$/cross-block class in four commands, but posture survived it —
and so did the guard written to prevent exactly this. The guard compared each
$$ path to the block that created it, so a path written once and then read via
prose had no second occurrence to flag. Measured live: written from PID 21614,
read attempted from PID 23772. The invariant is now blanket (no $$ in any temp
path), which also caught fix.md and feature-gap.md.

M-BUG-43: 6 of 7 scanners write their payload to stdout when --raw/--json is
set even when --output-file was given, and the templates redirected only
stderr. Measured: posture 255 182 B, whats-active 35 922 B, drift 28 316 B,
manifest 23 825 B, tokens 8 768 B. fix and feature-gap never read the file they
wrote, so both recovered one letter grade from a quarter-megabyte dump.

tokens swallowed --json and --with-telemetry-recipe: documented, never
threaded, so --json returned the humanized payload where the docs promise
byte-stable v5.0.0 output.

M-BUG-42: manifest's render contract asked for {load}; the payload carries
loadPattern, so the Load column rendered blank for all 96 rows.

Four new tests (1449 -> 1453), each verified red before the fix. The
render-contract test checks {field} names against a live payload from a
fixture, since a hardcoded key list would drift. Frozen v5.0.0 snapshots
untouched.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VGCk9o27eWo9uXLjkZTXEq
2026-08-01 20:40:07 +02:00
..
action-commands-shape.test.mjs fix(commands): stop assuming shell state survives between blocks 2026-08-01 20:12:17 +02:00
analyze-report-persistence.test.mjs fix(acr): analyze persists agent-returned report (M-BUG-18) 2026-07-16 20:24:12 +02:00
command-output-discipline.test.mjs fix(commands): stop writing files no later step can read, and payloads nobody asked for 2026-08-01 20:40:07 +02:00
command-shell-state-shape.test.mjs fix(commands): stop writing files no later step can read, and payloads nobody asked for 2026-08-01 20:40:07 +02:00
group-a-shape.test.mjs feat(humanizer): update audit/analysis command templates group A [skip-docs] 2026-05-01 19:41:08 +02:00
group-b-shape.test.mjs fix(commands): stop assuming shell state survives between blocks 2026-08-01 20:12:17 +02:00
implement-log-append.test.mjs fix(acr): pin Bash >> append discipline on shared implementation log (M-BUG-20) 2026-07-17 03:53:06 +02:00
interview-chunk-shape.test.mjs fix(commands): close the promises the command templates could not keep 2026-07-31 21:27:07 +02:00