# Inkhaven 1.3.6 — The Editorial Pass

_The capstone the 1.3 line has pointed at since 1.2.22 ("the substrate for
the 1.3 editorial-pass cycle"): unify every revision detector — the prose
ones AND the Planning Board's structure findings — into one ranked,
walkable, jump-to-location worklist. Full plan:
[EDITORIAL-1_PLAN.md](../PROPOSALS/EDITORIAL-1_PLAN.md)._

## Headline

Inkhaven has ~12 detectors. The problem was never detection — it was that
you ran each one separately (`doctor --scan`, `plan check`, `facts scan`, …)
and aggregated in your head. The Editorial Pass collapses all of it into
**one ranked worklist**, errors first, each finding you can jump to, defer,
or skip — the pre-submission sweep.

## `inkhaven edit`

```sh
inkhaven edit                      # the ranked worklist
inkhaven edit --json | jq '.errors'   # gate a CI build on zero errors
inkhaven edit --only structure,tension
```

Every finding carries a category, a severity (error → warn → info), a
location, and a message — unified from three sources:

- the editorial **`doctor`** classes (echo, pacing, continuity, naming,
  dropped-character, stalled-thread, numeric-contradiction, …),
- **`plan check`**'s structural findings (gaps, drift, pacing, flat tension,
  weak scenes / sequels),
- the **Facts-scan** sidecar (contradictions against your world facts).

The default pass is **deterministic** — it reads what's already computed,
runs no AI, and so works offline and in CI. `edit` is *manuscript
readiness*; `doctor` stays *project integrity* — they share the
author-judgment classes but aren't the same surface.

## The cockpit (`Ctrl+V Shift+R`)

The same worklist as a walkable modal:

- `↑↓` navigate; the selected finding's full message + hint expand below.
- `[` / `]` cycle the category filter.
- **`Enter`** jumps to the finding's chapter / paragraph in the editor (a
  `→` marks the jumpable ones). Most editorial findings are author judgment
  — the "fix" is you editing at the jumped-to spot.

### Skip and defer

- **`s`** skips a finding for the session.
- **`d`** **defers** it — persisted (`.inkhaven/editorial-dismissed.json`),
  fingerprinted by its text so it stays hidden until the prose changes
  (editing the passage renews it; a choice you've accepted stays gone).
- **`D`** clears every deferral.

From the CLI, deferred findings are hidden (with a count); `inkhaven edit
--show-deferred` includes them.

## The deep tier

The default reads the AI sidecars but never runs the AI. To refresh them
first — re-run the Facts scan, the tension scan, and the continuity
extract, then aggregate:

```sh
inkhaven edit --deep [--provider <name>]
```

A scan that can't run (no provider, an empty Facts book) is skipped and the
pass falls back to deterministic-only rather than aborting. `--deep` can't
combine with `--json`; for a CI gate, run the scans separately then
`inkhaven edit --json`.

## Under the hood

- Zero new dependencies — the pass *aggregates* existing detector outputs
  (no new detection), reuses the snapshot + open-by-uuid machinery, and the
  `--deep` tier reuses the existing scan commands.
- New pure, unit-tested code: `EditorialFinding` / `Location` / the
  per-source mappers / `aggregate` / the chapter extractor / the defer
  sidecar.
- The big new capability findings needed: **location resolution** (a file
  path or chapter title → a paragraph node id), so the cockpit can jump.
- Tests 1325 → 1326. One new tutorial (68).

## Deferred (later cuts)

- **AI rewrite-in-place** — "fix this echo / flat scene for me" (lift an AI
  rewrite into the buffer from a finding). A natural follow-up.
- **A TUI `--deep` trigger** — three sequential blocking AI passes don't
  belong in a modal key handler; run `edit --deep` in a terminal, then open
  the cockpit.

## Carryovers (still open)

- **The Whole-Book AI Editor** (RAG over the whole manuscript) → 1.4+.
- **1.2.20:** ePub inline images + popup footnotes.
- PDF follow-ups: N-up / booklet quick-impose presets; CMYK-JPEG grayscale.
- Sixth supported language; GitHub Release backfill for 1.2.11–1.2.19.
