# Inkhaven 1.5.3 — Trust & Hygiene (RESRCH-2 / R2-E)

_1.5.2 widened where research facts come from. 1.5.3 pays down the debt that breadth was riding on:
**real per-model cost**, a **scalable `/factcheck`**, **live-streamed** auditing, **Tab-completion** — and
turns the fact-check into a navigable workflow with **per-fact verdict flags in the Facts tree** and a new
**`/whatswrong`** explainer. No new crates._

_Plan: [RESRCH-2.4_PLAN.md](../PROPOSALS/RESRCH-2.4_PLAN.md) · cross-track path:
[RESRCH-4_RFC.md](../PROPOSALS/RESRCH-4_RFC.md)_

## Real cost model (RE-P1)

- The streaming primitive now captures the provider's **real prompt/completion token counts**
  (`with_capture_usage`), and a new **`cost.pricing`** table prices each model's input and output
  separately (USD per million tokens, longest model-name-substring match; `default_*` fallback).
- The status bar shows **`$0.012`** when priced from real usage, **`~$0.012`** when it falls back to the
  char-length estimate. Still informative only — `research.session_budget_warn` never blocks.

## Scalable, streamed `/factcheck` (RE-P2, RE-P3)

- The consistency pass is **chunked by Facts chapter** (large branches split to bounded sub-chunks) plus
  a **cross-branch** representatives pass — bounded LLM calls instead of one unbounded prompt, so it
  scales to a large corpus. The truth pass was already chunked.
- Both the accuracy and consistency passes — and `/fact` extraction — now **stream live** (dim tokens)
  instead of a silent status line.

## Verdict flags + `/whatswrong` (RE-P5)

- After a `/factcheck`, every fact in the **Facts tree** carries a verdict glyph: **✓** accurate (green),
  **?** questionable (yellow), **✗** inaccurate (red) — persisted in `.inkhaven/fact-verdicts.json` until
  the next audit. The report and status line gain a `✓N ?N ✗N` tally.
- New **`/whatswrong [facts/path]`** (bare → the selected fact) streams an AI explanation of *what* is
  inaccurate or questionable and what the correct information is — seeded with the recorded verdict
  reason, in the project language. The loop: `/factcheck` flags → the tree shows where → `/whatswrong`
  explains → you fix it by hand.

## Tab-completion (RE-P4)

- In the query prompt, **Tab** completes a Facts slug path after `/goto ` or after a `→` insertion arrow
  (single match completes + descends; several splice the common prefix and list the options). Elsewhere,
  Tab still cycles panes.

## Notes

- **No new runtime crates.** New config: `cost.pricing` + `cost.default_{input,output}_per_1m`. New
  sidecar: `.inkhaven/fact-verdicts.json`. New command: `/whatswrong`.
- The companion **RESRCH-4** track (computational `/calc` + World-book grounding) is now specified —
  [RFC](../PROPOSALS/RESRCH-4_RFC.md) / [track](../PROPOSALS/RESRCH-4_TRACK.md) — and is the next cut
  (R4-D World reader + R4-B astronomy).
- Tutorial 103 expanded (verdict flags, `/whatswrong`, cost table, tab-completion); `Ctrl+B h` updated.
  Tests 2186 → 2201.
