config-audit/docs
Kjell Tore Guttormsen 44b222859e feat(scanners): the recovery path is code you can run, not prose you can read
R1+R2 as one chunk — both KRITISK rows of the Q3 severity table sit on the
restore path, and neither closes alone.

R1: rollback-engine.mjs verified every checksum before AND after each write,
resolved the legacy backup root and reported createdNotRemoved — and none of it
was reachable. Measured: 16 files under scanners/ carry a process.argv entry;
the engine was not one of them. commands/rollback.md drove the restore as model
prose: an ESM import block a template cannot execute, ad-hoc `cp` offered
underneath as the runnable path, and "(checksum verified)" pre-rendered three
times in the success output. `cp` establishes no checksum, so the verification
was a property of the template rather than of the run — on the one surface that
runs when the user is already in trouble.

R2: implement.md Step 3 hand-built its backup (mkdir, cp, a date-derived id, a
manifest typed out in the template) while parseManifest knew one frozen sample
of that format, pinned by a HAND-WRITTEN fixture instead of by the template's
own text. Rename a key and parseManifest returns zero files while rollback
reports success.

Fixing only R1 leaves the new CLI parsing a prose format; fixing only R2 leaves
a clean format with no runnable entry.

- scanners/rollback-cli.mjs — --list / --create / --restore / --delete over the
  existing engine, on the shared requireValidArgs gate. Exit 0 done, 1
  outstanding (gate refusal with nothing written, or a backup that covered fewer
  targets than given), 2 a file failed, 3 could not do the job. A gated restore
  is 1, not 3: "this write leaves your project" is a verdict about a write that
  WAS examined, and it rides in the payload where a command under 2>/dev/null
  can act on it.
- createBackup gains `created` (recorded, never copied — no backup can hold a
  file that does not exist) and `skipped`, so a backup covering fewer files than
  asked is no longer indistinguishable from a clean one.
- implement.md Step 3 and rollback.md now call the CLI. parseManifest's
  implement-format branch stays: nothing writes that shape now, but every backup
  made before this chunk is on disk in it.
- backup-restore-contract.test.mjs checks every field rollback.md renders
  against a payload produced by RUNNING the CLI. That is what replaced
  "(checksum verified)".

20 guards seen red against the original state before any production code, then
each against its own defect. Two holes that surfaced there were mine: the
implement assertion matched `--create` as a substring of `--created` and stayed
green when the call was removed; and mutating the argv gate showed
requireValidArgs sets exit 3 by itself, so a CLI can report that it could not
parse its arguments and still run the restore underneath — that case is now
asserted on the bytes.

Suite 1752 -> 1777, 0 fail. Frozen tests/snapshots/v5.0.0 untouched. Dogfooded
through the templates' own command lines against a sandboxed HOME, including the
machine-wide arm: refused with the file unchanged, then restored under
--approve-scope.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Logq8GGWKhtyDem63FTEnG
2026-08-18 21:28:15 +02:00
..
cc-2.1.x-changelog-delta.md docs(knowledge): refresh corpus to Opus 4.8 era (CC 2.1.114->181 Batch 3) 2026-06-18 13:35:00 +02:00
cc-2.1.x-fase4-items-2-3-plan.md feat(skill-listing): add CA-SKL-002 aggregate listing-budget check 2026-06-18 18:06:17 +02:00
cc-2.1.x-gap-matrix.md docs(plan): v5.4.0 Session A — reconciliation + ship-list GO (Option A) [skip-docs] 2026-06-19 21:24:58 +02:00
cc-2.1.x-gap-review-plan.md docs(config-audit): CC 2.1.114-181 coverage gap analysis (Fase 0-2) 2026-06-18 11:31:48 +02:00
delete-and-rebuild-brief.md feat(optimize): add --subtract, the subtraction axis, behind a deterministic floor 2026-07-31 16:24:51 +02:00
devils-advocate-gap-verification-plan.md docs(plan): devil's advocate brief — adversarial gap-review verification 2026-06-18 18:28:02 +02:00
humanizer.md feat(ost): v5.6 C — output-style scanner (CA-OST, count 13→14) 2026-06-20 21:02:44 +02:00
q-audit-prose-invariants.md feat(scanners): the recovery path is code you can run, not prose you can read 2026-08-18 21:28:15 +02:00
scanner-internals.md feat(scanners): the recovery path is code you can run, not prose you can read 2026-08-18 21:28:15 +02:00
v5-brief.md docs(config-audit): v5.0.0 brief + implementation plan 2026-05-01 06:10:44 +02:00
v5-implementation-log.md docs(config-audit): v5 implementation log — Session 5 release result 2026-05-01 09:48:40 +02:00
v5-plan.md docs(config-audit): v5.0.0 brief + implementation plan 2026-05-01 06:10:44 +02:00
v5.1.0-test-audit.md chore(humanizer): pre-flight snapshots + test audit for v5.1.0 2026-05-01 16:47:13 +02:00
v5.2.0-release-plan.md release: v5.2.0 — CC 2.1.114→181 compat + skill-listing budget (SKL) 2026-06-18 20:37:45 +02:00
v5.3.0-release-plan.md docs(plan): v5.3.0 Session A — scope decision (ship-list empty) + gap-matrix reconciliation [skip-docs] 2026-06-19 20:30:04 +02:00
v5.4.0-release-plan.md docs(plan): mark v5.4.0 Feature 3 DONE — Session B complete [skip-docs] 2026-06-19 22:15:26 +02:00
v5.5-steering-model-plan.md chore(state): v5.5.0 A+E landed on main; Foundation deferred to v5.6 2026-06-20 11:21:30 +02:00
v5.7-optimization-lens-plan.md docs(state): v5.7 Fase 1 designet — visjons-diskusjon 2026-06-20 22:02:01 +02:00
v5.13-model-routing-effort-deadref-plan.md docs(knowledge): the judgment axis is knowledge, not a detector (B2) 2026-08-12 20:31:22 +02:00
v5.14-doctor-overlap-brief.md docs: add v5.14 /doctor-overlap brief (written by session #52) 2026-08-03 11:36:57 +02:00
v6-quality-plan.md docs(plan): the gate defect was a tracking defect, not a model defect (v6 quality plan) 2026-08-12 20:48:52 +02:00