# Inkhaven 1.4.15 — Utopian/dystopian coherence checker

_Inkhaven's world-consistency stack (WORLD-4/5) checks **physical** and **temporal** facts. It does
not check the **logical coherence of a social premise**. A utopia or dystopia makes a structured
claim — *society organised this way produces these outcomes* — and utopian fiction fails not from plot
holes but from **coherence holes**: the mechanism doesn't scale to enforce the premise, two
consequences contradict, or a scene depends on something the premise eliminated. WORLD-6 adds a
three-stage checker for exactly that. It reads **only what you declare**, reasons about
**logical/systemic** structure only (never morality — reserved for a future Inner Theologian), and
grounds the `utopian-architect` Inner Socrates persona with what it finds. **No new runtime crates.**_

_Plan: [WORLD-6_PLAN.md](../PROPOSALS/WORLD-6_PLAN.md)_

## Declare a premise in the World book

Write your premise set in the **World** system book as paragraphs carrying the four new
`para:utopia-*` tags (add a tag with **`Ctrl+B ]`**):

| Tag | Glyph | Means |
|---|:--:|---|
| `para:utopia-premise` | ⊢ | what's different from the real world, and why |
| `para:utopia-mechanism` | ⚙ | how the premise is enforced / maintained |
| `para:utopia-consequence` | ⇒ | what the premise produces |
| `para:utopia-elimination` | ∅ | what the premise rules out |

Consecutive tagged paragraphs form one **premise group**; a gap breaks the group (a
`// world:group:<name>` comment names the next one), so a book with a dominant society *and* a
resistance can declare both.

## Run the check

```sh
inkhaven world utopia-check              # Stage 1 (extraction) — cheap
inkhaven world utopia-check --stage 2    # + pairing (chain logic) — explicit
inkhaven world utopia-check --stage all  # + per-chapter entailment scan
inkhaven world utopia-model              # the extracted claims, no checks
```

- **Stage 1** extracts your claims (one call per group).
- **Stage 2** checks claim pairs for logical compatibility (premise→mechanism,
  mechanism→consequence, consequence↔consequence) and raises **CHAIN BREAK**, **CONSEQUENCE GAP**, and
  **INTERNAL CONFLICT** findings. It's O(pairs) LLM calls, so it's **explicit-only** — never silent.
- **Stage 3** scans each chapter against the **elimination inventory** and flags **ENTAILMENT
  VIOLATION**s — prose that uses something declared eliminated.

`utopia-check` exits **1** on any chain-logic finding and **2** on any entailment violation, so it
doubles as a pre-submission gate. After Stage 1, a deterministic (no-LLM) pass cross-references the
elimination inventory against your **Facts** book: a fact that's also declared eliminated raises a
`Factual` finding to reconcile.

## In the editor

The cached findings surface in the Output pane via the **`Ctrl+B Shift+C`** review pass — read-only,
zero-cost (the LLM stages run only when you ask, on the CLI). The **`utopian-architect`** Inner
Socrates persona (`Ctrl+B J → S` to select it) opens its Slow session grounded by these findings,
naming the unresolved tensions before its questions begin.

## Deliberate tensions

If a contradiction is the point — surveillance *and* flourishing, the novel's central irony —
suppress it: `inkhaven world utopia-suppress --finding <id> --reason "…"`, or add a
`deliberate_tension` entry covering `utopia_coherence` to the magic ledger. Suppressed findings leave
the Output pane but stay recorded.

## Notes

- **`inkhaven world` is now a subcommand group** (`utopia-check` / `utopia-model` / `utopia-suppress`
  / `utopia-refresh`). The bare **`inkhaven world`** consistency snapshot — and `--deep` / `--entity`
  / `--json` — behave exactly as before; backward-compatible.
- **Scope is enforced in the prompts:** every stage reads only what you declared and judges only
  logical/systemic compatibility. Moral, spiritual, and historical-plausibility judgements are out of
  scope. The schema reserves a `theological` finding domain and `research` grounding hooks for future
  features, with no coupling.
- **Scripting** — read-only `ink.utopia.{model,findings,violations}`; `ink.utopia.suppress` mutates.
- **No new runtime crates; no new system books; no new `NodeKind`.** One new
  `.inkhaven/utopia.duckdb`, four new `para:utopia-*` tags, one `utopia:` config block. New tutorial
  98. Tests 2039 → 2069 (the deterministic surface — tag/group detection, store, prompt construction,
  JSON parsing, pair selection, Facts cross-reference, grounding text — is unit-tested; the live LLM
  stages are integration-only, like Inner Editor's engage).
