Skip to content

Garry's Opinionated OpenClaw/Hermes Agent Brain

TypeScript

eval(fence-repair): Tier 3 measurement instrument: 78 hand-written fixtures, production-path runner, $0 oracle and scorer (#6188 T4)

garrytan73ed456b4afc
diff --git a/evals/fence-repair-tier3/README.md b/evals/fence-repair-tier3/README.md
new file mode 100644
index 0000000000..0e6b4177d1
--- /dev/null
+++ b/evals/fence-repair-tier3/README.md
@@ -0,0 +1,41 @@
+# Tier 3 fence-repair eval (#6188 T4)
+
+Measures how well a chat model repairs the facts and takes fences that the free repair rules (Tier 1) leave malformed, through the production Tier 3 path, and whether that is accurate enough to stay on by default. The preregistration, raw per-item results and verdict live in gbrain-evals (`docs/benchmarks/2026-10-06-fence-repair-tier3*`).
+
+## What's here
+
+| File | Role |
+|---|---|
+| `cases.ts` | 78 hand-written cases. Each is one page whose fence Tier 1 leaves with a residual reason a model may clear (`short_row`, `no_header`, `row_before_header`, `extra_cells`, `header_unmapped`), with the whole repaired section written by hand. Sets: 66 `repairable` (a correct repair exists and passes every gate), 9 `adversarial` (the only correct outcome is to stay held: 6 `ambiguous` with two readings the gates cannot tell apart, 3 `unrecoverable` missing a required value) and 3 `gate_limited` (a person would repair them, but the gates forbid the correct table; diagnostic). Placeholder names only. |
+| `generate-fixtures.ts` | Deterministic builder: `cases.ts` → `fixtures.jsonl` (committed). Regenerate after editing a case; the keyless test fails on drift. |
+| `run-case.ts` | One fixture through the production path: the page becomes a stored-page target, `analyzeFences` runs the free tiers, and `runTier3` makes the model call with the brain's real daily ledger and attempt store (prompt v1, one call per fence, at most one corrective re-ask, gates (a)-(g), Tier 1 fixed point). Nothing re-implements a tier or a gate. |
+| `oracle.ts` | The $0 label check: a scripted model answers with each ground truth (or adversarial probe) and the real gates must agree with the label. |
+| `score.ts` | Pure scoring: the cell-level match rule, per-model rates, Wilson intervals and the preregistered decision rule. |
+| `harness.ts` | Runner: `--oracle`, live (`--model`, `--run`, `--out`) and `--score`. |
+
+The keyless test is `test/eval-fence-repair-tier3.test.ts` (fixture freshness and coverage floors, the oracle, scorer arithmetic). It guards the instrument, not the score.
+
+## Running
+
+```bash
+# Prove every label against the production gates ($0, no key):
+bun evals/fence-repair-tier3/harness.ts --oracle
+
+# One live run of one model on a fresh throwaway brain (needs the provider key):
+bun evals/fence-repair-tier3/harness.ts --model anthropic:claude-sonnet-5-5 --run 1 --out results/sonnet-5-5-run1.jsonl --max-usd 10
+bun evals/fence-repair-tier3/harness.ts --model default --run 1 --out results/default-run1.jsonl # gbrain's own models.fence_repair resolution
+
+# Score saved runs ($0):
+bun evals/fence-repair-tier3/harness.ts --score results/*.jsonl --json summary.json
+```
+
+A live run sets `models.fence_repair` on its brain (unset for `default`), registers list prices gbrain's table lacks in `pricing.overrides` (as `gbrain pricing set` would), and sets `fences.repair.max_usd_per_day` to `--max-usd`, which the daily ledger enforces as a hard ceiling. The per-page cap stays at the production default ($0.05), so a corrective re-ask the cap cannot cover is refused exactly as in production. A provider error is retried twice after a pause, as the next maintenance run would retry it. Each result row records the outcome (repaired, or held with its gate or failure class), the match against the ground truth, per-call tokens, ledger-priced USD, latency and the model's answer text.
+
+Exit codes: 0 done, 1 oracle violation, 2 infrastructure (no key, cap reached, a fixture that no longer reaches Tier 3).
+
+## Metrics
+
+- **Gate-pass rate**: repairable fences whose Tier 3 repair passed every gate, over repairable fences run.
+- **False-accept rate**: repairable fences repaired but not matching the ground truth, over repairable fences run. A match means the same non-empty cell text in the same columns (spacing ignored) and identical text outside the fences.
+- **Held correctly**: adversarial fences that stayed held.
+- **USD per repair**: ledger-priced spend on repairable fences over repairs. **Latency**: wall time of the Tier 3 step per fence that made a call (p50, p95).
diff --git a/evals/fence-repair-tier3/cases.ts b/evals/fence-repair-tier3/cases.ts
new file mode 100644
index 0000000000..a0c5695c09
--- /dev/null
+++ b/evals/fence-repair-tier3/cases.ts
@@ -0,0 +1,428 @@
+/**
+ * Hand-written cases for the Tier 3 fence-repair eval (#6188 T4).
+ *
+ * Each case is one page whose facts or takes fence Tier 1 leaves with a
+ * residual reason a model may clear (`short_row`, `no_header`,
+ * `row_before_header`, `extra_cells`, `header_unmapped`). `body` is the
+ * section as written; `expected` is the whole section after a correct
+ * repair, written by hand (the canonical header and separator, then every
+ * row). Tokens: {FB}/{FE} facts markers, {TB}/{TE} takes markers, {FH}/{FS}
+ * the canonical narrow facts header and separator, {FW}/{FWS} the wide
+ * facts ones, {TH}/{TS} the narrow takes ones and {TW}/{TWS} the wide takes ones.
+ *
+ * Sets:
+ * - `repairable`: a correct repair exists and passes every production gate
+ * (the oracle test proves it).
+ * - `adversarial`: the only correct outcome is to stay held.
+ * `ambiguous` cases have two readings and the gates cannot tell them apart,
+ * so only the model can hold (`probe` is a plausible wrong guess the gates
+ * accept). `unrecoverable` cases lack a required value, so any repair must
+ * invent one and the gates reject it (`probe` is such a repair).
+ * - `gate_limited`: a person would repair it, but the gates forbid the
+ * correct table (`expected` is that table; the oracle test proves the
+ * gates reject it). Diagnostic only.
+ *
+ * Names are placeholders only (alice-example, acme-example, fund-a, ...).
+ */
+
+export type CaseSet = 'repairable' | 'adversarial' | 'gate_limited';
+export type CaseClass = 'short_row_trailing' | 'short_row_gap' | 'no_header' | 'row_before_header' | 'extra_cells' | 'header_unmapped' | 'mixed';
+
+export interface Case {
+ id: string;
+ set: CaseSet;
+ adversarial?: 'ambiguous' | 'unrecoverable';
+ cls: CaseClass;
+ kind: 'facts' | 'takes' | 'both';
+ section?: 'body' | 'timeline';
+ vis?: 'private' | 'world';
+ tags: string[];
+ note: string;
+ body: string[];
+ expected: string[] | null;
+ /** Adversarial only: a whole answer a model might return for the sent rows (header, separator, rows). */
+ probe?: string[];
+}
+
+const FENCE_ROW = '| 1 | Acme-example signed a two-year lease in Austin | event | 0.9 | private | high | 2026-02-11 | | lease summary | |';
+
+export const CASES: Case[] = [
+ // ── short rows, trailing cells missing (facts) ─────────────────────────
+ { id: 'f-st-01', set: 'repairable', cls: 'short_row_trailing', kind: 'facts', tags: [], note: 'valid_until, source and context dropped',
+ body: ['{FB}', '{FH}', '|---|---|---|---|---|---|---|---|---|---|', FENCE_ROW,
+ '| 2 | Acme-example closed its Series B | event | 0.9 | private | high | 2026-03-14 |', '{FE}'],
+ expected: ['{FB}', '{FH}', '{FS}', FENCE_ROW,
+ '| 2 | Acme-example closed its Series B | event | 0.9 | private | high | 2026-03-14 | | | |', '{FE}'] },
+ { id: 'f-st-02', set: 'repairable', cls: 'short_row_trailing', kind: 'facts', tags: [], note: 'only the required cells',
+ body: ['{FB}', '{FH}', '{FS}', '| 1 | Bob-example prefers async standups | preference | 0.7 | private | medium |', '{FE}'],
+ expected: ['{FB}', '{FH}', '{FS}', '| 1 | Bob-example prefers async standups | preference | 0.7 | private | medium | | | | |', '{FE}'] },
+ { id: 'f-st-03', set: 'repairable', cls: 'short_row_trailing', kind: 'facts', vis: 'world', tags: ['link', 'world'], note: 'world page, link in the claim',
+ body: ['{FB}', '{FH}', '{FS}', '| 3 | Gamma-example sells in 12 countries | fact | 0.8 | world | medium | 2026-01-02 | | company site | |',
+ '| 4 | Gamma-example moved its pricing page to [the new site](https://example.com/pricing) | fact | 0.85 | world | low | 2026-01-05 | |', '{FE}'],
+ expected: ['{FB}', '{FH}', '{FS}', '| 3 | Gamma-example sells in 12 countries | fact | 0.8 | world | medium | 2026-01-02 | | company site | |',
+ '| 4 | Gamma-example moved its pricing page to [the new site](https://example.com/pricing) | fact | 0.85 | world | low | 2026-01-05 | | | |', '{FE}'] },
+ { id: 'f-st-04', set: 'repairable', cls: 'short_row_trailing', kind: 'facts', tags: ['strike'], note: 'struck claim with both dates',
+ body: ['{FB}', '{FH}', '{FS}', '| 5 | ~~Delta-example plans a 2026 IPO~~ | belief | 0.4 | private | medium | 2025-11-02 | 2026-02-01 |',
+ '| 6 | Delta-example now plans to stay private | belief | 0.6 | private | medium | 2026-02-01 | | investor update | |', '{FE}'],
+ expected: ['{FB}', '{FH}', '{FS}', '| 5 | ~~Delta-example plans a 2026 IPO~~ | belief | 0.4 | private | medium | 2025-11-02 | 2026-02-01 | | |',
+ '| 6 | Delta-example now plans to stay private | belief | 0.6 | private | medium | 2026-02-01 | | investor update | |', '{FE}'] },
+ { id: 'f-st-05', set: 'repairable', cls: 'short_row_trailing', kind: 'facts', tags: ['number'], note: 'money with M and k suffixes in the claim',
+ body: ['{FB}', '{FH}', '{FS}', '| 3 | Beta-example ARR reached $4.2M, up from 900k | fact | 0.95 | private | high |', '{FE}'],
+ expected: ['{FB}', '{FH}', '{FS}', '| 3 | Beta-example ARR reached $4.2M, up from 900k | fact | 0.95 | private | high | | | | |', '{FE}'] },
+ { id: 'f-st-06', set: 'repairable', cls: 'short_row_trailing', kind: 'facts', tags: [], note: 'two short rows around a valid one',
+ body: ['{FB}', '{FH}', '{FS}', '| 1 | Carol-example runs the platform team | fact | 1.0 | private | medium | 2026-01-20 |',
+ '| 2 | Carol-example reports to bob-example | fact | 0.8 | private | low |',
+ '| 3 | The platform team has nine engineers | fact | 0.7 | private | low | 2026-01-20 | | staff list | |', '{FE}'],
+ expected: ['{FB}', '{FH}', '{FS}', '| 1 | Carol-example runs the platform team | fact | 1.0 | private | medium | 2026-01-20 | | | |',
+ '| 2 | Carol-example reports to bob-example | fact | 0.8 | private | low | | | | |',
+ '| 3 | The platform team has nine engineers | fact | 0.7 | private | low | 2026-01-20 | | staff list | |', '{FE}'] },
+ { id: 'f-st-07', set: 'repairable', cls: 'short_row_trailing', kind: 'facts', tags: ['pipe'], note: 'escaped pipe inside the claim',
+ body: ['{FB}', '{FH}', '{FS}', "| 7 | Fund-a's thesis is infra \\| devtools | belief | 0.6 | private | medium | 2026-04-02 |", '{FE}'],
+ expected: ['{FB}', '{FH}', '{FS}', "| 7 | Fund-a's thesis is infra \\| devtools | belief | 0.6 | private | medium | 2026-04-02 | | | |", '{FE}'] },
+ { id: 'f-st-08', set: 'repairable', cls: 'short_row_trailing', kind: 'facts', tags: ['tier1_after'], note: 'percent confidence: copied as written, then Tier 1 writes 0.85',
+ body: ['{FB}', '{FH}', '{FS}', '| 2 | Alice-example plans to hire two engineers | commitment | 85% | private | medium | 2026-05-01 |', '{FE}'],
+ expected: ['{FB}', '{FH}', '{FS}', '| 2 | Alice-example plans to hire two engineers | commitment | 0.85 | private | medium | 2026-05-01 | | | |', '{FE}'] },
+ { id: 'f-st-09', set: 'repairable', cls: 'short_row_trailing', kind: 'facts', section: 'timeline', tags: ['timeline'], note: 'fence in the timeline section',
+ body: ['{FB}', '{FH}', '{FS}', '| 1 | Acme-example hired a CFO | event | 0.9 | private | high | 2026-06-02 |', '{FE}'],
+ expected: ['{FB}', '{FH}', '{FS}', '| 1 | Acme-example hired a CFO | event | 0.9 | private | high | 2026-06-02 | | | |', '{FE}'] },
+ { id: 'f-st-10', set: 'repairable', cls: 'short_row_trailing', kind: 'facts', tags: ['tier1_after'], note: 'kind synonym: copied as written, then Tier 1 maps it and notes the original word',
+ body: ['{FB}', '{FH}', '{FS}', '| 3 | Beta-example shipped v2 to all customers | milestone | 0.9 | private | high | 2026-06-15 |', '{FE}'],
+ expected: ['{FB}', '{FH}', '{FS}', '| 3 | Beta-example shipped v2 to all customers | event | 0.9 | private | high | 2026-06-15 | | | original kind: milestone |', '{FE}'] },
+
+ // ── short rows, trailing cells missing (takes) ─────────────────────────
+ { id: 't-st-01', set: 'repairable', cls: 'short_row_trailing', kind: 'takes', tags: [], note: 'since and source dropped',
+ body: ['{TB}', '{TH}', '|---|---|---|---|---|---|---|', '| 1 | Remote-first teams ship faster | take | brain | 0.7 | 2026-01-10 | team retro |',
+ '| 2 | Rates fall by Q3 | bet | people/alice-example | 0.6 |', '{TE}'],
+ expected: ['{TB}', '{TH}', '{TS}', '| 1 | Remote-first teams ship faster | take | brain | 0.7 | 2026-01-10 | team retro |',
+ '| 2 | Rates fall by Q3 | bet | people/alice-example | 0.6 | | |', '{TE}'] },
+ { id: 't-st-02', set: 'repairable', cls: 'short_row_trailing', kind: 'takes', tags: [], note: 'company holder',
+ body: ['{TB}', '{TH}', '{TS}', '| 1 | Acme-example will be acquired within a year | hunch | companies/beta-example | 0.3 |', '{TE}'],
+ expected: ['{TB}', '{TH}', '{TS}', '| 1 | Acme-example will be acquired within a year | hunch | companies/beta-example | 0.3 | | |', '{TE}'] },
+ { id: 't-st-03', set: 'repairable', cls: 'short_row_trailing', kind: 'takes', tags: ['strike', 'link'], note: 'struck claim with a link',
+ body: ['{TB}', '{TH}', '{TS}', '| 3 | Gamma-example keeps its lead | take | people/bob-example | 0.6 | 2026-01-15 | board chat |',
+ '| 4 | ~~[Gamma-example](https://example.com/g) wins the RFP~~ | bet | people/bob-example | 0.5 |', '{TE}'],
+ expected: ['{TB}', '{TH}', '{TS}', '| 3 | Gamma-example keeps its lead | take | people/bob-example | 0.6 | 2026-01-15 | board chat |',
+ '| 4 | ~~[Gamma-example](https://example.com/g) wins the RFP~~ | bet | people/bob-example | 0.5 | | |', '{TE}'] },
+ { id: 't-st-04', set: 'repairable', cls: 'short_row_trailing', kind: 'takes', tags: [], note: 'world holder',
+ body: ['{TB}', '{TH}', '{TS}', '| 2 | Open-weight models close the gap by 2027 | take | world | 0.8 |', '{TE}'],
+ expected: ['{TB}', '{TH}', '{TS}', '| 2 | Open-weight models close the gap by 2027 | take | world | 0.8 | | |', '{TE}'] },
+ { id: 't-st-05', set: 'repairable', cls: 'short_row_trailing', kind: 'takes', tags: ['number'], note: 'two short rows, money in a claim',
+ body: ['{TB}', '{TH}', '{TS}', '| 3 | Hiring slows in H2 | hunch | brain | 0.4 |', '| 4 | Seed valuations hold near $20M | bet | people/carol-example | 0.55 |', '{TE}'],
+ expected: ['{TB}', '{TH}', '{TS}', '| 3 | Hiring slows in H2 | hunch | brain | 0.4 | | |', '| 4 | Seed valuations hold near $20M | bet | people/carol-example | 0.55 | | |', '{TE}'] },
+
+ // ── short rows, a cell missing in the middle (facts) ───────────────────
+ { id: 'f-sg-01', set: 'repairable', cls: 'short_row_gap', kind: 'facts', tags: [], note: 'valid_until dropped: the last cell is the source',
+ body: ['{FB}', '{FH}', '{FS}', FENCE_ROW, '| 2 | Carol-example joined acme-example as CTO | event | 0.9 | private | high | 2026-04-01 | intro call |', '{FE}'],
+ expected: ['{FB}', '{FH}', '{FS}', FENCE_ROW, '| 2 | Carol-example joined acme-example as CTO | event | 0.9 | private | high | 2026-04-01 | | intro call | |', '{FE}'] },
+ { id: 'f-sg-02', set: 'repairable', cls: 'short_row_gap', kind: 'facts', tags: ['link'], note: 'both dates dropped: a link source and a context note follow',
+ body: ['{FB}', '{FH}', '{FS}', '| 3 | Alice-example dislikes cold email | preference | 0.8 | private | medium | [call notes](https://example.com/notes/17) | mentioned again at the offsite |', '{FE}'],
+ expected: ['{FB}', '{FH}', '{FS}', '| 3 | Alice-example dislikes cold email | preference | 0.8 | private | medium | | | [call notes](https://example.com/notes/17) | mentioned again at the offsite |', '{FE}'] },
+ { id: 'f-sg-03', set: 'repairable', cls: 'short_row_gap', kind: 'facts', tags: ['date_meaning'], note: 'the claim says the pilot ends on the date, so it is valid_until',
+ body: ['{FB}', '{FH}', '{FS}', "| 4 | Beta-example's pilot with acme-example ends on 2026-06-30 | commitment | 0.75 | private | medium | 2026-06-30 | contract summary |", '{FE}'],
+ expected: ['{FB}', '{FH}', '{FS}', "| 4 | Beta-example's pilot with acme-example ends on 2026-06-30 | commitment | 0.75 | private | medium | | 2026-06-30 | contract summary | |", '{FE}'] },
+ { id: 'f-sg-04', set: 'repairable', cls: 'short_row_gap', kind: 'facts', vis: 'world', tags: ['world'], note: 'no dates: the only optional cell is the source',
+ body: ['{FB}', '{FH}', '{FS}', "| 5 | Gamma-example's CEO is carol-example | fact | 1.0 | world | high | company site |", '{FE}'],
+ expected: ['{FB}', '{FH}', '{FS}', "| 5 | Gamma-example's CEO is carol-example | fact | 1.0 | world | high | | | company site | |", '{FE}'] },
+ { id: 'f-sg-05', set: 'repairable', cls: 'short_row_gap', kind: 'facts', tags: ['link', 'number'], note: 'valid_until dropped, link source, money in the claim',
+ body: ['{FB}', '{FH}', '{FS}', "| 8 | Fund-a led acme-example's seed at a $12M cap | event | 0.95 | private | high | 2025-10-09 | [term sheet](https://example.com/ts) |", '{FE}'],
+ expected: ['{FB}', '{FH}', '{FS}', "| 8 | Fund-a led acme-example's seed at a $12M cap | event | 0.95 | private | high | 2025-10-09 | | [term sheet](https://example.com/ts) | |", '{FE}'] },
+ { id: 'f-sg-06', set: 'repairable', cls: 'short_row_gap', kind: 'facts', tags: ['strike'], note: 'struck row, valid_until dropped',
+ body: ['{FB}', '{FH}', '{FS}', '| 9 | ~~Carol-example leads sales~~ | fact | 0.9 | private | medium | 2025-06-01 | org chart |',
+ '| 10 | Dave-example leads sales | fact | 0.9 | private | medium | 2026-02-01 | | org chart | |', '{FE}'],
+ expected: ['{FB}', '{FH}', '{FS}', '| 9 | ~~Carol-example leads sales~~ | fact | 0.9 | private | medium | 2025-06-01 | | org chart | |',
+ '| 10 | Dave-example leads sales | fact | 0.9 | private | medium | 2026-02-01 | | org chart | |', '{FE}'] },
+ { id: 'f-sg-07', set: 'repairable', cls: 'short_row_gap', kind: 'facts', tags: ['pipe'], note: 'valid_until dropped, escaped pipe in the source',
+ body: ['{FB}', '{FH}', '{FS}', '| 10 | Beta-example renewed with gamma-example | event | 0.85 | private | medium | 2026-02-20 | renewal email \\| thread 3 |', '{FE}'],
+ expected: ['{FB}', '{FH}', '{FS}', '| 10 | Beta-example renewed with gamma-example | event | 0.85 | private | medium | 2026-02-20 | | renewal email \\| thread 3 | |', '{FE}'] },
+
+ // ── no header (facts) ──────────────────────────────────────────────────
+ { id: 'f-nh-01', set: 'repairable', cls: 'no_header', kind: 'facts', tags: [], note: 'two complete rows, no header or separator',
+ body: ['{FB}', '| 1 | Bob-example lives in Denver | fact | 0.9 | private | low | 2025-08-01 | | intro email | |',
+ '| 2 | Bob-example coaches youth soccer | fact | 0.7 | private | low | | | coffee chat | |', '{FE}'],
+ expected: ['{FB}', '{FH}', '{FS}', '| 1 | Bob-example lives in Denver | fact | 0.9 | private | low | 2025-08-01 | | intro email | |',
+ '| 2 | Bob-example coaches youth soccer | fact | 0.7 | private | low | | | coffee chat | |', '{FE}'] },
+ { id: 'f-nh-02', set: 'repairable', cls: 'no_header', kind: 'facts', tags: [], note: 'separator but no header; rows without the context cell',
+ body: ['{FB}', '|---|---|---|---|---|---|---|---|---|---|', '| 1 | Acme-example uses usage-based pricing | fact | 0.9 | private | medium | 2026-01-01 | | pricing page |',
+ '| 2 | Acme-example targets mid-market buyers | belief | 0.6 | private | medium | | | sales call |',
+ '| 3 | Acme-example will add an annual plan | commitment | 0.7 | private | low | 2026-07-01 | | roadmap |', '{FE}'],
+ expected: ['{FB}', '{FH}', '{FS}', '| 1 | Acme-example uses usage-based pricing | fact | 0.9 | private | medium | 2026-01-01 | | pricing page | |',
+ '| 2 | Acme-example targets mid-market buyers | belief | 0.6 | private | medium | | | sales call | |',
+ '| 3 | Acme-example will add an annual plan | commitment | 0.7 | private | low | 2026-07-01 | | roadmap | |', '{FE}'] },
+ { id: 'f-nh-03', set: 'repairable', cls: 'no_header', kind: 'facts', tags: ['wide', 'number'], note: 'typed rows (14 cells) with 120k and 1,250 values: the wide header',
+ body: ['{FB}', '| 1 | Acme-example MRR | fact | 0.9 | private | high | 2026-05-01 | | finance deck | | mrr | 120k | USD | monthly |',
+ '| 2 | Acme-example headcount | fact | 0.85 | private | medium | 2026-05-01 | | HR export | | headcount | 1,250 | people | point in time |', '{FE}'],
+ expected: ['{FB}', '{FW}', '{FWS}', '| 1 | Acme-example MRR | fact | 0.9 | private | high | 2026-05-01 | | finance deck | | mrr | 120k | USD | monthly |',
+ '| 2 | Acme-example headcount | fact | 0.85 | private | medium | 2026-05-01 | | HR export | | headcount | 1,250 | people | point in time |', '{FE}'] },
+ { id: 'f-nh-04', set: 'repairable', cls: 'no_header', kind: 'facts', vis: 'world', tags: ['world', 'strike', 'link'], note: 'world page, struck row superseded by a row with a link',
+ body: ['{FB}', '| 1 | Gamma-example is hiring in Lisbon | fact | 0.8 | world | low | 2026-02-01 | | [careers page](https://example.com/careers) | |',
+ "| 2 | ~~Gamma-example's only office is in Porto~~ | fact | 0.9 | world | low | 2025-01-01 | 2026-02-01 | careers page | superseded by #1 |", '{FE}'],
+ expected: ['{FB}', '{FH}', '{FS}', '| 1 | Gamma-example is hiring in Lisbon | fact | 0.8 | world | low | 2026-02-01 | | [careers page](https://example.com/careers) | |',
+ "| 2 | ~~Gamma-example's only office is in Porto~~ | fact | 0.9 | world | low | 2025-01-01 | 2026-02-01 | careers page | superseded by #1 |", '{FE}'] },
+ { id: 'f-nh-05', set: 'repairable', cls: 'no_header', kind: 'facts', section: 'timeline', tags: ['timeline'], note: 'timeline fence without a header',
+ body: ['{FB}', '| 4 | Delta-example opened a waitlist | event | 0.9 | private | medium | 2026-03-02 | | launch email | |',
+ '| 5 | Delta-example crossed 10k signups | event | 0.8 | private | high | 2026-04-11 | | founder update | |', '{FE}'],
+ expected: ['{FB}', '{FH}', '{FS}', '| 4 | Delta-example opened a waitlist | event | 0.9 | private | medium | 2026-03-02 | | launch email | |',
+ '| 5 | Delta-example crossed 10k signups | event | 0.8 | private | high | 2026-04-11 | | founder update | |', '{FE}'] },
+ { id: 'f-nh-06', set: 'repairable', cls: 'no_header', kind: 'facts', tags: ['br'], note: 'no header; a context with a <br> line break',
+ body: ['{FB}', "| 3 | Bob-example's offsite is in May | event | 0.7 | private | low | 2026-05-12 | | calendar | agenda TBD<br>venue booked |",
+ '| 4 | Bob-example invited eight founders | fact | 0.8 | private | low | 2026-04-20 | | invite list |', '{FE}'],
+ expected: ['{FB}', '{FH}', '{FS}', "| 3 | Bob-example's offsite is in May | event | 0.7 | private | low | 2026-05-12 | | calendar | agenda TBD<br>venue booked |",
+ '| 4 | Bob-example invited eight founders | fact | 0.8 | private | low | 2026-04-20 | | invite list | |', '{FE}'] },
+
+ // ── no header (takes) ──────────────────────────────────────────────────
+ { id: 't-nh-01', set: 'repairable', cls: 'no_header', kind: 'takes', tags: [], note: 'two complete rows',
+ body: ['{TB}', '| 1 | Acme-example should raise prices | take | brain | 0.7 | 2026-01-05 | pricing review |',
+ '| 2 | Acme-example churn drops next quarter | bet | people/alice-example | 0.55 | 2026-01-05 | QBR |', '{TE}'],
+ expected: ['{TB}', '{TH}', '{TS}', '| 1 | Acme-example should raise prices | take | brain | 0.7 | 2026-01-05 | pricing review |',
+ '| 2 | Acme-example churn drops next quarter | bet | people/alice-example | 0.55 | 2026-01-05 | QBR |', '{TE}'] },
+ { id: 't-nh-02', set: 'repairable', cls: 'no_header', kind: 'takes', tags: [], note: 'three rows, mixed holders, one without a source',
+ body: ['{TB}', '| 1 | Vertical AI tools win in legal | take | world | 0.6 | 2026-02-01 | industry report |',
+ '| 2 | Beta-example ships an API this year | bet | companies/beta-example | 0.5 | 2026-02-01 |',
+ '| 3 | The market softens in Q4 | hunch | brain | 0.3 | 2026-02-01 | gut feel |', '{TE}'],
+ expected: ['{TB}', '{TH}', '{TS}', '| 1 | Vertical AI tools win in legal | take | world | 0.6 | 2026-02-01 | industry report |',
+ '| 2 | Beta-example ships an API this year | bet | companies/beta-example | 0.5 | 2026-02-01 | |',
+ '| 3 | The market softens in Q4 | hunch | brain | 0.3 | 2026-02-01 | gut feel |', '{TE}'] },
+ { id: 't-nh-03', set: 'repairable', cls: 'no_header', kind: 'takes', tags: ['strike', 'link'], note: 'struck row and a link',
+ body: ['{TB}', '| 1 | ~~Delta-example stays seed-stage through 2026~~ | bet | people/bob-example | 0.4 | 2025-12-01 | [notes](https://example.com/n/4) |',
+ '| 2 | Delta-example raises a Series A in 2026 | bet | people/bob-example | 0.6 | 2026-03-01 | partner sync |', '{TE}'],
+ expected: ['{TB}', '{TH}', '{TS}', '| 1 | ~~Delta-example stays seed-stage through 2026~~ | bet | people/bob-example | 0.4 | 2025-12-01 | [notes](https://example.com/n/4) |',
+ '| 2 | Delta-example raises a Series A in 2026 | bet | people/bob-example | 0.6 | 2026-03-01 | partner sync |', '{TE}'] },
+ { id: 't-nh-04', set: 'repairable', cls: 'no_header', kind: 'takes', tags: ['pipe'], note: 'separator but no header; escaped pipe in a source',
+ body: ['{TB}', '|---|---|---|---|---|---|---|', '| 5 | Fund-a should lead the round | take | people/carol-example | 0.65 | 2026-04-01 | IC memo \\| draft 2 |', '{TE}'],
+ expected: ['{TB}', '{TH}', '{TS}', '| 5 | Fund-a should lead the round | take | people/carol-example | 0.65 | 2026-04-01 | IC memo \\| draft 2 |', '{TE}'] },
+
+ // ── a row before the header (facts) ────────────────────────────────────
+ { id: 'f-rb-01', set: 'repairable', cls: 'row_before_header', kind: 'facts', tags: [], note: 'one complete row above the header',
+ body: ['{FB}', '| 3 | Acme-example renewed its office lease | event | 0.8 | private | low | 2026-01-30 | | lease summary | |', '{FH}', '{FS}', FENCE_ROW,
+ '| 2 | Acme-example sublets one floor | fact | 0.6 | private | low | 2026-02-15 | | facilities email | |', '{FE}'],
+ expected: ['{FB}', '{FH}', '{FS}', '| 3 | Acme-example renewed its office lease | event | 0.8 | private | low | 2026-01-30 | | lease summary | |', FENCE_ROW,
+ '| 2 | Acme-example sublets one floor | fact | 0.6 | private | low | 2026-02-15 | | facilities email | |', '{FE}'] },
+ { id: 'f-rb-02', set: 'repairable', cls: 'row_before_header', kind: 'facts', tags: [], note: 'two rows above the header',
+ body: ['{FB}', '| 4 | Carol-example speaks Portuguese | fact | 0.9 | private | low | | | intro call | |',
+ '| 5 | Carol-example prefers mornings for calls | preference | 0.7 | private | low | | | scheduling thread | |', '{FH}', '{FS}',
+ '| 6 | Carol-example joined in 2024 | fact | 1.0 | private | medium | 2024-03-01 | | HR export | |', '{FE}'],
+ expected: ['{FB}', '{FH}', '{FS}', '| 4 | Carol-example speaks Portuguese | fact | 0.9 | private | low | | | intro call | |',
+ '| 5 | Carol-example prefers mornings for calls | preference | 0.7 | private | low | | | scheduling thread | |',
+ '| 6 | Carol-example joined in 2024 | fact | 1.0 | private | medium | 2024-03-01 | | HR export | |', '{FE}'] },
+ { id: 'f-rb-03', set: 'repairable', cls: 'row_before_header', kind: 'facts', tags: [], note: 'a short row above the header',
+ body: ['{FB}', '| 7 | Beta-example moved to weekly releases | event | 0.85 | private | medium | 2026-03-09 |', '{FH}', '{FS}',
+ '| 8 | Beta-example has 40 engineers | fact | 0.8 | private | low | 2026-03-01 | | org chart | |', '{FE}'],
+ expected: ['{FB}', '{FH}', '{FS}', '| 7 | Beta-example moved to weekly releases | event | 0.85 | private | medium | 2026-03-09 | | | |',
+ '| 8 | Beta-example has 40 engineers | fact | 0.8 | private | low | 2026-03-01 | | org chart | |', '{FE}'] },
+ { id: 'f-rb-04', set: 'repairable', cls: 'row_before_header', kind: 'facts', tags: ['pipe', 'link'], note: 'row above the header with an escaped pipe and a link',
+ body: ['{FB}', '| 9 | Gamma-example offers SSO \\| SCIM on the team plan | fact | 0.9 | private | medium | 2026-02-01 | | [docs](https://example.com/docs/sso) | |', '{FH}', '{FS}',
+ '| 10 | Gamma-example added audit logs | event | 0.8 | private | low | 2026-02-20 | | changelog | |', '{FE}'],
+ expected: ['{FB}', '{FH}', '{FS}', '| 9 | Gamma-example offers SSO \\| SCIM on the team plan | fact | 0.9 | private | medium | 2026-02-01 | | [docs](https://example.com/docs/sso) | |',
+ '| 10 | Gamma-example added audit logs | event | 0.8 | private | low | 2026-02-20 | | changelog | |', '{FE}'] },
+ { id: 'f-rb-05', set: 'repairable', cls: 'row_before_header', kind: 'facts', vis: 'world', tags: ['world'], note: 'world page, world row above the header',
+ body: ['{FB}', '| 1 | Delta-example is based in Oslo | fact | 1.0 | world | medium | | | company site | |', '{FH}', '{FS}',
+ '| 2 | Delta-example sells to utilities | fact | 0.8 | world | low | | | company site | |', '{FE}'],
+ expected: ['{FB}', '{FH}', '{FS}', '| 1 | Delta-example is based in Oslo | fact | 1.0 | world | medium | | | company site | |',
+ '| 2 | Delta-example sells to utilities | fact | 0.8 | world | low | | | company site | |', '{FE}'] },
+
+ // ── a row before the header (takes) ────────────────────────────────────
+ { id: 't-rb-01', set: 'repairable', cls: 'row_before_header', kind: 'takes', tags: [], note: 'one row above the header',
+ body: ['{TB}', '| 1 | Acme-example is underpriced | take | people/alice-example | 0.6 | 2026-01-12 | board dinner |', '{TH}', '{TS}',
+ '| 2 | Acme-example doubles revenue this year | bet | people/alice-example | 0.45 | 2026-01-12 | board dinner |', '{TE}'],
+ expected: ['{TB}', '{TH}', '{TS}', '| 1 | Acme-example is underpriced | take | people/alice-example | 0.6 | 2026-01-12 | board dinner |',
+ '| 2 | Acme-example doubles revenue this year | bet | people/alice-example | 0.45 | 2026-01-12 | board dinner |', '{TE}'] },
+ { id: 't-rb-02', set: 'repairable', cls: 'row_before_header', kind: 'takes', tags: [], note: 'a short row above the header',
+ body: ['{TB}', '| 3 | Usage pricing beats seats for infra | take | brain | 0.75 |', '{TH}', '{TS}',
+ '| 4 | Beta-example switches to usage pricing | bet | brain | 0.5 | 2026-02-02 | pricing review |', '{TE}'],
+ expected: ['{TB}', '{TH}', '{TS}', '| 3 | Usage pricing beats seats for infra | take | brain | 0.75 | | |',
+ '| 4 | Beta-example switches to usage pricing | bet | brain | 0.5 | 2026-02-02 | pricing review |', '{TE}'] },
+ { id: 't-rb-03', set: 'repairable', cls: 'row_before_header', kind: 'takes', tags: ['strike'], note: 'two rows above the header, one struck',
+ body: ['{TB}', '| 5 | ~~Gamma-example IPOs in 2026~~ | bet | companies/fund-a | 0.3 | 2025-09-01 | LP letter |',
+ '| 6 | Gamma-example IPOs in 2027 | bet | companies/fund-a | 0.4 | 2026-03-01 | LP letter |', '{TH}', '{TS}',
+ '| 7 | Gamma-example stays founder-led | take | companies/fund-a | 0.7 | 2026-03-01 | LP letter |', '{TE}'],
+ expected: ['{TB}', '{TH}', '{TS}', '| 5 | ~~Gamma-example IPOs in 2026~~ | bet | companies/fund-a | 0.3 | 2025-09-01 | LP letter |',
+ '| 6 | Gamma-example IPOs in 2027 | bet | companies/fund-a | 0.4 | 2026-03-01 | LP letter |',
+ '| 7 | Gamma-example stays founder-led | take | companies/fund-a | 0.7 | 2026-03-01 | LP letter |', '{TE}'] },
+
+ // ── extra cells (facts) ────────────────────────────────────────────────
+ { id: 'f-ex-01', set: 'repairable', cls: 'extra_cells', kind: 'facts', tags: [], note: 'an empty cell after the claim',
+ body: ['{FB}', '{FH}', '{FS}', FENCE_ROW, '| 2 | Acme-example opened a Denver office | | event | 0.8 | private | low | 2026-02-01 | | press release | |', '{FE}'],
+ expected: ['{FB}', '{FH}', '{FS}', FENCE_ROW, '| 2 | Acme-example opened a Denver office | event | 0.8 | private | low | 2026-02-01 | | press release | |', '{FE}'] },
+ { id: 'f-ex-02', set: 'repairable', cls: 'extra_cells', kind: 'facts', tags: [], note: 'an empty cell after the kind',
+ body: ['{FB}', '{FH}', '{FS}', '| 3 | Bob-example agreed to mentor two founders | commitment | | 0.9 | private | medium | 2026-03-05 | | 1:1 notes | |', '{FE}'],
+ expected: ['{FB}', '{FH}', '{FS}', '| 3 | Bob-example agreed to mentor two founders | commitment | 0.9 | private | medium | 2026-03-05 | | 1:1 notes | |', '{FE}'] },
+ { id: 'f-ex-03', set: 'repairable', cls: 'extra_cells', kind: 'facts', tags: [], note: 'an empty cell after the visibility',
+ body: ['{FB}', '{FH}', '{FS}', '| 4 | Carol-example prefers written updates | preference | 0.75 | private | | medium | | | survey | |', '{FE}'],
+ expected: ['{FB}', '{FH}', '{FS}', '| 4 | Carol-example prefers written updates | preference | 0.75 | private | medium | | | survey | |', '{FE}'] },
+ { id: 'f-ex-04', set: 'repairable', cls: 'extra_cells', kind: 'facts', tags: ['number'], note: 'two empty cells inserted; a percentage in the claim',
+ body: ['{FB}', '{FH}', '{FS}', '| 5 | Delta-example cut list prices 20% | | event | | 0.85 | private | medium | 2026-04-10 | | pricing page | |', '{FE}'],
+ expected: ['{FB}', '{FH}', '{FS}', '| 5 | Delta-example cut list prices 20% | event | 0.85 | private | medium | 2026-04-10 | | pricing page | |', '{FE}'] },
+ { id: 'f-ex-05', set: 'repairable', cls: 'extra_cells', kind: 'facts', tags: [], note: 'a parenthetical note after the claim belongs in context',
+ body: ['{FB}', '{FH}', '{FS}', '| 6 | Alice-example moved to Berlin | (relocation) | event | 0.8 | private | medium | 2026-01-10 | | email | |', '{FE}'],
+ expected: ['{FB}', '{FH}', '{FS}', '| 6 | Alice-example moved to Berlin | event | 0.8 | private | medium | 2026-01-10 | | email | (relocation) |', '{FE}'] },
+ { id: 'f-ex-06', set: 'repairable', cls: 'extra_cells', kind: 'facts', tags: ['wide', 'number'], note: 'typed row with an empty cell after the claim',
+ body: ['{FB}', '{FW}', '{FWS}', '| 7 | Beta-example gross margin | | fact | 0.9 | private | high | 2026-06-30 | | Q2 report | | gross_margin | 0.62 | ratio | quarterly |', '{FE}'],
+ expected: ['{FB}', '{FW}', '{FWS}', '| 7 | Beta-example gross margin | fact | 0.9 | private | high | 2026-06-30 | | Q2 report | | gross_margin | 0.62 | ratio | quarterly |', '{FE}'] },
+ { id: 'f-ex-07', set: 'repairable', cls: 'extra_cells', kind: 'facts', tags: ['strike', 'number'], note: 'struck row with an empty cell; the superseding row is valid',
+ body: ['{FB}', '{FH}', '{FS}', '| 8 | ~~Gamma-example raised $3.5M~~ | | event | 0.9 | private | high | 2025-12-01 | 2026-03-01 | news item | superseded by #9 |',
+ '| 9 | Gamma-example raised $5M | event | 0.9 | private | high | 2026-03-01 | | press release | |', '{FE}'],
+ expected: ['{FB}', '{FH}', '{FS}', '| 8 | ~~Gamma-example raised $3.5M~~ | event | 0.9 | private | high | 2025-12-01 | 2026-03-01 | news item | superseded by #9 |',
+ '| 9 | Gamma-example raised $5M | event | 0.9 | private | high | 2026-03-01 | | press release | |', '{FE}'] },
+
+ // ── extra cells (takes) ────────────────────────────────────────────────
+ { id: 't-ex-01', set: 'repairable', cls: 'extra_cells', kind: 'takes', tags: [], note: 'an empty cell after the claim',
+ body: ['{TB}', '{TH}', '{TS}', '| 3 | Vertical SaaS beats horizontal | | take | brain | 0.7 | 2026-01-01 | podcast notes |', '{TE}'],
+ expected: ['{TB}', '{TH}', '{TS}', '| 3 | Vertical SaaS beats horizontal | take | brain | 0.7 | 2026-01-01 | podcast notes |', '{TE}'] },
+ { id: 't-ex-02', set: 'repairable', cls: 'extra_cells', kind: 'takes', tags: [], note: 'an empty cell after the holder',
+ body: ['{TB}', '{TH}', '{TS}', '| 1 | Acme-example keeps its CEO | take | companies/beta-example | 0.8 | 2026-01-20 | board deck |',
+ '| 4 | Acme-example misses Q3 targets | bet | companies/beta-example | | 0.35 | 2026-02-02 | board chat |', '{TE}'],
+ expected: ['{TB}', '{TH}', '{TS}', '| 1 | Acme-example keeps its CEO | take | companies/beta-example | 0.8 | 2026-01-20 | board deck |',
+ '| 4 | Acme-example misses Q3 targets | bet | companies/beta-example | 0.35 | 2026-02-02 | board chat |', '{TE}'] },
+ { id: 't-ex-03', set: 'repairable', cls: 'extra_cells', kind: 'takes', tags: ['strike', 'link'], note: 'struck claim with a link, empty cell after the kind',
+ body: ['{TB}', '{TH}', '{TS}', '| 5 | ~~[Delta-example](https://example.com/d) pivots to enterprise~~ | hunch | | people/alice-example | 0.4 | 2026-03-03 | dinner |', '{TE}'],
+ expected: ['{TB}', '{TH}', '{TS}', '| 5 | ~~[Delta-example](https://example.com/d) pivots to enterprise~~ | hunch | people/alice-example | 0.4 | 2026-03-03 | dinner |', '{TE}'] },
+ { id: 't-ex-04', set: 'repairable', cls: 'extra_cells', kind: 'takes', tags: [], note: 'two empty cells after the claim',
+ body: ['{TB}', '{TH}', '{TS}', '| 6 | Rates stay flat through 2026 | | | bet | world | 0.5 | 2026-04-04 | market note |', '{TE}'],
+ expected: ['{TB}', '{TH}', '{TS}', '| 6 | Rates stay flat through 2026 | bet | world | 0.5 | 2026-04-04 | market note |', '{TE}'] },
+
+ // ── header with an unknown column (facts) ──────────────────────────────
+ { id: 'f-hu-01', set: 'repairable', cls: 'header_unmapped', kind: 'facts', tags: [], note: '`certainty` is the confidence; visibility sits before it',
+ body: ['{FB}', '| # | claim | kind | visibility | certainty | notability | valid_from | valid_until | source | context |', '|---|---|---|---|---|---|---|---|---|---|',
+ "| 1 | Acme-example's CFO is bob-example | fact | private | 0.9 | high | 2026-01-15 | | org chart | |",
+ '| 2 | Acme-example plans a Tokyo office | idea | private | 0.5 | medium | | | offsite notes | |', '{FE}'],
+ expected: ['{FB}', '{FH}', '{FS}', "| 1 | Acme-example's CFO is bob-example | fact | 0.9 | private | high | 2026-01-15 | | org chart | |",
+ '| 2 | Acme-example plans a Tokyo office | idea | 0.5 | private | medium | | | offsite notes | |', '{FE}'] },
+ { id: 'f-hu-02', set: 'repairable', cls: 'header_unmapped', kind: 'facts', tags: [], note: '`starts` and `ends` are the validity dates, written before the confidence',
+ body: ['{FB}', '| # | claim | kind | starts | ends | confidence | visibility | notability | source | context |', '|---|---|---|---|---|---|---|---|---|---|',
+ '| 1 | Bob-example chairs the audit committee | fact | 2025-07-01 | 2027-06-30 | 0.9 | private | medium | board minutes | |',
+ '| 2 | Bob-example is on parental leave | fact | 2026-03-01 | 2026-05-31 | 1.0 | private | low | HR note | |', '{FE}'],
+ expected: ['{FB}', '{FH}', '{FS}', '| 1 | Bob-example chairs the audit committee | fact | 0.9 | private | medium | 2025-07-01 | 2027-06-30 | board minutes | |',
+ '| 2 | Bob-example is on parental leave | fact | 1.0 | private | low | 2026-03-01 | 2026-05-31 | HR note | |', '{FE}'] },
+ { id: 'f-hu-03', set: 'repairable', cls: 'header_unmapped', kind: 'facts', tags: ['no_row_numbers'], note: 'no # column and an `origin` column (the source); Tier 1 numbers the rows after the model',
+ body: ['{FB}', '| claim | kind | confidence | visibility | notability | origin |', '|---|---|---|---|---|---|',
+ '| Carol-example runs a book club | fact | 0.8 | private | low | coffee chat |',
+ '| Carol-example wants to angel invest | preference | 0.6 | private | medium | dinner |',
+ '| Carol-example will intro two founders | commitment | 0.7 | private | medium | email |', '{FE}'],
+ expected: ['{FB}', '{FH}', '{FS}', '| 1 | Carol-example runs a book club | fact | 0.8 | private | low | | | coffee chat | |',
+ '| 2 | Carol-example wants to angel invest | preference | 0.6 | private | medium | | | dinner | |',
+ '| 3 | Carol-example will intro two founders | commitment | 0.7 | private | medium | | | email | |', '{FE}'] },
+ { id: 'f-hu-04', set: 'repairable', cls: 'header_unmapped', kind: 'facts', tags: [], note: 'kind before claim and an `audience` column (the visibility)',
+ body: ['{FB}', '| # | kind | claim | confidence | audience | notability | valid_from | source |', '|---|---|---|---|---|---|---|---|',
+ '| 1 | event | Beta-example signed acme-example | 0.9 | private | high | 2026-02-14 | deal desk |',
+ '| 2 | fact | Beta-example sells annual contracts | 0.8 | private | medium | | sales deck |', '{FE}'],
+ expected: ['{FB}', '{FH}', '{FS}', '| 1 | Beta-example signed acme-example | event | 0.9 | private | high | 2026-02-14 | | deal desk | |',
+ '| 2 | Beta-example sells annual contracts | fact | 0.8 | private | medium | | | sales deck | |', '{FE}'] },
+ { id: 'f-hu-05', set: 'repairable', cls: 'header_unmapped', kind: 'facts', vis: 'world', tags: ['world', 'link'], note: 'world page; a `reference` column (the source) before the confidence',
+ body: ['{FB}', '| # | claim | kind | reference | confidence | visibility | notability | valid_from | valid_until | notes |', '|---|---|---|---|---|---|---|---|---|---|',
+ '| 1 | Gamma-example open-sourced its SDK | event | [blog post](https://example.com/blog/sdk) | 0.95 | world | medium | 2026-03-20 | | |',
+ '| 2 | Gamma-example supports three languages | fact | SDK readme | 0.9 | world | low | 2026-03-20 | | Python, Go, Rust |', '{FE}'],
+ expected: ['{FB}', '{FH}', '{FS}', '| 1 | Gamma-example open-sourced its SDK | event | 0.95 | world | medium | 2026-03-20 | | [blog post](https://example.com/blog/sdk) | |',
+ '| 2 | Gamma-example supports three languages | fact | 0.9 | world | low | 2026-03-20 | | SDK readme | Python, Go, Rust |', '{FE}'] },
+ { id: 'f-hu-06', set: 'repairable', cls: 'header_unmapped', kind: 'facts', section: 'timeline', tags: ['timeline'], note: 'timeline fence; `effective` is valid_from, notability before visibility',
+ body: ['{FB}', '| # | claim | kind | confidence | notability | visibility | effective | source |', '|---|---|---|---|---|---|---|---|',
+ '| 1 | Delta-example appointed a new CFO | event | 0.9 | high | private | 2026-05-04 | press release |',
+ '| 2 | Delta-example closed its Austin office | event | 0.8 | medium | private | 2026-05-30 | staff email |', '{FE}'],
+ expected: ['{FB}', '{FH}', '{FS}', '| 1 | Delta-example appointed a new CFO | event | 0.9 | private | high | 2026-05-04 | | press release | |',
+ '| 2 | Delta-example closed its Austin office | event | 0.8 | private | medium | 2026-05-30 | | staff email | |', '{FE}'] },
+
+ // ── header with an unknown column (takes) ──────────────────────────────
+ { id: 't-hu-01', set: 'repairable', cls: 'header_unmapped', kind: 'takes', tags: [], note: '`conviction` is the weight; holder before kind',
+ body: ['{TB}', '| # | claim | holder | kind | conviction | since | source |', '|---|---|---|---|---|---|---|',
+ '| 1 | Acme-example wins the enterprise segment | people/alice-example | take | 0.7 | 2026-01-08 | strategy offsite |',
+ '| 2 | Acme-example hires a COO this year | people/alice-example | bet | 0.5 | 2026-01-08 | strategy offsite |', '{TE}'],
+ expected: ['{TB}', '{TH}', '{TS}', '| 1 | Acme-example wins the enterprise segment | take | people/alice-example | 0.7 | 2026-01-08 | strategy offsite |',
+ '| 2 | Acme-example hires a COO this year | bet | people/alice-example | 0.5 | 2026-01-08 | strategy offsite |', '{TE}'] },
+ { id: 't-hu-02', set: 'repairable', cls: 'header_unmapped', kind: 'takes', tags: ['link'], note: '`odds` is the weight and `link` the source',
+ body: ['{TB}', '| # | claim | kind | odds | who | date | link |', '|---|---|---|---|---|---|---|',
+ '| 1 | Beta-example lands a bank customer | bet | 0.4 | people/bob-example | 2026-02-10 | [pipeline](https://example.com/p) |', '{TE}'],
+ expected: ['{TB}', '{TH}', '{TS}', '| 1 | Beta-example lands a bank customer | bet | people/bob-example | 0.4 | 2026-02-10 | [pipeline](https://example.com/p) |', '{TE}'] },
+ { id: 't-hu-03', set: 'repairable', cls: 'header_unmapped', kind: 'takes', tags: ['no_row_numbers'], note: 'no # column; `confidence level` is the weight; Tier 1 numbers the rows',
+ body: ['{TB}', '| claim | kind | who | confidence level | since |', '|---|---|---|---|---|',
+ '| AI copilots become standard in CAD | take | brain | 0.65 | 2026-03-01 |',
+ '| Gamma-example ships a CAD copilot | bet | brain | 0.45 | 2026-03-01 |', '{TE}'],
+ expected: ['{TB}', '{TH}', '{TS}', '| 1 | AI copilots become standard in CAD | take | brain | 0.65 | 2026-03-01 | |',
+ '| 2 | Gamma-example ships a CAD copilot | bet | brain | 0.45 | 2026-03-01 | |', '{TE}'] },
+ { id: 't-hu-04', set: 'repairable', cls: 'header_unmapped', kind: 'takes', tags: ['strike'], note: '`probability` (the weight) before the kind; `as of` is since',
+ body: ['{TB}', '| # | claim | probability | kind | holder | as of | source |', '|---|---|---|---|---|---|---|',
+ '| 1 | ~~Delta-example sells by 2026~~ | 0.3 | bet | people/carol-example | 2025-10-01 | coffee |',
+ '| 2 | Delta-example sells by 2027 | 0.45 | bet | people/carol-example | 2026-04-01 | coffee |', '{TE}'],
+ expected: ['{TB}', '{TH}', '{TS}', '| 1 | ~~Delta-example sells by 2026~~ | bet | people/carol-example | 0.3 | 2025-10-01 | coffee |',
+ '| 2 | Delta-example sells by 2027 | bet | people/carol-example | 0.45 | 2026-04-01 | coffee |', '{TE}'] },
+
+ // ── several problems in one fence ──────────────────────────────────────
+ { id: 'f-mix-01', set: 'repairable', cls: 'mixed', kind: 'facts', tags: [], note: 'a short row and a row with an extra cell',
+ body: ['{FB}', '{FH}', '{FS}', '| 1 | Bob-example founded beta-example | fact | 1.0 | private | high | 2022-04-01 |',
+ '| 2 | Bob-example is raising a seed round | | event | 0.7 | private | medium | 2026-05-01 | | coffee chat | |',
+ '| 3 | Beta-example has six employees | fact | 0.8 | private | low | 2026-05-01 | | coffee chat | |', '{FE}'],
+ expected: ['{FB}', '{FH}', '{FS}', '| 1 | Bob-example founded beta-example | fact | 1.0 | private | high | 2022-04-01 | | | |',
+ '| 2 | Bob-example is raising a seed round | event | 0.7 | private | medium | 2026-05-01 | | coffee chat | |',
+ '| 3 | Beta-example has six employees | fact | 0.8 | private | low | 2026-05-01 | | coffee chat | |', '{FE}'] },
+ { id: 'f-mix-02', set: 'repairable', cls: 'mixed', kind: 'facts', tags: [], note: 'a row above the header and a short row below it',
+ body: ['{FB}', '| 4 | Gamma-example signed a reseller in Brazil | event | 0.8 | private | medium | 2026-02-27 | | partner email | |', '{FH}', '{FS}',
+ '| 5 | Gamma-example targets 30% growth | belief | 0.5 | private | medium |', '{FE}'],
+ expected: ['{FB}', '{FH}', '{FS}', '| 4 | Gamma-example signed a reseller in Brazil | event | 0.8 | private | medium | 2026-02-27 | | partner email | |',
+ '| 5 | Gamma-example targets 30% growth | belief | 0.5 | private | medium | | | | |', '{FE}'] },
+ { id: 't-mix-01', set: 'repairable', cls: 'mixed', kind: 'takes', tags: [], note: 'a short row and a row with an extra cell',
+ body: ['{TB}', '{TH}', '{TS}', '| 1 | Climate software consolidates | take | world | 0.6 |',
+ '| 2 | Delta-example gets acquired | | bet | people/bob-example | 0.35 | 2026-01-30 | rumor mill |', '{TE}'],
+ expected: ['{TB}', '{TH}', '{TS}', '| 1 | Climate software consolidates | take | world | 0.6 | | |',
+ '| 2 | Delta-example gets acquired | bet | people/bob-example | 0.35 | 2026-01-30 | rumor mill |', '{TE}'] },
+ { id: 'f-mix-03', set: 'repairable', cls: 'mixed', kind: 'facts', tags: [], note: 'no header and one of the rows is short',
+ body: ['{FB}', '| 1 | Alice-example leads product at acme-example | fact | 0.9 | private | medium | 2025-01-01 | | profile page | |',
+ '| 2 | Alice-example plans a sabbatical | idea | 0.4 | private | low |', '{FE}'],
+ expected: ['{FB}', '{FH}', '{FS}', '| 1 | Alice-example leads product at acme-example | fact | 0.9 | private | medium | 2025-01-01 | | profile page | |',
+ '| 2 | Alice-example plans a sabbatical | idea | 0.4 | private | low | | | | |', '{FE}'] },
+ { id: 'b-mix-01', set: 'repairable', cls: 'mixed', kind: 'both', tags: ['two_fences'], note: 'a facts fence and a takes fence on one page, each with a short row (two model calls)',
+ body: ['{FB}', '{FH}', '{FS}', '| 1 | Acme-example moved HQ to Austin | event | 0.9 | private | high | 2026-01-03 |', '{FE}', '',
+ '{TB}', '{TH}', '{TS}', '| 2 | Acme-example regrets the move within a year | hunch | brain | 0.3 |', '{TE}'],
+ expected: ['{FB}', '{FH}', '{FS}', '| 1 | Acme-example moved HQ to Austin | event | 0.9 | private | high | 2026-01-03 | | | |', '{FE}', '',
+ '{TB}', '{TH}', '{TS}', '| 2 | Acme-example regrets the move within a year | hunch | brain | 0.3 | | |', '{TE}'] },
+
+ // ── adversarial: two readings the gates cannot tell apart ──────────────
+ { id: 'f-adv-01', set: 'adversarial', adversarial: 'ambiguous', cls: 'extra_cells', kind: 'facts', tags: [], note: 'two confidence values; either could be the real one',
+ body: ['{FB}', '{FH}', '{FS}', '| 2 | Beta-example breaks even in 2026 | belief | 0.6 | 0.9 | private | medium | 2026-01-01 | | board deck | |', '{FE}'],
+ expected: null,
+ probe: ['{FH}', '{FS}', '| 2 | Beta-example breaks even in 2026 | belief | 0.6 | private | medium | 2026-01-01 | | board deck | 0.9 |'] },
+ { id: 'f-adv-02', set: 'adversarial', adversarial: 'ambiguous', cls: 'extra_cells', kind: 'facts', tags: [], note: 'two kinds (commitment, idea)',
+ body: ['{FB}', '{FH}', '{FS}', '| 3 | Acme-example launches in Japan | commitment | idea | 0.7 | private | medium | 2026-09-01 | | offsite | |', '{FE}'],
+ expected: null,
+ probe: ['{FH}', '{FS}', '| 3 | Acme-example launches in Japan | commitment | 0.7 | private | medium | 2026-09-01 | | offsite | idea |'] },
+ { id: 'f-adv-03', set: 'adversarial', adversarial: 'ambiguous', cls: 'extra_cells', kind: 'facts', tags: [], note: 'two notability values (high, low)',
+ body: ['{FB}', '{FH}', '{FS}', "| 4 | Delta-example's CTO is leaving | fact | 0.8 | high | private | low | 2026-04-01 | | hallway chat | |", '{FE}'],
+ expected: null,
+ probe: ['{FH}', '{FS}', "| 4 | Delta-example's CTO is leaving | fact | 0.8 | private | high | 2026-04-01 | | hallway chat | low |"] },
+ { id: 'f-adv-04', set: 'adversarial', adversarial: 'ambiguous', cls: 'extra_cells', kind: 'facts', vis: 'world', tags: ['world', 'privacy'], note: 'world page, the row says both private and world: picking world would publish it',
+ body: ['{FB}', '{FH}', '{FS}', '| 5 | Alice-example is raising a fund | fact | 0.7 | private | world | medium | 2026-05-01 | | coffee chat | |', '{FE}'],
+ expected: null,
+ probe: ['{FH}', '{FS}', '| 5 | Alice-example is raising a fund | fact | 0.7 | world | medium | 2026-05-01 | | coffee chat | private |'] },
+ { id: 't-adv-01', set: 'adversarial', adversarial: 'ambiguous', cls: 'extra_cells', kind: 'takes', tags: [], note: 'two holders; either could hold the bet',
+ body: ['{TB}', '{TH}', '{TS}', '| 2 | Gamma-example sells within two years | bet | people/alice-example | people/bob-example | 0.6 | 2026-02-02 | dinner notes |', '{TE}'],
+ expected: null,
+ probe: ['{TW}', '{TWS}', '| 2 | Gamma-example sells within two years | bet | people/alice-example | 0.6 | 2026-02-02 | dinner notes | | | people/bob-example | | | |'] },
+ { id: 'f-adv-05', set: 'adversarial', adversarial: 'ambiguous', cls: 'header_unmapped', kind: 'facts', tags: [], note: 'an `owner` column has no home in a facts table; the only free column is valid_until',
+ body: ['{FB}', '| # | claim | kind | owner | confidence | visibility | notability | valid_from | source | context |', '|---|---|---|---|---|---|---|---|---|---|',
+ '| 1 | The Q3 roadmap is approved | event | people/carol-example | 0.9 | private | medium | 2026-07-01 | planning doc | |', '{FE}'],
+ expected: null,
+ probe: ['{FH}', '{FS}', '| 1 | The Q3 roadmap is approved | event | 0.9 | private | medium | 2026-07-01 | people/carol-example | planning doc | |'] },
+
+ // ── adversarial: a required value is missing ───────────────────────────
+ { id: 'f-unr-01', set: 'adversarial', adversarial: 'unrecoverable', cls: 'short_row_gap', kind: 'facts', tags: [], note: 'the confidence is missing; any value would be invented',
+ body: ['{FB}', '{FH}', '{FS}', "| 3 | Gamma-example's churn fell | fact | private | medium | 2026-02-01 | | dashboard |", '{FE}'],
+ expected: null,
+ probe: ['{FH}', '{FS}', "| 3 | Gamma-example's churn fell | fact | 1.0 | private | medium | 2026-02-01 | | dashboard | |"] },
+ { id: 'f-unr-02', set: 'adversarial', adversarial: 'unrecoverable', cls: 'short_row_gap', kind: 'facts', tags: [], note: 'visibility and notability are missing',
+ body: ['{FB}', '{FH}', '{FS}', '| 4 | Bob-example left beta-example | event | 0.9 | 2026-03-31 | | email |', '{FE}'],
+ expected: null,
+ probe: ['{FH}', '{FS}', '| 4 | Bob-example left beta-example | event | 0.9 | private | medium | 2026-03-31 | | email | |'] },
+ { id: 't-unr-01', set: 'adversarial', adversarial: 'unrecoverable', cls: 'short_row_gap', kind: 'takes', tags: [], note: 'the weight is missing',
+ body: ['{TB}', '{TH}', '{TS}', '| 5 | Remote work stays dominant | take | people/carol-example | survey |', '{TE}'],
+ expected: null,
+ probe: ['{TH}', '{TS}', '| 5 | Remote work stays dominant | take | people/carol-example | 0.5 | | survey |'] },
+
+ // ── gate-limited: a person would repair these; the gates forbid it ─────
+ { id: 'f-gl-01', set: 'gate_limited', cls: 'no_header', kind: 'facts', tags: ['no_row_numbers'], note: 'no header and no # cells: read by position the claim is the kind cell, so gate (b) rejects the real claim',
+ body: ['{FB}', '| Acme-example opened a Denver office | event | 0.8 | private | low | 2026-02-01 | | press release | |', '{FE}'],
+ expected: ['{FB}', '{FH}', '{FS}', '| 1 | Acme-example opened a Denver office | event | 0.8 | private | low | 2026-02-01 | | press release | |', '{FE}'] },
+ { id: 'f-gl-02', set: 'gate_limited', cls: 'extra_cells', kind: 'facts', tags: ['pipe'], note: 'an unescaped pipe split the claim; rejoining it changes the claim cell (gate b)',
+ body: ['{FB}', '{FH}', '{FS}', '| 6 | Revenue grew 40% | driven by enterprise | fact | 0.9 | private | high | 2026-06-30 | | Q2 report | |', '{FE}'],
+ expected: ['{FB}', '{FH}', '{FS}', '| 6 | Revenue grew 40% \\| driven by enterprise | fact | 0.9 | private | high | 2026-06-30 | | Q2 report | |', '{FE}'] },
+ { id: 'f-gl-03', set: 'gate_limited', cls: 'header_unmapped', kind: 'facts', vis: 'world', tags: ['world'], note: 'world page, `audience` column says world; moving it into visibility fails gate (d)',
+ body: ['{FB}', '| # | claim | kind | confidence | audience | notability | source |', '|---|---|---|---|---|---|---|',
+ '| 1 | Delta-example won a design award | event | 0.9 | world | low | press release |', '{FE}'],
+ expected: ['{FB}', '{FH}', '{FS}', '| 1 | Delta-example won a design award | event | 0.9 | world | low | | | press release | |', '{FE}'] },
+];
diff --git a/evals/fence-repair-tier3/fixtures.jsonl b/evals/fence-repair-tier3/fixtures.jsonl
new file mode 100644
index 0000000000..4498dd09f2
--- /dev/null
+++ b/evals/fence-repair-tier3/fixtures.jsonl
@@ -0,0 +1,78 @@
+{"id":"f-st-01","set":"repairable","adversarial":null,"cls":"short_row_trailing","kind":"facts","section":"body","page_visibility":"private","tags":[],"note":"valid_until, source and context dropped","page":{"compiled_truth":"# Notes f-st-01\n\nWorking notes kept by the brain owner.\n\n<!--- gbrain:facts:begin -->\n| # | claim | kind | confidence | visibility | notability | valid_from | valid_until | source | context |\n|---|---|---|---|---|---|---|---|---|---|\n| 1 | Acme-example signed a two-year lease in Austin | event | 0.9 | private | high | 2026-02-11 | | lease summary | |\n| 2 | Acme-example closed its Series B | event | 0.9 | private | high | 2026-03-14 |\n<!--- gbrain:facts:end -->\n","timeline":""},"expected":{"compiled_truth":"# Notes f-st-01\n\nWorking notes kept by the brain owner.\n\n<!--- gbrain:facts:begin -->\n| # | claim | kind | confidence | visibility | notability | valid_from | valid_until | source | context |\n|---|-------|------|------------|------------|------------|------------|-------------|--------|---------|\n| 1 | Acme-example signed a two-year lease in Austin | event | 0.9 | private | high | 2026-02-11 | | lease summary | |\n| 2 | Acme-example closed its Series B | event | 0.9 | private | high | 2026-03-14 | | | |\n<!--- gbrain:facts:end -->\n","timeline":""},"probe":null}
+{"id":"f-st-02","set":"repairable","adversarial":null,"cls":"short_row_trailing","kind":"facts","section":"body","page_visibility":"private","tags":[],"note":"only the required cells","page":{"compiled_truth":"# Notes f-st-02\n\nWorking notes kept by the brain owner.\n\n<!--- gbrain:facts:begin -->\n| # | claim | kind | confidence | visibility | notability | valid_from | valid_until | source | context |\n|---|-------|------|------------|------------|------------|------------|-------------|--------|---------|\n| 1 | Bob-example prefers async standups | preference | 0.7 | private | medium |\n<!--- gbrain:facts:end -->\n","timeline":""},"expected":{"compiled_truth":"# Notes f-st-02\n\nWorking notes kept by the brain owner.\n\n<!--- gbrain:facts:begin -->\n| # | claim | kind | confidence | visibility | notability | valid_from | valid_until | source | context |\n|---|-------|------|------------|------------|------------|------------|-------------|--------|---------|\n| 1 | Bob-example prefers async standups | preference | 0.7 | private | medium | | | | |\n<!--- gbrain:facts:end -->\n","timeline":""},"probe":null}
+{"id":"f-st-03","set":"repairable","adversarial":null,"cls":"short_row_trailing","kind":"facts","section":"body","page_visibility":"world","tags":["link","world"],"note":"world page, link in the claim","page":{"compiled_truth":"# Notes f-st-03\n\nWorking notes kept by the brain owner.\n\n<!--- gbrain:facts:begin -->\n| # | claim | kind | confidence | visibility | notability | valid_from | valid_until | source | context |\n|---|-------|------|------------|------------|------------|------------|-------------|--------|---------|\n| 3 | Gamma-example sells in 12 countries | fact | 0.8 | world | medium | 2026-01-02 | | company site | |\n| 4 | Gamma-example moved its pricing page to [the new site](https://example.com/pricing) | fact | 0.85 | world | low | 2026-01-05 | |\n<!--- gbrain:facts:end -->\n","timeline":""},"expected":{"compiled_truth":"# Notes f-st-03\n\nWorking notes kept by the brain owner.\n\n<!--- gbrain:facts:begin -->\n| # | claim | kind | confidence | visibility | notability | valid_from | valid_until | source | context |\n|---|-------|------|------------|------------|------------|------------|-------------|--------|---------|\n| 3 | Gamma-example sells in 12 countries | fact | 0.8 | world | medium | 2026-01-02 | | company site | |\n| 4 | Gamma-example moved its pricing page to [the new site](https://example.com/pricing) | fact | 0.85 | world | low | 2026-01-05 | | | |\n<!--- gbrain:facts:end -->\n","timeline":""},"probe":null}
+{"id":"f-st-04","set":"repairable","adversarial":null,"cls":"short_row_trailing","kind":"facts","section":"body","page_visibility":"private","tags":["strike"],"note":"struck claim with both dates","page":{"compiled_truth":"# Notes f-st-04\n\nWorking notes kept by the brain owner.\n\n<!--- gbrain:facts:begin -->\n| # | claim | kind | confidence | visibility | notability | valid_from | valid_until | source | context |\n|---|-------|------|------------|------------|------------|------------|-------------|--------|---------|\n| 5 | ~~Delta-example plans a 2026 IPO~~ | belief | 0.4 | private | medium | 2025-11-02 | 2026-02-01 |\n| 6 | Delta-example now plans to stay private | belief | 0.6 | private | medium | 2026-02-01 | | investor update | |\n<!--- gbrain:facts:end -->\n","timeline":""},"expected":{"compiled_truth":"# Notes f-st-04\n\nWorking notes kept by the brain owner.\n\n<!--- gbrain:facts:begin -->\n| # | claim | kind | confidence | visibility | notability | valid_from | valid_until | source | context |\n|---|-------|------|------------|------------|------------|------------|-------------|--------|---------|\n| 5 | ~~Delta-example plans a 2026 IPO~~ | belief | 0.4 | private | medium | 2025-11-02 | 2026-02-01 | | |\n| 6 | Delta-example now plans to stay private | belief | 0.6 | private | medium | 2026-02-01 | | investor update | |\n<!--- gbrain:facts:end -->\n","timeline":""},"probe":null}
+{"id":"f-st-05","set":"repairable","adversarial":null,"cls":"short_row_trailing","kind":"facts","section":"body","page_visibility":"private","tags":["number"],"note":"money with M and k suffixes in the claim","page":{"compiled_truth":"# Notes f-st-05\n\nWorking notes kept by the brain owner.\n\n<!--- gbrain:facts:begin -->\n| # | claim | kind | confidence | visibility | notability | valid_from | valid_until | source | context |\n|---|-------|------|------------|------------|------------|------------|-------------|--------|---------|\n| 3 | Beta-example ARR reached $4.2M, up from 900k | fact | 0.95 | private | high |\n<!--- gbrain:facts:end -->\n","timeline":""},"expected":{"compiled_truth":"# Notes f-st-05\n\nWorking notes kept by the brain owner.\n\n<!--- gbrain:facts:begin -->\n| # | claim | kind | confidence | visibility | notability | valid_from | valid_until | source | context |\n|---|-------|------|------------|------------|------------|------------|-------------|--------|---------|\n| 3 | Beta-example ARR reached $4.2M, up from 900k | fact | 0.95 | private | high | | | | |\n<!--- gbrain:facts:end -->\n","timeline":""},"probe":null}
+{"id":"f-st-06","set":"repairable","adversarial":null,"cls":"short_row_trailing","kind":"facts","section":"body","page_visibility":"private","tags":[],"note":"two short rows around a valid one","page":{"compiled_truth":"# Notes f-st-06\n\nWorking notes kept by the brain owner.\n\n<!--- gbrain:facts:begin -->\n| # | claim | kind | confidence | visibility | notability | valid_from | valid_until | source | context |\n|---|-------|------|------------|------------|------------|------------|-------------|--------|---------|\n| 1 | Carol-example runs the platform team | fact | 1.0 | private | medium | 2026-01-20 |\n| 2 | Carol-example reports to bob-example | fact | 0.8 | private | low |\n| 3 | The platform team has nine engineers | fact | 0.7 | private | low | 2026-01-20 | | staff list | |\n<!--- gbrain:facts:end -->\n","timeline":""},"expected":{"compiled_truth":"# Notes f-st-06\n\nWorking notes kept by the brain owner.\n\n<!--- gbrain:facts:begin -->\n| # | claim | kind | confidence | visibility | notability | valid_from | valid_until | source | context |\n|---|-------|------|------------|------------|------------|------------|-------------|--------|---------|\n| 1 | Carol-example runs the platform team | fact | 1.0 | private | medium | 2026-01-20 | | | |\n| 2 | Carol-example reports to bob-example | fact | 0.8 | private | low | | | | |\n| 3 | The platform team has nine engineers | fact | 0.7 | private | low | 2026-01-20 | | staff list | |\n<!--- gbrain:facts:end -->\n","timeline":""},"probe":null}
+{"id":"f-st-07","set":"repairable","adversarial":null,"cls":"short_row_trailing","kind":"facts","section":"body","page_visibility":"private","tags":["pipe"],"note":"escaped pipe inside the claim","page":{"compiled_truth":"# Notes f-st-07\n\nWorking notes kept by the brain owner.\n\n<!--- gbrain:facts:begin -->\n| # | claim | kind | confidence | visibility | notability | valid_from | valid_until | source | context |\n|---|-------|------|------------|------------|------------|------------|-------------|--------|---------|\n| 7 | Fund-a's thesis is infra \\| devtools | belief | 0.6 | private | medium | 2026-04-02 |\n<!--- gbrain:facts:end -->\n","timeline":""},"expected":{"compiled_truth":"# Notes f-st-07\n\nWorking notes kept by the brain owner.\n\n<!--- gbrain:facts:begin -->\n| # | claim | kind | confidence | visibility | notability | valid_from | valid_until | source | context |\n|---|-------|------|------------|------------|------------|------------|-------------|--------|---------|\n| 7 | Fund-a's thesis is infra \\| devtools | belief | 0.6 | private | medium | 2026-04-02 | | | |\n<!--- gbrain:facts:end -->\n","timeline":""},"probe":null}
+{"id":"f-st-08","set":"repairable","adversarial":null,"cls":"short_row_trailing","kind":"facts","section":"body","page_visibility":"private","tags":["tier1_after"],"note":"percent confidence: copied as written, then Tier 1 writes 0.85","page":{"compiled_truth":"# Notes f-st-08\n\nWorking notes kept by the brain owner.\n\n<!--- gbrain:facts:begin -->\n| # | claim | kind | confidence | visibility | notability | valid_from | valid_until | source | context |\n|---|-------|------|------------|------------|------------|------------|-------------|--------|---------|\n| 2 | Alice-example plans to hire two engineers | commitment | 85% | private | medium | 2026-05-01 |\n<!--- gbrain:facts:end -->\n","timeline":""},"expected":{"compiled_truth":"# Notes f-st-08\n\nWorking notes kept by the brain owner.\n\n<!--- gbrain:facts:begin -->\n| # | claim | kind | confidence | visibility | notability | valid_from | valid_until | source | context |\n|---|-------|------|------------|------------|------------|------------|-------------|--------|---------|\n| 2 | Alice-example plans to hire two engineers | commitment | 0.85 | private | medium | 2026-05-01 | | | |\n<!--- gbrain:facts:end -->\n","timeline":""},"probe":null}
+{"id":"f-st-09","set":"repairable","adversarial":null,"cls":"short_row_trailing","kind":"facts","section":"timeline","page_visibility":"private","tags":["timeline"],"note":"fence in the timeline section","page":{"compiled_truth":"# Notes f-st-09\n\nWorking notes kept by the brain owner.\n","timeline":"<!--- gbrain:facts:begin -->\n| # | claim | kind | confidence | visibility | notability | valid_from | valid_until | source | context |\n|---|-------|------|------------|------------|------------|------------|-------------|--------|---------|\n| 1 | Acme-example hired a CFO | event | 0.9 | private | high | 2026-06-02 |\n<!--- gbrain:facts:end -->\n"},"expected":{"compiled_truth":"# Notes f-st-09\n\nWorking notes kept by the brain owner.\n","timeline":"<!--- gbrain:facts:begin -->\n| # | claim | kind | confidence | visibility | notability | valid_from | valid_until | source | context |\n|---|-------|------|------------|------------|------------|------------|-------------|--------|---------|\n| 1 | Acme-example hired a CFO | event | 0.9 | private | high | 2026-06-02 | | | |\n<!--- gbrain:facts:end -->\n"},"probe":null}
+{"id":"f-st-10","set":"repairable","adversarial":null,"cls":"short_row_trailing","kind":"facts","section":"body","page_visibility":"private","tags":["tier1_after"],"note":"kind synonym: copied as written, then Tier 1 maps it and notes the original word","page":{"compiled_truth":"# Notes f-st-10\n\nWorking notes kept by the brain owner.\n\n<!--- gbrain:facts:begin -->\n| # | claim | kind | confidence | visibility | notability | valid_from | valid_until | source | context |\n|---|-------|------|------------|------------|------------|------------|-------------|--------|---------|\n| 3 | Beta-example shipped v2 to all customers | milestone | 0.9 | private | high | 2026-06-15 |\n<!--- gbrain:facts:end -->\n","timeline":""},"expected":{"compiled_truth":"# Notes f-st-10\n\nWorking notes kept by the brain owner.\n\n<!--- gbrain:facts:begin -->\n| # | claim | kind | confidence | visibility | notability | valid_from | valid_until | source | context |\n|---|-------|------|------------|------------|------------|------------|-------------|--------|---------|\n| 3 | Beta-example shipped v2 to all customers | event | 0.9 | private | high | 2026-06-15 | | | original kind: milestone |\n<!--- gbrain:facts:end -->\n","timeline":""},"probe":null}
+{"id":"t-st-01","set":"repairable","adversarial":null,"cls":"short_row_trailing","kind":"takes","section":"body","page_visibility":"private","tags":[],"note":"since and source dropped","page":{"compiled_truth":"# Notes t-st-01\n\nWorking notes kept by the brain owner.\n\n<!--- gbrain:takes:begin -->\n| # | claim | kind | who | weight | since | source |\n|---|---|---|---|---|---|---|\n| 1 | Remote-first teams ship faster | take | brain | 0.7 | 2026-01-10 | team retro |\n| 2 | Rates fall by Q3 | bet | people/alice-example | 0.6 |\n<!--- gbrain:takes:end -->\n","timeline":""},"expected":{"compiled_truth":"# Notes t-st-01\n\nWorking notes kept by the brain owner.\n\n<!--- gbrain:takes:begin -->\n| # | claim | kind | who | weight | since | source |\n|---|-------|------|-----|--------|-------|--------|\n| 1 | Remote-first teams ship faster | take | brain | 0.7 | 2026-01-10 | team retro |\n| 2 | Rates fall by Q3 | bet | people/alice-example | 0.6 | | |\n<!--- gbrain:takes:end -->\n","timeline":""},"probe":null}
+{"id":"t-st-02","set":"repairable","adversarial":null,"cls":"short_row_trailing","kind":"takes","section":"body","page_visibility":"private","tags":[],"note":"company holder","page":{"compiled_truth":"# Notes t-st-02\n\nWorking notes kept by the brain owner.\n\n<!--- gbrain:takes:begin -->\n| # | claim | kind | who | weight | since | source |\n|---|-------|------|-----|--------|-------|--------|\n| 1 | Acme-example will be acquired within a year | hunch | companies/beta-example | 0.3 |\n<!--- gbrain:takes:end -->\n","timeline":""},"expected":{"compiled_truth":"# Notes t-st-02\n\nWorking notes kept by the brain owner.\n\n<!--- gbrain:takes:begin -->\n| # | claim | kind | who | weight | since | source |\n|---|-------|------|-----|--------|-------|--------|\n| 1 | Acme-example will be acquired within a year | hunch | companies/beta-example | 0.3 | | |\n<!--- gbrain:takes:end -->\n","timeline":""},"probe":null}
+{"id":"t-st-03","set":"repairable","adversarial":null,"cls":"short_row_trailing","kind":"takes","section":"body","page_visibility":"private","tags":["strike","link"],"note":"struck claim with a link","page":{"compiled_truth":"# Notes t-st-03\n\nWorking notes kept by the brain owner.\n\n<!--- gbrain:takes:begin -->\n| # | claim | kind | who | weight | since | source |\n|---|-------|------|-----|--------|-------|--------|\n| 3 | Gamma-example keeps its lead | take | people/bob-example | 0.6 | 2026-01-15 | board chat |\n| 4 | ~~[Gamma-example](https://example.com/g) wins the RFP~~ | bet | people/bob-example | 0.5 |\n<!--- gbrain:takes:end -->\n","timeline":""},"expected":{"compiled_truth":"# Notes t-st-03\n\nWorking notes kept by the brain owner.\n\n<!--- gbrain:takes:begin -->\n| # | claim | kind | who | weight | since | source |\n|---|-------|------|-----|--------|-------|--------|\n| 3 | Gamma-example keeps its lead | take | people/bob-example | 0.6 | 2026-01-15 | board chat |\n| 4 | ~~[Gamma-example](https://example.com/g) wins the RFP~~ | bet | people/bob-example | 0.5 | | |\n<!--- gbrain:takes:end -->\n","timeline":""},"probe":null}
+{"id":"t-st-04","set":"repairable","adversarial":null,"cls":"short_row_trailing","kind":"takes","section":"body","page_visibility":"private","tags":[],"note":"world holder","page":{"compiled_truth":"# Notes t-st-04\n\nWorking notes kept by the brain owner.\n\n<!--- gbrain:takes:begin -->\n| # | claim | kind | who | weight | since | source |\n|---|-------|------|-----|--------|-------|--------|\n| 2 | Open-weight models close the gap by 2027 | take | world | 0.8 |\n<!--- gbrain:takes:end -->\n","timeline":""},"expected":{"compiled_truth":"# Notes t-st-04\n\nWorking notes kept by the brain owner.\n\n<!--- gbrain:takes:begin -->\n| # | claim | kind | who | weight | since | source |\n|---|-------|------|-----|--------|-------|--------|\n| 2 | Open-weight models close the gap by 2027 | take | world | 0.8 | | |\n<!--- gbrain:takes:end -->\n","timeline":""},"probe":null}
+{"id":"t-st-05","set":"repairable","adversarial":null,"cls":"short_row_trailing","kind":"takes","section":"body","page_visibility":"private","tags":["number"],"note":"two short rows, money in a claim","page":{"compiled_truth":"# Notes t-st-05\n\nWorking notes kept by the brain owner.\n\n<!--- gbrain:takes:begin -->\n| # | claim | kind | who | weight | since | source |\n|---|-------|------|-----|--------|-------|--------|\n| 3 | Hiring slows in H2 | hunch | brain | 0.4 |\n| 4 | Seed valuations hold near $20M | bet | people/carol-example | 0.55 |\n<!--- gbrain:takes:end -->\n","timeline":""},"expected":{"compiled_truth":"# Notes t-st-05\n\nWorking notes kept by the brain owner.\n\n<!--- gbrain:takes:begin -->\n| # | claim | kind | who | weight | since | source |\n|---|-------|------|-----|--------|-------|--------|\n| 3 | Hiring slows in H2 | hunch | brain | 0.4 | | |\n| 4 | Seed valuations hold near $20M | bet | people/carol-example | 0.55 | | |\n<!--- gbrain:takes:end -->\n","timeline":""},"probe":null}
+{"id":"f-sg-01","set":"repairable","adversarial":null,"cls":"short_row_gap","kind":"facts","section":"body","page_visibility":"private","tags":[],"note":"valid_until dropped: the last cell is the source","page":{"compiled_truth":"# Notes f-sg-01\n\nWorking notes kept by the brain owner.\n\n<!--- gbrain:facts:begin -->\n| # | claim | kind | confidence | visibility | notability | valid_from | valid_until | source | context |\n|---|-------|------|------------|------------|------------|------------|-------------|--------|---------|\n| 1 | Acme-example signed a two-year lease in Austin | event | 0.9 | private | high | 2026-02-11 | | lease summary | |\n| 2 | Carol-example joined acme-example as CTO | event | 0.9 | private | high | 2026-04-01 | intro call |\n<!--- gbrain:facts:end -->\n","timeline":""},"expected":{"compiled_truth":"# Notes f-sg-01\n\nWorking notes kept by the brain owner.\n\n<!--- gbrain:facts:begin -->\n| # | claim | kind | confidence | visibility | notability | valid_from | valid_until | source | context |\n|---|-------|------|------------|------------|------------|------------|-------------|--------|---------|\n| 1 | Acme-example signed a two-year lease in Austin | event | 0.9 | private | high | 2026-02-11 | | lease summary | |\n| 2 | Carol-example joined acme-example as CTO | event | 0.9 | private | high | 2026-04-01 | | intro call | |\n<!--- gbrain:facts:end -->\n","timeline":""},"probe":null}
+{"id":"f-sg-02","set":"repairable","adversarial":null,"cls":"short_row_gap","kind":"facts","section":"body","page_visibility":"private","tags":["link"],"note":"both dates dropped: a link source and a context note follow","page":{"compiled_truth":"# Notes f-sg-02\n\nWorking notes kept by the brain owner.\n\n<!--- gbrain:facts:begin -->\n| # | claim | kind | confidence | visibility | notability | valid_from | valid_until | source | context |\n|---|-------|------|------------|------------|------------|------------|-------------|--------|---------|\n| 3 | Alice-example dislikes cold email | preference | 0.8 | private | medium | [call notes](https://example.com/notes/17) | mentioned again at the offsite |\n<!--- gbrain:facts:end -->\n","timeline":""},"expected":{"compiled_truth":"# Notes f-sg-02\n\nWorking notes kept by the brain owner.\n\n<!--- gbrain:facts:begin -->\n| # | claim | kind | confidence | visibility | notability | valid_from | valid_until | source | context |\n|---|-------|------|------------|------------|------------|------------|-------------|--------|---------|\n| 3 | Alice-example dislikes cold email | preference | 0.8 | private | medium | | | [call notes](https://example.com/notes/17) | mentioned again at the offsite |\n<!--- gbrain:facts:end -->\n","timeline":""},"probe":null}
+{"id":"f-sg-03","set":"repairable","adversarial":null,"cls":"short_row_gap","kind":"facts","section":"body","page_visibility":"private","tags":["date_meaning"],"note":"the claim says the pilot ends on the date, so it is valid_until","page":{"compiled_truth":"# Notes f-sg-03\n\nWorking notes kept by the brain owner.\n\n<!--- gbrain:facts:begin -->\n| # | claim | kind | confidence | visibility | notability | valid_from | valid_until | source | context |\n|---|-------|------|------------|------------|------------|------------|-------------|--------|---------|\n| 4 | Beta-example's pilot with acme-example ends on 2026-06-30 | commitment | 0.75 | private | medium | 2026-06-30 | contract summary |\n<!--- gbrain:facts:end -->\n","timeline":""},"expected":{"compiled_truth":"# Notes f-sg-03\n\nWorking notes kept by the brain owner.\n\n<!--- gbrain:facts:begin -->\n| # | claim | kind | confidence | visibility | notability | valid_from | valid_until | source | context |\n|---|-------|------|------------|------------|------------|------------|-------------|--------|---------|\n| 4 | Beta-example's pilot with acme-example ends on 2026-06-30 | commitment | 0.75 | private | medium | | 2026-06-30 | contract summary | |\n<!--- gbrain:facts:end -->\n","timeline":""},"probe":null}
+{"id":"f-sg-04","set":"repairable","adversarial":null,"cls":"short_row_gap","kind":"facts","section":"body","page_visibility":"world","tags":["world"],"note":"no dates: the only optional cell is the source","page":{"compiled_truth":"# Notes f-sg-04\n\nWorking notes kept by the brain owner.\n\n<!--- gbrain:facts:begin -->\n| # | claim | kind | confidence | visibility | notability | valid_from | valid_until | source | context |\n|---|-------|------|------------|------------|------------|------------|-------------|--------|---------|\n| 5 | Gamma-example's CEO is carol-example | fact | 1.0 | world | high | company site |\n<!--- gbrain:facts:end -->\n","timeline":""},"expected":{"compiled_truth":"# Notes f-sg-04\n\nWorking notes kept by the brain owner.\n\n<!--- gbrain:facts:begin -->\n| # | claim | kind | confidence | visibility | notability | valid_from | valid_until | source | context |\n|---|-------|------|------------|------------|------------|------------|-------------|--------|---------|\n| 5 | Gamma-example's CEO is carol-example | fact | 1.0 | world | high | | | company site | |\n<!--- gbrain:facts:end -->\n","timeline":""},"probe":null}
+{"id":"f-sg-05","set":"repairable","adversarial":null,"cls":"short_row_gap","kind":"facts","section":"body","page_visibility":"private","tags":["link","number"],"note":"valid_until dropped, link source, money in the claim","page":{"compiled_truth":"# Notes f-sg-05\n\nWorking notes kept by the brain owner.\n\n<!--- gbrain:facts:begin -->\n| # | claim | kind | confidence | visibility | notability | valid_from | valid_until | source | context |\n|---|-------|------|------------|------------|------------|------------|-------------|--------|---------|\n| 8 | Fund-a led acme-example's seed at a $12M cap | event | 0.95 | private | high | 2025-10-09 | [term sheet](https://example.com/ts) |\n<!--- gbrain:facts:end -->\n","timeline":""},"expected":{"compiled_truth":"# Notes f-sg-05\n\nWorking notes kept by the brain owner.\n\n<!--- gbrain:facts:begin -->\n| # | claim | kind | confidence | visibility | notability | valid_from | valid_until | source | context |\n|---|-------|------|------------|------------|------------|------------|-------------|--------|---------|\n| 8 | Fund-a led acme-example's seed at a $12M cap | event | 0.95 | private | high | 2025-10-09 | | [term sheet](https://example.com/ts) | |\n<!--- gbrain:facts:end -->\n","timeline":""},"probe":null}
+{"id":"f-sg-06","set":"repairable","adversarial":null,"cls":"short_row_gap","kind":"facts","section":"body","page_visibility":"private","tags":["strike"],"note":"struck row, valid_until dropped","page":{"compiled_truth":"# Notes f-sg-06\n\nWorking notes kept by the brain owner.\n\n<!--- gbrain:facts:begin -->\n| # | claim | kind | confidence | visibility | notability | valid_from | valid_until | source | context |\n|---|-------|------|------------|------------|------------|------------|-------------|--------|---------|\n| 9 | ~~Carol-example leads sales~~ | fact | 0.9 | private | medium | 2025-06-01 | org chart |\n| 10 | Dave-example leads sales | fact | 0.9 | private | medium | 2026-02-01 | | org chart | |\n<!--- gbrain:facts:end -->\n","timeline":""},"expected":{"compiled_truth":"# Notes f-sg-06\n\nWorking notes kept by the brain owner.\n\n<!--- gbrain:facts:begin -->\n| # | claim | kind | confidence | visibility | notability | valid_from | valid_until | source | context |\n|---|-------|------|------------|------------|------------|------------|-------------|--------|---------|\n| 9 | ~~Carol-example leads sales~~ | fact | 0.9 | private | medium | 2025-06-01 | | org chart | |\n| 10 | Dave-example leads sales | fact | 0.9 | private | medium | 2026-02-01 | | org chart | |\n<!--- gbrain:facts:end -->\n","timeline":""},"probe":null}
+{"id":"f-sg-07","set":"repairable","adversarial":null,"cls":"short_row_gap","kind":"facts","section":"body","page_visibility":"private","tags":["pipe"],"note":"valid_until dropped, escaped pipe in the source","page":{"compiled_truth":"# Notes f-sg-07\n\nWorking notes kept by the brain owner.\n\n<!--- gbrain:facts:begin -->\n| # | claim | kind | confidence | visibility | notability | valid_from | valid_until | source | context |\n|---|-------|------|------------|------------|------------|------------|-------------|--------|---------|\n| 10 | Beta-example renewed with gamma-example | event | 0.85 | private | medium | 2026-02-20 | renewal email \\| thread 3 |\n<!--- gbrain:facts:end -->\n","timeline":""},"expected":{"compiled_truth":"# Notes f-sg-07\n\nWorking notes kept by the brain owner.\n\n<!--- gbrain:facts:begin -->\n| # | claim | kind | confidence | visibility | notability | valid_from | valid_until | source | context |\n|---|-------|------|------------|------------|------------|------------|-------------|--------|---------|\n| 10 | Beta-example renewed with gamma-example | event | 0.85 | private | medium | 2026-02-20 | | renewal email \\| thread 3 | |\n<!--- gbrain:facts:end -->\n","timeline":""},"probe":null}
+{"id":"f-nh-01","set":"repairable","adversarial":null,"cls":"no_header","kind":"facts","section":"body","page_visibility":"private","tags":[],"note":"two complete rows, no header or separator","page":{"compiled_truth":"# Notes f-nh-01\n\nWorking notes kept by the brain owner.\n\n<!--- gbrain:facts:begin -->\n| 1 | Bob-example lives in Denver | fact | 0.9 | private | low | 2025-08-01 | | intro email | |\n| 2 | Bob-example coaches youth soccer | fact | 0.7 | private | low | | | coffee chat | |\n<!--- gbrain:facts:end -->\n","timeline":""},"expected":{"compiled_truth":"# Notes f-nh-01\n\nWorking notes kept by the brain owner.\n\n<!--- gbrain:facts:begin -->\n| # | claim | kind | confidence | visibility | notability | valid_from | valid_until | source | context |\n|---|-------|------|------------|------------|------------|------------|-------------|--------|---------|\n| 1 | Bob-example lives in Denver | fact | 0.9 | private | low | 2025-08-01 | | intro email | |\n| 2 | Bob-example coaches youth soccer | fact | 0.7 | private | low | | | coffee chat | |\n<!--- gbrain:facts:end -->\n","timeline":""},"probe":null}
+{"id":"f-nh-02","set":"repairable","adversarial":null,"cls":"no_header","kind":"facts","section":"body","page_visibility":"private","tags":[],"note":"separator but no header; rows without the context cell","page":{"compiled_truth":"# Notes f-nh-02\n\nWorking notes kept by the brain owner.\n\n<!--- gbrain:facts:begin -->\n|---|---|---|---|---|---|---|---|---|---|\n| 1 | Acme-example uses usage-based pricing | fact | 0.9 | private | medium | 2026-01-01 | | pricing page |\n| 2 | Acme-example targets mid-market buyers | belief | 0.6 | private | medium | | | sales call |\n| 3 | Acme-example will add an annual plan | commitment | 0.7 | private | low | 2026-07-01 | | roadmap |\n<!--- gbrain:facts:end -->\n","timeline":""},"expected":{"compiled_truth":"# Notes f-nh-02\n\nWorking notes kept by the brain owner.\n\n<!--- gbrain:facts:begin -->\n| # | claim | kind | confidence | visibility | notability | valid_from | valid_until | source | context |\n|---|-------|------|------------|------------|------------|------------|-------------|--------|---------|\n| 1 | Acme-example uses usage-based pricing | fact | 0.9 | private | medium | 2026-01-01 | | pricing page | |\n| 2 | Acme-example targets mid-market buyers | belief | 0.6 | private | medium | | | sales call | |\n| 3 | Acme-example will add an annual plan | commitment | 0.7 | private | low | 2026-07-01 | | roadmap | |\n<!--- gbrain:facts:end -->\n","timeline":""},"probe":null}
+{"id":"f-nh-03","set":"repairable","adversarial":null,"cls":"no_header","kind":"facts","section":"body","page_visibility":"private","tags":["wide","number"],"note":"typed rows (14 cells) with 120k and 1,250 values: the wide header","page":{"compiled_truth":"# Notes f-nh-03\n\nWorking notes kept by the brain owner.\n\n<!--- gbrain:facts:begin -->\n| 1 | Acme-example MRR | fact | 0.9 | private | high | 2026-05-01 | | finance deck | | mrr | 120k | USD | monthly |\n| 2 | Acme-example headcount | fact | 0.85 | private | medium | 2026-05-01 | | HR export | | headcount | 1,250 | people | point in time |\n<!--- gbrain:facts:end -->\n","timeline":""},"expected":{"compiled_truth":"# Notes f-nh-03\n\nWorking notes kept by the brain owner.\n\n<!--- gbrain:facts:begin -->\n| # | claim | kind | confidence | visibility | notability | valid_from | valid_until | source | context | claim_metric | claim_value | claim_unit | claim_period |\n|---|-------|------|------------|------------|------------|------------|-------------|--------|---------|--------------|-------------|------------|--------------|\n| 1 | Acme-example MRR | fact | 0.9 | private | high | 2026-05-01 | | finance deck | | mrr | 120k | USD | monthly |\n| 2 | Acme-example headcount | fact | 0.85 | private | medium | 2026-05-01 | | HR export | | headcount | 1,250 | people | point in time |\n<!--- gbrain:facts:end -->\n","timeline":""},"probe":null}
+{"id":"f-nh-04","set":"repairable","adversarial":null,"cls":"no_header","kind":"facts","section":"body","page_visibility":"world","tags":["world","strike","link"],"note":"world page, struck row superseded by a row with a link","page":{"compiled_truth":"# Notes f-nh-04\n\nWorking notes kept by the brain owner.\n\n<!--- gbrain:facts:begin -->\n| 1 | Gamma-example is hiring in Lisbon | fact | 0.8 | world | low | 2026-02-01 | | [careers page](https://example.com/careers) | |\n| 2 | ~~Gamma-example's only office is in Porto~~ | fact | 0.9 | world | low | 2025-01-01 | 2026-02-01 | careers page | superseded by #1 |\n<!--- gbrain:facts:end -->\n","timeline":""},"expected":{"compiled_truth":"# Notes f-nh-04\n\nWorking notes kept by the brain owner.\n\n<!--- gbrain:facts:begin -->\n| # | claim | kind | confidence | visibility | notability | valid_from | valid_until | source | context |\n|---|-------|------|------------|------------|------------|------------|-------------|--------|---------|\n| 1 | Gamma-example is hiring in Lisbon | fact | 0.8 | world | low | 2026-02-01 | | [careers page](https://example.com/careers) | |\n| 2 | ~~Gamma-example's only office is in Porto~~ | fact | 0.9 | world | low | 2025-01-01 | 2026-02-01 | careers page | superseded by #1 |\n<!--- gbrain:facts:end -->\n","timeline":""},"probe":null}
+{"id":"f-nh-05","set":"repairable","adversarial":null,"cls":"no_header","kind":"facts","section":"timeline","page_visibility":"private","tags":["timeline"],"note":"timeline fence without a header","page":{"compiled_truth":"# Notes f-nh-05\n\nWorking notes kept by the brain owner.\n","timeline":"<!--- gbrain:facts:begin -->\n| 4 | Delta-example opened a waitlist | event | 0.9 | private | medium | 2026-03-02 | | launch email | |\n| 5 | Delta-example crossed 10k signups | event | 0.8 | private | high | 2026-04-11 | | founder update | |\n<!--- gbrain:facts:end -->\n"},"expected":{"compiled_truth":"# Notes f-nh-05\n\nWorking notes kept by the brain owner.\n","timeline":"<!--- gbrain:facts:begin -->\n| # | claim | kind | confidence | visibility | notability | valid_from | valid_until | source | context |\n|---|-------|------|------------|------------|------------|------------|-------------|--------|---------|\n| 4 | Delta-example opened a waitlist | event | 0.9 | private | medium | 2026-03-02 | | launch email | |\n| 5 | Delta-example crossed 10k signups | event | 0.8 | private | high | 2026-04-11 | | founder update | |\n<!--- gbrain:facts:end -->\n"},"probe":null}
+{"id":"f-nh-06","set":"repairable","adversarial":null,"cls":"no_header","kind":"facts","section":"body","page_visibility":"private","tags":["br"],"note":"no header; a context with a <br> line break","page":{"compiled_truth":"# Notes f-nh-06\n\nWorking notes kept by the brain owner.\n\n<!--- gbrain:facts:begin -->\n| 3 | Bob-example's offsite is in May | event | 0.7 | private | low | 2026-05-12 | | calendar | agenda TBD<br>venue booked |\n| 4 | Bob-example invited eight founders | fact | 0.8 | private | low | 2026-04-20 | | invite list |\n<!--- gbrain:facts:end -->\n","timeline":""},"expected":{"compiled_truth":"# Notes f-nh-06\n\nWorking notes kept by the brain owner.\n\n<!--- gbrain:facts:begin -->\n| # | claim | kind | confidence | visibility | notability | valid_from | valid_until | source | context |\n|---|-------|------|------------|------------|------------|------------|-------------|--------|---------|\n| 3 | Bob-example's offsite is in May | event | 0.7 | private | low | 2026-05-12 | | calendar | agenda TBD<br>venue booked |\n| 4 | Bob-example invited eight founders | fact | 0.8 | private | low | 2026-04-20 | | invite list | |\n<!--- gbrain:facts:end -->\n","timeline":""},"probe":null}
+{"id":"t-nh-01","set":"repairable","adversarial":null,"cls":"no_header","kind":"takes","section":"body","page_visibility":"private","tags":[],"note":"two complete rows","page":{"compiled_truth":"# Notes t-nh-01\n\nWorking notes kept by the brain owner.\n\n<!--- gbrain:takes:begin -->\n| 1 | Acme-example should raise prices | take | brain | 0.7 | 2026-01-05 | pricing review |\n| 2 | Acme-example churn drops next quarter | bet | people/alice-example | 0.55 | 2026-01-05 | QBR |\n<!--- gbrain:takes:end -->\n","timeline":""},"expected":{"compiled_truth":"# Notes t-nh-01\n\nWorking notes kept by the brain owner.\n\n<!--- gbrain:takes:begin -->\n| # | claim | kind | who | weight | since | source |\n|---|-------|------|-----|--------|-------|--------|\n| 1 | Acme-example should raise prices | take | brain | 0.7 | 2026-01-05 | pricing review |\n| 2 | Acme-example churn drops next quarter | bet | people/alice-example | 0.55 | 2026-01-05 | QBR |\n<!--- gbrain:takes:end -->\n","timeline":""},"probe":null}
+{"id":"t-nh-02","set":"repairable","adversarial":null,"cls":"no_header","kind":"takes","section":"body","page_visibility":"private","tags":[],"note":"three rows, mixed holders, one without a source","page":{"compiled_truth":"# Notes t-nh-02\n\nWorking notes kept by the brain owner.\n\n<!--- gbrain:takes:begin -->\n| 1 | Vertical AI tools win in legal | take | world | 0.6 | 2026-02-01 | industry report |\n| 2 | Beta-example ships an API this year | bet | companies/beta-example | 0.5 | 2026-02-01 |\n| 3 | The market softens in Q4 | hunch | brain | 0.3 | 2026-02-01 | gut feel |\n<!--- gbrain:takes:end -->\n","timeline":""},"expected":{"compiled_truth":"# Notes t-nh-02\n\nWorking notes kept by the brain owner.\n\n<!--- gbrain:takes:begin -->\n| # | claim | kind | who | weight | since | source |\n|---|-------|------|-----|--------|-------|--------|\n| 1 | Vertical AI tools win in legal | take | world | 0.6 | 2026-02-01 | industry report |\n| 2 | Beta-example ships an API this year | bet | companies/beta-example | 0.5 | 2026-02-01 | |\n| 3 | The market softens in Q4 | hunch | brain | 0.3 | 2026-02-01 | gut feel |\n<!--- gbrain:takes:end -->\n","timeline":""},"probe":null}
+{"id":"t-nh-03","set":"repairable","adversarial":null,"cls":"no_header","kind":"takes","section":"body","page_visibility":"private","tags":["strike","link"],"note":"struck row and a link","page":{"compiled_truth":"# Notes t-nh-03\n\nWorking notes kept by the brain owner.\n\n<!--- gbrain:takes:begin -->\n| 1 | ~~Delta-example stays seed-stage through 2026~~ | bet | people/bob-example | 0.4 | 2025-12-01 | [notes](https://example.com/n/4) |\n| 2 | Delta-example raises a Series A in 2026 | bet | people/bob-example | 0.6 | 2026-03-01 | partner sync |\n<!--- gbrain:takes:end -->\n","timeline":""},"expected":{"compiled_truth":"# Notes t-nh-03\n\nWorking notes kept by the brain owner.\n\n<!--- gbrain:takes:begin -->\n| # | claim | kind | who | weight | since | source |\n|---|-------|------|-----|--------|-------|--------|\n| 1 | ~~Delta-example stays seed-stage through 2026~~ | bet | people/bob-example | 0.4 | 2025-12-01 | [notes](https://example.com/n/4) |\n| 2 | Delta-example raises a Series A in 2026 | bet | people/bob-example | 0.6 | 2026-03-01 | partner sync |\n<!--- gbrain:takes:end -->\n","timeline":""},"probe":null}
+{"id":"t-nh-04","set":"repairable","adversarial":null,"cls":"no_header","kind":"takes","section":"body","page_visibility":"private","tags":["pipe"],"note":"separator but no header; escaped pipe in a source","page":{"compiled_truth":"# Notes t-nh-04\n\nWorking notes kept by the brain owner.\n\n<!--- gbrain:takes:begin -->\n|---|---|---|---|---|---|---|\n| 5 | Fund-a should lead the round | take | people/carol-example | 0.65 | 2026-04-01 | IC memo \\| draft 2 |\n<!--- gbrain:takes:end -->\n","timeline":""},"expected":{"compiled_truth":"# Notes t-nh-04\n\nWorking notes kept by the brain owner.\n\n<!--- gbrain:takes:begin -->\n| # | claim | kind | who | weight | since | source |\n|---|-------|------|-----|--------|-------|--------|\n| 5 | Fund-a should lead the round | take | people/carol-example | 0.65 | 2026-04-01 | IC memo \\| draft 2 |\n<!--- gbrain:takes:end -->\n","timeline":""},"probe":null}
+{"id":"f-rb-01","set":"repairable","adversarial":null,"cls":"row_before_header","kind":"facts","section":"body","page_visibility":"private","tags":[],"note":"one complete row above the header","page":{"compiled_truth":"# Notes f-rb-01\n\nWorking notes kept by the brain owner.\n\n<!--- gbrain:facts:begin -->\n| 3 | Acme-example renewed its office lease | event | 0.8 | private | low | 2026-01-30 | | lease summary | |\n| # | claim | kind | confidence | visibility | notability | valid_from | valid_until | source | context |\n|---|-------|------|------------|------------|------------|------------|-------------|--------|---------|\n| 1 | Acme-example signed a two-year lease in Austin | event | 0.9 | private | high | 2026-02-11 | | lease summary | |\n| 2 | Acme-example sublets one floor | fact | 0.6 | private | low | 2026-02-15 | | facilities email | |\n<!--- gbrain:facts:end -->\n","timeline":""},"expected":{"compiled_truth":"# Notes f-rb-01\n\nWorking notes kept by the brain owner.\n\n<!--- gbrain:facts:begin -->\n| # | claim | kind | confidence | visibility | notability | valid_from | valid_until | source | context |\n|---|-------|------|------------|------------|------------|------------|-------------|--------|---------|\n| 3 | Acme-example renewed its office lease | event | 0.8 | private | low | 2026-01-30 | | lease summary | |\n| 1 | Acme-example signed a two-year lease in Austin | event | 0.9 | private | high | 2026-02-11 | | lease summary | |\n| 2 | Acme-example sublets one floor | fact | 0.6 | private | low | 2026-02-15 | | facilities email | |\n<!--- gbrain:facts:end -->\n","timeline":""},"probe":null}
+{"id":"f-rb-02","set":"repairable","adversarial":null,"cls":"row_before_header","kind":"facts","section":"body","page_visibility":"private","tags":[],"note":"two rows above the header","page":{"compiled_truth":"# Notes f-rb-02\n\nWorking notes kept by the brain owner.\n\n<!--- gbrain:facts:begin -->\n| 4 | Carol-example speaks Portuguese | fact | 0.9 | private | low | | | intro call | |\n| 5 | Carol-example prefers mornings for calls | preference | 0.7 | private | low | | | scheduling thread | |\n| # | claim | kind | confidence | visibility | notability | valid_from | valid_until | source | context |\n|---|-------|------|------------|------------|------------|------------|-------------|--------|---------|\n| 6 | Carol-example joined in 2024 | fact | 1.0 | private | medium | 2024-03-01 | | HR export | |\n<!--- gbrain:facts:end -->\n","timeline":""},"expected":{"compiled_truth":"# Notes f-rb-02\n\nWorking notes kept by the brain owner.\n\n<!--- gbrain:facts:begin -->\n| # | claim | kind | confidence | visibility | notability | valid_from | valid_until | source | context |\n|---|-------|------|------------|------------|------------|------------|-------------|--------|---------|\n| 4 | Carol-example speaks Portuguese | fact | 0.9 | private | low | | | intro call | |\n| 5 | Carol-example prefers mornings for calls | preference | 0.7 | private | low | | | scheduling thread | |\n| 6 | Carol-example joined in 2024 | fact | 1.0 | private | medium | 2024-03-01 | | HR export | |\n<!--- gbrain:facts:end -->\n","timeline":""},"probe":null}
+{"id":"f-rb-03","set":"repairable","adversarial":null,"cls":"row_before_header","kind":"facts","section":"body","page_visibility":"private","tags":[],"note":"a short row above the header","page":{"compiled_truth":"# Notes f-rb-03\n\nWorking notes kept by the brain owner.\n\n<!--- gbrain:facts:begin -->\n| 7 | Beta-example moved to weekly releases | event | 0.85 | private | medium | 2026-03-09 |\n| # | claim | kind | confidence | visibility | notability | valid_from | valid_until | source | context |\n|---|-------|------|------------|------------|------------|------------|-------------|--------|---------|\n| 8 | Beta-example has 40 engineers | fact | 0.8 | private | low | 2026-03-01 | | org chart | |\n<!--- gbrain:facts:end -->\n","timeline":""},"expected":{"compiled_truth":"# Notes f-rb-03\n\nWorking notes kept by the brain owner.\n\n<!--- gbrain:facts:begin -->\n| # | claim | kind | confidence | visibility | notability | valid_from | valid_until | source | context |\n|---|-------|------|------------|------------|------------|------------|-------------|--------|---------|\n| 7 | Beta-example moved to weekly releases | event | 0.85 | private | medium | 2026-03-09 | | | |\n| 8 | Beta-example has 40 engineers | fact | 0.8 | private | low | 2026-03-01 | | org chart | |\n<!--- gbrain:facts:end -->\n","timeline":""},"probe":null}
+{"id":"f-rb-04","set":"repairable","adversarial":null,"cls":"row_before_header","kind":"facts","section":"body","page_visibility":"private","tags":["pipe","link"],"note":"row above the header with an escaped pipe and a link","page":{"compiled_truth":"# Notes f-rb-04\n\nWorking notes kept by the brain owner.\n\n<!--- gbrain:facts:begin -->\n| 9 | Gamma-example offers SSO \\| SCIM on the team plan | fact | 0.9 | private | medium | 2026-02-01 | | [docs](https://example.com/docs/sso) | |\n| # | claim | kind | confidence | visibility | notability | valid_from | valid_until | source | context |\n|---|-------|------|------------|------------|------------|------------|-------------|--------|---------|\n| 10 | Gamma-example added audit logs | event | 0.8 | private | low | 2026-02-20 | | changelog | |\n<!--- gbrain:facts:end -->\n","timeline":""},"expected":{"compiled_truth":"# Notes f-rb-04\n\nWorking notes kept by the brain owner.\n\n<!--- gbrain:facts:begin -->\n| # | claim | kind | confidence | visibility | notability | valid_from | valid_until | source | context |\n|---|-------|------|------------|------------|------------|------------|-------------|--------|---------|\n| 9 | Gamma-example offers SSO \\| SCIM on the team plan | fact | 0.9 | private | medium | 2026-02-01 | | [docs](https://example.com/docs/sso) | |\n| 10 | Gamma-example added audit logs | event | 0.8 | private | low | 2026-02-20 | | changelog | |\n<!--- gbrain:facts:end -->\n","timeline":""},"probe":null}
+{"id":"f-rb-05","set":"repairable","adversarial":null,"cls":"row_before_header","kind":"facts","section":"body","page_visibility":"world","tags":["world"],"note":"world page, world row above the header","page":{"compiled_truth":"# Notes f-rb-05\n\nWorking notes kept by the brain owner.\n\n<!--- gbrain:facts:begin -->\n| 1 | Delta-example is based in Oslo | fact | 1.0 | world | medium | | | company site | |\n| # | claim | kind | confidence | visibility | notability | valid_from | valid_until | source | context |\n|---|-------|------|------------|------------|------------|------------|-------------|--------|---------|\n| 2 | Delta-example sells to utilities | fact | 0.8 | world | low | | | company site | |\n<!--- gbrain:facts:end -->\n","timeline":""},"expected":{"compiled_truth":"# Notes f-rb-05\n\nWorking notes kept by the brain owner.\n\n<!--- gbrain:facts:begin -->\n| # | claim | kind | confidence | visibility | notability | valid_from | valid_until | source | context |\n|---|-------|------|------------|------------|------------|------------|-------------|--------|---------|\n| 1 | Delta-example is based in Oslo | fact | 1.0 | world | medium | | | company site | |\n| 2 | Delta-example sells to utilities | fact | 0.8 | world | low | | | company site | |\n<!--- gbrain:facts:end -->\n","timeline":""},"probe":null}
+{"id":"t-rb-01","set":"repairable","adversarial":null,"cls":"row_before_header","kind":"takes","section":"body","page_visibility":"private","tags":[],"note":"one row above the header","page":{"compiled_truth":"# Notes t-rb-01\n\nWorking notes kept by the brain owner.\n\n<!--- gbrain:takes:begin -->\n| 1 | Acme-example is underpriced | take | people/alice-example | 0.6 | 2026-01-12 | board dinner |\n| # | claim | kind | who | weight | since | source |\n|---|-------|------|-----|--------|-------|--------|\n| 2 | Acme-example doubles revenue this year | bet | people/alice-example | 0.45 | 2026-01-12 | board dinner |\n<!--- gbrain:takes:end -->\n","timeline":""},"expected":{"compiled_truth":"# Notes t-rb-01\n\nWorking notes kept by the brain owner.\n\n<!--- gbrain:takes:begin -->\n| # | claim | kind | who | weight | since | source |\n|---|-------|------|-----|--------|-------|--------|\n| 1 | Acme-example is underpriced | take | people/alice-example | 0.6 | 2026-01-12 | board dinner |\n| 2 | Acme-example doubles revenue this year | bet | people/alice-example | 0.45 | 2026-01-12 | board dinner |\n<!--- gbrain:takes:end -->\n","timeline":""},"probe":null}
+{"id":"t-rb-02","set":"repairable","adversarial":null,"cls":"row_before_header","kind":"takes","section":"body","page_visibility":"private","tags":[],"note":"a short row above the header","page":{"compiled_truth":"# Notes t-rb-02\n\nWorking notes kept by the brain owner.\n\n<!--- gbrain:takes:begin -->\n| 3 | Usage pricing beats seats for infra | take | brain | 0.75 |\n| # | claim | kind | who | weight | since | source |\n|---|-------|------|-----|--------|-------|--------|\n| 4 | Beta-example switches to usage pricing | bet | brain | 0.5 | 2026-02-02 | pricing review |\n<!--- gbrain:takes:end -->\n","timeline":""},"expected":{"compiled_truth":"# Notes t-rb-02\n\nWorking notes kept by the brain owner.\n\n<!--- gbrain:takes:begin -->\n| # | claim | kind | who | weight | since | source |\n|---|-------|------|-----|--------|-------|--------|\n| 3 | Usage pricing beats seats for infra | take | brain | 0.75 | | |\n| 4 | Beta-example switches to usage pricing | bet | brain | 0.5 | 2026-02-02 | pricing review |\n<!--- gbrain:takes:end -->\n","timeline":""},"probe":null}
+{"id":"t-rb-03","set":"repairable","adversarial":null,"cls":"row_before_header","kind":"takes","section":"body","page_visibility":"private","tags":["strike"],"note":"two rows above the header, one struck","page":{"compiled_truth":"# Notes t-rb-03\n\nWorking notes kept by the brain owner.\n\n<!--- gbrain:takes:begin -->\n| 5 | ~~Gamma-example IPOs in 2026~~ | bet | companies/fund-a | 0.3 | 2025-09-01 | LP letter |\n| 6 | Gamma-example IPOs in 2027 | bet | companies/fund-a | 0.4 | 2026-03-01 | LP letter |\n| # | claim | kind | who | weight | since | source |\n|---|-------|------|-----|--------|-------|--------|\n| 7 | Gamma-example stays founder-led | take | companies/fund-a | 0.7 | 2026-03-01 | LP letter |\n<!--- gbrain:takes:end -->\n","timeline":""},"expected":{"compiled_truth":"# Notes t-rb-03\n\nWorking notes kept by the brain owner.\n\n<!--- gbrain:takes:begin -->\n| # | claim | kind | who | weight | since | source |\n|---|-------|------|-----|--------|-------|--------|\n| 5 | ~~Gamma-example IPOs in 2026~~ | bet | companies/fund-a | 0.3 | 2025-09-01 | LP letter |\n| 6 | Gamma-example IPOs in 2027 | bet | companies/fund-a | 0.4 | 2026-03-01 | LP letter |\n| 7 | Gamma-example stays founder-led | take | companies/fund-a | 0.7 | 2026-03-01 | LP letter |\n<!--- gbrain:takes:end -->\n","timeline":""},"probe":null}
+{"id":"f-ex-01","set":"repairable","adversarial":null,"cls":"extra_cells","kind":"facts","section":"body","page_visibility":"private","tags":[],"note":"an empty cell after the claim","page":{"compiled_truth":"# Notes f-ex-01\n\nWorking notes kept by the brain owner.\n\n<!--- gbrain:facts:begin -->\n| # | claim | kind | confidence | visibility | notability | valid_from | valid_until | source | context |\n|---|-------|------|------------|------------|------------|------------|-------------|--------|---------|\n| 1 | Acme-example signed a two-year lease in Austin | event | 0.9 | private | high | 2026-02-11 | | lease summary | |\n| 2 | Acme-example opened a Denver office | | event | 0.8 | private | low | 2026-02-01 | | press release | |\n<!--- gbrain:facts:end -->\n","timeline":""},"expected":{"compiled_truth":"# Notes f-ex-01\n\nWorking notes kept by the brain owner.\n\n<!--- gbrain:facts:begin -->\n| # | claim | kind | confidence | visibility | notability | valid_from | valid_until | source | context |\n|---|-------|------|------------|------------|------------|------------|-------------|--------|---------|\n| 1 | Acme-example signed a two-year lease in Austin | event | 0.9 | private | high | 2026-02-11 | | lease summary | |\n| 2 | Acme-example opened a Denver office | event | 0.8 | private | low | 2026-02-01 | | press release | |\n<!--- gbrain:facts:end -->\n","timeline":""},"probe":null}
+{"id":"f-ex-02","set":"repairable","adversarial":null,"cls":"extra_cells","kind":"facts","section":"body","page_visibility":"private","tags":[],"note":"an empty cell after the kind","page":{"compiled_truth":"# Notes f-ex-02\n\nWorking notes kept by the brain owner.\n\n<!--- gbrain:facts:begin -->\n| # | claim | kind | confidence | visibility | notability | valid_from | valid_until | source | context |\n|---|-------|------|------------|------------|------------|------------|-------------|--------|---------|\n| 3 | Bob-example agreed to mentor two founders | commitment | | 0.9 | private | medium | 2026-03-05 | | 1:1 notes | |\n<!--- gbrain:facts:end -->\n","timeline":""},"expected":{"compiled_truth":"# Notes f-ex-02\n\nWorking notes kept by the brain owner.\n\n<!--- gbrain:facts:begin -->\n| # | claim | kind | confidence | visibility | notability | valid_from | valid_until | source | context |\n|---|-------|------|------------|------------|------------|------------|-------------|--------|---------|\n| 3 | Bob-example agreed to mentor two founders | commitment | 0.9 | private | medium | 2026-03-05 | | 1:1 notes | |\n<!--- gbrain:facts:end -->\n","timeline":""},"probe":null}
+{"id":"f-ex-03","set":"repairable","adversarial":null,"cls":"extra_cells","kind":"facts","section":"body","page_visibility":"private","tags":[],"note":"an empty cell after the visibility","page":{"compiled_truth":"# Notes f-ex-03\n\nWorking notes kept by the brain owner.\n\n<!--- gbrain:facts:begin -->\n| # | claim | kind | confidence | visibility | notability | valid_from | valid_until | source | context |\n|---|-------|------|------------|------------|------------|------------|-------------|--------|---------|\n| 4 | Carol-example prefers written updates | preference | 0.75 | private | | medium | | | survey | |\n<!--- gbrain:facts:end -->\n","timeline":""},"expected":{"compiled_truth":"# Notes f-ex-03\n\nWorking notes kept by the brain owner.\n\n<!--- gbrain:facts:begin -->\n| # | claim | kind | confidence | visibility | notability | valid_from | valid_until | source | context |\n|---|-------|------|------------|------------|------------|------------|-------------|--------|---------|\n| 4 | Carol-example prefers written updates | preference | 0.75 | private | medium | | | survey | |\n<!--- gbrain:facts:end -->\n","timeline":""},"probe":null}
+{"id":"f-ex-04","set":"repairable","adversarial":null,"cls":"extra_cells","kind":"facts","section":"body","page_visibility":"private","tags":["number"],"note":"two empty cells inserted; a percentage in the claim","page":{"compiled_truth":"# Notes f-ex-04\n\nWorking notes kept by the brain owner.\n\n<!--- gbrain:facts:begin -->\n| # | claim | kind | confidence | visibility | notability | valid_from | valid_until | source | context |\n|---|-------|------|------------|------------|------------|------------|-------------|--------|---------|\n| 5 | Delta-example cut list prices 20% | | event | | 0.85 | private | medium | 2026-04-10 | | pricing page | |\n<!--- gbrain:facts:end -->\n","timeline":""},"expected":{"compiled_truth":"# Notes f-ex-04\n\nWorking notes kept by the brain owner.\n\n<!--- gbrain:facts:begin -->\n| # | claim | kind | confidence | visibility | notability | valid_from | valid_until | source | context |\n|---|-------|------|------------|------------|------------|------------|-------------|--------|---------|\n| 5 | Delta-example cut list prices 20% | event | 0.85 | private | medium | 2026-04-10 | | pricing page | |\n<!--- gbrain:facts:end -->\n","timeline":""},"probe":null}
+{"id":"f-ex-05","set":"repairable","adversarial":null,"cls":"extra_cells","kind":"facts","section":"body","page_visibility":"private","tags":[],"note":"a parenthetical note after the claim belongs in context","page":{"compiled_truth":"# Notes f-ex-05\n\nWorking notes kept by the brain owner.\n\n<!--- gbrain:facts:begin -->\n| # | claim | kind | confidence | visibility | notability | valid_from | valid_until | source | context |\n|---|-------|------|------------|------------|------------|------------|-------------|--------|---------|\n| 6 | Alice-example moved to Berlin | (relocation) | event | 0.8 | private | medium | 2026-01-10 | | email | |\n<!--- gbrain:facts:end -->\n","timeline":""},"expected":{"compiled_truth":"# Notes f-ex-05\n\nWorking notes kept by the brain owner.\n\n<!--- gbrain:facts:begin -->\n| # | claim | kind | confidence | visibility | notability | valid_from | valid_until | source | context |\n|---|-------|------|------------|------------|------------|------------|-------------|--------|---------|\n| 6 | Alice-example moved to Berlin | event | 0.8 | private | medium | 2026-01-10 | | email | (relocation) |\n<!--- gbrain:facts:end -->\n","timeline":""},"probe":null}
+{"id":"f-ex-06","set":"repairable","adversarial":null,"cls":"extra_cells","kind":"facts","section":"body","page_visibility":"private","tags":["wide","number"],"note":"typed row with an empty cell after the claim","page":{"compiled_truth":"# Notes f-ex-06\n\nWorking notes kept by the brain owner.\n\n<!--- gbrain:facts:begin -->\n| # | claim | kind | confidence | visibility | notability | valid_from | valid_until | source | context | claim_metric | claim_value | claim_unit | claim_period |\n|---|-------|------|------------|------------|------------|------------|-------------|--------|---------|--------------|-------------|------------|--------------|\n| 7 | Beta-example gross margin | | fact | 0.9 | private | high | 2026-06-30 | | Q2 report | | gross_margin | 0.62 | ratio | quarterly |\n<!--- gbrain:facts:end -->\n","timeline":""},"expected":{"compiled_truth":"# Notes f-ex-06\n\nWorking notes kept by the brain owner.\n\n<!--- gbrain:facts:begin -->\n| # | claim | kind | confidence | visibility | notability | valid_from | valid_until | source | context | claim_metric | claim_value | claim_unit | claim_period |\n|---|-------|------|------------|------------|------------|------------|-------------|--------|---------|--------------|-------------|------------|--------------|\n| 7 | Beta-example gross margin | fact | 0.9 | private | high | 2026-06-30 | | Q2 report | | gross_margin | 0.62 | ratio | quarterly |\n<!--- gbrain:facts:end -->\n","timeline":""},"probe":null}
+{"id":"f-ex-07","set":"repairable","adversarial":null,"cls":"extra_cells","kind":"facts","section":"body","page_visibility":"private","tags":["strike","number"],"note":"struck row with an empty cell; the superseding row is valid","page":{"compiled_truth":"# Notes f-ex-07\n\nWorking notes kept by the brain owner.\n\n<!--- gbrain:facts:begin -->\n| # | claim | kind | confidence | visibility | notability | valid_from | valid_until | source | context |\n|---|-------|------|------------|------------|------------|------------|-------------|--------|---------|\n| 8 | ~~Gamma-example raised $3.5M~~ | | event | 0.9 | private | high | 2025-12-01 | 2026-03-01 | news item | superseded by #9 |\n| 9 | Gamma-example raised $5M | event | 0.9 | private | high | 2026-03-01 | | press release | |\n<!--- gbrain:facts:end -->\n","timeline":""},"expected":{"compiled_truth":"# Notes f-ex-07\n\nWorking notes kept by the brain owner.\n\n<!--- gbrain:facts:begin -->\n| # | claim | kind | confidence | visibility | notability | valid_from | valid_until | source | context |\n|---|-------|------|------------|------------|------------|------------|-------------|--------|---------|\n| 8 | ~~Gamma-example raised $3.5M~~ | event | 0.9 | private | high | 2025-12-01 | 2026-03-01 | news item | superseded by #9 |\n| 9 | Gamma-example raised $5M | event | 0.9 | private | high | 2026-03-01 | | press release | |\n<!--- gbrain:facts:end -->\n","timeline":""},"probe":null}
+{"id":"t-ex-01","set":"repairable","adversarial":null,"cls":"extra_cells","kind":"takes","section":"body","page_visibility":"private","tags":[],"note":"an empty cell after the claim","page":{"compiled_truth":"# Notes t-ex-01\n\nWorking notes kept by the brain owner.\n\n<!--- gbrain:takes:begin -->\n| # | claim | kind | who | weight | since | source |\n|---|-------|------|-----|--------|-------|--------|\n| 3 | Vertical SaaS beats horizontal | | take | brain | 0.7 | 2026-01-01 | podcast notes |\n<!--- gbrain:takes:end -->\n","timeline":""},"expected":{"compiled_truth":"# Notes t-ex-01\n\nWorking notes kept by the brain owner.\n\n<!--- gbrain:takes:begin -->\n| # | claim | kind | who | weight | since | source |\n|---|-------|------|-----|--------|-------|--------|\n| 3 | Vertical SaaS beats horizontal | take | brain | 0.7 | 2026-01-01 | podcast notes |\n<!--- gbrain:takes:end -->\n","timeline":""},"probe":null}
+{"id":"t-ex-02","set":"repairable","adversarial":null,"cls":"extra_cells","kind":"takes","section":"body","page_visibility":"private","tags":[],"note":"an empty cell after the holder","page":{"compiled_truth":"# Notes t-ex-02\n\nWorking notes kept by the brain owner.\n\n<!--- gbrain:takes:begin -->\n| # | claim | kind | who | weight | since | source |\n|---|-------|------|-----|--------|-------|--------|\n| 1 | Acme-example keeps its CEO | take | companies/beta-example | 0.8 | 2026-01-20 | board deck |\n| 4 | Acme-example misses Q3 targets | bet | companies/beta-example | | 0.35 | 2026-02-02 | board chat |\n<!--- gbrain:takes:end -->\n","timeline":""},"expected":{"compiled_truth":"# Notes t-ex-02\n\nWorking notes kept by the brain owner.\n\n<!--- gbrain:takes:begin -->\n| # | claim | kind | who | weight | since | source |\n|---|-------|------|-----|--------|-------|--------|\n| 1 | Acme-example keeps its CEO | take | companies/beta-example | 0.8 | 2026-01-20 | board deck |\n| 4 | Acme-example misses Q3 targets | bet | companies/beta-example | 0.35 | 2026-02-02 | board chat |\n<!--- gbrain:takes:end -->\n","timeline":""},"probe":null}
+{"id":"t-ex-03","set":"repairable","adversarial":null,"cls":"extra_cells","kind":"takes","section":"body","page_visibility":"private","tags":["strike","link"],"note":"struck claim with a link, empty cell after the kind","page":{"compiled_truth":"# Notes t-ex-03\n\nWorking notes kept by the brain owner.\n\n<!--- gbrain:takes:begin -->\n| # | claim | kind | who | weight | since | source |\n|---|-------|------|-----|--------|-------|--------|\n| 5 | ~~[Delta-example](https://example.com/d) pivots to enterprise~~ | hunch | | people/alice-example | 0.4 | 2026-03-03 | dinner |\n<!--- gbrain:takes:end -->\n","timeline":""},"expected":{"compiled_truth":"# Notes t-ex-03\n\nWorking notes kept by the brain owner.\n\n<!--- gbrain:takes:begin -->\n| # | claim | kind | who | weight | since | source |\n|---|-------|------|-----|--------|-------|--------|\n| 5 | ~~[Delta-example](https://example.com/d) pivots to enterprise~~ | hunch | people/alice-example | 0.4 | 2026-03-03 | dinner |\n<!--- gbrain:takes:end -->\n","timeline":""},"probe":null}
+{"id":"t-ex-04","set":"repairable","adversarial":null,"cls":"extra_cells","kind":"takes","section":"body","page_visibility":"private","tags":[],"note":"two empty cells after the claim","page":{"compiled_truth":"# Notes t-ex-04\n\nWorking notes kept by the brain owner.\n\n<!--- gbrain:takes:begin -->\n| # | claim | kind | who | weight | since | source |\n|---|-------|------|-----|--------|-------|--------|\n| 6 | Rates stay flat through 2026 | | | bet | world | 0.5 | 2026-04-04 | market note |\n<!--- gbrain:takes:end -->\n","timeline":""},"expected":{"compiled_truth":"# Notes t-ex-04\n\nWorking notes kept by the brain owner.\n\n<!--- gbrain:takes:begin -->\n| # | claim | kind | who | weight | since | source |\n|---|-------|------|-----|--------|-------|--------|\n| 6 | Rates stay flat through 2026 | bet | world | 0.5 | 2026-04-04 | market note |\n<!--- gbrain:takes:end -->\n","timeline":""},"probe":null}
+{"id":"f-hu-01","set":"repairable","adversarial":null,"cls":"header_unmapped","kind":"facts","section":"body","page_visibility":"private","tags":[],"note":"`certainty` is the confidence; visibility sits before it","page":{"compiled_truth":"# Notes f-hu-01\n\nWorking notes kept by the brain owner.\n\n<!--- gbrain:facts:begin -->\n| # | claim | kind | visibility | certainty | notability | valid_from | valid_until | source | context |\n|---|---|---|---|---|---|---|---|---|---|\n| 1 | Acme-example's CFO is bob-example | fact | private | 0.9 | high | 2026-01-15 | | org chart | |\n| 2 | Acme-example plans a Tokyo office | idea | private | 0.5 | medium | | | offsite notes | |\n<!--- gbrain:facts:end -->\n","timeline":""},"expected":{"compiled_truth":"# Notes f-hu-01\n\nWorking notes kept by the brain owner.\n\n<!--- gbrain:facts:begin -->\n| # | claim | kind | confidence | visibility | notability | valid_from | valid_until | source | context |\n|---|-------|------|------------|------------|------------|------------|-------------|--------|---------|\n| 1 | Acme-example's CFO is bob-example | fact | 0.9 | private | high | 2026-01-15 | | org chart | |\n| 2 | Acme-example plans a Tokyo office | idea | 0.5 | private | medium | | | offsite notes | |\n<!--- gbrain:facts:end -->\n","timeline":""},"probe":null}
+{"id":"f-hu-02","set":"repairable","adversarial":null,"cls":"header_unmapped","kind":"facts","section":"body","page_visibility":"private","tags":[],"note":"`starts` and `ends` are the validity dates, written before the confidence","page":{"compiled_truth":"# Notes f-hu-02\n\nWorking notes kept by the brain owner.\n\n<!--- gbrain:facts:begin -->\n| # | claim | kind | starts | ends | confidence | visibility | notability | source | context |\n|---|---|---|---|---|---|---|---|---|---|\n| 1 | Bob-example chairs the audit committee | fact | 2025-07-01 | 2027-06-30 | 0.9 | private | medium | board minutes | |\n| 2 | Bob-example is on parental leave | fact | 2026-03-01 | 2026-05-31 | 1.0 | private | low | HR note | |\n<!--- gbrain:facts:end -->\n","timeline":""},"expected":{"compiled_truth":"# Notes f-hu-02\n\nWorking notes kept by the brain owner.\n\n<!--- gbrain:facts:begin -->\n| # | claim | kind | confidence | visibility | notability | valid_from | valid_until | source | context |\n|---|-------|------|------------|------------|------------|------------|-------------|--------|---------|\n| 1 | Bob-example chairs the audit committee | fact | 0.9 | private | medium | 2025-07-01 | 2027-06-30 | board minutes | |\n| 2 | Bob-example is on parental leave | fact | 1.0 | private | low | 2026-03-01 | 2026-05-31 | HR note | |\n<!--- gbrain:facts:end -->\n","timeline":""},"probe":null}
+{"id":"f-hu-03","set":"repairable","adversarial":null,"cls":"header_unmapped","kind":"facts","section":"body","page_visibility":"private","tags":["no_row_numbers"],"note":"no # column and an `origin` column (the source); Tier 1 numbers the rows after the model","page":{"compiled_truth":"# Notes f-hu-03\n\nWorking notes kept by the brain owner.\n\n<!--- gbrain:facts:begin -->\n| claim | kind | confidence | visibility | notability | origin |\n|---|---|---|---|---|---|\n| Carol-example runs a book club | fact | 0.8 | private | low | coffee chat |\n| Carol-example wants to angel invest | preference | 0.6 | private | medium | dinner |\n| Carol-example will intro two founders | commitment | 0.7 | private | medium | email |\n<!--- gbrain:facts:end -->\n","timeline":""},"expected":{"compiled_truth":"# Notes f-hu-03\n\nWorking notes kept by the brain owner.\n\n<!--- gbrain:facts:begin -->\n| # | claim | kind | confidence | visibility | notability | valid_from | valid_until | source | context |\n|---|-------|------|------------|------------|------------|------------|-------------|--------|---------|\n| 1 | Carol-example runs a book club | fact | 0.8 | private | low | | | coffee chat | |\n| 2 | Carol-example wants to angel invest | preference | 0.6 | private | medium | | | dinner | |\n| 3 | Carol-example will intro two founders | commitment | 0.7 | private | medium | | | email | |\n<!--- gbrain:facts:end -->\n","timeline":""},"probe":null}
+{"id":"f-hu-04","set":"repairable","adversarial":null,"cls":"header_unmapped","kind":"facts","section":"body","page_visibility":"private","tags":[],"note":"kind before claim and an `audience` column (the visibility)","page":{"compiled_truth":"# Notes f-hu-04\n\nWorking notes kept by the brain owner.\n\n<!--- gbrain:facts:begin -->\n| # | kind | claim | confidence | audience | notability | valid_from | source |\n|---|---|---|---|---|---|---|---|\n| 1 | event | Beta-example signed acme-example | 0.9 | private | high | 2026-02-14 | deal desk |\n| 2 | fact | Beta-example sells annual contracts | 0.8 | private | medium | | sales deck |\n<!--- gbrain:facts:end -->\n","timeline":""},"expected":{"compiled_truth":"# Notes f-hu-04\n\nWorking notes kept by the brain owner.\n\n<!--- gbrain:facts:begin -->\n| # | claim | kind | confidence | visibility | notability | valid_from | valid_until | source | context |\n|---|-------|------|------------|------------|------------|------------|-------------|--------|---------|\n| 1 | Beta-example signed acme-example | event | 0.9 | private | high | 2026-02-14 | | deal desk | |\n| 2 | Beta-example sells annual contracts | fact | 0.8 | private | medium | | | sales deck | |\n<!--- gbrain:facts:end -->\n","timeline":""},"probe":null}
+{"id":"f-hu-05","set":"repairable","adversarial":null,"cls":"header_unmapped","kind":"facts","section":"body","page_visibility":"world","tags":["world","link"],"note":"world page; a `reference` column (the source) before the confidence","page":{"compiled_truth":"# Notes f-hu-05\n\nWorking notes kept by the brain owner.\n\n<!--- gbrain:facts:begin -->\n| # | claim | kind | reference | confidence | visibility | notability | valid_from | valid_until | notes |\n|---|---|---|---|---|---|---|---|---|---|\n| 1 | Gamma-example open-sourced its SDK | event | [blog post](https://example.com/blog/sdk) | 0.95 | world | medium | 2026-03-20 | | |\n| 2 | Gamma-example supports three languages | fact | SDK readme | 0.9 | world | low | 2026-03-20 | | Python, Go, Rust |\n<!--- gbrain:facts:end -->\n","timeline":""},"expected":{"compiled_truth":"# Notes f-hu-05\n\nWorking notes kept by the brain owner.\n\n<!--- gbrain:facts:begin -->\n| # | claim | kind | confidence | visibility | notability | valid_from | valid_until | source | context |\n|---|-------|------|------------|------------|------------|------------|-------------|--------|---------|\n| 1 | Gamma-example open-sourced its SDK | event | 0.95 | world | medium | 2026-03-20 | | [blog post](https://example.com/blog/sdk) | |\n| 2 | Gamma-example supports three languages | fact | 0.9 | world | low | 2026-03-20 | | SDK readme | Python, Go, Rust |\n<!--- gbrain:facts:end -->\n","timeline":""},"probe":null}
+{"id":"f-hu-06","set":"repairable","adversarial":null,"cls":"header_unmapped","kind":"facts","section":"timeline","page_visibility":"private","tags":["timeline"],"note":"timeline fence; `effective` is valid_from, notability before visibility","page":{"compiled_truth":"# Notes f-hu-06\n\nWorking notes kept by the brain owner.\n","timeline":"<!--- gbrain:facts:begin -->\n| # | claim | kind | confidence | notability | visibility | effective | source |\n|---|---|---|---|---|---|---|---|\n| 1 | Delta-example appointed a new CFO | event | 0.9 | high | private | 2026-05-04 | press release |\n| 2 | Delta-example closed its Austin office | event | 0.8 | medium | private | 2026-05-30 | staff email |\n<!--- gbrain:facts:end -->\n"},"expected":{"compiled_truth":"# Notes f-hu-06\n\nWorking notes kept by the brain owner.\n","timeline":"<!--- gbrain:facts:begin -->\n| # | claim | kind | confidence | visibility | notability | valid_from | valid_until | source | context |\n|---|-------|------|------------|------------|------------|------------|-------------|--------|---------|\n| 1 | Delta-example appointed a new CFO | event | 0.9 | private | high | 2026-05-04 | | press release | |\n| 2 | Delta-example closed its Austin office | event | 0.8 | private | medium | 2026-05-30 | | staff email | |\n<!--- gbrain:facts:end -->\n"},"probe":null}
+{"id":"t-hu-01","set":"repairable","adversarial":null,"cls":"header_unmapped","kind":"takes","section":"body","page_visibility":"private","tags":[],"note":"`conviction` is the weight; holder before kind","page":{"compiled_truth":"# Notes t-hu-01\n\nWorking notes kept by the brain owner.\n\n<!--- gbrain:takes:begin -->\n| # | claim | holder | kind | conviction | since | source |\n|---|---|---|---|---|---|---|\n| 1 | Acme-example wins the enterprise segment | people/alice-example | take | 0.7 | 2026-01-08 | strategy offsite |\n| 2 | Acme-example hires a COO this year | people/alice-example | bet | 0.5 | 2026-01-08 | strategy offsite |\n<!--- gbrain:takes:end -->\n","timeline":""},"expected":{"compiled_truth":"# Notes t-hu-01\n\nWorking notes kept by the brain owner.\n\n<!--- gbrain:takes:begin -->\n| # | claim | kind | who | weight | since | source |\n|---|-------|------|-----|--------|-------|--------|\n| 1 | Acme-example wins the enterprise segment | take | people/alice-example | 0.7 | 2026-01-08 | strategy offsite |\n| 2 | Acme-example hires a COO this year | bet | people/alice-example | 0.5 | 2026-01-08 | strategy offsite |\n<!--- gbrain:takes:end -->\n","timeline":""},"probe":null}
+{"id":"t-hu-02","set":"repairable","adversarial":null,"cls":"header_unmapped","kind":"takes","section":"body","page_visibility":"private","tags":["link"],"note":"`odds` is the weight and `link` the source","page":{"compiled_truth":"# Notes t-hu-02\n\nWorking notes kept by the brain owner.\n\n<!--- gbrain:takes:begin -->\n| # | claim | kind | odds | who | date | link |\n|---|---|---|---|---|---|---|\n| 1 | Beta-example lands a bank customer | bet | 0.4 | people/bob-example | 2026-02-10 | [pipeline](https://example.com/p) |\n<!--- gbrain:takes:end -->\n","timeline":""},"expected":{"compiled_truth":"# Notes t-hu-02\n\nWorking notes kept by the brain owner.\n\n<!--- gbrain:takes:begin -->\n| # | claim | kind | who | weight | since | source |\n|---|-------|------|-----|--------|-------|--------|\n| 1 | Beta-example lands a bank customer | bet | people/bob-example | 0.4 | 2026-02-10 | [pipeline](https://example.com/p) |\n<!--- gbrain:takes:end -->\n","timeline":""},"probe":null}
+{"id":"t-hu-03","set":"repairable","adversarial":null,"cls":"header_unmapped","kind":"takes","section":"body","page_visibility":"private","tags":["no_row_numbers"],"note":"no # column; `confidence level` is the weight; Tier 1 numbers the rows","page":{"compiled_truth":"# Notes t-hu-03\n\nWorking notes kept by the brain owner.\n\n<!--- gbrain:takes:begin -->\n| claim | kind | who | confidence level | since |\n|---|---|---|---|---|\n| AI copilots become standard in CAD | take | brain | 0.65 | 2026-03-01 |\n| Gamma-example ships a CAD copilot | bet | brain | 0.45 | 2026-03-01 |\n<!--- gbrain:takes:end -->\n","timeline":""},"expected":{"compiled_truth":"# Notes t-hu-03\n\nWorking notes kept by the brain owner.\n\n<!--- gbrain:takes:begin -->\n| # | claim | kind | who | weight | since | source |\n|---|-------|------|-----|--------|-------|--------|\n| 1 | AI copilots become standard in CAD | take | brain | 0.65 | 2026-03-01 | |\n| 2 | Gamma-example ships a CAD copilot | bet | brain | 0.45 | 2026-03-01 | |\n<!--- gbrain:takes:end -->\n","timeline":""},"probe":null}
+{"id":"t-hu-04","set":"repairable","adversarial":null,"cls":"header_unmapped","kind":"takes","section":"body","page_visibility":"private","tags":["strike"],"note":"`probability` (the weight) before the kind; `as of` is since","page":{"compiled_truth":"# Notes t-hu-04\n\nWorking notes kept by the brain owner.\n\n<!--- gbrain:takes:begin -->\n| # | claim | probability | kind | holder | as of | source |\n|---|---|---|---|---|---|---|\n| 1 | ~~Delta-example sells by 2026~~ | 0.3 | bet | people/carol-example | 2025-10-01 | coffee |\n| 2 | Delta-example sells by 2027 | 0.45 | bet | people/carol-example | 2026-04-01 | coffee |\n<!--- gbrain:takes:end -->\n","timeline":""},"expected":{"compiled_truth":"# Notes t-hu-04\n\nWorking notes kept by the brain owner.\n\n<!--- gbrain:takes:begin -->\n| # | claim | kind | who | weight | since | source |\n|---|-------|------|-----|--------|-------|--------|\n| 1 | ~~Delta-example sells by 2026~~ | bet | people/carol-example | 0.3 | 2025-10-01 | coffee |\n| 2 | Delta-example sells by 2027 | bet | people/carol-example | 0.45 | 2026-04-01 | coffee |\n<!--- gbrain:takes:end -->\n","timeline":""},"probe":null}
+{"id":"f-mix-01","set":"repairable","adversarial":null,"cls":"mixed","kind":"facts","section":"body","page_visibility":"private","tags":[],"note":"a short row and a row with an extra cell","page":{"compiled_truth":"# Notes f-mix-01\n\nWorking notes kept by the brain owner.\n\n<!--- gbrain:facts:begin -->\n| # | claim | kind | confidence | visibility | notability | valid_from | valid_until | source | context |\n|---|-------|------|------------|------------|------------|------------|-------------|--------|---------|\n| 1 | Bob-example founded beta-example | fact | 1.0 | private | high | 2022-04-01 |\n| 2 | Bob-example is raising a seed round | | event | 0.7 | private | medium | 2026-05-01 | | coffee chat | |\n| 3 | Beta-example has six employees | fact | 0.8 | private | low | 2026-05-01 | | coffee chat | |\n<!--- gbrain:facts:end -->\n","timeline":""},"expected":{"compiled_truth":"# Notes f-mix-01\n\nWorking notes kept by the brain owner.\n\n<!--- gbrain:facts:begin -->\n| # | claim | kind | confidence | visibility | notability | valid_from | valid_until | source | context |\n|---|-------|------|------------|------------|------------|------------|-------------|--------|---------|\n| 1 | Bob-example founded beta-example | fact | 1.0 | private | high | 2022-04-01 | | | |\n| 2 | Bob-example is raising a seed round | event | 0.7 | private | medium | 2026-05-01 | | coffee chat | |\n| 3 | Beta-example has six employees | fact | 0.8 | private | low | 2026-05-01 | | coffee chat | |\n<!--- gbrain:facts:end -->\n","timeline":""},"probe":null}
+{"id":"f-mix-02","set":"repairable","adversarial":null,"cls":"mixed","kind":"facts","section":"body","page_visibility":"private","tags":[],"note":"a row above the header and a short row below it","page":{"compiled_truth":"# Notes f-mix-02\n\nWorking notes kept by the brain owner.\n\n<!--- gbrain:facts:begin -->\n| 4 | Gamma-example signed a reseller in Brazil | event | 0.8 | private | medium | 2026-02-27 | | partner email | |\n| # | claim | kind | confidence | visibility | notability | valid_from | valid_until | source | context |\n|---|-------|------|------------|------------|------------|------------|-------------|--------|---------|\n| 5 | Gamma-example targets 30% growth | belief | 0.5 | private | medium |\n<!--- gbrain:facts:end -->\n","timeline":""},"expected":{"compiled_truth":"# Notes f-mix-02\n\nWorking notes kept by the brain owner.\n\n<!--- gbrain:facts:begin -->\n| # | claim | kind | confidence | visibility | notability | valid_from | valid_until | source | context |\n|---|-------|------|------------|------------|------------|------------|-------------|--------|---------|\n| 4 | Gamma-example signed a reseller in Brazil | event | 0.8 | private | medium | 2026-02-27 | | partner email | |\n| 5 | Gamma-example targets 30% growth | belief | 0.5 | private | medium | | | | |\n<!--- gbrain:facts:end -->\n","timeline":""},"probe":null}
+{"id":"t-mix-01","set":"repairable","adversarial":null,"cls":"mixed","kind":"takes","section":"body","page_visibility":"private","tags":[],"note":"a short row and a row with an extra cell","page":{"compiled_truth":"# Notes t-mix-01\n\nWorking notes kept by the brain owner.\n\n<!--- gbrain:takes:begin -->\n| # | claim | kind | who | weight | since | source |\n|---|-------|------|-----|--------|-------|--------|\n| 1 | Climate software consolidates | take | world | 0.6 |\n| 2 | Delta-example gets acquired | | bet | people/bob-example | 0.35 | 2026-01-30 | rumor mill |\n<!--- gbrain:takes:end -->\n","timeline":""},"expected":{"compiled_truth":"# Notes t-mix-01\n\nWorking notes kept by the brain owner.\n\n<!--- gbrain:takes:begin -->\n| # | claim | kind | who | weight | since | source |\n|---|-------|------|-----|--------|-------|--------|\n| 1 | Climate software consolidates | take | world | 0.6 | | |\n| 2 | Delta-example gets acquired | bet | people/bob-example | 0.35 | 2026-01-30 | rumor mill |\n<!--- gbrain:takes:end -->\n","timeline":""},"probe":null}
+{"id":"f-mix-03","set":"repairable","adversarial":null,"cls":"mixed","kind":"facts","section":"body","page_visibility":"private","tags":[],"note":"no header and one of the rows is short","page":{"compiled_truth":"# Notes f-mix-03\n\nWorking notes kept by the brain owner.\n\n<!--- gbrain:facts:begin -->\n| 1 | Alice-example leads product at acme-example | fact | 0.9 | private | medium | 2025-01-01 | | profile page | |\n| 2 | Alice-example plans a sabbatical | idea | 0.4 | private | low |\n<!--- gbrain:facts:end -->\n","timeline":""},"expected":{"compiled_truth":"# Notes f-mix-03\n\nWorking notes kept by the brain owner.\n\n<!--- gbrain:facts:begin -->\n| # | claim | kind | confidence | visibility | notability | valid_from | valid_until | source | context |\n|---|-------|------|------------|------------|------------|------------|-------------|--------|---------|\n| 1 | Alice-example leads product at acme-example | fact | 0.9 | private | medium | 2025-01-01 | | profile page | |\n| 2 | Alice-example plans a sabbatical | idea | 0.4 | private | low | | | | |\n<!--- gbrain:facts:end -->\n","timeline":""},"probe":null}
+{"id":"b-mix-01","set":"repairable","adversarial":null,"cls":"mixed","kind":"both","section":"body","page_visibility":"private","tags":["two_fences"],"note":"a facts fence and a takes fence on one page, each with a short row (two model calls)","page":{"compiled_truth":"# Notes b-mix-01\n\nWorking notes kept by the brain owner.\n\n<!--- gbrain:facts:begin -->\n| # | claim | kind | confidence | visibility | notability | valid_from | valid_until | source | context |\n|---|-------|------|------------|------------|------------|------------|-------------|--------|---------|\n| 1 | Acme-example moved HQ to Austin | event | 0.9 | private | high | 2026-01-03 |\n<!--- gbrain:facts:end -->\n\n<!--- gbrain:takes:begin -->\n| # | claim | kind | who | weight | since | source |\n|---|-------|------|-----|--------|-------|--------|\n| 2 | Acme-example regrets the move within a year | hunch | brain | 0.3 |\n<!--- gbrain:takes:end -->\n","timeline":""},"expected":{"compiled_truth":"# Notes b-mix-01\n\nWorking notes kept by the brain owner.\n\n<!--- gbrain:facts:begin -->\n| # | claim | kind | confidence | visibility | notability | valid_from | valid_until | source | context |\n|---|-------|------|------------|------------|------------|------------|-------------|--------|---------|\n| 1 | Acme-example moved HQ to Austin | event | 0.9 | private | high | 2026-01-03 | | | |\n<!--- gbrain:facts:end -->\n\n<!--- gbrain:takes:begin -->\n| # | claim | kind | who | weight | since | source |\n|---|-------|------|-----|--------|-------|--------|\n| 2 | Acme-example regrets the move within a year | hunch | brain | 0.3 | | |\n<!--- gbrain:takes:end -->\n","timeline":""},"probe":null}
+{"id":"f-adv-01","set":"adversarial","adversarial":"ambiguous","cls":"extra_cells","kind":"facts","section":"body","page_visibility":"private","tags":[],"note":"two confidence values; either could be the real one","page":{"compiled_truth":"# Notes f-adv-01\n\nWorking notes kept by the brain owner.\n\n<!--- gbrain:facts:begin -->\n| # | claim | kind | confidence | visibility | notability | valid_from | valid_until | source | context |\n|---|-------|------|------------|------------|------------|------------|-------------|--------|---------|\n| 2 | Beta-example breaks even in 2026 | belief | 0.6 | 0.9 | private | medium | 2026-01-01 | | board deck | |\n<!--- gbrain:facts:end -->\n","timeline":""},"expected":null,"probe":"| # | claim | kind | confidence | visibility | notability | valid_from | valid_until | source | context |\n|---|-------|------|------------|------------|------------|------------|-------------|--------|---------|\n| 2 | Beta-example breaks even in 2026 | belief | 0.6 | private | medium | 2026-01-01 | | board deck | 0.9 |"}
+{"id":"f-adv-02","set":"adversarial","adversarial":"ambiguous","cls":"extra_cells","kind":"facts","section":"body","page_visibility":"private","tags":[],"note":"two kinds (commitment, idea)","page":{"compiled_truth":"# Notes f-adv-02\n\nWorking notes kept by the brain owner.\n\n<!--- gbrain:facts:begin -->\n| # | claim | kind | confidence | visibility | notability | valid_from | valid_until | source | context |\n|---|-------|------|------------|------------|------------|------------|-------------|--------|---------|\n| 3 | Acme-example launches in Japan | commitment | idea | 0.7 | private | medium | 2026-09-01 | | offsite | |\n<!--- gbrain:facts:end -->\n","timeline":""},"expected":null,"probe":"| # | claim | kind | confidence | visibility | notability | valid_from | valid_until | source | context |\n|---|-------|------|------------|------------|------------|------------|-------------|--------|---------|\n| 3 | Acme-example launches in Japan | commitment | 0.7 | private | medium | 2026-09-01 | | offsite | idea |"}
+{"id":"f-adv-03","set":"adversarial","adversarial":"ambiguous","cls":"extra_cells","kind":"facts","section":"body","page_visibility":"private","tags":[],"note":"two notability values (high, low)","page":{"compiled_truth":"# Notes f-adv-03\n\nWorking notes kept by the brain owner.\n\n<!--- gbrain:facts:begin -->\n| # | claim | kind | confidence | visibility | notability | valid_from | valid_until | source | context |\n|---|-------|------|------------|------------|------------|------------|-------------|--------|---------|\n| 4 | Delta-example's CTO is leaving | fact | 0.8 | high | private | low | 2026-04-01 | | hallway chat | |\n<!--- gbrain:facts:end -->\n","timeline":""},"expected":null,"probe":"| # | claim | kind | confidence | visibility | notability | valid_from | valid_until | source | context |\n|---|-------|------|------------|------------|------------|------------|-------------|--------|---------|\n| 4 | Delta-example's CTO is leaving | fact | 0.8 | private | high | 2026-04-01 | | hallway chat | low |"}
+{"id":"f-adv-04","set":"adversarial","adversarial":"ambiguous","cls":"extra_cells","kind":"facts","section":"body","page_visibility":"world","tags":["world","privacy"],"note":"world page, the row says both private and world: picking world would publish it","page":{"compiled_truth":"# Notes f-adv-04\n\nWorking notes kept by the brain owner.\n\n<!--- gbrain:facts:begin -->\n| # | claim | kind | confidence | visibility | notability | valid_from | valid_until | source | context |\n|---|-------|------|------------|------------|------------|------------|-------------|--------|---------|\n| 5 | Alice-example is raising a fund | fact | 0.7 | private | world | medium | 2026-05-01 | | coffee chat | |\n<!--- gbrain:facts:end -->\n","timeline":""},"expected":null,"probe":"| # | claim | kind | confidence | visibility | notability | valid_from | valid_until | source | context |\n|---|-------|------|------------|------------|------------|------------|-------------|--------|---------|\n| 5 | Alice-example is raising a fund | fact | 0.7 | world | medium | 2026-05-01 | | coffee chat | private |"}
+{"id":"t-adv-01","set":"adversarial","adversarial":"ambiguous","cls":"extra_cells","kind":"takes","section":"body","page_visibility":"private","tags":[],"note":"two holders; either could hold the bet","page":{"compiled_truth":"# Notes t-adv-01\n\nWorking notes kept by the brain owner.\n\n<!--- gbrain:takes:begin -->\n| # | claim | kind | who | weight | since | source |\n|---|-------|------|-----|--------|-------|--------|\n| 2 | Gamma-example sells within two years | bet | people/alice-example | people/bob-example | 0.6 | 2026-02-02 | dinner notes |\n<!--- gbrain:takes:end -->\n","timeline":""},"expected":null,"probe":"| # | claim | kind | who | weight | since | source | resolved | quality | evidence | value | unit | by |\n|---|-------|------|-----|--------|-------|--------|----------|---------|----------|-------|------|----|\n| 2 | Gamma-example sells within two years | bet | people/alice-example | 0.6 | 2026-02-02 | dinner notes | | | people/bob-example | | | |"}
+{"id":"f-adv-05","set":"adversarial","adversarial":"ambiguous","cls":"header_unmapped","kind":"facts","section":"body","page_visibility":"private","tags":[],"note":"an `owner` column has no home in a facts table; the only free column is valid_until","page":{"compiled_truth":"# Notes f-adv-05\n\nWorking notes kept by the brain owner.\n\n<!--- gbrain:facts:begin -->\n| # | claim | kind | owner | confidence | visibility | notability | valid_from | source | context |\n|---|---|---|---|---|---|---|---|---|---|\n| 1 | The Q3 roadmap is approved | event | people/carol-example | 0.9 | private | medium | 2026-07-01 | planning doc | |\n<!--- gbrain:facts:end -->\n","timeline":""},"expected":null,"probe":"| # | claim | kind | confidence | visibility | notability | valid_from | valid_until | source | context |\n|---|-------|------|------------|------------|------------|------------|-------------|--------|---------|\n| 1 | The Q3 roadmap is approved | event | 0.9 | private | medium | 2026-07-01 | people/carol-example | planning doc | |"}
+{"id":"f-unr-01","set":"adversarial","adversarial":"unrecoverable","cls":"short_row_gap","kind":"facts","section":"body","page_visibility":"private","tags":[],"note":"the confidence is missing; any value would be invented","page":{"compiled_truth":"# Notes f-unr-01\n\nWorking notes kept by the brain owner.\n\n<!--- gbrain:facts:begin -->\n| # | claim | kind | confidence | visibility | notability | valid_from | valid_until | source | context |\n|---|-------|------|------------|------------|------------|------------|-------------|--------|---------|\n| 3 | Gamma-example's churn fell | fact | private | medium | 2026-02-01 | | dashboard |\n<!--- gbrain:facts:end -->\n","timeline":""},"expected":null,"probe":"| # | claim | kind | confidence | visibility | notability | valid_from | valid_until | source | context |\n|---|-------|------|------------|------------|------------|------------|-------------|--------|---------|\n| 3 | Gamma-example's churn fell | fact | 1.0 | private | medium | 2026-02-01 | | dashboard | |"}
+{"id":"f-unr-02","set":"adversarial","adversarial":"unrecoverable","cls":"short_row_gap","kind":"facts","section":"body","page_visibility":"private","tags":[],"note":"visibility and notability are missing","page":{"compiled_truth":"# Notes f-unr-02\n\nWorking notes kept by the brain owner.\n\n<!--- gbrain:facts:begin -->\n| # | claim | kind | confidence | visibility | notability | valid_from | valid_until | source | context |\n|---|-------|------|------------|------------|------------|------------|-------------|--------|---------|\n| 4 | Bob-example left beta-example | event | 0.9 | 2026-03-31 | | email |\n<!--- gbrain:facts:end -->\n","timeline":""},"expected":null,"probe":"| # | claim | kind | confidence | visibility | notability | valid_from | valid_until | source | context |\n|---|-------|------|------------|------------|------------|------------|-------------|--------|---------|\n| 4 | Bob-example left beta-example | event | 0.9 | private | medium | 2026-03-31 | | email | |"}
+{"id":"t-unr-01","set":"adversarial","adversarial":"unrecoverable","cls":"short_row_gap","kind":"takes","section":"body","page_visibility":"private","tags":[],"note":"the weight is missing","page":{"compiled_truth":"# Notes t-unr-01\n\nWorking notes kept by the brain owner.\n\n<!--- gbrain:takes:begin -->\n| # | claim | kind | who | weight | since | source |\n|---|-------|------|-----|--------|-------|--------|\n| 5 | Remote work stays dominant | take | people/carol-example | survey |\n<!--- gbrain:takes:end -->\n","timeline":""},"expected":null,"probe":"| # | claim | kind | who | weight | since | source |\n|---|-------|------|-----|--------|-------|--------|\n| 5 | Remote work stays dominant | take | people/carol-example | 0.5 | | survey |"}
+{"id":"f-gl-01","set":"gate_limited","adversarial":null,"cls":"no_header","kind":"facts","section":"body","page_visibility":"private","tags":["no_row_numbers"],"note":"no header and no # cells: read by position the claim is the kind cell, so gate (b) rejects the real claim","page":{"compiled_truth":"# Notes f-gl-01\n\nWorking notes kept by the brain owner.\n\n<!--- gbrain:facts:begin -->\n| Acme-example opened a Denver office | event | 0.8 | private | low | 2026-02-01 | | press release | |\n<!--- gbrain:facts:end -->\n","timeline":""},"expected":{"compiled_truth":"# Notes f-gl-01\n\nWorking notes kept by the brain owner.\n\n<!--- gbrain:facts:begin -->\n| # | claim | kind | confidence | visibility | notability | valid_from | valid_until | source | context |\n|---|-------|------|------------|------------|------------|------------|-------------|--------|---------|\n| 1 | Acme-example opened a Denver office | event | 0.8 | private | low | 2026-02-01 | | press release | |\n<!--- gbrain:facts:end -->\n","timeline":""},"probe":null}
+{"id":"f-gl-02","set":"gate_limited","adversarial":null,"cls":"extra_cells","kind":"facts","section":"body","page_visibility":"private","tags":["pipe"],"note":"an unescaped pipe split the claim; rejoining it changes the claim cell (gate b)","page":{"compiled_truth":"# Notes f-gl-02\n\nWorking notes kept by the brain owner.\n\n<!--- gbrain:facts:begin -->\n| # | claim | kind | confidence | visibility | notability | valid_from | valid_until | source | context |\n|---|-------|------|------------|------------|------------|------------|-------------|--------|---------|\n| 6 | Revenue grew 40% | driven by enterprise | fact | 0.9 | private | high | 2026-06-30 | | Q2 report | |\n<!--- gbrain:facts:end -->\n","timeline":""},"expected":{"compiled_truth":"# Notes f-gl-02\n\nWorking notes kept by the brain owner.\n\n<!--- gbrain:facts:begin -->\n| # | claim | kind | confidence | visibility | notability | valid_from | valid_until | source | context |\n|---|-------|------|------------|------------|------------|------------|-------------|--------|---------|\n| 6 | Revenue grew 40% \\| driven by enterprise | fact | 0.9 | private | high | 2026-06-30 | | Q2 report | |\n<!--- gbrain:facts:end -->\n","timeline":""},"probe":null}
+{"id":"f-gl-03","set":"gate_limited","adversarial":null,"cls":"header_unmapped","kind":"facts","section":"body","page_visibility":"world","tags":["world"],"note":"world page, `audience` column says world; moving it into visibility fails gate (d)","page":{"compiled_truth":"# Notes f-gl-03\n\nWorking notes kept by the brain owner.\n\n<!--- gbrain:facts:begin -->\n| # | claim | kind | confidence | audience | notability | source |\n|---|---|---|---|---|---|---|\n| 1 | Delta-example won a design award | event | 0.9 | world | low | press release |\n<!--- gbrain:facts:end -->\n","timeline":""},"expected":{"compiled_truth":"# Notes f-gl-03\n\nWorking notes kept by the brain owner.\n\n<!--- gbrain:facts:begin -->\n| # | claim | kind | confidence | visibility | notability | valid_from | valid_until | source | context |\n|---|-------|------|------------|------------|------------|------------|-------------|--------|---------|\n| 1 | Delta-example won a design award | event | 0.9 | world | low | | | press release | |\n<!--- gbrain:facts:end -->\n","timeline":""},"probe":null}
diff --git a/evals/fence-repair-tier3/generate-fixtures.ts b/evals/fence-repair-tier3/generate-fixtures.ts
new file mode 100644
index 0000000000..db524845cb
--- /dev/null
+++ b/evals/fence-repair-tier3/generate-fixtures.ts
@@ -0,0 +1,74 @@
+#!/usr/bin/env bun
+/**
+ * Builds fixtures.jsonl from cases.ts (deterministic; no dates, no randomness).
+ *
+ * Each case becomes one page: a title, one prose line, then the section
+ * body (fences included) in `compiled_truth`, or in `timeline` for a
+ * timeline case. `expected` is the same page with the hand-written repaired
+ * section; `probe` is the adversarial answer text.
+ *
+ * Regenerate: bun evals/fence-repair-tier3/generate-fixtures.ts
+ * Output: evals/fence-repair-tier3/fixtures.jsonl (committed)
+ */
+import { writeFileSync } from 'node:fs';
+import { join } from 'node:path';
+import { FACTS_FENCE_BEGIN, FACTS_FENCE_END } from '../../src/core/facts-fence.ts';
+import { TAKES_FENCE_BEGIN, TAKES_FENCE_END } from '../../src/core/takes-fence.ts';
+import { CANONICAL_HEADER } from '../../src/core/fence-repair/schema.ts';
+import { CASES, type Case } from './cases.ts';
+
+export const FIXTURES_PATH = join(import.meta.dir, 'fixtures.jsonl');
+
+const TOKENS: Record<string, string> = {
+ '{FB}': FACTS_FENCE_BEGIN, '{FE}': FACTS_FENCE_END, '{TB}': TAKES_FENCE_BEGIN, '{TE}': TAKES_FENCE_END,
+ '{FH}': CANONICAL_HEADER.facts.narrow, '{FS}': CANONICAL_HEADER.facts.narrowSep,
+ '{FW}': CANONICAL_HEADER.facts.wide, '{FWS}': CANONICAL_HEADER.facts.wideSep,
+ '{TH}': CANONICAL_HEADER.takes.narrow, '{TS}': CANONICAL_HEADER.takes.narrowSep,
+ '{TW}': CANONICAL_HEADER.takes.wide, '{TWS}': CANONICAL_HEADER.takes.wideSep,
+};
+
+export interface FencePageText { compiled_truth: string; timeline: string }
+
+export interface Fixture {
+ id: string;
+ set: Case['set'];
+ adversarial: Case['adversarial'] | null;
+ cls: Case['cls'];
+ kind: Case['kind'];
+ section: 'body' | 'timeline';
+ page_visibility: 'private' | 'world';
+ tags: string[];
+ note: string;
+ page: FencePageText;
+ /** The page after a correct repair; null when the only correct outcome is to stay held. */
+ expected: FencePageText | null;
+ /** Adversarial: an answer a model might give (see cases.ts). */
+ probe: string | null;
+}
+
+const expand = (lines: readonly string[]) => lines.map(line => TOKENS[line] ?? line).join('\n');
+
+function pageOf(c: Case, body: readonly string[]): FencePageText {
+ const section = `${expand(body)}\n`;
+ const title = `# Notes ${c.id}\n\nWorking notes kept by the brain owner.\n\n`;
+ return c.section === 'timeline'
+ ? { compiled_truth: `# Notes ${c.id}\n\nWorking notes kept by the brain owner.\n`, timeline: section }
+ : { compiled_truth: `${title}${section}`, timeline: '' };
+}
+
+export function buildFixtures(): Fixture[] {
+ return CASES.map(c => ({
+ id: c.id, set: c.set, adversarial: c.adversarial ?? null, cls: c.cls, kind: c.kind, section: c.section ?? 'body',
+ page_visibility: c.vis ?? 'private', tags: c.tags, note: c.note,
+ page: pageOf(c, c.body), expected: c.expected ? pageOf(c, c.expected) : null, probe: c.probe ? expand(c.probe) : null,
+ }));
+}
+
+export function fixturesJsonl(): string {
+ return buildFixtures().map(f => JSON.stringify(f)).join('\n') + '\n';
+}
+
+if (import.meta.main) {
+ writeFileSync(FIXTURES_PATH, fixturesJsonl());
+ console.log(`wrote ${CASES.length} fixtures to ${FIXTURES_PATH}`);
+}
diff --git a/evals/fence-repair-tier3/harness.ts b/evals/fence-repair-tier3/harness.ts
new file mode 100644
index 0000000000..88d9ad5ae5
--- /dev/null
+++ b/evals/fence-repair-tier3/harness.ts
@@ -0,0 +1,225 @@
+#!/usr/bin/env bun
+/**
+ * Tier 3 fence-repair eval runner (#6188 T4).
+ *
+ * ORACLE mode ($0, no key):
+ * bun evals/fence-repair-tier3/harness.ts --oracle
+ * Runs every fixture through the production path with a scripted model that
+ * answers with the hand-written ground truth (repairable, gate_limited) or
+ * the adversarial probe. It proves each label: a repairable ground truth
+ * passes every gate and comes out byte-identical; a gate-limited one is
+ * rejected; an ambiguous probe is accepted (only the model can hold it); an
+ * unrecoverable probe is rejected. Exit 1 on any violation.
+ *
+ * LIVE mode (spends tokens):
+ * bun evals/fence-repair-tier3/harness.ts --model <provider:model | default> --run <n> --out <results.jsonl>
+ * [--max-usd 10] [--only id1,id2]
+ * One throwaway PGLite brain per invocation (fresh ledger and attempt
+ * memo). `models.fence_repair` is set to the model (left unset for
+ * `default`, so gbrain's own resolution picks it), `pricing.overrides`
+ * registers list prices gbrain's table lacks (as `gbrain pricing set`
+ * would), and `fences.repair.max_usd_per_day` is set to --max-usd, which the
+ * daily ledger enforces as a hard ceiling. The per-page cap stays at the
+ * production default ($0.05). Each fixture goes through `run-case.ts`. A
+ * provider error (`llm_unavailable`) is retried twice after a pause, as the
+ * next maintenance run would; anything else is the outcome.
+ *
+ * SCORE mode ($0):
+ * bun evals/fence-repair-tier3/harness.ts --score a.jsonl b.jsonl ... [--json summary.json]
+ *
+ * Exit codes: 0 done, 1 oracle violation, 2 infrastructure (no key, cap reached, fixture defect).
+ */
+import { appendFileSync, readFileSync, writeFileSync } from 'node:fs';
+import { createHash } from 'node:crypto';
+import { join } from 'node:path';
+import type { Fixture } from './generate-fixtures.ts';
+import type { ResultRow } from './score.ts';
+
+const here = import.meta.dir;
+const args = process.argv.slice(2);
+const flag = (name: string) => { const i = args.indexOf(name); return i === -1 ? null : args[i + 1] ?? null; };
+
+/** List prices (USD per 1M tokens) for models gbrain's price table lacks, registered on the eval brain like `gbrain pricing set`. */
+export const REGISTERED_PRICES: Record<string, { input: number; output: number; source: string }> = {
+ 'openai:gpt-6.1-sol': { input: 2, output: 10, source: 'gbrain-evals eval/runner/budget-ledger.ts CHAT_PRICE_OVERRIDES (provider pricing page, checked 2026-10-02)' },
+};
+
+export const CALL_TIMEOUT_MS = Number(process.env.GBRAIN_FENCE_REPAIR_CALL_TIMEOUT_MS) > 0 ? Number(process.env.GBRAIN_FENCE_REPAIR_CALL_TIMEOUT_MS) : 90_000;
+
+export function loadFixtures(): Fixture[] {
+ return readFileSync(join(here, 'fixtures.jsonl'), 'utf8').trim().split('\n').map(line => JSON.parse(line));
+}
+
+async function newBrain() {
+ const { PGLiteEngine } = await import('../../src/core/pglite-engine.ts');
+ const engine = new PGLiteEngine();
+ await engine.connect({});
+ await engine.initSchema();
+ const [src] = await engine.executeRaw<{ incarnation: string }>("SELECT incarnation::text AS incarnation FROM sources WHERE id='default'");
+ return { engine, incarnation: src!.incarnation };
+}
+
+// ── score ─────────────────────────────────────────────────────────────────
+if (args.includes('--score')) {
+ const files = args.slice(args.indexOf('--score') + 1).filter(a => !a.startsWith('--') && a !== flag('--json'));
+ const rows: ResultRow[] = files.flatMap(file => readFileSync(file, 'utf8').trim().split('\n').filter(Boolean).map(line => JSON.parse(line)));
+ const { summarize, meetsRule, SCORER_VERSION } = await import('./score.ts');
+ const summary = summarize(rows);
+ const out = { scorer_version: SCORER_VERSION, files, models: summary.map(s => ({ ...s, meets_rule: meetsRule(s) })) };
+ if (flag('--json')) writeFileSync(flag('--json')!, JSON.stringify(out, null, 2) + '\n');
+ const pct = (x: number) => `${(100 * x).toFixed(1)}%`;
+ console.log('model | runs | gate-pass | false-accept | adversarial held | USD/repair | p50 s | p95 s | rule');
+ for (const s of out.models) {
+ console.log(`${s.model} | ${s.runs} | ${s.repairable.repaired}/${s.repairable.n} ${pct(s.repairable.gate_pass)} | ${s.repairable.false_accepts}/${s.repairable.n} ${pct(s.repairable.false_accept)} | `
+ + `${s.adversarial.held}/${s.adversarial.n} | ${s.cost.usd_per_repair?.toFixed(4) ?? 'n/a'} | ${((s.latency_ms.p50 ?? 0) / 1000).toFixed(1)} | ${((s.latency_ms.p95 ?? 0) / 1000).toFixed(1)} | ${s.meets_rule ? 'meets' : 'fails'}`);
+ }
+ process.exit(0);
+}
+
+const fixtures = loadFixtures();
+const only = flag('--only')?.split(',');
+const selected = only ? fixtures.filter(f => only.includes(f.id)) : fixtures;
+
+const { runCase } = await import('./run-case.ts');
+const { compareRepair } = await import('./score.ts');
+const { dailyLedger, FENCE_REPAIR_LEDGER, chatCallUsd } = await import('../../src/core/budget/daily-ledger.ts');
+const { attemptStore } = await import('../../src/core/fence-repair/attempts.ts');
+
+// ── oracle ────────────────────────────────────────────────────────────────
+if (args.includes('--oracle')) {
+ const { oracleAnswers, runOracle } = await import('./oracle.ts');
+ const violations = await runOracle(selected, oracleAnswers);
+ for (const v of violations) console.error(`VIOLATION ${v}`);
+ console.log(`oracle: ${selected.length} fixture(s), ${violations.length} violation(s)`);
+ process.exit(violations.length ? 1 : 0);
+}
+
+// ── live ──────────────────────────────────────────────────────────────────
+const modelArg = flag('--model');
+const run = Number(flag('--run') ?? 1);
+const outPath = flag('--out');
+const maxUsd = Number(flag('--max-usd') ?? 10);
+if (!modelArg || !outPath || !Number.isInteger(run) || !(maxUsd > 0)) {
+ console.error('usage: harness.ts --model <provider:model|default> --run <n> --out <results.jsonl> [--max-usd 10] [--only ids]');
+ process.exit(2);
+}
+
+const { configureEvalGateway } = await import('../../src/eval/shared/gateway-bootstrap.ts');
+const { isAvailable } = await import('../../src/core/ai/gateway.ts');
+const { registerChatUsageSink } = await import('../../src/core/ai/chat-usage.ts');
+const { resolveFenceRepairModel } = await import('../../src/core/repair/fences.ts');
+const { readFenceRepairCaps, FENCE_REPAIR_MAX_USD_PER_DAY_KEY } = await import('../../src/core/fence-repair/config.ts');
+const { loadPricingOverrides } = await import('../../src/core/budget/budget-tracker.ts');
+const { analyzeFences, tier3Estimate } = await import('../../src/core/fence-repair/repair-tiers.ts');
+const { buildTier3Prompt, FENCE_REPAIR_PROMPT_VERSION } = await import('../../src/core/fence-repair/llm.ts');
+const { fixtureTarget } = await import('./run-case.ts');
+
+const { engine, incarnation } = await newBrain();
+if (modelArg !== 'default') await engine.setConfig('models.fence_repair', modelArg);
+await engine.setConfig('pricing.overrides', JSON.stringify(Object.fromEntries(Object.entries(REGISTERED_PRICES).map(([m, p]) => [m, { input: p.input, output: p.output }]))));
+await engine.setConfig(FENCE_REPAIR_MAX_USD_PER_DAY_KEY, String(maxUsd));
+const model = await resolveFenceRepairModel(engine);
+const overrides = await loadPricingOverrides(engine);
+const caps = await readFenceRepairCaps(engine);
+configureEvalGateway({ chatModel: model });
+if (!isAvailable('chat', model)) {
+ console.error(`fence-repair-tier3: no chat provider configured for ${model}; set its key. Refusing to run keyless.`);
+ process.exit(2);
+}
+
+// Pre-run estimate: every page's first-call quotes, from the same estimator the per-page cap uses.
+let estimate = 0;
+for (const f of selected) {
+ const analysis = await analyzeFences(engine, fixtureTarget(f), { pageId: null });
+ if (analysis.status !== 'llm') continue;
+ const quote = tier3Estimate(analysis.requests, { model, overrides, capSource: 'default' });
+ if (quote.ok) estimate += quote.usd;
+}
+console.error(`fence-repair-tier3: ${selected.length} fixture(s) on ${model} (run ${run}); first-call ceiling estimate $${estimate.toFixed(4)}; daily ledger cap $${maxUsd}; per-page cap $${caps.perPageUsd}.`);
+if (estimate > maxUsd) { console.error('Refusing: the estimate exceeds --max-usd.'); process.exit(2); }
+
+// Observers (read-only): tokens from the chat usage sink, answer text and latency from the provider HTTP response.
+const usage: Array<{ input_tokens: number; output_tokens: number }> = [];
+registerChatUsageSink(record => { usage.push({ input_tokens: record.input_tokens, output_tokens: record.output_tokens }); });
+const http: Array<{ latency_ms: number; status: number; stop: string | null; text: string | null }> = [];
+const realFetch = globalThis.fetch;
+globalThis.fetch = (async (input: RequestInfo | URL, init?: RequestInit) => {
+ const url = typeof input === 'string' ? input : input instanceof URL ? input.href : input.url;
+ const watched = /\/(messages|responses|chat\/completions)(\?|$)/.test(url);
+ const t0 = performance.now();
+ const res = await realFetch(input as RequestInfo, init);
+ if (watched) {
+ const record = { latency_ms: Math.round(performance.now() - t0), status: res.status, stop: null as string | null, text: null as string | null };
+ http.push(record);
+ res.clone().text().then(body => {
+ try {
+ const json = JSON.parse(body);
+ if (Array.isArray(json.content)) {
+ record.text = json.content.filter((b: { type: string }) => b.type === 'text').map((b: { text: string }) => b.text).join('');
+ record.stop = json.stop_reason ?? null;
+ } else if (Array.isArray(json.output)) {
+ record.text = json.output.filter((o: { type: string }) => o.type === 'message').flatMap((o: { content: Array<{ type: string; text: string }> }) => o.content.filter(c => c.type === 'output_text').map(c => c.text)).join('');
+ record.stop = json.incomplete_details?.reason ?? json.status ?? null;
+ } else if (Array.isArray(json.choices)) {
+ record.text = json.choices[0]?.message?.content ?? null;
+ record.stop = json.choices[0]?.finish_reason ?? null;
+ }
+ } catch { record.text = null; }
+ }).catch(() => {});
+ }
+ return res;
+}) as typeof fetch;
+
+const promptDigest = createHash('sha256').update(buildTier3Prompt({ kind: 'facts', section: 'body', pageVisibility: 'private', layout: 'narrow', header: null, rows: [], issues: [] }).system).digest('hex');
+const commit = Bun.spawnSync(['git', 'rev-parse', 'HEAD'], { cwd: here }).stdout.toString().trim();
+const meta = { model, model_arg: modelArg, run, started_at: new Date().toISOString(), gbrain_commit: commit, bun: Bun.version, prompt_version: FENCE_REPAIR_PROMPT_VERSION,
+ system_prompt_sha256: promptDigest, fixtures_sha256: createHash('sha256').update(readFileSync(join(here, 'fixtures.jsonl'))).digest('hex'),
+ caps: { per_page_usd: caps.perPageUsd, per_day_usd: caps.perDayUsd }, registered_prices: REGISTERED_PRICES, call_timeout_ms: CALL_TIMEOUT_MS };
+writeFileSync(`${outPath}.meta.json`, JSON.stringify(meta, null, 2) + '\n');
+writeFileSync(outPath, '');
+
+const deps = { ledger: dailyLedger(engine, FENCE_REPAIR_LEDGER), store: attemptStore(engine), model, overrides,
+ capSource: caps.perPageSource === 'user' || caps.perDaySource === 'user' ? 'user' as const : 'default' as const,
+ perPageUsd: caps.perPageUsd, perDayUsd: caps.perDayUsd, timeoutMs: CALL_TIMEOUT_MS, now: () => new Date() };
+
+let spent = 0;
+let stopped: string | null = null;
+for (const f of selected) {
+ let attempts = 0;
+ let out;
+ let calls: ResultRow['calls'] = [];
+ let latency = 0;
+ for (;;) {
+ attempts++;
+ usage.length = 0; http.length = 0;
+ const t0 = performance.now();
+ out = await runCase(engine, incarnation, f, deps);
+ latency = Math.round(performance.now() - t0);
+ await new Promise(r => setTimeout(r, 50));
+ const ok = http.filter(h => h.status === 200);
+ calls = out.ledger_calls.map((c, i) => ({ estimate_usd: c.estimate_usd, usd: c.usd, input_tokens: usage[i]?.input_tokens ?? null, output_tokens: usage[i]?.output_tokens ?? null,
+ latency_ms: ok[i]?.latency_ms ?? null, stop: ok[i]?.stop ?? null, text: ok[i]?.text ?? null }));
+ if (out.reason !== 'llm_unavailable' || attempts >= 3) break;
+ console.error(`${f.id}: provider unavailable (attempt ${attempts}); retrying after a pause`);
+ await new Promise(r => setTimeout(r, attempts * 20_000));
+ }
+ spent += out.spent_usd;
+ if (out.tier1 !== 'llm') {
+ console.error(`${f.id}: fixture defect, the free tiers returned ${out.tier1} (${out.reason}); it must reach Tier 3.`);
+ process.exitCode = 2;
+ }
+ const match = out.outcome === 'repaired' && f.expected ? compareRepair(out.after!, f.expected) : null;
+ const unregistered = calls.every(c => c.input_tokens !== null)
+ ? calls.reduce((s, c) => s + chatCallUsd(model, { inputTokens: c.input_tokens!, outputTokens: c.output_tokens! }).usd, 0) : null;
+ const row = { model, run, id: f.id, set: f.set, adversarial: f.adversarial, cls: f.cls, kind: f.kind, tags: f.tags, tier1: out.tier1, residual: out.residual, requests: out.requests,
+ outcome: out.outcome, reason: out.reason, gate: out.gate, rows: out.rows, match_cells: match ? match.cells : null, match_exact: match ? match.exact : null,
+ calls, spent_usd: out.spent_usd, usd_unregistered: unregistered, latency_ms: latency, attempts, message: out.message, after: out.after };
+ appendFileSync(outPath, JSON.stringify(row) + '\n');
+ console.error(`${f.id}: ${out.outcome}${out.gate ? ` gate ${out.gate}` : out.reason && out.outcome !== 'repaired' ? ` ${out.reason}` : ''}${match ? (match.cells ? ' match' : ' MISMATCH') : ''} calls=${calls.length} $${out.spent_usd.toFixed(4)} ${latency}ms`);
+ if (out.reason === 'budget_exhausted' && /daily/.test(out.message ?? '')) { stopped = `the daily ledger cap ($${maxUsd}) was reached after $${spent.toFixed(4)}`; break; }
+}
+globalThis.fetch = realFetch;
+await engine.disconnect();
+writeFileSync(`${outPath}.meta.json`, JSON.stringify({ ...meta, finished_at: new Date().toISOString(), spent_usd: spent, stopped }, null, 2) + '\n');
+console.error(`spend: $${spent.toFixed(4)} on ${model} (run ${run})${stopped ? `; STOPPED: ${stopped} (partial, not scored)` : ''}`);
+process.exit(stopped ? 2 : process.exitCode ?? 0);
diff --git a/evals/fence-repair-tier3/oracle.ts b/evals/fence-repair-tier3/oracle.ts
new file mode 100644
index 0000000000..56a954082c
--- /dev/null
+++ b/evals/fence-repair-tier3/oracle.ts
@@ -0,0 +1,99 @@
+/**
+ * The $0 oracle for the Tier 3 fence-repair eval (#6188 T4): every fixture
+ * through the production path (`run-case.ts`) with a scripted model, to
+ * prove the labels before any paid run.
+ *
+ * - repairable: the model answers with the ground-truth rows; the repair
+ * must pass every gate and equal `expected` byte for byte. Fixtures tagged
+ * `no_row_numbers` also run with the `#` cells left empty (prompt rule 3);
+ * Tier 1 must then number them to the same result.
+ * - gate_limited: the ground-truth answer must be rejected by a gate.
+ * - adversarial/ambiguous: the probe (a wrong guess) must be accepted, which
+ * shows only the model can keep the page held.
+ * - adversarial/unrecoverable: the probe (an invented value) must be rejected.
+ *
+ * Every fixture must also reach Tier 3 with the residual reason its class names.
+ */
+import { __setChatTransportForTests, type ChatResult } from '../../src/core/ai/gateway.ts';
+import { dailyLedger, FENCE_REPAIR_LEDGER } from '../../src/core/budget/daily-ledger.ts';
+import { attemptStore } from '../../src/core/fence-repair/attempts.ts';
+import { analyzeFences } from '../../src/core/fence-repair/repair-tiers.ts';
+import { extractRawRows, primaryFence } from '../../src/core/fence-repair/raw-rows.ts';
+import type { Tier3Request } from '../../src/core/fence-repair/llm.ts';
+import { PGLiteEngine } from '../../src/core/pglite-engine.ts';
+import type { Fixture } from './generate-fixtures.ts';
+import { fixtureTarget, runCase } from './run-case.ts';
+
+const REASON_OF: Record<string, string | null> = {
+ short_row_trailing: 'short_row', short_row_gap: 'short_row', no_header: 'no_header', row_before_header: 'row_before_header',
+ extra_cells: 'extra_cells', header_unmapped: 'header_unmapped', mixed: null,
+};
+
+export type AnswerFn = (f: Fixture, req: Tier3Request, variant: 'as_written' | 'blank_numbers') => string;
+
+/** The scripted answer: the probe, or the expected page's rows at the sent positions under the expected header. */
+export const oracleAnswers: AnswerFn = (f, req, variant) => {
+ if (f.probe) return f.probe;
+ const expected = f.expected!;
+ const text = req.section === 'body' ? expected.compiled_truth : expected.timeline;
+ const fence = primaryFence(extractRawRows(text, req.section), req.kind)!;
+ const header = text.slice(fence.header!.start, fence.header!.end);
+ const sep = fence.separators[0]!;
+ const rows = req.rows.map(r => {
+ const row = fence.rows[r.occurrence]!;
+ const line = text.slice(row.start, row.end);
+ return variant === 'blank_numbers' ? line.replace(/^\|\s*\d+\s*\|/, '| |') : line;
+ });
+ return [header, text.slice(sep.start, sep.end), ...rows].join('\n');
+};
+
+const result = (text: string): ChatResult => ({ text, blocks: [], stopReason: 'end',
+ usage: { input_tokens: 600, output_tokens: 120, cache_read_tokens: 0, cache_creation_tokens: 0 }, model: 'anthropic:claude-opus-4-7', providerId: 'anthropic' });
+
+export async function runOracle(fixtures: readonly Fixture[], answer: AnswerFn): Promise<string[]> {
+ const engine = new PGLiteEngine();
+ await engine.connect({});
+ await engine.initSchema();
+ const [src] = await engine.executeRaw<{ incarnation: string }>("SELECT incarnation::text AS incarnation FROM sources WHERE id='default'");
+ const deps = { ledger: dailyLedger(engine, FENCE_REPAIR_LEDGER), store: attemptStore(engine), model: 'anthropic:claude-opus-4-7', capSource: 'default' as const,
+ perPageUsd: 0.05, perDayUsd: 1000, timeoutMs: 30_000, now: () => new Date() };
+ const violations: string[] = [];
+ try {
+ for (const f of fixtures) {
+ const variants: Array<'as_written' | 'blank_numbers'> = f.set === 'repairable' && f.tags.includes('no_row_numbers') ? ['as_written', 'blank_numbers'] : ['as_written'];
+ for (const variant of variants) {
+ const run = variant === 'as_written' ? f : { ...f, id: `${f.id}~blank` };
+ const analysis = await analyzeFences(engine, fixtureTarget(run), { pageId: null });
+ if (analysis.status !== 'llm') {
+ violations.push(`${f.id}: the free tiers returned ${analysis.status}${analysis.status === 'manual' ? ` (${analysis.reason})` : ''}; it must reach Tier 3`);
+ continue;
+ }
+ const want = REASON_OF[f.cls];
+ if (want && !analysis.residual.some(i => i.reason === want)) violations.push(`${f.id}: residual ${analysis.residual.map(i => i.reason).join(',')} lacks ${want}`);
+ const byFence = new Map(analysis.requests.map(req => [`${req.kind}:${req.section}`, answer(f, req, variant)]));
+ __setChatTransportForTests(async opts => {
+ const first = String(opts.messages[0]!.content);
+ const m = /^Fence: (facts|takes) \((body|timeline) section\)/.exec(first);
+ return result(byFence.get(`${m?.[1]}:${m?.[2]}`) ?? '');
+ });
+ const out = await runCase(engine, src!.incarnation, run, deps);
+ const tag = `${f.id}${variant === 'blank_numbers' ? ' (# left empty)' : ''}`;
+ if (process.env.ORACLE_VERBOSE) console.error(`${tag}: ${out.outcome} ${out.reason ?? ''} ${out.gate ?? ''} residual=${out.residual.join(',')} requests=${out.requests}`);
+ if (f.set === 'repairable') {
+ if (out.outcome !== 'repaired') violations.push(`${tag}: ground truth held (${out.reason}${out.gate ? `, gate ${out.gate} rows ${out.rows.join(',')}` : ''})`);
+ else if (out.after!.compiled_truth !== f.expected!.compiled_truth || out.after!.timeline !== f.expected!.timeline) {
+ violations.push(`${tag}: repaired page differs from expected:\n--- got\n${out.after!.compiled_truth}${out.after!.timeline}\n--- want\n${f.expected!.compiled_truth}${f.expected!.timeline}`);
+ }
+ } else if (f.set === 'gate_limited') {
+ if (out.outcome === 'repaired' || !out.gate) violations.push(`${tag}: expected a gate rejection, got ${out.outcome} ${out.reason ?? ''}`);
+ } else if (f.adversarial === 'ambiguous') {
+ if (out.outcome !== 'repaired') violations.push(`${tag}: the ambiguous probe was rejected (${out.reason}${out.gate ? `, gate ${out.gate}` : ''}); the gates can already hold it`);
+ } else if (out.outcome === 'repaired') violations.push(`${tag}: the unrecoverable probe was accepted`);
+ }
+ }
+ } finally {
+ __setChatTransportForTests(null);
+ await engine.disconnect();
+ }
+ return violations;
+}
diff --git a/evals/fence-repair-tier3/run-case.ts b/evals/fence-repair-tier3/run-case.ts
new file mode 100644
index 0000000000..b3931563c4
--- /dev/null
+++ b/evals/fence-repair-tier3/run-case.ts
@@ -0,0 +1,91 @@
+/**
+ * One fixture through the production Tier 3 path (#6188 T4).
+ *
+ * The fixture page becomes a database-page target (`mode: 'db'`, the shape
+ * `readFenceTarget` returns for a stored page) on the eval brain's default
+ * source. `analyzeFences` runs the free tiers exactly as `gbrain repair
+ * fences` does; a page they leave for the model goes through `runTier3` with
+ * the real daily ledger and attempt store of that brain: prompt v1, one call
+ * per fence, at most one corrective re-ask, gates (a)-(g) and the Tier 1
+ * fixed point. Nothing here re-implements a tier or a gate.
+ *
+ * `observeCalls` wraps the ledger to record each call's estimate and settled
+ * cost; the harness adds tokens (chat usage sink) and the answer text (a
+ * read-only fetch observer). Observation never changes a decision.
+ */
+import type { BrainEngine } from '../../src/core/engine.ts';
+import type { DailyLedger } from '../../src/core/budget/daily-ledger.ts';
+import { analyzeFences, runTier3, type Tier3Deps } from '../../src/core/fence-repair/repair-tiers.ts';
+import { pageSha, type FenceTarget } from '../../src/core/fence-repair/repair-io.ts';
+import type { Fixture, FencePageText } from './generate-fixtures.ts';
+
+export interface LedgerCall { estimate_usd: number; usd: number | null }
+
+export interface CaseOutcome {
+ id: string;
+ /** What the free tiers decided: `llm` means the page reached Tier 3. */
+ tier1: 'clean' | 'proposal' | 'manual' | 'llm';
+ /** Residual reasons Tier 1 left (location-only codes). */
+ residual: string[];
+ /** Model requests (fences) sent for this page. */
+ requests: number;
+ outcome: 'repaired' | 'held' | 'not_sent';
+ reason: string | null;
+ gate: string | null;
+ rows: number[];
+ spent_usd: number;
+ ledger_calls: LedgerCall[];
+ after: FencePageText | null;
+ message: string | null;
+}
+
+export const EVAL_SOURCE = 'default';
+
+export function fixtureTarget(f: Fixture): FenceTarget {
+ const page = { compiled_truth: f.page.compiled_truth, timeline: f.page.timeline };
+ return { mode: 'db', sourceId: EVAL_SOURCE, key: `slug:eval/${f.id}`, slug: `eval/${f.id}`, path: null, sourcePath: null,
+ page, content: null, before: pageSha(page), snapshot: null, hold: null, ctx: { pageVisibility: f.page_visibility } };
+}
+
+/** The ledger with each reserve/settle pair recorded in call order. */
+export function observeCalls(ledger: DailyLedger, calls: LedgerCall[]): DailyLedger {
+ const byId = new Map<string, LedgerCall>();
+ return {
+ ...ledger,
+ reserve: async (estimateUsd, opts) => {
+ const out = await ledger.reserve(estimateUsd, opts);
+ if (out.ok) {
+ const call = { estimate_usd: estimateUsd, usd: null };
+ byId.set(out.reservation.id, call);
+ calls.push(call);
+ }
+ return out;
+ },
+ dispatch: id => ledger.dispatch(id),
+ settle: async (id, actualUsd) => {
+ const call = byId.get(id);
+ if (call) call.usd = actualUsd;
+ return ledger.settle(id, actualUsd);
+ },
+ release: id => { const call = byId.get(id); if (call) calls.splice(calls.indexOf(call), 1); return ledger.release(id); },
+ reclaimExpired: () => ledger.reclaimExpired(),
+ readDay: day => ledger.readDay(day),
+ };
+}
+
+export async function runCase(engine: BrainEngine, incarnation: string, f: Fixture, deps: Tier3Deps): Promise<CaseOutcome> {
+ const target = fixtureTarget(f);
+ const base = { id: f.id, spent_usd: 0, ledger_calls: [] as LedgerCall[], after: null, gate: null, rows: [] as number[], message: null, requests: 0 };
+ const analysis = await analyzeFences(engine, target, { pageId: null });
+ if (analysis.status === 'clean') return { ...base, tier1: 'clean', residual: [], outcome: 'not_sent', reason: 'clean' };
+ if (analysis.status === 'proposal') return { ...base, tier1: 'proposal', residual: [], outcome: 'not_sent', reason: analysis.tier, after: analysis.after };
+ if (analysis.status === 'manual') {
+ return { ...base, tier1: 'manual', residual: [analysis.reason], outcome: 'not_sent', reason: analysis.reason, gate: analysis.gate ?? null, rows: analysis.rows ?? [] };
+ }
+ const calls: LedgerCall[] = [];
+ const result = await runTier3(target, analysis, incarnation, { ...deps, ledger: observeCalls(deps.ledger, calls) });
+ const residual = [...new Set(analysis.residual.map(i => i.reason))].sort();
+ if (result.ok) return { ...base, tier1: 'llm', residual, requests: analysis.requests.length, outcome: 'repaired', reason: null, spent_usd: result.spentUsd, ledger_calls: calls, after: { compiled_truth: result.after.compiled_truth, timeline: result.after.timeline } };
+ return { ...base, tier1: 'llm', residual, requests: analysis.requests.length, outcome: 'held', reason: result.reason, gate: result.gate ?? null, rows: result.rows ?? [],
+ spent_usd: result.spentUsd, ledger_calls: calls, message: result.message };
+}
diff --git a/evals/fence-repair-tier3/score.ts b/evals/fence-repair-tier3/score.ts
new file mode 100644
index 0000000000..334d87ca29
--- /dev/null
+++ b/evals/fence-repair-tier3/score.ts
@@ -0,0 +1,171 @@
+/**
+ * Scoring for the Tier 3 fence-repair eval (#6188 T4). Pure functions.
+ *
+ * A repaired page MATCHES its ground truth when, for every facts and takes
+ * fence in both sections, the rows hold the same non-empty cell text in the
+ * same columns (whitespace collapsed; `\|` read as `|`), and everything
+ * outside the fences is byte-identical. Spacing inside cells and the
+ * choice of narrow versus wide layout when the extra columns are empty do
+ * not count; any moved, dropped or changed text does. `exact` is the
+ * stricter byte-for-byte comparison, reported alongside.
+ *
+ * Metrics (preregistered in gbrain-evals, docs/benchmarks/2026-10-06-fence-repair-tier3-preregistration.md):
+ * - gate-pass rate: repairable items whose Tier 3 repair passed every gate,
+ * over repairable items run.
+ * - false-accept rate: repairable items repaired but not matching their
+ * ground truth, over repairable items run.
+ * - held correctly: adversarial items that stayed held, over adversarial
+ * items run.
+ * - USD per repair: ledger-priced spend on repairable items over repairs.
+ * - latency p50/p95: wall time of the Tier 3 step per item that made a call.
+ */
+import { extractRawRows, primaryFence } from '../../src/core/fence-repair/raw-rows.ts';
+import { collapse } from '../../src/core/fence-repair/schema.ts';
+import type { FencePageText } from './generate-fixtures.ts';
+
+export const SCORER_VERSION = 1;
+
+type Section = 'compiled_truth' | 'timeline';
+
+function fenceShape(text: string, sectionName: 'body' | 'timeline') {
+ const raw = extractRawRows(text, sectionName);
+ const fences = (['facts', 'takes'] as const).map(kind => {
+ const fence = primaryFence(raw, kind);
+ if (!fence) return { kind, rows: null as string[] | null, region: null as [number, number] | null };
+ const rows = fence.rows.map(row => {
+ const cells = [...row.byColumn].map(([column, cell]) => [column, collapse(cell.text)] as const).filter(([, text]) => text !== '');
+ const extra = row.extra.map(cell => collapse(cell.text)).filter(Boolean);
+ return JSON.stringify([Object.fromEntries(cells.sort(([a], [b]) => (a < b ? -1 : 1))), extra]);
+ });
+ return { kind, rows, region: [fence.begin.start, (fence.end ?? { end: text.length }).end] as [number, number] };
+ });
+ let outside = text;
+ for (const f of fences.filter(f => f.region).sort((a, b) => b.region![0] - a.region![0])) outside = outside.slice(0, f.region![0]) + '\u0000FENCE\u0000' + outside.slice(f.region![1]);
+ return { fences: fences.map(f => ({ kind: f.kind, rows: f.rows })), outside };
+}
+
+/** Cell-level comparison of a repaired page with its ground truth. */
+export function compareRepair(after: FencePageText, expected: FencePageText): { cells: boolean; exact: boolean } {
+ const exact = after.compiled_truth === expected.compiled_truth && (after.timeline ?? '') === (expected.timeline ?? '');
+ const cells = (['compiled_truth', 'timeline'] as Section[]).every(field => {
+ const name = field === 'compiled_truth' ? 'body' : 'timeline';
+ const a = fenceShape(after[field] ?? '', name);
+ const e = fenceShape(expected[field] ?? '', name);
+ return a.outside === e.outside && JSON.stringify(a.fences) === JSON.stringify(e.fences);
+ });
+ return { cells, exact };
+}
+
+export interface ResultRow {
+ model: string;
+ run: number;
+ id: string;
+ set: 'repairable' | 'adversarial' | 'gate_limited';
+ adversarial: 'ambiguous' | 'unrecoverable' | null;
+ cls: string;
+ kind: string;
+ tags: string[];
+ tier1: string;
+ /** Model requests (fences) the page sent; more calls than this means a corrective re-ask ran. */
+ requests: number;
+ outcome: 'repaired' | 'held' | 'not_sent';
+ reason: string | null;
+ gate: string | null;
+ match_cells: boolean | null;
+ match_exact: boolean | null;
+ calls: Array<{ latency_ms: number | null; input_tokens: number | null; output_tokens: number | null; estimate_usd: number | null; usd: number | null; stop: string | null; text: string | null }>;
+ spent_usd: number;
+ usd_unregistered: number | null;
+ latency_ms: number;
+ attempts: number;
+}
+
+/** The outcome bucket a held item reports: the gate letter, or the failure reason. */
+export function heldBucket(row: Pick<ResultRow, 'outcome' | 'reason' | 'gate'>): string {
+ if (row.outcome === 'repaired') return 'repaired';
+ if (row.outcome === 'not_sent') return `not_sent:${row.reason}`;
+ return row.gate ? `gate_${row.gate}` : row.reason ?? 'held';
+}
+
+export function quantile(values: readonly number[], q: number): number | null {
+ if (!values.length) return null;
+ const sorted = [...values].sort((a, b) => a - b);
+ const at = (sorted.length - 1) * q;
+ const lo = Math.floor(at);
+ const hi = Math.ceil(at);
+ return sorted[lo]! + (sorted[hi]! - sorted[lo]!) * (at - lo);
+}
+
+/** Wilson 95% interval for k successes in n trials. */
+export function wilson(k: number, n: number): [number, number] | null {
+ if (!n) return null;
+ const z = 1.959964;
+ const p = k / n;
+ const denom = 1 + (z * z) / n;
+ const centre = (p + (z * z) / (2 * n)) / denom;
+ const half = (z * Math.sqrt((p * (1 - p)) / n + (z * z) / (4 * n * n))) / denom;
+ return [Math.max(0, centre - half), Math.min(1, centre + half)];
+}
+
+export interface ModelSummary {
+ model: string;
+ runs: number;
+ repairable: { n: number; repaired: number; gate_pass: number; gate_pass_ci: [number, number] | null; false_accepts: number; false_accept: number; false_accept_ci: [number, number] | null;
+ exact_matches: number; per_run_gate_pass: number[]; reask_used: number; reask_rescued: number; held_by: Record<string, number> };
+ adversarial: { n: number; held: number; held_rate: number; ambiguous_n: number; ambiguous_held: number; unrecoverable_n: number; unrecoverable_held: number; accepted_ids: string[] };
+ gate_limited: { n: number; held: number; accepted_ids: string[] };
+ cost: { usd_total: number; usd_repairable: number; usd_per_repair: number | null; usd_per_item: number; usd_unregistered_per_repair: number | null; input_tokens: number; output_tokens: number; calls: number };
+ latency_ms: { p50: number | null; p95: number | null };
+}
+
+export function summarize(rows: readonly ResultRow[]): ModelSummary[] {
+ const models = [...new Set(rows.map(r => r.model))];
+ return models.map(model => {
+ const mine = rows.filter(r => r.model === model);
+ const rep = mine.filter(r => r.set === 'repairable');
+ const adv = mine.filter(r => r.set === 'adversarial');
+ const gl = mine.filter(r => r.set === 'gate_limited');
+ const repaired = rep.filter(r => r.outcome === 'repaired');
+ const falseAccepts = repaired.filter(r => r.match_cells === false);
+ const runs = [...new Set(mine.map(r => r.run))].sort((a, b) => a - b);
+ const heldBy: Record<string, number> = {};
+ for (const r of rep.filter(r => r.outcome !== 'repaired')) heldBy[heldBucket(r)] = (heldBy[heldBucket(r)] ?? 0) + 1;
+ const reask = rep.filter(r => r.calls.length > r.requests);
+ const amb = adv.filter(r => r.adversarial === 'ambiguous');
+ const unr = adv.filter(r => r.adversarial === 'unrecoverable');
+ const usdRep = rep.reduce((s, r) => s + r.spent_usd, 0);
+ const unregistered = rep.every(r => r.usd_unregistered !== null) ? rep.reduce((s, r) => s + (r.usd_unregistered ?? 0), 0) : null;
+ const allCalls = mine.flatMap(r => r.calls);
+ const latencies = mine.filter(r => r.calls.length > 0).map(r => r.latency_ms);
+ return {
+ model, runs: runs.length,
+ repairable: {
+ n: rep.length, repaired: repaired.length, gate_pass: rep.length ? repaired.length / rep.length : 0, gate_pass_ci: wilson(repaired.length, rep.length),
+ false_accepts: falseAccepts.length, false_accept: rep.length ? falseAccepts.length / rep.length : 0, false_accept_ci: wilson(falseAccepts.length, rep.length),
+ exact_matches: repaired.filter(r => r.match_exact).length,
+ per_run_gate_pass: runs.map(run => { const x = rep.filter(r => r.run === run); return x.length ? x.filter(r => r.outcome === 'repaired').length / x.length : 0; }),
+ reask_used: reask.length, reask_rescued: reask.filter(r => r.outcome === 'repaired').length, held_by: heldBy,
+ },
+ adversarial: {
+ n: adv.length, held: adv.filter(r => r.outcome !== 'repaired').length, held_rate: adv.length ? adv.filter(r => r.outcome !== 'repaired').length / adv.length : 0,
+ ambiguous_n: amb.length, ambiguous_held: amb.filter(r => r.outcome !== 'repaired').length,
+ unrecoverable_n: unr.length, unrecoverable_held: unr.filter(r => r.outcome !== 'repaired').length,
+ accepted_ids: [...new Set(adv.filter(r => r.outcome === 'repaired').map(r => r.id))].sort(),
+ },
+ gate_limited: { n: gl.length, held: gl.filter(r => r.outcome !== 'repaired').length, accepted_ids: [...new Set(gl.filter(r => r.outcome === 'repaired').map(r => r.id))].sort() },
+ cost: {
+ usd_total: mine.reduce((s, r) => s + r.spent_usd, 0), usd_repairable: usdRep, usd_per_repair: repaired.length ? usdRep / repaired.length : null,
+ usd_per_item: mine.length ? mine.reduce((s, r) => s + r.spent_usd, 0) / mine.length : 0,
+ usd_unregistered_per_repair: unregistered !== null && repaired.length ? unregistered / repaired.length : null,
+ input_tokens: allCalls.reduce((s, c) => s + (c.input_tokens ?? 0), 0), output_tokens: allCalls.reduce((s, c) => s + (c.output_tokens ?? 0), 0), calls: allCalls.length,
+ },
+ latency_ms: { p50: quantile(latencies, 0.5), p95: quantile(latencies, 0.95) },
+ };
+ });
+}
+
+/** The preregistered decision rule for one model's summary. */
+export const DECISION = { minGatePass: 0.8, maxFalseAccept: 0.01 } as const;
+export function meetsRule(s: ModelSummary): boolean {
+ return s.repairable.gate_pass >= DECISION.minGatePass && s.repairable.false_accept <= DECISION.maxFalseAccept;
+}
diff --git a/test/eval-fence-repair-tier3.test.ts b/test/eval-fence-repair-tier3.test.ts
new file mode 100644
index 0000000000..c80d567a36
--- /dev/null
+++ b/test/eval-fence-repair-tier3.test.ts
@@ -0,0 +1,89 @@
+/**
+ * Keyless check of the Tier 3 fence-repair eval instrument (#6188 T4,
+ * evals/fence-repair-tier3/).
+ *
+ * Protects: the committed fixtures match their generator; the set keeps at
+ * least 60 repairable fences across every Tier 3 residual class plus both
+ * kinds of adversarial fence; every label holds under the production gates
+ * (the $0 oracle: each repairable ground truth passes every gate and comes
+ * out byte-identical, each gate-limited one is rejected, each ambiguous
+ * probe is accepted, each unrecoverable probe is rejected); and the scorer's
+ * match rule and rates. Fails when: a fixture is hand-edited without
+ * regenerating, a Tier 1 or gate change moves a fixture out of Tier 3 or
+ * makes a ground truth unreachable, or the scorer stops counting a moved
+ * cell as a mismatch. It guards the instrument, not the score: the live run
+ * (harness.ts --model ...) spends tokens and is never part of CI.
+ * Why new: the eval is new with T4.
+ * Seams: the gateway's chat transport stub (oracle.ts), which production never sets.
+ */
+import { afterAll, describe, expect, test } from 'bun:test';
+import { readFileSync } from 'node:fs';
+import { join } from 'node:path';
+import { resetGateway } from '../src/core/ai/gateway.ts';
+import { fixturesJsonl, type Fixture } from '../evals/fence-repair-tier3/generate-fixtures.ts';
+import { oracleAnswers, runOracle } from '../evals/fence-repair-tier3/oracle.ts';
+import { compareRepair, meetsRule, summarize, wilson, type ResultRow } from '../evals/fence-repair-tier3/score.ts';
+
+const dir = join(import.meta.dir, '..', 'evals/fence-repair-tier3');
+const text = readFileSync(join(dir, 'fixtures.jsonl'), 'utf8');
+const fixtures: Fixture[] = text.trim().split('\n').map(line => JSON.parse(line));
+
+afterAll(() => resetGateway());
+
+describe('fixtures', () => {
+ test('match the generator (regenerate with bun evals/fence-repair-tier3/generate-fixtures.ts)', () => {
+ expect(text).toBe(fixturesJsonl());
+ });
+
+ test('at least 60 repairable fences over every class, both adversarial kinds, unique ids', () => {
+ expect(new Set(fixtures.map(f => f.id)).size).toBe(fixtures.length);
+ const repairable = fixtures.filter(f => f.set === 'repairable');
+ expect(repairable.length).toBeGreaterThanOrEqual(60);
+ for (const cls of ['short_row_trailing', 'short_row_gap', 'no_header', 'row_before_header', 'extra_cells', 'header_unmapped', 'mixed']) {
+ expect(repairable.filter(f => f.cls === cls).length).toBeGreaterThanOrEqual(5);
+ }
+ for (const kind of ['facts', 'takes']) expect(repairable.filter(f => f.kind === kind).length).toBeGreaterThanOrEqual(15);
+ expect(fixtures.filter(f => f.adversarial === 'ambiguous').length).toBeGreaterThanOrEqual(5);
+ expect(fixtures.filter(f => f.adversarial === 'unrecoverable').length).toBeGreaterThanOrEqual(3);
+ for (const f of fixtures) expect(f.expected === null).toBe(f.set === 'adversarial');
+ });
+});
+
+describe('oracle', () => {
+ test('every label holds under the production gates', async () => {
+ expect(await runOracle(fixtures, oracleAnswers)).toEqual([]);
+ }, 60_000);
+});
+
+describe('scorer', () => {
+ const fx = fixtures.find(f => f.id === 'f-sg-01')!;
+ const want = fx.expected!;
+ test('cell spacing does not matter; a moved or changed cell does', () => {
+ const spaced = { ...want, compiled_truth: want.compiled_truth.replace('| 2026-04-01 | | intro call | |', '|2026-04-01||intro call||') };
+ expect(compareRepair(spaced, want)).toEqual({ cells: true, exact: false });
+ const moved = { ...want, compiled_truth: want.compiled_truth.replace('| 2026-04-01 | | intro call | |', '| 2026-04-01 | intro call | | |') };
+ expect(compareRepair(moved, want).cells).toBe(false);
+ const changed = { ...want, compiled_truth: want.compiled_truth.replace('intro call', 'intro-call') };
+ expect(compareRepair(changed, want).cells).toBe(false);
+ const prose = { ...want, compiled_truth: want.compiled_truth.replace('Working notes', 'Working note') };
+ expect(compareRepair(prose, want).cells).toBe(false);
+ });
+
+ test('rates, the decision boundary and the interval', () => {
+ const row = (id: string, set: ResultRow['set'], outcome: ResultRow['outcome'], match: boolean | null): ResultRow => ({ model: 'm', run: 1, id, set, adversarial: set === 'adversarial' ? 'ambiguous' : null,
+ cls: 'short_row_trailing', kind: 'facts', tags: [], tier1: 'llm', requests: 1, outcome, reason: outcome === 'held' ? 'cell_changed' : null, gate: outcome === 'held' ? 'f' : null,
+ match_cells: match, match_exact: match, calls: [{ latency_ms: 1000, input_tokens: 500, output_tokens: 100, estimate_usd: 0.02, usd: 0.01, stop: 'end_turn', text: '' }],
+ spent_usd: 0.01, usd_unregistered: 0.01, latency_ms: 1000, attempts: 1 });
+ const rows = [...Array.from({ length: 8 }, (_, i) => row(`r${i}`, 'repairable', 'repaired', true)), row('r8', 'repairable', 'repaired', false), row('r9', 'repairable', 'held', null), row('a0', 'adversarial', 'held', null)];
+ const [s] = summarize(rows);
+ expect(s!.repairable).toMatchObject({ n: 10, repaired: 9, gate_pass: 0.9, false_accepts: 1, false_accept: 0.1 });
+ expect(s!.adversarial).toMatchObject({ n: 1, held: 1 });
+ expect(s!.cost.usd_per_repair).toBeCloseTo(0.1 / 9, 10);
+ expect(meetsRule(s!)).toBe(false);
+ expect(meetsRule({ ...s!, repairable: { ...s!.repairable, gate_pass: 0.8, false_accept: 0.01 } })).toBe(true);
+ expect(meetsRule({ ...s!, repairable: { ...s!.repairable, gate_pass: 0.79, false_accept: 0 } })).toBe(false);
+ const [lo, hi] = wilson(0, 198)!;
+ expect(lo).toBe(0);
+ expect(hi).toBeCloseTo(0.019, 3);
+ });
+});