Skip to content

feat(doctor): read-only five-layer health surface (spec + first implementation) - #112

Merged
arcaven merged 1 commit into
mainfrom
feat/doctor-five-layer
Aug 1, 2026
Merged

feat(doctor): read-only five-layer health surface (spec + first implementation)#112
arcaven merged 1 commit into
mainfrom
feat/doctor-five-layer

Conversation

@arcaven

@arcaven arcaven commented Aug 1, 2026

Copy link
Copy Markdown
Member

Consumers have no way to ask "is what sideshow recorded still true on this machine": the store can silently drift from its receipts, bindings can go stale, and the absence of a lockfile or defects feed today looks identical to a clean bill of health. This ships sideshow doctor, the read-only report over sideshow's own records (bd aae-orc-xteh, orc charter F24 layer vocabulary), with a spec at docs/doctor-spec.md.

Design points worth review attention:

  • Exit policy is the diagnostic-not-gate rule as code. Findings carry a structural/advisory class; only structural failures exit 2, --strict promotes structural warns only, and advisory/unavailable never gate under any flag. One test row per branch of that table.
  • Absent inputs are unavailable, never clean. No lockfile (aae-orc-333y), no defects feed (aae-orc-ztg5/10vq), no retained release manifests (aae-orc-wk92): each prints the ticket that supplies it. Zero checksummed receipts reports unavailable with both under-coverage causes named.
  • Layer 4's real signal needs no new state: re-hash checksummed receipts against disk (the No enforcement mode: a pack cannot restore a baseline once a repo has diverged #92 observation). The No enforcement mode: a pack cannot restore a baseline once a repo has diverged #92 write-path fixes are deliberately a separate PR so this one stays read-only.
  • The d3nq.9 seam is proven by use: plugin-class packs get a check set (ledger-row-coherence ships in it); the per-repo bind battery lands there later with no runner changes.
  • Layer 3 is clamped to advisory warn-or-below by the runner, not by convention.

Verified against the live store: it found the pre-freeze beads-config install (advisory, benign causes named), a dead /tmp receipt root (skipped with reason), and one false positive during development (custom-source sync entries) which is fixed and covered by a test. 19 top-level tests; lint clean; additive only, two tiny read-only exports (bindings.LoadManifest, distribute marker accessors).

…mentation)

sideshow doctor reports on the state sideshow itself has written:
store, receipts, sync manifest, and repo-bindings ledger. Layers per
orc charter F24: (1) native integrity, (3) cwd discoverability
warn-only, (4) fleet drift, (5) known defects. Layer 2 is excluded by
decision and the text output explains the gap in place.

Result model: four statuses (ok, warn, fail, unavailable) crossed
with a structural/advisory class. Only structural failures move the
exit code (2); --strict promotes structural warns; advisory and
unavailable never gate, under any flag. That is the orc
diagnostic-not-gate rule expressed as code, and the exit table has a
test row per branch.

Absent inputs report unavailable with the ticket that supplies them
(no lockfile: aae-orc-333y; no defects feed: aae-orc-ztg5 and
aae-orc-10vq; no retained release manifests: aae-orc-wk92). Silence
never reads as cleanliness: zero checksummed receipts is unavailable
with both known under-coverage causes named, not clean.

Layer 1 checks: registry parse, registry/current-symlink/version-dir
coherence, installer-output shape (closes the aae-orc-xbkl surface),
store freeze bits (advisory, benign causes named), per-file content
census against the pack's own files-manifest.csv, sync-manifest
presence + version currency (custom-source entries exempt), receipted
claude_md marker pairing and rules managed-by lines, receipted
symlink resolution. Plugin-class seam ships ledger-row-coherence so
the aae-orc-d3nq.9 slot is proven by use, not merely declared.

Layer 3 wraps coexist-check, the foreign census grades, and the
factory guard, clamped to advisory warn-or-below by the runner.
Layer 4 re-hashes checksummed receipts against disk (the sideshow#92
signal, which needs no lockfile), reports version skew and dead
receipt roots, and names the lockfile gap.

Supporting exports: bindings.LoadManifest, distribute.MarkerPrefix/
SectionBegin/SectionEnd. Read-only throughout; the receipt-fidelity
write-path fixes (sideshow#92 hash retention, RecordResults wholesale
replacement) are deliberately a separate change.

Verified against the live store: found the pre-freeze beads-config
install, a dead /tmp receipt root, and honest unavailable rows; exit
0 with zero structural failures.

Closes: aae-orc-xteh (bd)
Refs: sideshow#92, docs/doctor-spec.md
@arcaven
arcaven merged commit 345a579 into main Aug 1, 2026
@arcaven
arcaven deleted the feat/doctor-five-layer branch August 1, 2026 22:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant