# Inkhaven 1.4.0 — Consolidation & hardening

_The 1.4.0 milestone. After a long run of capability features (the examined-authorship
triad, the timeline trilogy), 1.4.0 is the **consolidation & hardening** release: surface
what was buried, complete what was hardcoded, harden the whole tree, and land the last
marquee — **EPUB import**. It bundles everything shipped across the 1.3.32 → 1.3.37 cycle.
**No external application or binary dependencies were added across the entire milestone;
the one new feature that needed parsing reused the in-tree `zip` + `quick-xml`._

_Roadmap: [ROADMAP-1.4.0.md](../PROPOSALS/ROADMAP-1.4.0.md). New tutorials:
[82](../Tutorials/82-project-health-and-review.md)–[86](../Tutorials/86-epub-import.md)._

## The marquee — EPUB import

`inkhaven epub` has always exported a standards-compliant EPUB3. **`inkhaven import-epub
<file.epub>`** now reads one back: container → OPF → spine, creating a Book → a Chapter
per spine document → paragraphs of converted prose (headings, `*strong*`, `_emph_`,
lists), with images extracted to a `<book-slug>-images/` sidecar. `--book-name` /
`--dry-run`; exits non-zero on partial failure; built on the in-tree `zip` + `quick-xml`.
Every parser is fuzz-hardened (never-panic proptests over arbitrary bytes / tag-salad).
See [Tutorial 86](../Tutorials/86-epub-import.md).

## Surfacing the buried — the analytics get a face

- **Project doctor** (`inkhaven doctor --scan`) — a referential-integrity scan (broken
  parent refs, dangling paragraph/event links, slug collisions, duplicate system books)
  with `--json` / `--class` / `--autofix`, exit 2 on Warning+.
- **The unified review pass** — `Ctrl+B Shift+C` / `inkhaven check`: every fast checker at
  once (world fact-check + Inner Socrates over the open paragraph + timeline critique over
  the project) → the Output pane, with per-node **report-card badges** in the tree.
- **The AI cost dashboard** — `Ctrl+B $` / `inkhaven cost`: today's LLM calls vs the
  **informative (non-blocking)** daily budgets + every other call by category.
- **The command palette** — `Ctrl+V Space`: fuzzy-find-and-run over every bound command.
- **Output-pane filters** — `f` / `S` / `t` / `c`, persisted across sessions.
- **Writing goals, surfaced** — `inkhaven goals` (the terminal report), the **lifetime-best
  streak** + `hook.on_streak_milestone`, and an **in-app goals editor** (`e`) that writes
  back to `inkhaven.hjson` comment-preservingly.
- **The project-wide snapshot browser** — `Ctrl+F6`: every snapshot across all paragraphs,
  filter + diff + jump.

See Tutorials [82](../Tutorials/82-project-health-and-review.md)–[85](../Tutorials/85-snapshot-browser.md).

## Completing the config

Thirteen behaviours that were hardcoded became HJSON options — **every default preserves
prior behaviour**. New blocks `cost:` (the daily caps + usage retention) and
`project_lock:` (the single-instance lock's `enabled` / `on_conflict`); new
`goals.day_boundary` (`utc` | `local` — so the streak/totals/caps roll over at *your*
midnight); five `editor` durability knobs (crash-mirror cadence, kill-ring depth,
external-change reload, fact-check idle, visited-history cap); and `backup` retention
(`keep_last`) + an explicit `auto_backup_on_exit`. All documented in
[CONFIGURATION.md](../CONFIGURATION.md); all appear in the schema-driven `inkhaven config`
editor.

## Hardening the spine

- **Pre-1.4.0 audit + fix pass** — a full read-only stability audit, then 16 verified
  fixes: split-view save now saves the *focused* pane; recover/import exit non-zero on
  failure; a panicking Bund hook is isolated (`catch_unwind`) instead of crashing the
  editor; the external `typst` compile drains its pipes (no deadlock); crash-safe store
  write ordering + a metadata schema-version anchor; atomic writes everywhere; the
  `longest_streak` O(D²) made linear; export/import fidelity (markdown `#raw`, RTF bold,
  RTF encoding); a config security floor; render-slice + calendar-overflow guards.
- **Fuzz coverage** — never-panic proptests for the previously-unguarded parsers
  (Scrivener RTF, the Typst check, the `.scrivx` binder XML, and the new EPUB parsers).
- **Advisory project lock** — guards two sessions from corrupting the shared store; the
  kernel releases it on crash, so there's no stale-lock cleanup; informs, never blocks.

## Dependencies & compatibility

**No external application or binary dependencies; no new runtime crates** across the whole
1.3.32 → 1.4.0 milestone. No on-disk shape moved (the schema version stamps existing
projects at v1 on first open). Every prior `inkhaven.hjson` keeps working — the new config
options are all opt-in. The per-release write-ups for 1.3.32 → 1.3.36 carry the detailed
logs; this note is the milestone summary.
