# Inkhaven 1.3.32 — Project doctor

_1.3.x has been a feature explosion — the ConLang Suite, WORLD-4/5, INNER_SOCRATES-1,
TIMELINE-2-INTEGRATION. 1.3.32 opens the road to **1.4.0**, a consolidation &
hardening milestone, and it opens with the stability bookend: a data-integrity
safety net and the test/bench spine every release after it will lean on. The
`inkhaven doctor` scanner learns **referential integrity**, and the codebase gains
a property-based test harness over its panic-prone parsers._

_Plan: [DOCTOR_PLAN.md](../PROPOSALS/DOCTOR_PLAN.md) · Roadmap:
[ROADMAP-1.4.0.md](../PROPOSALS/ROADMAP-1.4.0.md) · Maintenance:
[MAINTENANCE.md](../MAINTENANCE.md)_

## Doctor learns referential integrity

`inkhaven doctor --scan` already caught disk-side trouble (zero-byte files, orphan
rows, bdslib drift, corrupt sidecars). None of its checks looked at the **dangling
UUIDs inside the hierarchy** — the references that rot from deletes, partial
restores, and hand-edits. Five new classes close that gap, all running on the
already-loaded node tree (no extra I/O):

- **`broken-parent-ref`** *(Critical)* — a node whose `parent_id` points at a UUID
  that doesn't exist. The node is detached — unreachable from the tree, invisible in
  the TUI. Real structural corruption.
- **`dangling-paragraph-link`** *(Warning)* — a `linked_paragraphs` entry whose
  target paragraph was deleted.
- **`dangling-event-ref`** *(Warning)* — a timeline event referencing a
  character/place node that no longer exists.
- **`sibling-slug-collision`** *(Warning)* — two children of the same parent sharing
  a slug, so their on-disk paths collide (one overwrites the other on save /
  assemble).
- **`duplicate-system-book`** *(Warning)* — more than one Book carrying the same
  `system_tag`, which makes system-book lookups ambiguous.

They run in the default `doctor --scan` (and gate CI: exit code 2 on any
≥ Warning), are addressable individually with `--class <name>`, and appear in
`--json` output. Detection-only this release — the safe autofixes (pruning dangling
refs) are a planned follow-up.

## A property-test spine

The road to 1.4.0 needs a stability backbone, so 1.3.32 stands one up:

- **`proptest`** (a pure-Rust dev-dependency) for property-based testing.
- **Perf budgets as ordinary tests** — an in-process timing assertion that runs in
  the normal `cargo test` gate (the right tool for catching a regression, vs.
  criterion for manual profiling). First budget: the referential scans over a
  1,000-node project complete well under half a second, guarding against an
  accidental O(n²).
- **A parser property sweep** codifying *never-panic* guarantees on the three
  panic-prone parsers — the calendar (`parse` / `format` / round-trip across every
  preset and precision), HJSON config loading (arbitrary input *and* brace/quote
  soup — a panic there would crash the editor at open), and language detection
  (arbitrary unicode, empty / emoji / 100k-char inputs).

## Dependencies & compatibility

**No external application or binary dependencies.** One pure-Rust dev-crate
(`proptest`), test-only — never linked into the shipped binary. No change to the
data model, the CLI surface, or any existing scan class. Tests 1725 → 1771.

_First of the 1.3.x releases on the road to 1.4.0 — see
[ROADMAP-1.4.0.md](../PROPOSALS/ROADMAP-1.4.0.md) for the full sequence._
