<?xml version="1.0" encoding="UTF-8"?>
<spec xmlns="https://vibevm.org/spec/1">
  <title id="root">PROP-013: Periodic health audit — vibevm's instance</title>
  <status stage="spec" state="done" comment="B0 2026-07-24: accepted 2026-05-23, in force; living audit-category checklist; fact grain 2026-07-24"/>
  <p p="1"><fact id="status-line" status="spec/done">**Status:** accepted 2026-05-23 — owner-requested; in force. The audit-category checklist (§2) is **living** — it grows as new defect classes surface.
**Related:** [PROP-000](PROP-000.xml) (the per-commit gate this audit complements), [`CLAUDE.md`](../../CLAUDE.md), [PROP-006](PROP-006-operating-modes.xml) (the `move fast and break things` posture an audit-driven fix-up often runs under), `vibe check` (the automated *subset* of what this audit does by hand), [`vibevm/vibespecs/WAL.xml`](../WAL.md) (Known issues — active findings), [`AUDIT.md`](../../AUDIT.md) (the inventory this process writes).</fact></p>
  <list ordered="false" p="2">
    <item><fact id="model-pointer" status="spec/done">The **general methodology** — why a green per-commit gate is not enough (its four blind spots), what a periodic breadth-first judgment sweep inventories, the `AUDIT.md` append-only home and why it is not the volatile checkpoint, the five-field finding record, severity, disposition and carry-forward, the living checklist, and the once-per-milestone cadence — is the `health-audit` flow this project depends on: `spec://org.vibevm.world/health-audit/flows/health-audit/HEALTH-AUDIT-PROTOCOL#root`.</fact></item>
    <item><fact id="prop-scope" status="spec/done">This PROP records vibevm's **instance** of it: the concrete gate, the known findings per category, vibevm's added discipline-depth category, and the open questions.</fact></item>
  </list>
  <section id="motivation" title="1. Why vibevm runs it — the M1.19 proof">
    <list ordered="false" p="3">
      <item><fact id="GATE-DEF" status="spec/done">vibevm's per-commit gate is `tools/self-check.sh` (`cargo fmt --check`, `cargo test --workspace`, `cargo clippy -D warnings`, `vibe check`).</fact></item>
      <item><fact id="GATE-BLIND-SPOTS" status="spec/done">It is a regression detector, blind by construction to uncovered code, out-of-gate trees, drift, and slow debt (the four blind spots: `spec://org.vibevm.world/health-audit/flows/health-audit/HEALTH-AUDIT-PROTOCOL#blind-spots`).</fact></item>
    </list>
    <p p="4"><fact id="m119-lead" status="spec/done">This is not hypothetical for vibevm.</fact></p>
    <list ordered="false" p="5">
      <item><fact id="M119-INIT-DEFECT" status="spec/done">The M1.19 session shipped a milestone — eight phases, ~800 hermetic tests green, the gate passing on every commit — in which `vibe init` scaffolded **broken projects**: it wrote `naming = "kind-name"`, so a freshly-initialised project could not install any package at all.</fact></item>
      <item><fact id="M119-TEST-ASSERTED-BROKEN" status="spec/done">The defect survived the entire milestone; a `cli_init` test even *asserted the broken value as correct*, staying green the whole time.</fact></item>
      <item><fact id="M119-CAUGHT-BY-SMOKE" status="spec/done">It was caught only by a live smoke run during the registry migration.</fact></item>
      <item><fact id="VIBE-INDEX-ROT" status="spec/done">Earlier, the `vibe-index` crate — then a separate Cargo workspace, outside `cargo test --workspace` — rotted unnoticed until a state review found its suite red.</fact></item>
      <item><fact id="AUDIT-NON-OPTIONAL" status="spec/done">These are the concrete failures that made the audit non-optional here.</fact></item>
    </list>
  </section>
  <section id="instances" title="2. vibevm&apos;s checklist — the known instances">
    <p p="6"><fact id="CHECKLIST-WALK" status="spec/done">vibevm walks the flow's category checklist (`spec://org.vibevm.world/health-audit/flows/health-audit/HEALTH-AUDIT-PROTOCOL#categories`) breadth-first. The categories below carry vibevm's **known instances** — the findings that made each line permanent (a discovered defect class becomes a standing row, `spec://org.vibevm.world/health-audit/flows/health-audit/HEALTH-AUDIT-PROTOCOL#living`):</fact></p>
    <p p="7"><fact id="CAT-A" status="spec/done">**A — Test integrity.**</fact></p>
    <list ordered="false" p="8">
      <item><fact id="A1-COVERAGE-GAPS" status="spec/done">**A1 · Coverage gaps.** *Known:* install e2e tests overwhelmingly drive `LocalRegistry`, shadowing the real `GitPackageRegistry` + `NamingConvention` path; the `vibe init` default-config path had no e2e at all.</fact></item>
      <item><fact id="A2-QUARANTINED" status="spec/done">**A2 · Quarantined tests.** `#[ignore]`d tests — red? stale? (`grep -rn '#\[ignore\]'`.) *Known:* `cli_live_e2e.rs` — ignored and red.</fact></item>
      <item><fact id="A3-WRONG-BEHAVIOR" status="spec/done">**A3 · Tests that encode the wrong behavior.** Detectable only by reading the assertion against the spec. *Known:* `cli_init` asserted `naming == kind-name`.</fact></item>
    </list>
    <p p="9"><fact id="CAT-B" status="spec/done">**B — Rot outside the gate.**</fact></p>
    <list ordered="false" p="10">
      <item><fact id="B1-UNREACHED-TREES" status="spec/done">**B1 · Unreached trees.** Separate workspaces, scripts, `fixtures/**` and `manual-tests/**` no test parses. *Known:* `fixtures/manual-test-packages/` carries retired schema across two milestones.</fact></item>
      <item><fact id="B2-GATE-COMPLETENESS" status="spec/done">**B2 · Gate completeness.** A new crate, a `[lib] test = false`, or a moved file can quietly carve a hole in what the gate covers.</fact></item>
    </list>
    <p p="11"><fact id="CAT-C" status="spec/done">**C — Drift.**</fact></p>
    <list ordered="false" p="12">
      <item><fact id="C1-DOC-DRIFT" status="spec/done">**C1 · Doc drift.** `docs/**` versus `VIBEVM-SPEC.md` versus the code's actual behavior.</fact></item>
      <item><fact id="C2-SPEC-DRIFT" status="spec/done">**C2 · Spec drift.** A PROP self-contradicting or contradicting another; dead `spec://` references. *Known:* PROP-008 §3 said lockfile v4 while §7 said v5; PROP-005 references a `crates/vibe-index/schemas/` directory that does not exist.</fact></item>
      <item><fact id="C3-WAL-DRIFT" status="spec/done">**C3 · WAL / CONTINUE drift.** Does the checkpoint match the tree, the branch, the commit chain?</fact></item>
      <item><fact id="C4-OUTWARD-DRIFT" status="spec/done">**C4 · Outward drift.** Live registry orgs and other external state versus what the tool now expects.</fact></item>
    </list>
    <p p="13"><fact id="CAT-D" status="spec/done">**D — Debt.**</fact></p>
    <list ordered="false" p="14">
      <item><fact id="D1-DEFERRED" status="spec/done">**D1 · Deferred &amp; parked items** — walk every "deferred" / "parked" / "Known issues" entry in the WAL and the PROPs.</fact></item>
      <item><fact id="D2-AGING-MARKERS" status="spec/done">**D2 · Aging markers** — `&lt;!-- REVIEW … --&gt;`, `TODO`, `FIXME`, `HACK` (`grep -rn`; `vibe check` ages REVIEW markers).</fact></item>
      <item><fact id="D3-ESCAPE-HATCHES" status="spec/done">**D3 · Escape hatches** — `#[allow(dead_code)]`, `#[allow(clippy::…)]` (`grep -rn '#\[allow'`).</fact></item>
      <item><fact id="D4-DEP-STALENESS" status="spec/done">**D4 · Dependency staleness** — `cargo update --dry-run`; `cargo audit` / `cargo outdated`.</fact></item>
    </list>
    <p p="15"><fact id="CAT-E" status="spec/done">**E — Discipline depth (AI-Native).** vibevm's own category, added 2026-06-12: it measures how deep the Discipline v0.2 adoption actually goes (the flow's corollary — audit *depth* of adoption, not merely that it exists), against vibevm's specific machinery:</fact></p>
    <list ordered="false" p="16">
      <item><fact id="E1-SPEC-GRANULARITY" status="spec/done">**E1 · Spec granularity &amp; typing.** Units at REQ grain with kind/revision/status lines, not merely heading-anchored — an untyped unit cannot carry revision discipline. *Aid:* `specmap.json`. *Known:* at the category's birth, 347 of 352 units were untyped.</fact></item>
      <item><fact id="E2-EDGE-COVERAGE" status="spec/done">**E2 · Edge coverage.** Which crates and specs carry `implements`/`verifies` edges, which are bare; implemented features whose PROP has zero inbound edges (PROP-012 at birth); suites with no `#[verifies]`. *Aid:* `specmap.json` counts; a `#[verifies]` census.</fact></item>
      <item><fact id="E3-CELL-SEAM" status="spec/done">**E3 · Cell &amp; seam structure.** Seam traits without `#[cell]` manifests; god-files; single-impl speculative seams; hardcoded dispatch where a seam belongs; test monoliths. *Aid:* `grep '#\[cell('`, the `pub trait` inventory, a file-length census.</fact></item>
      <item><fact id="E4-CHECKER-CARD-GAPS" status="spec/done">**E4 · Checker-vs-card gaps.** Conform rules implemented weaker than the card they cite; guide-mandated checkers that do not exist (a rule with no checker is a WISH); committed gate artifacts that have silently rotted. *Aid:* read each rule's `check()` against its card's ops block; probe gates empirically on a clean tree.</fact></item>
    </list>
  </section>
  <section id="record" title="3. vibevm&apos;s inventory and cadence">
    <list ordered="false" p="17">
      <item><fact id="INVENTORY-AUDIT-MD" status="spec/done">Findings live in **`AUDIT.md`** at the repo root — the append-only chronicle whose history is vibevm's health trend (the flow's `spec://org.vibevm.world/health-audit/flows/health-audit/HEALTH-AUDIT-PROTOCOL#audit-md`; the five-field record `…#finding`; disposition and carry-forward `…#disposition`).</fact></item>
      <item><fact id="CADENCE-FLOOR" status="spec/done">Cadence is **owner-triggered, floor once per milestone** (`…#cadence`) — a vibevm milestone is never declared done on an un-audited base.</fact></item>
      <item><fact id="RECONCILE-WAL" status="spec/done">Each run reconciles the WAL "Known issues" against `AUDIT.md` before it closes.</fact></item>
    </list>
  </section>
  <section id="open" title="4. Open questions">
    <status stage="spec" state="work" comment="B1 2026-07-24: three questions still open, no owner ruling yet"/>
    <list ordered="true" p="18">
      <item><fact id="open-trigger-phrase" status="spec/work">**Trigger phrase.** Add `АУДИТ` / `RUN AUDIT` to `CLAUDE.md` / `AGENTS.md` / `GEMINI.md` as a recognised command (mirroring the `ЗАВЕРШИ СЕССИЮ` session-end command), or keep the audit purely owner-narrated?</fact></item>
      <item><fact id="open-vibe-audit" status="spec/work">**`vibe audit` aggregator.** Once enough §2 categories are mechanical, a `vibe audit` subcommand could run them and pre-fill the `AUDIT.md` skeleton — a FEAT worth opening when that threshold is reached.</fact></item>
      <item><fact id="open-health-metric" status="spec/work">**Health metric.** Should a run compute one coarse number — open P1 / P2 counts, the trend versus the previous run — so the project's direction is visible at a glance?</fact></item>
    </list>
  </section>
  <section id="history" title="5. Version history">
    <list ordered="false" p="19">
      <item><fact id="HIST-DRAFT-1" status="spec/done">**2026-05-23 — draft 1, in force.** Owner-requested after the M1.19 session surfaced a milestone-grade defect — `vibe init` scaffolding broken projects — that the per-commit gate and ~800 hermetic tests missed. The process, the category checklist, the `AUDIT.md` inventory, the severity / disposition model, and the per-milestone cadence floor were defined here. The first (seed) run is recorded in [`AUDIT.md`](../../AUDIT.md).</fact></item>
      <item><fact id="HIST-CATEGORY-E" status="spec/done">**2026-06-12 — category E (discipline depth) added** by that day's owner-requested full sweep — the first post-adoption depth audit. Permanent per the living-checklist law: the same gap (surface adoption mistaken for depth) is never re-missed. The run also demonstrated E4's empirical-probe clause — a merge-panel gate believed green was red on a clean tree.</fact></item>
      <item><fact id="HIST-EXTRACTED" status="spec/done">**2026-07-14 — general methodology extracted to the `health-audit` flow.** The gate-vs-audit argument, the four blind spots, the category framework, the `AUDIT.md` model, the finding / severity / disposition machinery, the living-checklist law, and the cadence moved into the installable `health-audit` package (reaching vibevm through the redbook dependency); this PROP was thinned to vibevm's gate, its known findings, its discipline-depth category E, and its open questions. No process changed.</fact></item>
    </list>
  </section>
</spec>
