# Inkhaven 1.3.26 — The World Fact-Checker

_The other half of the world simulation arrives. 1.3.25 gave Inkhaven a compiler
that builds a world; 1.3.26 gives it a **fact-checker** that reads your prose and
flags claims that don't fit the world you built — as you write. A messenger who
covers 600 km in three days, a blizzard in your tropical capital, a city ten
times bigger than the map can feed, three moons in a two-moon sky: the Output
pane tells you, quietly, while you keep typing. And a **magic ledger** lets you
declare the exceptions to physics your world allows, so the checker respects
them. This is RFC WORLD-4 Branch B (the fast track)._

_Reference: [WORLD-4_PLAN.md](../PROPOSALS/WORLD-4_PLAN.md)_

## The magic ledger — declared exceptions to physics

Add a `magic:` block to `world.hjson`. Each rule names a `kind`, the check
categories it `covers`, and who/where it applies to:

```hjson
magic: {
    enabled: true
    rules: [
        {
            kind: "messenger_birds"
            covers: ["travel_time"]
            description: "Royal pelicans fly day and night with relays"
            applicable_to: { roles: ["royal_messenger"] }
        }
        {
            kind: "extended_lifespan"
            covers: ["character_age"]
            description: "Sun-priests live to 200"
            applies_to_role: "sun_priest"
            multiplier: 2.5
        }
    ]
}
```

The fact-checker consults the ledger **lazily** — only after it has a candidate
warning. If a rule covers that warning's category and applies, the warning is
suppressed with a note ("consistent with declared magic rule `messenger_birds`")
instead of nagging you forever. A one-time setup retires whole classes of false
positive. List the ledger with `inkhaven realworld magic`; it materializes into
`World / Magic Ledger`.

## The fact-checker — fast track

The checker reads prose for assertions about the world and verifies them. It's
deterministic and instant (no LLM), and it runs four categories today:

- **Travel time** — a sentence that states a distance *and* a duration implies a
  pace; implausible paces flag ("600 km in three days = 200 km/day, which far
  exceeds pre-industrial travel"). Pure prose — needs no world data.
- **Climate** — weather described at a known place that contradicts its climate
  zone (a blizzard at a tropical city).
- **Demographics** — a population stated for a place that diverges sharply from
  the modeled figure ("a city of two million" where the world supports ~40,000).
- **Astronomy** — a moon count that disagrees with the world's sky ("all three
  moons" when the world has two).

The climate and demographics checks resolve place names in your prose through a
**gazetteer** built from the Place ↔ World cross-references — the same links the
compiler records when you accept a city. So the loop closes: compile a world,
accept its cities, write about them, and the checker knows what they are.

### Real-time, as you write

When your project has a world, the fast track runs **automatically**: pause for a
few seconds on a paragraph and its findings appear in the **Output pane** (per
PANE-1) — no chord, no focus stolen, you keep writing. A re-check replaces the
paragraph's prior findings, so the pane always shows the current state and fixed
problems simply disappear.

Prefer to ask explicitly? **`Ctrl+B W` → `F`** fact-checks the open paragraph on
demand and flips you to Output. Headless? `inkhaven fact-check --text "…"` (or
`--paragraph <id>`) prints findings with severity icons. Findings carry a
severity — info (suppressed by magic), warning, contradiction.

## The editor hub — `Ctrl+B W`

The World overview gained two more actions, so it's a one-stop hub:

- **`C`** compile + materialize every layer + seed the proposal queue.
- **`P`** review and accept/reject the Place proposals.
- **`F`** fact-check the open paragraph.

## New dependencies

**None.** The magic ledger and the entire fast-track fact-checker reuse what's
already in tree (`regex`, the DuckDB stores, the PANE-1 Output pane). The world
compiler's `noise` + `delaunator` (1.3.25) are unchanged.

## Compatibility

Non-breaking and opt-in. The fact-checker only runs when a project has a
`world.hjson`; projects without one are completely unaffected and pay no cost.
The `magic:` block is optional. The Output, Places, and World books all work
exactly as before.

Tests 1613 → 1625.
