# Inkhaven 1.3.8 — World consistency

_On top of 1.3.7. A long book builds a world — a climate, a geography, a
cast with fixed attributes, a setting in time — and the tools to keep that
world consistent were scattered. 1.3.8 fills the four remaining gaps: does
the world contradict *itself*, does the prose fit its *era*, can you *see*
the whole world at once, and can a *series* share one canon. Full plan:
[WORLD-1_PLAN.md](../PROPOSALS/WORLD-1_PLAN.md)._

## Headline

`facts scan` already checked the prose against the Facts book and
`continuity-drift` caught a character's eyes changing colour. What it
couldn't do: notice when the Facts book disagrees with *itself*, flag a
wristwatch in an 1840 novel, show you the whole world on one screen, or let
Book II of a trilogy share Book I's canon. Now it can.

## `facts check` — internal consistency

`inkhaven facts check` runs an AI pass over the *whole* Facts book looking
for contradictions between the facts themselves — "winters are mild" under
Climate vs. "the harbor freezes each January" under Geography:

```
facts check: 1 internal contradiction(s):
  ⚠ winters are mild  ⟷  the harbor freezes each January
      ↳ a mild winter can't freeze a harbor
```

Cached in `.inkhaven/facts_check.json` (order-independent content hash),
`--json` for a CI gate. The findings also surface in the **Editorial Pass**
(`inkhaven edit`, category `world`) alongside everything else.

## Anachronism detection

Set the manuscript's setting `year` and Inkhaven flags terms that postdate
it — a "wristwatch" before 1900, a "telephone" before 1876, "okay" before
1839:

```hjson
editor: { style_warnings: { anachronism: {
  year: 1840
  terms: [ { term: "spyglass-cam", earliest: 1990 } ]
} } }
```

A ~35-term built-in lexicon ships (each with its earliest plausible year);
your `terms` add to it. Off until you set a `year` — a contemporary novel
sees nothing. Findings appear in `inkhaven edit` (category `anachronism`),
jumpable to the exact word.

## The story bible — `Ctrl+V Shift+L`

One chord (**L** for **L**ore) opens a consolidated, navigable view of the
world: every **Character** with the attributes `continuity extract` has
tracked across chapters beneath it (`eye_color: brown (ch.3)`), plus the
**Places**, **Artefacts**, and **Facts** books. `↑↓` navigate, **`Enter`**
jumps to an entry's source paragraph (a `→` marks the jumpable rows).

## Series-shared facts

Point a `facts.shared_path` at a directory of plain-text fact files (one
file per fact — filename is the title, contents the body) and a whole series
shares one canon:

```hjson
facts: { shared_path: "../series-bible/facts" }
```

`facts check` then layers the shared canon under each book's local facts
(**local wins** on a name clash). Or `inkhaven facts import` copies a
snapshot into this book's Facts book as paragraphs (idempotent, dry-run by
default, `--yes` to write, `--from <dir>` to override).

## Under the hood

- Zero new dependencies. The fact-check + import reuse the Facts-scan
  sidecar machinery (`io_atomic`, DefaultHasher content hash); the
  anachronism detector reuses the `style_warnings` per-line detector
  substrate; the story bible reuses the lexicon books + the continuity
  sidecar.
- New pure, unit-tested code: `FactCheckReport` / `parse_conflicts` /
  `shared_facts`, the `AnachronismDetector`, `editorial::from_fact_conflict`,
  the story-bible row builder.
- Tests 1328 → 1333. Tutorial 69 added.

## Deferred (later cuts)

- **Live anachronism overlay** — the detector feeds `inkhaven edit`; wiring
  it into the live editor underline (theme colour + panes) is a refinement.
- **Embedding-based divergent-description check** — catch two descriptions
  of the same place/character that *drift* without a hard fact clash.
- **Span-scoped editorial rewrite** + a **filter-words** editorial category.

## 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.
- A TUI `edit --deep` trigger; sixth supported language; GitHub Release
  backfill for 1.2.11–1.2.19.
