Skip to content

Garry's Opinionated OpenClaw/Hermes Agent Brain

TypeScript

eval(fence-repair): round 2 measured: gpt-6.1-sol, claude-opus-5-5 and claude-fable-5-1 qualify on the round 1 fixtures and a held-out set; claude-opus-5-5 becomes the Anthropic default; one instrument (held-out set, routing-aware harness and scorer, oracle with free-tier paths and HOLD) (#6188 T4)

garrytan51f4602d4420
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 444bd1e32e..480915b953 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -35,13 +35,13 @@ gbrain config set fences.repair.llm false # keep table rows away from the mo
| Managed sources | Each repaired file is committed as `gbrain: repair fence in <path> (<classes>)`. |
| Other sources | The original file is backed up under `~/.gbrain/backups/fences/` before the write, and `gbrain sources status` plus doctor show the repair until you commit it. |
| Held files | Every `invalid_fence` hold and the doctor `fence_integrity` fix point at the `gbrain repair fences` preview (`--only <path>` for one file). A table only a person can decide still names the exact edit. |
-| Model choice | `models.fence_repair` picks the model, and a model you set always runs. Unset, gbrain uses `openai:gpt-6.1-sol` when it has an OpenAI key, else `anthropic:claude-fable-5-1` when it has an Anthropic key, else no model (those tables wait as `no_measured_model`). `gbrain models` shows which. |
+| Model choice | `models.fence_repair` picks the model, and a model you set always runs. Unset, gbrain uses `openai:gpt-6.1-sol` when it has an OpenAI key, else `anthropic:claude-opus-5-5` when it has an Anthropic key, else no model (those tables wait as `no_measured_model`). `gbrain models` shows which. |
| Stray cells | A row with an extra empty cell is lined up by a free rule when exactly one cell can go. A row whose extra cells hold text, or a facts kind cell that holds a sentence, is held for a person: usually an unescaped `\|` cut the claim in two, and no check can tell that from a misplaced cell. |
### Things to watch
-- How often the model's rewrites pass the checks is not measured yet.
-- Each model call reserves its worst case, including room for a reasoning model to think, so the per-page cap is $0.30; measured spend was about $0.02 per repaired table on the most expensive default model.
+- Measured on 40 held-out synthetic broken tables over three runs, the default models (`openai:gpt-6.1-sol`, `anthropic:claude-opus-5-5`) each repaired 95 of 99 attempts with no cell in the wrong column and answered HOLD on the other 4. The checks cannot tell which of two free-text columns a moved cell belongs in, so only models measured this way are defaults.
+- Each model call reserves its worst case, including room for a reasoning model to think, so the per-page cap is $0.30; measured spend was about $0.003 (`openai:gpt-6.1-sol`) and $0.008 (`anthropic:claude-opus-5-5`) per repaired table.
- A model gbrain has no price for still runs under the default caps, metered at the highest chat rate gbrain knows; under a cap you set, it waits until you register its price with `gbrain pricing set`.
- When the daily cap runs out, repair stops and the remaining tables wait until 00:00 UTC; the run says when and how many.
- Turning the settings off stops future repairs and does not undo past ones. A broken table you restore is held again on the next sync and repaired again by the next maintenance run, so pause first if you want to keep it.
@@ -50,7 +50,7 @@ gbrain config set fences.repair.llm false # keep table rows away from the mo
- `src/core/repair/fences.ts`: the `fences` repair kind (preview-bound, `spends: 'llm'`). Candidates come from the fence census after a bounded scan (`GBRAIN_FENCE_REPAIR_SCAN_MS`, default 10 s); `--only`, `--skip` and `--slug` also reach files and pages the census has not judged yet. A candidate whose source is owned by another host (`owner_unavailable`) or mid-sync (`sync_in_progress`) is skipped, and every candidate is re-read before any fix runs.
- Holder names (`src/core/fence-repair/repair-tiers.ts`) resolve strictly, without same-name guessing, only to `people/` and `companies/` pages, and never to a private page from a world-visible one. A model repair claims the attempt memo, checks the per-page cap and the run's allowance, reserves on the daily ledger before each call and settles the real tokens after; a rewrite the checks rejected, or a HOLD (`llm_declined`), is never paid for again for unchanged bytes. The call (`src/core/fence-repair/llm.ts`, prompt version 2) uses no tools, no fallback model and no temperature; its output ceiling adds 2,048 tokens for a model whose reasoning the call cannot turn off, and the estimate uses the ceiling the gateway sends. It gets one corrective re-ask only when the answer does not parse or changes the row count; any other gate rejection is final. A headerless table of 14-cell rows is sent with the wide header.
-- The model default (`src/core/fence-repair/model.ts`, `measured.ts`): `models.fence_repair` when set; else the first of the measured models (`openai:gpt-6.1-sol`, `anthropic:claude-fable-5-1`) whose provider key the brain has; else none (`no_measured_model`, a paid hold whose fix sets `models.fence_repair`). `openai:gpt-6.1-sol` joins the price table at $2/$10 per million tokens and stays out of OpenAI tier-default discovery. `fences.repair.max_usd_per_page` defaults to $0.30 (was $0.05), the largest worst-case page estimate of the measured models on the eval's fixtures being $0.27.
+- The model default (`src/core/fence-repair/model.ts`, `measured.ts`): `models.fence_repair` when set; else the first of the measured models (`openai:gpt-6.1-sol`, `anthropic:claude-opus-5-5`, `anthropic:claude-fable-5-1`; the models that met the eval's bar on its round 1 fixtures and its held-out set) whose provider key the brain has; else none (`no_measured_model`, a paid hold whose fix sets `models.fence_repair`). `openai:gpt-6.1-sol` joins the price table at $2/$10 per million tokens and stays out of OpenAI tier-default discovery. `fences.repair.max_usd_per_page` defaults to $0.30 (was $0.05), the largest worst-case page estimate of the measured models on the eval's fixtures being $0.27.
- Tier 1 `stray_empty_cell` (`src/core/fence-repair/stray-cells.ts`) removes empty cells from a row with too many only when exactly one removal makes every checked column valid. `extra_cells` is now manual, and a facts `kind_map` reads only a kind word (at most three words, no sentence punctuation, link or strikethrough); anything else is `claim_split`, manual. `FENCE_RULES_VERSION` is 2, so older holds are screened again.
- Every rewrite passes the same validation gates as the inline repair, plus a fixed-point check, before it is written. A misaligned cell whose text is unchanged is now moved to the column it belongs to rather than rejected.
- Write-back (`src/core/fence-repair/repair-io.ts`): managed sources go through `managed_file_repair` with a location-only `fence_repair` receipt checked at submission and again when prepared (remote callers are refused); other checkouts are confined, re-hashed (`changed_since_read`), backed up, written and imported, with the backup restored if the import refuses; database-only pages and mirrors get a revision-bound write.
diff --git a/docs/guides/repair.md b/docs/guides/repair.md
index 28152c961a..707e76495e 100644
--- a/docs/guides/repair.md
+++ b/docs/guides/repair.md
@@ -857,9 +857,18 @@ sent again until the file, the model or the rules change.
The repair model is `models.fence_repair` when set. Unset, it is the first
model the fence-repair eval measured as accurate enough whose provider key the
-brain has: `openai:gpt-6.1-sol`, then `anthropic:claude-fable-5-1`. With
-neither key, model-tier fences wait as `no_measured_model` until the user
-picks a model.
+brain has: `openai:gpt-6.1-sol` with an OpenAI key, else
+`anthropic:claude-opus-5-5` with an Anthropic key (`anthropic:claude-fable-5-1`
+also met the bar). With neither key, model-tier fences wait as
+`no_measured_model` until the user picks a model.
+
+The gates check that no text is lost or rewritten; they cannot tell which of two
+free-text columns a moved cell belongs in, which is why only measured models
+are defaults. On 40 held-out synthetic malformed fences over three runs
+(`evals/fence-repair-tier3`), `openai:gpt-6.1-sol` and
+`anthropic:claude-opus-5-5` each repaired 95 of the 99 attempts that reached
+the model, none with a cell in the wrong column, and answered HOLD on the
+other 4; rows with stray empty cells were lined up by the free rule instead.
The session below is real output (volatile ids, hashes and times shown as
`<id>`, `<hash>`, `<time>`; `test/fence-walkthrough.test.ts` runs these
@@ -1018,7 +1027,7 @@ the next maintenance run, so pause first if you want to keep the original.
| `fences.repair.llm` | `true` | `false` keeps every repair to the free tiers; model-tier holds stay `llm_disabled`. |
| `fences.repair.max_usd_per_page` | `0.30` | The most one page may spend on the model, checked against each call's worst case (the prompt plus the full output ceiling, with 2,048 tokens for a reasoning model to think). `0` means no model spend. |
| `fences.repair.max_usd_per_day` | `1.00` | The most all processes together spend per UTC day, through a durable ledger. `0` means no model spend. |
-| `models.fence_repair` | unset: the first measured model with a key (`openai:gpt-6.1-sol`, then `anthropic:claude-fable-5-1`), else none | The model Tier 3 calls (`gbrain models` shows it). A model you set always runs; one gbrain has no price for runs under the default caps at an estimated ceiling (the highest chat rate gbrain knows; `gbrain pricing set` makes it exact) and waits for its price under a cap you set. |
+| `models.fence_repair` | unset: the first measured model with a key (`openai:gpt-6.1-sol` with an OpenAI key, else `anthropic:claude-opus-5-5` with an Anthropic key), else none | The model Tier 3 calls (`gbrain models` shows it). A model you set always runs; one gbrain has no price for runs under the default caps at an estimated ceiling (the highest chat rate gbrain knows; `gbrain pricing set` makes it exact) and waits for its price under a cap you set. |
| `fences.normalize` | `true` | `false` stops the inline rewrite on writes and syncs: a fixable fence is held or refused like any other. |
## Resume
diff --git a/docs/guides/write-refusals.md b/docs/guides/write-refusals.md
index 372b1c6f8f..404b835b27 100644
--- a/docs/guides/write-refusals.md
+++ b/docs/guides/write-refusals.md
@@ -242,8 +242,8 @@ remaining daily cap, and prints the apply command with its `--expect` hash.
Applying needs no extra consent. Tier 1 and 2 changes are exact rules; Tier 3
sends only the fence header and the rows it must realign (never valid rows,
never the rest of the page) to the repair model (`models.fence_repair`, or
-unset the first measured model with a key: `openai:gpt-6.1-sol`, then
-`anthropic:claude-fable-5-1`), within `fences.repair.max_usd_per_page` ($0.30) and
+unset the first measured model with a key: `openai:gpt-6.1-sol`, else
+`anthropic:claude-opus-5-5`), within `fences.repair.max_usd_per_page` ($0.30) and
`fences.repair.max_usd_per_day` ($1.00) ([spend](../operations/spend-controls.md#the-gates)).
Every tier's output passes [gates (a) to (g)](fence-format.md#gates) before
anything is written. `--no-llm` keeps a run to the free tiers and
@@ -325,7 +325,7 @@ clears or retries it with no one acting.
| <a id="fence-llm_truncated"></a>`llm_truncated` | The repair model stopped before finishing; its output is rejected even when it parses. | `llm` | no | Fix the named rows by hand; the same file is not sent to the model again until it or the model changes. Format: [tiers](fence-format.md#never-guessed). |
| <a id="fence-llm_declined"></a>`llm_declined` | The repair model answered HOLD: a row has more than one reasonable reading (two values for one column, or a cell that fits two columns), so it declined to guess. | `llm` | no | Fix the named rows by hand; the same file is not sent to the model again until it, the model or the rules change. Format: [tiers](fence-format.md#never-guessed). |
| <a id="fence-llm_disabled"></a>`llm_disabled` | Model repair is off (`fences.repair.llm false`), so a fence only Tier 3 can realign waits. | `llm` | no | Fix the named rows by hand, or ask the user before turning model repair back on: `gbrain config set fences.repair.llm true` (it spends within the caps). Format: [tiers](fence-format.md#never-guessed). |
-| <a id="fence-no_measured_model"></a>`no_measured_model` | `models.fence_repair` is unset and no model the fence-repair eval measured as accurate enough (`openai:gpt-6.1-sol`, then `anthropic:claude-fable-5-1`) has a provider key on this brain, so model repair is off by default. | `llm` | no | Fix the named rows by hand, or ask the user which model to trust, then `gbrain config set models.fence_repair <provider:model>` (an explicit model always runs). Format: [tiers](fence-format.md#never-guessed). |
+| <a id="fence-no_measured_model"></a>`no_measured_model` | `models.fence_repair` is unset and no model the fence-repair eval measured as accurate enough (`openai:gpt-6.1-sol`, `anthropic:claude-opus-5-5`, `anthropic:claude-fable-5-1`) has a provider key on this brain, so model repair is off by default. | `llm` | no | Fix the named rows by hand, or ask the user which model to trust, then `gbrain config set models.fence_repair <provider:model>` (an explicit model always runs). Format: [tiers](fence-format.md#never-guessed). |
| <a id="fence-budget_exhausted"></a>`budget_exhausted` | The page's repair estimate is over `fences.repair.max_usd_per_page` or over what is left of `fences.repair.max_usd_per_day` today (UTC). A repair run stops with exit 1 naming the spend, the cap, the reset time (next 00:00 UTC) and the pages waiting. | `llm` | yes | Nothing to do: repairs resume after 00:00 UTC. Raising a cap is the user's call: `gbrain config set fences.repair.max_usd_per_day <usd>` (or `fences.repair.max_usd_per_page`). Format: [tiers](fence-format.md#never-guessed). |
| <a id="fence-no_pricing"></a>`no_pricing` | A spend cap the user set is in force and gbrain has no price for the repair model, so no call was made. Under the default caps an unpriced model runs, metered at an estimated ceiling. | `llm` | no | Look up the model's per-token price and register it on the brain host: `gbrain pricing set <model> --input <usd> --output <usd>` ([registering a model price](../operations/spend-controls.md#registering-a-model-price)). The next run repairs it. Format: [tiers](fence-format.md#never-guessed). |
| <a id="fence-ledger_unavailable"></a>`ledger_unavailable` | The spend ledger could not be read or written, so no model call was made. | `llm` | yes | Nothing to do: the next run retries. If it keeps happening, check the database with `gbrain doctor --json`. Format: [tiers](fence-format.md#never-guessed). |
diff --git a/docs/operations/spend-controls.md b/docs/operations/spend-controls.md
index 0acf01dbcf..c4f7f5ab2e 100644
--- a/docs/operations/spend-controls.md
+++ b/docs/operations/spend-controls.md
@@ -182,8 +182,9 @@ is free.
- **Model.** `models.fence_repair` when set (any model, priced or not, always
runs). Unset, the first model the fence-repair eval measured as accurate
- enough whose provider key the brain has: `openai:gpt-6.1-sol`, then
- `anthropic:claude-fable-5-1`. With neither key, model repair is off by
+ enough whose provider key the brain has: `openai:gpt-6.1-sol` with an
+ OpenAI key, else `anthropic:claude-opus-5-5` with an Anthropic key
+ (`anthropic:claude-fable-5-1` also met the bar). With neither key, model repair is off by
default and those fences wait as `no_measured_model`; choosing a model is
the user's call.
@@ -199,9 +200,10 @@ is free.
`config set`; `0` means no model spend. A call's estimate is its worst
case: the prompt plus the full output ceiling, which leaves a reasoning
model 2,048 tokens to think before it writes the table. The per-page
- default covers `anthropic:claude-fable-5-1`'s worst case for the largest
- page in the eval (two fences, $0.27); measured spend was about $0.02 per
- repair. A page over either cap waits as
+ default covers the worst case of every measured model for the largest
+ page in the eval (`anthropic:claude-fable-5-1`, two fences, $0.27); measured
+ spend per model repair was about $0.003 (`openai:gpt-6.1-sol`), $0.008
+ (`anthropic:claude-opus-5-5`) and $0.02 (`anthropic:claude-fable-5-1`). A page over either cap waits as
`budget_exhausted`; `gbrain repair fences --apply` stops with exit 1,
naming the spend, the cap, the reset time (next 00:00 UTC) and the pages
waiting. Raising a cap is the user's call.
diff --git a/evals/fence-repair-tier3/README.md b/evals/fence-repair-tier3/README.md
index e8c9002b59..f5cccfa7ae 100644
--- a/evals/fence-repair-tier3/README.md
+++ b/evals/fence-repair-tier3/README.md
@@ -1,41 +1,60 @@
# 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*`).
+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 which models are accurate enough to be the default. The preregistration, its round 2 amendment, raw per-item results and verdicts live in gbrain-evals (`docs/benchmarks/2026-10-06-fence-repair-tier3*`).
+
+## Current result
+
+Round 2, measured 2026-10-06 at gbrain `7d75e08c` (prompt version 2: a model may answer HOLD; a corrective re-ask only after gate (a) or (e); Tier 1 `stray_empty_cell`; extra text cells and split claims held before the model). Three runs per model. Gate-pass and false-accept count the fences that reach the model: 33 of the 40 held-out repairable fences (99 attempts per model) and 55 of the 66 round 1 repairable fences (165). The preregistered bar is gate-pass at least 80% and false-accept at most 1%, and a model qualifies only if it meets it on both sets; the held-out set, written before the round 2 code, decides.
+
+| Model | Held-out gate-pass | Held-out false-accept | Round 1 gate-pass | Round 1 false-accept | USD per repair | Latency p50 / p95 | Qualifies |
+|---|---|---|---|---|---|---|---|
+| `openai:gpt-6.1-sol` | 95/99 (96.0%) | 0/99 | 156/165 (94.5%) | 0/165 | $0.0026 | 3.7 s / 7.1 s | yes |
+| `anthropic:claude-opus-5-5` | 95/99 (96.0%) | 0/99 | 157/165 (95.2%) | 0/165 | $0.0081 | 3.9 s / 10.9 s | yes |
+| `anthropic:claude-fable-5-1` | 93/99 (93.9%) | 0/99 | 154/165 (93.3%) | 0/165 | $0.0210 | 6.6 s / 17.7 s | yes |
+| `anthropic:claude-opus-4-7` | 96/99 (97.0%) | 0/99 | 162/165 (98.2%) | 3/165 (1.8%) | $0.0077 | 1.8 s / 4.5 s | no |
+| `anthropic:claude-sonnet-5-5` | 96/99 (97.0%) | 3/99 (3.0%) | 144/165 (87.3%) | 3/165 (1.8%) | $0.0031 | 1.7 s / 3.0 s | no |
+
+Held-out USD and latency shown. So `FENCE_REPAIR_MEASURED_MODELS` (`src/core/fence-repair/measured.ts`) is `openai:gpt-6.1-sol`, `anthropic:claude-opus-5-5`, `anthropic:claude-fable-5-1`: with `models.fence_repair` unset, an OpenAI key gets `gpt-6.1-sol` and an Anthropic key `claude-opus-5-5` (it ties `gpt-6.1-sol` on held-out gate-pass and beats Fable 5.1 on gate-pass, cost and speed). Every held repairable attempt of the three qualifying models was a HOLD; every false accept was a free-text cell in the wrong column. The free tiers repaired every stray-empty-cell fence exactly (18 held-out and 30 round 1 attempts per model). No answer ran out of output tokens and no re-ask ran.
+
+Round 1 (prompt v1, 2026-10-06 at `171a7e24`) found the default then, `claude-opus-4-7`, writing a wrong cell in 8 of 198 repairs (4.0%); its findings led to the round 2 code.
## What's here
| File | Role |
|---|---|
-| `cases.ts` | 78 hand-written cases. Each is one page whose fence the first run's Tier 1 left with a residual reason a model could clear (`short_row`, `no_header`, `row_before_header`, `extra_cells`, `header_unmapped`), with the whole repaired section written by hand. The cases and `fixtures.jsonl` are unchanged since the preregistered run; since then the free tiers decide 17 of them (`FREE_TIER_PATH` in `oracle.ts`): Tier 1 repairs 10 stray-empty-cell rows and holds 7 rows whose extra cells removing empty cells cannot line up. 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 (a page they repair is `repaired` with `tier1: proposal`, one they hold is `not_sent`), and `runTier3` makes the model call with the brain's real daily ledger and attempt store (prompt v2, where the model may answer HOLD, held as `llm_declined`; one call per fence; a corrective re-ask only after a structural failure, gate (a) or (e); gates (a)-(g); Tier 1 fixed point). Nothing re-implements a tier or a gate. |
+| `cases.ts` | Round 1: 78 hand-written cases. Each is one page whose fence round 1's Tier 1 left with a residual reason a model could 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). Unchanged since the preregistered run; the free tiers now decide 17 of them (`FREE_TIER_PATH` in `oracle.ts`). Placeholder names only. |
+| `heldout-cases.ts` | Round 2's held-out set: 52 cases written after round 1 and before any round 2 code result, with the same class mix on new pages (40 repairable) plus 6 ambiguous, 4 split-claim (a claim cut in two by an unescaped pipe; the correct outcome is to stay held) and 2 unrecoverable adversarials. The free tiers decide 12 of them. |
+| `generate-fixtures.ts` | Deterministic builder: `cases.ts` → `fixtures.jsonl` and `heldout-cases.ts` → `heldout.jsonl` (both 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 v2, where the model may answer HOLD, held as `llm_declined`; one call per fence; a corrective re-ask only after gate (a) or (e); gates (a)-(g); Tier 1 fixed point). A fence the free tiers repair or hold is reported with that tier. 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; the free tiers must decide the `FREE_TIER_PATH` fixtures as listed; a HOLD answer to every Tier 3 fixture must be held as `llm_declined`. |
-| `score.ts` | Pure scoring: the cell-level match rule, per-model rates over the production path plus the Tier 3-only share (`repairable.tier3`), HOLD counts, Wilson intervals and the preregistered decision rule. |
-| `harness.ts` | Runner: `--oracle`, live (`--model`, `--run`, `--out`) and `--score`. |
+| `score.ts` | Pure scoring: the cell-level match rule, the preregistered Tier 3 rates, the whole-path rates (a free-tier repair counting as repaired), wrong writes per tier, how adversarial fences were held, Wilson intervals and the decision rule. |
+| `harness.ts` | Runner: `--oracle`, live (`--model`, `--run`, `--out`) and `--score`; every mode takes `--fixtures fixtures.jsonl` (default) or `--fixtures heldout.jsonl`. |
-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.
+The keyless test is `test/eval-fence-repair-tier3.test.ts` (fixture freshness and coverage floors for both sets, the oracle on both, 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
+bun evals/fence-repair-tier3/harness.ts --oracle --fixtures heldout.jsonl
# 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 --fixtures heldout.jsonl --model anthropic:claude-opus-5-5 --run 1 --out results/heldout-opus-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
+# Score saved runs ($0), one set at a time:
+bun evals/fence-repair-tier3/harness.ts --score results/heldout-*.jsonl --json summary-heldout.json
```
-A live run sets `models.fence_repair` on its brain (unset for `default`, which resolves to the first measured model with a provider key and refuses to run when there is none), registers list prices gbrain's table lacks in `pricing.overrides` (as `gbrain pricing set` would; none today), 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, so a call 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.
+A live run sets `models.fence_repair` on its brain (unset for `default`, which resolves to the first measured model with a provider key and refuses to run when there is none), registers list prices gbrain's table lacks in `pricing.overrides` (as `gbrain pricing set` would; none today), 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, so a call 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 tier and 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).
+Exit codes: 0 done, 1 oracle violation, 2 infrastructure (no key or no measured model, cap reached, a fixture that already compiles).
## Metrics
-- **Gate-pass rate**: repairable fences repaired on the production path (by the free tiers, or by a Tier 3 repair that passed every gate), over repairable fences run. `repairable.tier3` gives the same counts for the fences that reached the model.
-- **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 (`declined` counts the ones the model held with HOLD).
-- **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).
+- **Gate-pass rate** (preregistered): repairable fences that reached Tier 3 and whose repair passed every gate, over repairable fences that reached Tier 3. A HOLD counts as not repaired.
+- **False-accept rate** (preregistered): of those, repairs not matching the ground truth. A match means the same non-empty cell text in the same columns (spacing ignored) and identical text outside the fences.
+- **Whole path** (reported): the same rates over every repairable fence, a free-tier repair counting as repaired; **end to end** adds wrong writes per tier.
+- **Held correctly** (reported): adversarial fences that stayed held, by kind and by how (before the model, HOLD, a gate, the output budget).
+- **USD per repair**: ledger-priced spend on repairable fences that reached the model over their 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
index a0c5695c09..a4f9d2603c 100644
--- a/evals/fence-repair-tier3/cases.ts
+++ b/evals/fence-repair-tier3/cases.ts
@@ -18,6 +18,8 @@
* 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).
+ * `split_claim` cases have a claim cut in two by an unescaped pipe; the
+ * claim cannot be rejoined (gate b), so a repair can only keep it cut.
* - `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.
@@ -31,7 +33,7 @@ export type CaseClass = 'short_row_trailing' | 'short_row_gap' | 'no_header' | '
export interface Case {
id: string;
set: CaseSet;
- adversarial?: 'ambiguous' | 'unrecoverable';
+ adversarial?: 'ambiguous' | 'unrecoverable' | 'split_claim';
cls: CaseClass;
kind: 'facts' | 'takes' | 'both';
section?: 'body' | 'timeline';
diff --git a/evals/fence-repair-tier3/generate-fixtures.ts b/evals/fence-repair-tier3/generate-fixtures.ts
index db524845cb..0bc064c95b 100644
--- a/evals/fence-repair-tier3/generate-fixtures.ts
+++ b/evals/fence-repair-tier3/generate-fixtures.ts
@@ -1,6 +1,7 @@
#!/usr/bin/env bun
/**
- * Builds fixtures.jsonl from cases.ts (deterministic; no dates, no randomness).
+ * Builds fixtures.jsonl from cases.ts (round 1) and heldout.jsonl from
+ * heldout-cases.ts (round 2's held-out set); 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
@@ -8,7 +9,7 @@
* section; `probe` is the adversarial answer text.
*
* Regenerate: bun evals/fence-repair-tier3/generate-fixtures.ts
- * Output: evals/fence-repair-tier3/fixtures.jsonl (committed)
+ * Output: evals/fence-repair-tier3/fixtures.jsonl and heldout.jsonl (committed)
*/
import { writeFileSync } from 'node:fs';
import { join } from 'node:path';
@@ -16,8 +17,10 @@ import { FACTS_FENCE_BEGIN, FACTS_FENCE_END } from '../../src/core/facts-fence.t
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';
+import { HELDOUT_CASES } from './heldout-cases.ts';
export const FIXTURES_PATH = join(import.meta.dir, 'fixtures.jsonl');
+export const HELDOUT_PATH = join(import.meta.dir, 'heldout.jsonl');
const TOKENS: Record<string, string> = {
'{FB}': FACTS_FENCE_BEGIN, '{FE}': FACTS_FENCE_END, '{TB}': TAKES_FENCE_BEGIN, '{TE}': TAKES_FENCE_END,
@@ -56,19 +59,20 @@ function pageOf(c: Case, body: readonly string[]): FencePageText {
: { compiled_truth: `${title}${section}`, timeline: '' };
}
-export function buildFixtures(): Fixture[] {
- return CASES.map(c => ({
+export function buildFixtures(cases: readonly Case[] = CASES): 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';
+export function fixturesJsonl(cases: readonly Case[] = CASES): string {
+ return buildFixtures(cases).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}`);
+ writeFileSync(FIXTURES_PATH, fixturesJsonl(CASES));
+ writeFileSync(HELDOUT_PATH, fixturesJsonl(HELDOUT_CASES));
+ console.log(`wrote ${CASES.length} fixtures to ${FIXTURES_PATH} and ${HELDOUT_CASES.length} to ${HELDOUT_PATH}`);
}
diff --git a/evals/fence-repair-tier3/harness.ts b/evals/fence-repair-tier3/harness.ts
index 19c560e146..29d0b768e7 100644
--- a/evals/fence-repair-tier3/harness.ts
+++ b/evals/fence-repair-tier3/harness.ts
@@ -2,14 +2,18 @@
/**
* Tier 3 fence-repair eval runner (#6188 T4).
*
+ * Every mode takes `--fixtures <file>`: fixtures.jsonl (round 1, default) or
+ * heldout.jsonl (round 2's held-out set).
+ *
* ORACLE mode ($0, no key):
- * bun evals/fence-repair-tier3/harness.ts --oracle
+ * bun evals/fence-repair-tier3/harness.ts --oracle [--fixtures heldout.jsonl]
* 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.
+ * unrecoverable probe is rejected. Fixtures the free tiers settle are listed
+ * as routing notes (see oracle.ts). 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>
@@ -41,15 +45,18 @@ 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`.
- * Empty: every model this eval has run is in the table (gpt-6.1-sol joined it with the fixes the first run found).
+ * List prices (USD per 1M tokens) registered on the eval brain like `gbrain pricing set`, only for a model gbrain's own price table lacks.
+ * Empty: every model this eval runs is in the table (round 1 registered `openai:gpt-6.1-sol` at $2/$10 before it joined the table).
*/
export const REGISTERED_PRICES: Record<string, { input: number; output: number; source: string }> = {};
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;
+/** `--fixtures <file>`: round 1's fixtures.jsonl by default, or heldout.jsonl; a bare name resolves next to this file. */
+export const FIXTURES_FILE = (() => { const f = flag('--fixtures') ?? 'fixtures.jsonl'; return f.includes('/') ? f : join(here, f); })();
+
export function loadFixtures(): Fixture[] {
- return readFileSync(join(here, 'fixtures.jsonl'), 'utf8').trim().split('\n').map(line => JSON.parse(line));
+ return readFileSync(FIXTURES_FILE, 'utf8').trim().split('\n').map(line => JSON.parse(line));
}
async function newBrain() {
@@ -70,9 +77,10 @@ if (args.includes('--score')) {
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');
+ console.log('model | runs | Tier 3 gate-pass | Tier 3 false-accept | end to end repaired / wrong | 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.end_to_end.repaired}/${s.end_to_end.n} / ${s.end_to_end.wrong_writes} | `
+ `${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);
@@ -90,9 +98,10 @@ 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);
+ const { violations, notes } = await runOracle(selected, oracleAnswers);
+ for (const n of notes) console.log(`ROUTING ${n}`);
for (const v of violations) console.error(`VIOLATION ${v}`);
- console.log(`oracle: ${selected.length} fixture(s), ${violations.length} violation(s)`);
+ console.log(`oracle: ${selected.length} fixture(s) from ${FIXTURES_FILE}, ${notes.length} routing note(s), ${violations.length} violation(s)`);
process.exit(violations.length ? 1 : 0);
}
@@ -113,19 +122,18 @@ const { resolveFenceRepairModel } = await import('../../src/core/fence-repair/mo
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 { canonicalLookup } = await import('../../src/core/model-pricing.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 }]))));
+const registered = Object.fromEntries(Object.entries(REGISTERED_PRICES).filter(([m]) => !canonicalLookup(m)));
+await engine.setConfig('pricing.overrides', JSON.stringify(Object.fromEntries(Object.entries(registered).map(([m, p]) => [m, { input: p.input, output: p.output }]))));
await engine.setConfig(FENCE_REPAIR_MAX_USD_PER_DAY_KEY, String(maxUsd));
const resolved = await resolveFenceRepairModel(engine);
-if (!resolved) {
- console.error('fence-repair-tier3: --model default resolves to no model: no measured fence-repair model has a provider key here. Set a key, or pass --model.');
- process.exit(2);
-}
-const model = resolved;
+if (!resolved) { console.error('fence-repair-tier3: --model default resolves to no model: no measured fence-repair model has a provider key here. Set a key, or pass --model.'); process.exit(2); }
+const model: string = resolved;
const overrides = await loadPricingOverrides(engine);
const caps = await readFenceRepairCaps(engine);
configureEvalGateway({ chatModel: model });
@@ -179,9 +187,10 @@ globalThis.fetch = (async (input: RequestInfo | URL, init?: RequestInit) => {
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 };
+const harnessSha = createHash('sha256').update(['run-case.ts', 'harness.ts', 'score.ts', 'oracle.ts'].map(f => readFileSync(join(here, f), 'utf8')).join('\u0000')).digest('hex');
+const meta = { model, model_arg: modelArg, run, started_at: new Date().toISOString(), gbrain_commit: commit, harness_sha256: harnessSha, bun: Bun.version, prompt_version: FENCE_REPAIR_PROMPT_VERSION,
+ system_prompt_sha256: promptDigest, fixtures_file: FIXTURES_FILE.slice(FIXTURES_FILE.lastIndexOf('/') + 1), fixtures_sha256: createHash('sha256').update(readFileSync(FIXTURES_FILE)).digest('hex'),
+ caps: { per_page_usd: caps.perPageUsd, per_day_usd: caps.perDayUsd }, registered_prices: registered, call_timeout_ms: CALL_TIMEOUT_MS };
writeFileSync(`${outPath}.meta.json`, JSON.stringify(meta, null, 2) + '\n');
writeFileSync(outPath, '');
@@ -211,14 +220,18 @@ for (const f of selected) {
await new Promise(r => setTimeout(r, attempts * 20_000));
}
spent += out.spent_usd;
+ if (out.tier1 === 'clean') {
+ console.error(`${f.id}: fixture defect, the page already compiles.`);
+ 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,
+ 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, tier: out.tier, 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.tier1 === 'llm' ? '' : `[${out.tier1}] `}${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`);
+ console.error(`${f.id}: ${out.tier ?? '-'} ${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;
diff --git a/evals/fence-repair-tier3/heldout-cases.ts b/evals/fence-repair-tier3/heldout-cases.ts
new file mode 100644
index 0000000000..0ece841f3a
--- /dev/null
+++ b/evals/fence-repair-tier3/heldout-cases.ts
@@ -0,0 +1,257 @@
+/**
+ * Held-out cases for the Tier 3 fence-repair eval (#6188 T4, round 2).
+ *
+ * Written after round 1 and before any result from the round 2 code, which
+ * was designed from the round 1 fixtures (cases.ts). Same format and the same
+ * class mix as cases.ts, new pages and placeholder names, plus split-claim
+ * adversarials (a claim cut in two by an unescaped pipe; the only correct
+ * outcome is to stay held). Built into heldout.jsonl by generate-fixtures.ts.
+ */
+import type { Case } from './cases.ts';
+
+const ERIN = '| 3 | Erin-example joined omega-example in 2025 | event | 1.0 | private | medium | 2025-05-12 | | offer letter | |';
+
+export const HELDOUT_CASES: Case[] = [
+ // ── short rows, trailing cells missing ─────────────────────────────────
+ { id: 'h-f-st-01', set: 'repairable', cls: 'short_row_trailing', kind: 'facts', tags: [], note: 'valid_until, source and context dropped',
+ body: ['{FB}', '{FH}', '|---|---|---|---|---|---|---|---|---|---|', ERIN, '| 4 | Erin-example manages the data team | fact | 0.85 | private | medium | 2026-02-03 |', '{FE}'],
+ expected: ['{FB}', '{FH}', '{FS}', ERIN, '| 4 | Erin-example manages the data team | fact | 0.85 | private | medium | 2026-02-03 | | | |', '{FE}'] },
+ { id: 'h-f-st-02', set: 'repairable', cls: 'short_row_trailing', kind: 'facts', tags: [], note: 'only the required cells',
+ body: ['{FB}', '{FH}', '{FS}', "| 1 | Omega-example's runway is 18 months | belief | 0.6 | private | high |", '{FE}'],
+ expected: ['{FB}', '{FH}', '{FS}', "| 1 | Omega-example's runway is 18 months | belief | 0.6 | private | high | | | | |", '{FE}'] },
+ { id: 'h-f-st-03', set: 'repairable', cls: 'short_row_trailing', kind: 'facts', vis: 'world', tags: ['world', 'link'], note: 'world page, link in the claim, source and context dropped',
+ body: ['{FB}', '{FH}', '{FS}', '| 2 | Sigma-example published [its security report](https://example.com/sec-2026) | event | 0.95 | world | medium | 2026-03-30 | |', '{FE}'],
+ expected: ['{FB}', '{FH}', '{FS}', '| 2 | Sigma-example published [its security report](https://example.com/sec-2026) | event | 0.95 | world | medium | 2026-03-30 | | | |', '{FE}'] },
+ { id: 'h-f-st-04', set: 'repairable', cls: 'short_row_trailing', kind: 'facts', tags: ['strike', 'number'], note: 'struck row with both dates; counts with a k suffix',
+ body: ['{FB}', '{FH}', '{FS}', '| 6 | ~~Kappa-example has 2.1k paying teams~~ | fact | 0.8 | private | medium | 2025-12-01 | 2026-04-01 |',
+ '| 7 | Kappa-example has 3.4k paying teams | fact | 0.85 | private | medium | 2026-04-01 | | billing export | replaces #6 |', '{FE}'],
+ expected: ['{FB}', '{FH}', '{FS}', '| 6 | ~~Kappa-example has 2.1k paying teams~~ | fact | 0.8 | private | medium | 2025-12-01 | 2026-04-01 | | |',
+ '| 7 | Kappa-example has 3.4k paying teams | fact | 0.85 | private | medium | 2026-04-01 | | billing export | replaces #6 |', '{FE}'] },
+ { id: 'h-f-st-05', set: 'repairable', cls: 'short_row_trailing', kind: 'facts', section: 'timeline', tags: ['pipe', 'timeline'], note: 'timeline fence, escaped pipe in the claim',
+ body: ['{FB}', '{FH}', '{FS}', "| 2 | Frank-example's stack is Go \\| Postgres | fact | 0.9 | private | low | 2026-01-11 |", '{FE}'],
+ expected: ['{FB}', '{FH}', '{FS}', "| 2 | Frank-example's stack is Go \\| Postgres | fact | 0.9 | private | low | 2026-01-11 | | | |", '{FE}'] },
+ { id: 'h-f-st-06', set: 'repairable', cls: 'short_row_trailing', kind: 'facts', tags: ['tier1_after'], note: 'percent confidence: copied as written, then Tier 1 writes 0.7',
+ body: ['{FB}', '{FH}', '{FS}', '| 5 | Grace-example will present at the summit | commitment | 70% | private | medium | 2026-09-15 |', '{FE}'],
+ expected: ['{FB}', '{FH}', '{FS}', '| 5 | Grace-example will present at the summit | commitment | 0.7 | private | medium | 2026-09-15 | | | |', '{FE}'] },
+ { id: 'h-t-st-01', set: 'repairable', cls: 'short_row_trailing', kind: 'takes', tags: [], note: 'since and source dropped',
+ body: ['{TB}', '{TH}', '|---|---|---|---|---|---|---|', '| 1 | Observability tools consolidate | take | people/erin-example | 0.7 | 2026-02-02 | conference notes |',
+ '| 2 | Usage-based pricing wins in observability | take | people/erin-example | 0.65 |', '{TE}'],
+ expected: ['{TB}', '{TH}', '{TS}', '| 1 | Observability tools consolidate | take | people/erin-example | 0.7 | 2026-02-02 | conference notes |',
+ '| 2 | Usage-based pricing wins in observability | take | people/erin-example | 0.65 | | |', '{TE}'] },
+ { id: 'h-t-st-02', set: 'repairable', cls: 'short_row_trailing', kind: 'takes', tags: ['strike'], note: 'struck claim, fund holder',
+ body: ['{TB}', '{TH}', '{TS}', '| 3 | ~~Omega-example raises in Q2~~ | bet | companies/fund-b | 0.35 |', '{TE}'],
+ expected: ['{TB}', '{TH}', '{TS}', '| 3 | ~~Omega-example raises in Q2~~ | bet | companies/fund-b | 0.35 | | |', '{TE}'] },
+ { id: 'h-t-st-03', set: 'repairable', cls: 'short_row_trailing', kind: 'takes', tags: ['number'], note: 'money in the claim, brain holder',
+ body: ['{TB}', '{TH}', '{TS}', '| 1 | Lambda-example passes $50M ARR by 2027 | bet | brain | 0.45 |', '{TE}'],
+ expected: ['{TB}', '{TH}', '{TS}', '| 1 | Lambda-example passes $50M ARR by 2027 | bet | brain | 0.45 | | |', '{TE}'] },
+
+ // ── short rows, a cell missing in the middle ───────────────────────────
+ { id: 'h-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}', '| 3 | Henry-example started as head of design | event | 0.9 | private | medium | 2026-01-19 | onboarding email |', '{FE}'],
+ expected: ['{FB}', '{FH}', '{FS}', '| 3 | Henry-example started as head of design | event | 0.9 | private | medium | 2026-01-19 | | onboarding email | |', '{FE}'] },
+ { id: 'h-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}', '| 4 | Grace-example prefers chat over email | preference | 0.75 | private | low | [thread](https://example.com/t/88) | said in two standups |', '{FE}'],
+ expected: ['{FB}', '{FH}', '{FS}', '| 4 | Grace-example prefers chat over email | preference | 0.75 | private | low | | | [thread](https://example.com/t/88) | said in two standups |', '{FE}'] },
+ { id: 'h-f-sg-03', set: 'repairable', cls: 'short_row_gap', kind: 'facts', vis: 'world', tags: ['world', 'date_meaning'], note: 'the claim says the free tier ends on the date, so it is valid_until',
+ body: ['{FB}', '{FH}', '{FS}', "| 5 | Sigma-example's free tier ends on 2026-12-31 | commitment | 0.8 | world | medium | 2026-12-31 | pricing FAQ |", '{FE}'],
+ expected: ['{FB}', '{FH}', '{FS}', "| 5 | Sigma-example's free tier ends on 2026-12-31 | commitment | 0.8 | world | medium | | 2026-12-31 | pricing FAQ | |", '{FE}'] },
+ { id: 'h-f-sg-04', set: 'repairable', cls: 'short_row_gap', kind: 'facts', tags: [], note: 'no dates: the only optional cell is the source',
+ body: ['{FB}', '{FH}', '{FS}', "| 6 | Kappa-example's support runs around the clock | fact | 0.9 | private | low | support page |", '{FE}'],
+ expected: ['{FB}', '{FH}', '{FS}', "| 6 | Kappa-example's support runs around the clock | fact | 0.9 | private | low | | | support page | |", '{FE}'] },
+
+ // ── no header ──────────────────────────────────────────────────────────
+ { id: 'h-f-nh-01', set: 'repairable', cls: 'no_header', kind: 'facts', tags: [], note: 'two complete rows, no header or separator',
+ body: ['{FB}', '| 1 | Henry-example lives in Toronto | fact | 0.9 | private | low | 2024-09-01 | | intro call | |',
+ '| 2 | Henry-example runs marathons | fact | 0.8 | private | low | | | coffee chat | |', '{FE}'],
+ expected: ['{FB}', '{FH}', '{FS}', '| 1 | Henry-example lives in Toronto | fact | 0.9 | private | low | 2024-09-01 | | intro call | |',
+ '| 2 | Henry-example runs marathons | fact | 0.8 | private | low | | | coffee chat | |', '{FE}'] },
+ { id: 'h-f-nh-02', set: 'repairable', cls: 'no_header', kind: 'facts', tags: [], note: 'separator but no header; rows without the context cell',
+ body: ['{FB}', '|---|---|---|---|---|---|---|---|---|---|', '| 1 | Widget-co sells through distributors | fact | 0.85 | private | medium | 2025-11-01 | | partner deck |',
+ '| 2 | Widget-co wants a direct channel | belief | 0.55 | private | medium | | | strategy call |',
+ '| 3 | Widget-co will open a web store | commitment | 0.6 | private | low | 2026-10-01 | | roadmap |', '{FE}'],
+ expected: ['{FB}', '{FH}', '{FS}', '| 1 | Widget-co sells through distributors | fact | 0.85 | private | medium | 2025-11-01 | | partner deck | |',
+ '| 2 | Widget-co wants a direct channel | belief | 0.55 | private | medium | | | strategy call | |',
+ '| 3 | Widget-co will open a web store | commitment | 0.6 | private | low | 2026-10-01 | | roadmap | |', '{FE}'] },
+ { id: 'h-f-nh-03', set: 'repairable', cls: 'no_header', kind: 'facts', tags: ['wide', 'number'], note: 'typed rows (14 cells) with 450k and $8.1M values: the wide header',
+ body: ['{FB}', '| 1 | Omega-example burn | fact | 0.8 | private | high | 2026-06-01 | | finance review | | burn | 450k | USD | monthly |',
+ '| 2 | Omega-example cash | fact | 0.9 | private | high | 2026-06-01 | | bank statement | | cash | $8.1M | USD | point in time |', '{FE}'],
+ expected: ['{FB}', '{FW}', '{FWS}', '| 1 | Omega-example burn | fact | 0.8 | private | high | 2026-06-01 | | finance review | | burn | 450k | USD | monthly |',
+ '| 2 | Omega-example cash | fact | 0.9 | private | high | 2026-06-01 | | bank statement | | cash | $8.1M | USD | point in time |', '{FE}'] },
+ { id: 'h-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 | Lambda-example ships from Rotterdam | fact | 0.85 | world | low | 2026-03-01 | | [shipping page](https://example.com/ship) | |',
+ '| 2 | ~~Lambda-example ships from Hamburg~~ | fact | 0.9 | world | low | 2024-01-01 | 2026-03-01 | shipping page | superseded by #1 |', '{FE}'],
+ expected: ['{FB}', '{FH}', '{FS}', '| 1 | Lambda-example ships from Rotterdam | fact | 0.85 | world | low | 2026-03-01 | | [shipping page](https://example.com/ship) | |',
+ '| 2 | ~~Lambda-example ships from Hamburg~~ | fact | 0.9 | world | low | 2024-01-01 | 2026-03-01 | shipping page | superseded by #1 |', '{FE}'] },
+ { id: 'h-t-nh-01', set: 'repairable', cls: 'no_header', kind: 'takes', tags: [], note: 'two complete rows',
+ body: ['{TB}', '| 1 | Widget-co should exit retail | take | people/frank-example | 0.6 | 2026-02-14 | ops review |',
+ '| 2 | Widget-co margins improve next year | bet | people/frank-example | 0.5 | 2026-02-14 | ops review |', '{TE}'],
+ expected: ['{TB}', '{TH}', '{TS}', '| 1 | Widget-co should exit retail | take | people/frank-example | 0.6 | 2026-02-14 | ops review |',
+ '| 2 | Widget-co margins improve next year | bet | people/frank-example | 0.5 | 2026-02-14 | ops review |', '{TE}'] },
+ { id: 'h-t-nh-02', set: 'repairable', cls: 'no_header', kind: 'takes', tags: ['pipe', 'strike'], note: 'separator but no header; escaped pipe in a source, a struck row',
+ body: ['{TB}', '|---|---|---|---|---|---|---|', '| 4 | ~~Fund-c passes on omega-example~~ | hunch | companies/fund-c | 0.3 | 2026-01-05 | partner meeting |',
+ '| 5 | Fund-c leads omega-example\'s round | bet | companies/fund-c | 0.55 | 2026-03-05 | IC notes \\| v3 |', '{TE}'],
+ expected: ['{TB}', '{TH}', '{TS}', '| 4 | ~~Fund-c passes on omega-example~~ | hunch | companies/fund-c | 0.3 | 2026-01-05 | partner meeting |',
+ '| 5 | Fund-c leads omega-example\'s round | bet | companies/fund-c | 0.55 | 2026-03-05 | IC notes \\| v3 |', '{TE}'] },
+
+ // ── a row before the header ────────────────────────────────────────────
+ { id: 'h-f-rb-01', set: 'repairable', cls: 'row_before_header', kind: 'facts', tags: [], note: 'one complete row above the header',
+ body: ['{FB}', '| 2 | Omega-example moved to a four-day week | event | 0.8 | private | medium | 2026-02-02 | | all-hands notes | |', '{FH}', '{FS}',
+ '| 3 | Omega-example kept Friday on-call | fact | 0.7 | private | low | 2026-02-02 | | all-hands notes | |', '{FE}'],
+ expected: ['{FB}', '{FH}', '{FS}', '| 2 | Omega-example moved to a four-day week | event | 0.8 | private | medium | 2026-02-02 | | all-hands notes | |',
+ '| 3 | Omega-example kept Friday on-call | fact | 0.7 | private | low | 2026-02-02 | | all-hands notes | |', '{FE}'] },
+ { id: 'h-f-rb-02', set: 'repairable', cls: 'row_before_header', kind: 'facts', tags: [], note: 'a short row above the header',
+ body: ['{FB}', '| 4 | Grace-example finished her MBA | event | 0.9 | private | low | 2026-05-20 |', '{FH}', '{FS}',
+ '| 5 | Grace-example studied part time | fact | 0.8 | private | low | | | coffee chat | |', '{FE}'],
+ expected: ['{FB}', '{FH}', '{FS}', '| 4 | Grace-example finished her MBA | event | 0.9 | private | low | 2026-05-20 | | | |',
+ '| 5 | Grace-example studied part time | fact | 0.8 | private | low | | | coffee chat | |', '{FE}'] },
+ { id: 'h-f-rb-03', set: 'repairable', cls: 'row_before_header', kind: 'facts', section: 'timeline', tags: ['timeline', 'link'], note: 'timeline fence, two rows above the header, one with a link',
+ body: ['{FB}', '| 1 | Sigma-example launched in Canada | event | 0.9 | private | high | 2026-04-01 | | [launch post](https://example.com/ca) | |',
+ '| 2 | Sigma-example hired a country lead | event | 0.8 | private | medium | 2026-04-20 | | team page | |', '{FH}', '{FS}',
+ '| 3 | Sigma-example plans Mexico next | idea | 0.5 | private | medium | | | board notes | |', '{FE}'],
+ expected: ['{FB}', '{FH}', '{FS}', '| 1 | Sigma-example launched in Canada | event | 0.9 | private | high | 2026-04-01 | | [launch post](https://example.com/ca) | |',
+ '| 2 | Sigma-example hired a country lead | event | 0.8 | private | medium | 2026-04-20 | | team page | |',
+ '| 3 | Sigma-example plans Mexico next | idea | 0.5 | private | medium | | | board notes | |', '{FE}'] },
+ { id: 'h-t-rb-01', set: 'repairable', cls: 'row_before_header', kind: 'takes', tags: [], note: 'one row above the header',
+ body: ['{TB}', '| 1 | Kappa-example should hire a CFO | take | people/grace-example | 0.7 | 2026-03-12 | board prep |', '{TH}', '{TS}',
+ '| 2 | Kappa-example hires a CFO by Q4 | bet | people/grace-example | 0.6 | 2026-03-12 | board prep |', '{TE}'],
+ expected: ['{TB}', '{TH}', '{TS}', '| 1 | Kappa-example should hire a CFO | take | people/grace-example | 0.7 | 2026-03-12 | board prep |',
+ '| 2 | Kappa-example hires a CFO by Q4 | bet | people/grace-example | 0.6 | 2026-03-12 | board prep |', '{TE}'] },
+ { id: 'h-t-rb-02', set: 'repairable', cls: 'row_before_header', kind: 'takes', tags: [], note: 'a short row above the header',
+ body: ['{TB}', '| 3 | Hardware startups need longer runways | take | world | 0.8 |', '{TH}', '{TS}',
+ '| 4 | Lambda-example raises a bridge round | bet | world | 0.4 | 2026-04-04 | rumor |', '{TE}'],
+ expected: ['{TB}', '{TH}', '{TS}', '| 3 | Hardware startups need longer runways | take | world | 0.8 | | |',
+ '| 4 | Lambda-example raises a bridge round | bet | world | 0.4 | 2026-04-04 | rumor |', '{TE}'] },
+
+ // ── extra cells ────────────────────────────────────────────────────────
+ { id: 'h-f-ex-01', set: 'repairable', cls: 'extra_cells', kind: 'facts', tags: [], note: 'an empty cell after the claim',
+ body: ['{FB}', '{FH}', '{FS}', ERIN, '| 4 | Erin-example moved to the Lisbon office | | event | 0.85 | private | low | 2026-03-03 | | relocation email | |', '{FE}'],
+ expected: ['{FB}', '{FH}', '{FS}', ERIN, '| 4 | Erin-example moved to the Lisbon office | event | 0.85 | private | low | 2026-03-03 | | relocation email | |', '{FE}'] },
+ { id: 'h-f-ex-02', set: 'repairable', cls: 'extra_cells', kind: 'facts', tags: [], note: 'an empty cell after the confidence',
+ body: ['{FB}', '{FH}', '{FS}', '| 2 | Frank-example will mentor the new PMs | commitment | 0.8 | | private | medium | 2026-02-10 | | 1:1 notes | |', '{FE}'],
+ expected: ['{FB}', '{FH}', '{FS}', '| 2 | Frank-example will mentor the new PMs | commitment | 0.8 | private | medium | 2026-02-10 | | 1:1 notes | |', '{FE}'] },
+ { id: 'h-f-ex-03', set: 'repairable', cls: 'extra_cells', kind: 'facts', tags: ['link'], note: 'an empty cell after the kind; a link source',
+ body: ['{FB}', '{FH}', '{FS}', '| 7 | Kappa-example added SAML login | event | | 0.9 | private | low | 2026-01-28 | | [changelog](https://example.com/cl/12) | |', '{FE}'],
+ expected: ['{FB}', '{FH}', '{FS}', '| 7 | Kappa-example added SAML login | event | 0.9 | private | low | 2026-01-28 | | [changelog](https://example.com/cl/12) | |', '{FE}'] },
+ { id: 'h-f-ex-04', set: 'repairable', cls: 'extra_cells', kind: 'facts', tags: ['wide', 'number'], note: 'typed row with an empty cell after the kind',
+ body: ['{FB}', '{FW}', '{FWS}', '| 5 | Widget-co net revenue retention | fact | | 0.85 | private | high | 2026-06-30 | | QBR deck | | nrr | 1.12 | ratio | annual |', '{FE}'],
+ expected: ['{FB}', '{FW}', '{FWS}', '| 5 | Widget-co net revenue retention | fact | 0.85 | private | high | 2026-06-30 | | QBR deck | | nrr | 1.12 | ratio | annual |', '{FE}'] },
+ { id: 'h-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}', '| 8 | Henry-example took over the design system | (interim) | event | 0.75 | private | medium | 2026-02-20 | | team update | |', '{FE}'],
+ expected: ['{FB}', '{FH}', '{FS}', '| 8 | Henry-example took over the design system | event | 0.75 | private | medium | 2026-02-20 | | team update | (interim) |', '{FE}'] },
+ { id: 'h-t-ex-01', set: 'repairable', cls: 'extra_cells', kind: 'takes', tags: [], note: 'an empty cell after the claim',
+ body: ['{TB}', '{TH}', '{TS}', '| 2 | Open banking APIs commoditize | | take | brain | 0.6 | 2026-03-09 | fintech panel |', '{TE}'],
+ expected: ['{TB}', '{TH}', '{TS}', '| 2 | Open banking APIs commoditize | take | brain | 0.6 | 2026-03-09 | fintech panel |', '{TE}'] },
+ { id: 'h-t-ex-02', set: 'repairable', cls: 'extra_cells', kind: 'takes', tags: ['strike'], note: 'struck claim, empty cell after the kind',
+ body: ['{TB}', '{TH}', '{TS}', '| 6 | ~~Sigma-example stays independent~~ | bet | | people/henry-example | 0.35 | 2026-01-15 | dinner |', '{TE}'],
+ expected: ['{TB}', '{TH}', '{TS}', '| 6 | ~~Sigma-example stays independent~~ | bet | people/henry-example | 0.35 | 2026-01-15 | dinner |', '{TE}'] },
+
+ // ── header with an unknown column ──────────────────────────────────────
+ { id: 'h-f-hu-01', set: 'repairable', cls: 'header_unmapped', kind: 'facts', tags: [], note: '`trust` is the confidence, written after the notability',
+ body: ['{FB}', '| # | claim | kind | notability | trust | visibility | valid_from | valid_until | source | context |', '|---|---|---|---|---|---|---|---|---|---|',
+ "| 1 | Omega-example's CTO is frank-example | fact | high | 0.95 | private | 2025-08-01 | | team page | |",
+ '| 2 | Omega-example is rewriting its billing | idea | medium | 0.5 | private | | | standup | |', '{FE}'],
+ expected: ['{FB}', '{FH}', '{FS}', "| 1 | Omega-example's CTO is frank-example | fact | 0.95 | private | high | 2025-08-01 | | team page | |",
+ '| 2 | Omega-example is rewriting its billing | idea | 0.5 | private | medium | | | standup | |', '{FE}'] },
+ { id: 'h-f-hu-02', set: 'repairable', cls: 'header_unmapped', kind: 'facts', tags: [], note: '`begins`, `expires` and `reference` are the dates and the source, written first',
+ body: ['{FB}', '| # | claim | kind | begins | expires | reference | confidence | visibility | notability |', '|---|---|---|---|---|---|---|---|---|',
+ '| 1 | Grace-example sits on the pricing council | fact | 2026-01-01 | 2026-12-31 | council charter | 0.9 | private | medium |',
+ '| 2 | Grace-example covers the EMEA queue | fact | 2026-03-01 | 2026-03-31 | rota | 1.0 | private | low |', '{FE}'],
+ expected: ['{FB}', '{FH}', '{FS}', '| 1 | Grace-example sits on the pricing council | fact | 0.9 | private | medium | 2026-01-01 | 2026-12-31 | council charter | |',
+ '| 2 | Grace-example covers the EMEA queue | fact | 1.0 | private | low | 2026-03-01 | 2026-03-31 | rota | |', '{FE}'] },
+ { id: 'h-f-hu-03', set: 'repairable', cls: 'header_unmapped', kind: 'facts', tags: ['no_row_numbers'], note: 'no # column and a `learned from` column (the source); Tier 1 numbers the rows',
+ body: ['{FB}', '| claim | kind | confidence | visibility | notability | learned from |', '|---|---|---|---|---|---|',
+ '| Henry-example plays cello | fact | 0.8 | private | low | dinner |',
+ '| Henry-example wants to teach a course | preference | 0.6 | private | medium | coffee chat |', '{FE}'],
+ expected: ['{FB}', '{FH}', '{FS}', '| 1 | Henry-example plays cello | fact | 0.8 | private | low | | | dinner | |',
+ '| 2 | Henry-example wants to teach a course | preference | 0.6 | private | medium | | | coffee chat | |', '{FE}'] },
+ { id: 'h-f-hu-04', set: 'repairable', cls: 'header_unmapped', kind: 'facts', tags: [], note: 'kind before claim and a `sharing` column (the visibility)',
+ body: ['{FB}', '| # | kind | claim | confidence | sharing | notability | valid_from |', '|---|---|---|---|---|---|---|',
+ '| 1 | event | Lambda-example signed widget-co | 0.9 | private | high | 2026-05-05 |',
+ '| 2 | fact | Lambda-example bills quarterly | 0.8 | private | low | |', '{FE}'],
+ expected: ['{FB}', '{FH}', '{FS}', '| 1 | Lambda-example signed widget-co | event | 0.9 | private | high | 2026-05-05 | | | |',
+ '| 2 | Lambda-example bills quarterly | fact | 0.8 | private | low | | | | |', '{FE}'] },
+ { id: 'h-t-hu-01', set: 'repairable', cls: 'header_unmapped', kind: 'takes', tags: [], note: '`believer` is the holder and `strength` the weight',
+ body: ['{TB}', '| # | claim | believer | kind | strength | since | source |', '|---|---|---|---|---|---|---|',
+ '| 1 | Kappa-example wins mid-market | people/erin-example | take | 0.7 | 2026-02-20 | pipeline review |',
+ '| 2 | Kappa-example doubles headcount | people/erin-example | bet | 0.4 | 2026-02-20 | pipeline review |', '{TE}'],
+ expected: ['{TB}', '{TH}', '{TS}', '| 1 | Kappa-example wins mid-market | take | people/erin-example | 0.7 | 2026-02-20 | pipeline review |',
+ '| 2 | Kappa-example doubles headcount | bet | people/erin-example | 0.4 | 2026-02-20 | pipeline review |', '{TE}'] },
+ { id: 'h-t-hu-02', set: 'repairable', cls: 'header_unmapped', kind: 'takes', tags: ['no_row_numbers'], note: 'no # column; `likelihood` is the weight and `noted` the since date',
+ body: ['{TB}', '| claim | kind | who | likelihood | noted |', '|---|---|---|---|---|',
+ '| Robotics funding recovers in 2027 | bet | brain | 0.5 | 2026-04-02 |',
+ '| Sigma-example enters robotics | hunch | brain | 0.25 | 2026-04-02 |', '{TE}'],
+ expected: ['{TB}', '{TH}', '{TS}', '| 1 | Robotics funding recovers in 2027 | bet | brain | 0.5 | 2026-04-02 | |',
+ '| 2 | Sigma-example enters robotics | hunch | brain | 0.25 | 2026-04-02 | |', '{TE}'] },
+
+ // ── several problems in one fence ──────────────────────────────────────
+ { id: 'h-f-mix-01', set: 'repairable', cls: 'mixed', kind: 'facts', tags: [], note: 'a short row and a row with an extra empty cell',
+ body: ['{FB}', '{FH}', '{FS}', '| 1 | Frank-example founded widget-co | fact | 1.0 | private | high | 2019-03-01 |',
+ '| 2 | Frank-example is hiring a COO | | event | 0.7 | private | medium | 2026-06-01 | | recruiter call | |', '{FE}'],
+ expected: ['{FB}', '{FH}', '{FS}', '| 1 | Frank-example founded widget-co | fact | 1.0 | private | high | 2019-03-01 | | | |',
+ '| 2 | Frank-example is hiring a COO | event | 0.7 | private | medium | 2026-06-01 | | recruiter call | |', '{FE}'] },
+ { id: 'h-t-mix-01', set: 'repairable', cls: 'mixed', kind: 'takes', tags: [], note: 'a row above the header and a short row below it',
+ body: ['{TB}', '| 1 | Lambda-example is overvalued | take | people/henry-example | 0.55 | 2026-05-01 | lunch |', '{TH}', '{TS}',
+ '| 2 | Lambda-example cuts prices this year | bet | people/henry-example | 0.45 |', '{TE}'],
+ expected: ['{TB}', '{TH}', '{TS}', '| 1 | Lambda-example is overvalued | take | people/henry-example | 0.55 | 2026-05-01 | lunch |',
+ '| 2 | Lambda-example cuts prices this year | bet | people/henry-example | 0.45 | | |', '{TE}'] },
+ { id: 'h-b-mix-01', set: 'repairable', cls: 'mixed', kind: 'both', tags: ['two_fences'], note: 'a facts fence without a header and a takes fence with a short row on one page (two model calls)',
+ body: ['{FB}', '| 1 | Widget-co moved its warehouse to Reno | event | 0.9 | private | medium | 2026-02-01 | | ops email | |', '{FE}', '',
+ '{TB}', '{TH}', '{TS}', '| 2 | Widget-co regrets the Reno move | hunch | brain | 0.3 |', '{TE}'],
+ expected: ['{FB}', '{FH}', '{FS}', '| 1 | Widget-co moved its warehouse to Reno | event | 0.9 | private | medium | 2026-02-01 | | ops email | |', '{FE}', '',
+ '{TB}', '{TH}', '{TS}', '| 2 | Widget-co regrets the Reno move | hunch | brain | 0.3 | | |', '{TE}'] },
+
+ // ── adversarial: two readings the gates cannot tell apart ──────────────
+ { id: 'h-adv-01', set: 'adversarial', adversarial: 'ambiguous', cls: 'extra_cells', kind: 'facts', tags: [], note: 'two confidence values',
+ body: ['{FB}', '{FH}', '{FS}', '| 3 | Omega-example hits its Q3 target | belief | 0.4 | 0.8 | private | medium | 2026-07-01 | | forecast sheet | |', '{FE}'],
+ expected: null,
+ probe: ['{FH}', '{FS}', '| 3 | Omega-example hits its Q3 target | belief | 0.4 | private | medium | 2026-07-01 | | forecast sheet | 0.8 |'] },
+ { id: 'h-adv-02', set: 'adversarial', adversarial: 'ambiguous', cls: 'extra_cells', kind: 'takes', tags: [], note: 'two kinds (bet, hunch)',
+ body: ['{TB}', '{TH}', '{TS}', '| 4 | Kappa-example gets acquired | bet | hunch | people/frank-example | 0.3 | 2026-03-03 | hallway chat |', '{TE}'],
+ expected: null,
+ probe: ['{TW}', '{TWS}', '| 4 | Kappa-example gets acquired | bet | people/frank-example | 0.3 | 2026-03-03 | hallway chat | | | hunch | | | |'] },
+ { id: 'h-adv-03', set: 'adversarial', adversarial: 'ambiguous', cls: 'header_unmapped', kind: 'facts', tags: [], note: 'a `team` column has no home in a facts table; the only free column is valid_until',
+ body: ['{FB}', '| # | claim | kind | team | confidence | visibility | notability | valid_from | source | context |', '|---|---|---|---|---|---|---|---|---|---|',
+ '| 1 | The hiring plan is frozen | event | platform | 0.85 | private | high | 2026-08-01 | leadership sync | |', '{FE}'],
+ expected: null,
+ probe: ['{FH}', '{FS}', '| 1 | The hiring plan is frozen | event | 0.85 | private | high | 2026-08-01 | platform | leadership sync | |'] },
+ { id: 'h-adv-04', set: 'adversarial', adversarial: 'ambiguous', cls: 'header_unmapped', kind: 'takes', tags: [], note: 'a `rationale` column is neither a date nor a source, but the gates accept it in either free column',
+ body: ['{TB}', '| # | claim | rationale | kind | who | weight |', '|---|---|---|---|---|---|',
+ '| 1 | Widget-co raises prices in 2027 | pricing power | bet | people/grace-example | 0.6 |', '{TE}'],
+ expected: null,
+ probe: ['{TH}', '{TS}', '| 1 | Widget-co raises prices in 2027 | bet | people/grace-example | 0.6 | | pricing power |'] },
+ { id: 'h-adv-05', set: 'adversarial', adversarial: 'ambiguous', cls: 'short_row_gap', kind: 'facts', tags: ['date_meaning'], note: 'a notice-period date could be its start or its end',
+ body: ['{FB}', '{FH}', '{FS}', "| 5 | Frank-example's notice period at kappa-example | fact | 0.8 | private | medium | 2026-03-31 | HR call |", '{FE}'],
+ expected: null,
+ probe: ['{FH}', '{FS}', "| 5 | Frank-example's notice period at kappa-example | fact | 0.8 | private | medium | 2026-03-31 | | HR call | |"] },
+ { id: 'h-adv-06', set: 'adversarial', adversarial: 'ambiguous', cls: 'short_row_gap', kind: 'facts', tags: [], note: 'two free-text notes; neither reads clearly as the source or the context',
+ body: ['{FB}', '{FH}', '{FS}', '| 6 | Grace-example is moving to the platform team | event | 0.7 | private | medium | Q3 offsite | budget review |', '{FE}'],
+ expected: null,
+ probe: ['{FH}', '{FS}', '| 6 | Grace-example is moving to the platform team | event | 0.7 | private | medium | | | Q3 offsite | budget review |'] },
+
+ // ── adversarial: a claim cut in two by an unescaped pipe ───────────────
+ { id: 'h-spl-01', set: 'adversarial', adversarial: 'split_claim', cls: 'extra_cells', kind: 'facts', tags: ['pipe'], note: 'the claim continues in the cell after it',
+ body: ['{FB}', '{FH}', '{FS}', '| 7 | Churn fell to 2% | after the pricing change | fact | 0.8 | private | high | 2026-05-31 | | metrics review | |', '{FE}'],
+ expected: null,
+ probe: ['{FH}', '{FS}', '| 7 | Churn fell to 2% | fact | 0.8 | private | high | 2026-05-31 | | metrics review | after the pricing change |'] },
+ { id: 'h-spl-02', set: 'adversarial', adversarial: 'split_claim', cls: 'extra_cells', kind: 'takes', tags: ['pipe'], note: 'a takes claim cut in two',
+ body: ['{TB}', '{TH}', '{TS}', '| 3 | Rates fall in 2026 | then rise in 2027 | bet | world | 0.4 | 2026-02-01 | macro notes |', '{TE}'],
+ expected: null,
+ probe: ['{TW}', '{TWS}', '| 3 | Rates fall in 2026 | bet | world | 0.4 | 2026-02-01 | macro notes | | | then rise in 2027 | | | |'] },
+ { id: 'h-spl-03', set: 'adversarial', adversarial: 'split_claim', cls: 'short_row_gap', kind: 'facts', tags: ['pipe'], note: 'the claim is cut and the kind cell is missing, so the row has the canonical width and the second half sits in the kind column',
+ body: ['{FB}', '{FH}', '{FS}', '| 8 | Revenue doubled | led by the EU | 0.9 | private | high | 2026-06-30 | | board deck | |', '{FE}'],
+ expected: null },
+ { id: 'h-spl-04', set: 'adversarial', adversarial: 'split_claim', cls: 'no_header', kind: 'facts', tags: ['pipe'], note: 'no header, and the claim continues in the next cell',
+ body: ['{FB}', '| 2 | Omega-example hired a CRO | from widget-co | event | 0.9 | private | high | 2026-03-01 | | press release | |', '{FE}'],
+ expected: null,
+ probe: ['{FH}', '{FS}', '| 2 | Omega-example hired a CRO | event | 0.9 | private | high | 2026-03-01 | | press release | from widget-co |'] },
+
+ // ── adversarial: a required value is missing ───────────────────────────
+ { id: 'h-unr-01', set: 'adversarial', adversarial: 'unrecoverable', cls: 'short_row_gap', kind: 'takes', tags: [], note: 'the weight is missing',
+ body: ['{TB}', '{TH}', '{TS}', '| 4 | Edge inference beats cloud for robots | take | people/henry-example | robotics panel |', '{TE}'],
+ expected: null,
+ probe: ['{TH}', '{TS}', '| 4 | Edge inference beats cloud for robots | take | people/henry-example | 0.5 | | robotics panel |'] },
+ { id: 'h-unr-02', set: 'adversarial', adversarial: 'unrecoverable', cls: 'short_row_gap', kind: 'facts', tags: [], note: 'the notability is missing',
+ body: ['{FB}', '{FH}', '{FS}', '| 9 | Sigma-example rotated its API keys | event | 0.95 | private | 2026-02-14 | | security log |', '{FE}'],
+ expected: null,
+ probe: ['{FH}', '{FS}', '| 9 | Sigma-example rotated its API keys | event | 0.95 | private | medium | 2026-02-14 | | security log | |'] },
+];
diff --git a/evals/fence-repair-tier3/heldout.jsonl b/evals/fence-repair-tier3/heldout.jsonl
new file mode 100644
index 0000000000..91915a38c0
--- /dev/null
+++ b/evals/fence-repair-tier3/heldout.jsonl
@@ -0,0 +1,52 @@
+{"id":"h-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 h-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| 3 | Erin-example joined omega-example in 2025 | event | 1.0 | private | medium | 2025-05-12 | | offer letter | |\n| 4 | Erin-example manages the data team | fact | 0.85 | private | medium | 2026-02-03 |\n<!--- gbrain:facts:end -->\n","timeline":""},"expected":{"compiled_truth":"# Notes h-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| 3 | Erin-example joined omega-example in 2025 | event | 1.0 | private | medium | 2025-05-12 | | offer letter | |\n| 4 | Erin-example manages the data team | fact | 0.85 | private | medium | 2026-02-03 | | | |\n<!--- gbrain:facts:end -->\n","timeline":""},"probe":null}
+{"id":"h-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 h-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 | Omega-example's runway is 18 months | belief | 0.6 | private | high |\n<!--- gbrain:facts:end -->\n","timeline":""},"expected":{"compiled_truth":"# Notes h-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 | Omega-example's runway is 18 months | belief | 0.6 | private | high | | | | |\n<!--- gbrain:facts:end -->\n","timeline":""},"probe":null}
+{"id":"h-f-st-03","set":"repairable","adversarial":null,"cls":"short_row_trailing","kind":"facts","section":"body","page_visibility":"world","tags":["world","link"],"note":"world page, link in the claim, source and context dropped","page":{"compiled_truth":"# Notes h-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| 2 | Sigma-example published [its security report](https://example.com/sec-2026) | event | 0.95 | world | medium | 2026-03-30 | |\n<!--- gbrain:facts:end -->\n","timeline":""},"expected":{"compiled_truth":"# Notes h-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| 2 | Sigma-example published [its security report](https://example.com/sec-2026) | event | 0.95 | world | medium | 2026-03-30 | | | |\n<!--- gbrain:facts:end -->\n","timeline":""},"probe":null}
+{"id":"h-f-st-04","set":"repairable","adversarial":null,"cls":"short_row_trailing","kind":"facts","section":"body","page_visibility":"private","tags":["strike","number"],"note":"struck row with both dates; counts with a k suffix","page":{"compiled_truth":"# Notes h-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| 6 | ~~Kappa-example has 2.1k paying teams~~ | fact | 0.8 | private | medium | 2025-12-01 | 2026-04-01 |\n| 7 | Kappa-example has 3.4k paying teams | fact | 0.85 | private | medium | 2026-04-01 | | billing export | replaces #6 |\n<!--- gbrain:facts:end -->\n","timeline":""},"expected":{"compiled_truth":"# Notes h-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| 6 | ~~Kappa-example has 2.1k paying teams~~ | fact | 0.8 | private | medium | 2025-12-01 | 2026-04-01 | | |\n| 7 | Kappa-example has 3.4k paying teams | fact | 0.85 | private | medium | 2026-04-01 | | billing export | replaces #6 |\n<!--- gbrain:facts:end -->\n","timeline":""},"probe":null}
+{"id":"h-f-st-05","set":"repairable","adversarial":null,"cls":"short_row_trailing","kind":"facts","section":"timeline","page_visibility":"private","tags":["pipe","timeline"],"note":"timeline fence, escaped pipe in the claim","page":{"compiled_truth":"# Notes h-f-st-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| 2 | Frank-example's stack is Go \\| Postgres | fact | 0.9 | private | low | 2026-01-11 |\n<!--- gbrain:facts:end -->\n"},"expected":{"compiled_truth":"# Notes h-f-st-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| 2 | Frank-example's stack is Go \\| Postgres | fact | 0.9 | private | low | 2026-01-11 | | | |\n<!--- gbrain:facts:end -->\n"},"probe":null}
+{"id":"h-f-st-06","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.7","page":{"compiled_truth":"# Notes h-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| 5 | Grace-example will present at the summit | commitment | 70% | private | medium | 2026-09-15 |\n<!--- gbrain:facts:end -->\n","timeline":""},"expected":{"compiled_truth":"# Notes h-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| 5 | Grace-example will present at the summit | commitment | 0.7 | private | medium | 2026-09-15 | | | |\n<!--- gbrain:facts:end -->\n","timeline":""},"probe":null}
+{"id":"h-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 h-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 | Observability tools consolidate | take | people/erin-example | 0.7 | 2026-02-02 | conference notes |\n| 2 | Usage-based pricing wins in observability | take | people/erin-example | 0.65 |\n<!--- gbrain:takes:end -->\n","timeline":""},"expected":{"compiled_truth":"# Notes h-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 | Observability tools consolidate | take | people/erin-example | 0.7 | 2026-02-02 | conference notes |\n| 2 | Usage-based pricing wins in observability | take | people/erin-example | 0.65 | | |\n<!--- gbrain:takes:end -->\n","timeline":""},"probe":null}
+{"id":"h-t-st-02","set":"repairable","adversarial":null,"cls":"short_row_trailing","kind":"takes","section":"body","page_visibility":"private","tags":["strike"],"note":"struck claim, fund holder","page":{"compiled_truth":"# Notes h-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| 3 | ~~Omega-example raises in Q2~~ | bet | companies/fund-b | 0.35 |\n<!--- gbrain:takes:end -->\n","timeline":""},"expected":{"compiled_truth":"# Notes h-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| 3 | ~~Omega-example raises in Q2~~ | bet | companies/fund-b | 0.35 | | |\n<!--- gbrain:takes:end -->\n","timeline":""},"probe":null}
+{"id":"h-t-st-03","set":"repairable","adversarial":null,"cls":"short_row_trailing","kind":"takes","section":"body","page_visibility":"private","tags":["number"],"note":"money in the claim, brain holder","page":{"compiled_truth":"# Notes h-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| 1 | Lambda-example passes $50M ARR by 2027 | bet | brain | 0.45 |\n<!--- gbrain:takes:end -->\n","timeline":""},"expected":{"compiled_truth":"# Notes h-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| 1 | Lambda-example passes $50M ARR by 2027 | bet | brain | 0.45 | | |\n<!--- gbrain:takes:end -->\n","timeline":""},"probe":null}
+{"id":"h-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 h-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| 3 | Henry-example started as head of design | event | 0.9 | private | medium | 2026-01-19 | onboarding email |\n<!--- gbrain:facts:end -->\n","timeline":""},"expected":{"compiled_truth":"# Notes h-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| 3 | Henry-example started as head of design | event | 0.9 | private | medium | 2026-01-19 | | onboarding email | |\n<!--- gbrain:facts:end -->\n","timeline":""},"probe":null}
+{"id":"h-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 h-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| 4 | Grace-example prefers chat over email | preference | 0.75 | private | low | [thread](https://example.com/t/88) | said in two standups |\n<!--- gbrain:facts:end -->\n","timeline":""},"expected":{"compiled_truth":"# Notes h-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| 4 | Grace-example prefers chat over email | preference | 0.75 | private | low | | | [thread](https://example.com/t/88) | said in two standups |\n<!--- gbrain:facts:end -->\n","timeline":""},"probe":null}
+{"id":"h-f-sg-03","set":"repairable","adversarial":null,"cls":"short_row_gap","kind":"facts","section":"body","page_visibility":"world","tags":["world","date_meaning"],"note":"the claim says the free tier ends on the date, so it is valid_until","page":{"compiled_truth":"# Notes h-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| 5 | Sigma-example's free tier ends on 2026-12-31 | commitment | 0.8 | world | medium | 2026-12-31 | pricing FAQ |\n<!--- gbrain:facts:end -->\n","timeline":""},"expected":{"compiled_truth":"# Notes h-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| 5 | Sigma-example's free tier ends on 2026-12-31 | commitment | 0.8 | world | medium | | 2026-12-31 | pricing FAQ | |\n<!--- gbrain:facts:end -->\n","timeline":""},"probe":null}
+{"id":"h-f-sg-04","set":"repairable","adversarial":null,"cls":"short_row_gap","kind":"facts","section":"body","page_visibility":"private","tags":[],"note":"no dates: the only optional cell is the source","page":{"compiled_truth":"# Notes h-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| 6 | Kappa-example's support runs around the clock | fact | 0.9 | private | low | support page |\n<!--- gbrain:facts:end -->\n","timeline":""},"expected":{"compiled_truth":"# Notes h-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| 6 | Kappa-example's support runs around the clock | fact | 0.9 | private | low | | | support page | |\n<!--- gbrain:facts:end -->\n","timeline":""},"probe":null}
+{"id":"h-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 h-f-nh-01\n\nWorking notes kept by the brain owner.\n\n<!--- gbrain:facts:begin -->\n| 1 | Henry-example lives in Toronto | fact | 0.9 | private | low | 2024-09-01 | | intro call | |\n| 2 | Henry-example runs marathons | fact | 0.8 | private | low | | | coffee chat | |\n<!--- gbrain:facts:end -->\n","timeline":""},"expected":{"compiled_truth":"# Notes h-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 | Henry-example lives in Toronto | fact | 0.9 | private | low | 2024-09-01 | | intro call | |\n| 2 | Henry-example runs marathons | fact | 0.8 | private | low | | | coffee chat | |\n<!--- gbrain:facts:end -->\n","timeline":""},"probe":null}
+{"id":"h-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 h-f-nh-02\n\nWorking notes kept by the brain owner.\n\n<!--- gbrain:facts:begin -->\n|---|---|---|---|---|---|---|---|---|---|\n| 1 | Widget-co sells through distributors | fact | 0.85 | private | medium | 2025-11-01 | | partner deck |\n| 2 | Widget-co wants a direct channel | belief | 0.55 | private | medium | | | strategy call |\n| 3 | Widget-co will open a web store | commitment | 0.6 | private | low | 2026-10-01 | | roadmap |\n<!--- gbrain:facts:end -->\n","timeline":""},"expected":{"compiled_truth":"# Notes h-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 | Widget-co sells through distributors | fact | 0.85 | private | medium | 2025-11-01 | | partner deck | |\n| 2 | Widget-co wants a direct channel | belief | 0.55 | private | medium | | | strategy call | |\n| 3 | Widget-co will open a web store | commitment | 0.6 | private | low | 2026-10-01 | | roadmap | |\n<!--- gbrain:facts:end -->\n","timeline":""},"probe":null}
+{"id":"h-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 450k and $8.1M values: the wide header","page":{"compiled_truth":"# Notes h-f-nh-03\n\nWorking notes kept by the brain owner.\n\n<!--- gbrain:facts:begin -->\n| 1 | Omega-example burn | fact | 0.8 | private | high | 2026-06-01 | | finance review | | burn | 450k | USD | monthly |\n| 2 | Omega-example cash | fact | 0.9 | private | high | 2026-06-01 | | bank statement | | cash | $8.1M | USD | point in time |\n<!--- gbrain:facts:end -->\n","timeline":""},"expected":{"compiled_truth":"# Notes h-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 | Omega-example burn | fact | 0.8 | private | high | 2026-06-01 | | finance review | | burn | 450k | USD | monthly |\n| 2 | Omega-example cash | fact | 0.9 | private | high | 2026-06-01 | | bank statement | | cash | $8.1M | USD | point in time |\n<!--- gbrain:facts:end -->\n","timeline":""},"probe":null}
+{"id":"h-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 h-f-nh-04\n\nWorking notes kept by the brain owner.\n\n<!--- gbrain:facts:begin -->\n| 1 | Lambda-example ships from Rotterdam | fact | 0.85 | world | low | 2026-03-01 | | [shipping page](https://example.com/ship) | |\n| 2 | ~~Lambda-example ships from Hamburg~~ | fact | 0.9 | world | low | 2024-01-01 | 2026-03-01 | shipping page | superseded by #1 |\n<!--- gbrain:facts:end -->\n","timeline":""},"expected":{"compiled_truth":"# Notes h-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 | Lambda-example ships from Rotterdam | fact | 0.85 | world | low | 2026-03-01 | | [shipping page](https://example.com/ship) | |\n| 2 | ~~Lambda-example ships from Hamburg~~ | fact | 0.9 | world | low | 2024-01-01 | 2026-03-01 | shipping page | superseded by #1 |\n<!--- gbrain:facts:end -->\n","timeline":""},"probe":null}
+{"id":"h-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 h-t-nh-01\n\nWorking notes kept by the brain owner.\n\n<!--- gbrain:takes:begin -->\n| 1 | Widget-co should exit retail | take | people/frank-example | 0.6 | 2026-02-14 | ops review |\n| 2 | Widget-co margins improve next year | bet | people/frank-example | 0.5 | 2026-02-14 | ops review |\n<!--- gbrain:takes:end -->\n","timeline":""},"expected":{"compiled_truth":"# Notes h-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 | Widget-co should exit retail | take | people/frank-example | 0.6 | 2026-02-14 | ops review |\n| 2 | Widget-co margins improve next year | bet | people/frank-example | 0.5 | 2026-02-14 | ops review |\n<!--- gbrain:takes:end -->\n","timeline":""},"probe":null}
+{"id":"h-t-nh-02","set":"repairable","adversarial":null,"cls":"no_header","kind":"takes","section":"body","page_visibility":"private","tags":["pipe","strike"],"note":"separator but no header; escaped pipe in a source, a struck row","page":{"compiled_truth":"# Notes h-t-nh-02\n\nWorking notes kept by the brain owner.\n\n<!--- gbrain:takes:begin -->\n|---|---|---|---|---|---|---|\n| 4 | ~~Fund-c passes on omega-example~~ | hunch | companies/fund-c | 0.3 | 2026-01-05 | partner meeting |\n| 5 | Fund-c leads omega-example's round | bet | companies/fund-c | 0.55 | 2026-03-05 | IC notes \\| v3 |\n<!--- gbrain:takes:end -->\n","timeline":""},"expected":{"compiled_truth":"# Notes h-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| 4 | ~~Fund-c passes on omega-example~~ | hunch | companies/fund-c | 0.3 | 2026-01-05 | partner meeting |\n| 5 | Fund-c leads omega-example's round | bet | companies/fund-c | 0.55 | 2026-03-05 | IC notes \\| v3 |\n<!--- gbrain:takes:end -->\n","timeline":""},"probe":null}
+{"id":"h-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 h-f-rb-01\n\nWorking notes kept by the brain owner.\n\n<!--- gbrain:facts:begin -->\n| 2 | Omega-example moved to a four-day week | event | 0.8 | private | medium | 2026-02-02 | | all-hands notes | |\n| # | claim | kind | confidence | visibility | notability | valid_from | valid_until | source | context |\n|---|-------|------|------------|------------|------------|------------|-------------|--------|---------|\n| 3 | Omega-example kept Friday on-call | fact | 0.7 | private | low | 2026-02-02 | | all-hands notes | |\n<!--- gbrain:facts:end -->\n","timeline":""},"expected":{"compiled_truth":"# Notes h-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| 2 | Omega-example moved to a four-day week | event | 0.8 | private | medium | 2026-02-02 | | all-hands notes | |\n| 3 | Omega-example kept Friday on-call | fact | 0.7 | private | low | 2026-02-02 | | all-hands notes | |\n<!--- gbrain:facts:end -->\n","timeline":""},"probe":null}
+{"id":"h-f-rb-02","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 h-f-rb-02\n\nWorking notes kept by the brain owner.\n\n<!--- gbrain:facts:begin -->\n| 4 | Grace-example finished her MBA | event | 0.9 | private | low | 2026-05-20 |\n| # | claim | kind | confidence | visibility | notability | valid_from | valid_until | source | context |\n|---|-------|------|------------|------------|------------|------------|-------------|--------|---------|\n| 5 | Grace-example studied part time | fact | 0.8 | private | low | | | coffee chat | |\n<!--- gbrain:facts:end -->\n","timeline":""},"expected":{"compiled_truth":"# Notes h-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 | Grace-example finished her MBA | event | 0.9 | private | low | 2026-05-20 | | | |\n| 5 | Grace-example studied part time | fact | 0.8 | private | low | | | coffee chat | |\n<!--- gbrain:facts:end -->\n","timeline":""},"probe":null}
+{"id":"h-f-rb-03","set":"repairable","adversarial":null,"cls":"row_before_header","kind":"facts","section":"timeline","page_visibility":"private","tags":["timeline","link"],"note":"timeline fence, two rows above the header, one with a link","page":{"compiled_truth":"# Notes h-f-rb-03\n\nWorking notes kept by the brain owner.\n","timeline":"<!--- gbrain:facts:begin -->\n| 1 | Sigma-example launched in Canada | event | 0.9 | private | high | 2026-04-01 | | [launch post](https://example.com/ca) | |\n| 2 | Sigma-example hired a country lead | event | 0.8 | private | medium | 2026-04-20 | | team page | |\n| # | claim | kind | confidence | visibility | notability | valid_from | valid_until | source | context |\n|---|-------|------|------------|------------|------------|------------|-------------|--------|---------|\n| 3 | Sigma-example plans Mexico next | idea | 0.5 | private | medium | | | board notes | |\n<!--- gbrain:facts:end -->\n"},"expected":{"compiled_truth":"# Notes h-f-rb-03\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 | Sigma-example launched in Canada | event | 0.9 | private | high | 2026-04-01 | | [launch post](https://example.com/ca) | |\n| 2 | Sigma-example hired a country lead | event | 0.8 | private | medium | 2026-04-20 | | team page | |\n| 3 | Sigma-example plans Mexico next | idea | 0.5 | private | medium | | | board notes | |\n<!--- gbrain:facts:end -->\n"},"probe":null}
+{"id":"h-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 h-t-rb-01\n\nWorking notes kept by the brain owner.\n\n<!--- gbrain:takes:begin -->\n| 1 | Kappa-example should hire a CFO | take | people/grace-example | 0.7 | 2026-03-12 | board prep |\n| # | claim | kind | who | weight | since | source |\n|---|-------|------|-----|--------|-------|--------|\n| 2 | Kappa-example hires a CFO by Q4 | bet | people/grace-example | 0.6 | 2026-03-12 | board prep |\n<!--- gbrain:takes:end -->\n","timeline":""},"expected":{"compiled_truth":"# Notes h-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 | Kappa-example should hire a CFO | take | people/grace-example | 0.7 | 2026-03-12 | board prep |\n| 2 | Kappa-example hires a CFO by Q4 | bet | people/grace-example | 0.6 | 2026-03-12 | board prep |\n<!--- gbrain:takes:end -->\n","timeline":""},"probe":null}
+{"id":"h-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 h-t-rb-02\n\nWorking notes kept by the brain owner.\n\n<!--- gbrain:takes:begin -->\n| 3 | Hardware startups need longer runways | take | world | 0.8 |\n| # | claim | kind | who | weight | since | source |\n|---|-------|------|-----|--------|-------|--------|\n| 4 | Lambda-example raises a bridge round | bet | world | 0.4 | 2026-04-04 | rumor |\n<!--- gbrain:takes:end -->\n","timeline":""},"expected":{"compiled_truth":"# Notes h-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 | Hardware startups need longer runways | take | world | 0.8 | | |\n| 4 | Lambda-example raises a bridge round | bet | world | 0.4 | 2026-04-04 | rumor |\n<!--- gbrain:takes:end -->\n","timeline":""},"probe":null}
+{"id":"h-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 h-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| 3 | Erin-example joined omega-example in 2025 | event | 1.0 | private | medium | 2025-05-12 | | offer letter | |\n| 4 | Erin-example moved to the Lisbon office | | event | 0.85 | private | low | 2026-03-03 | | relocation email | |\n<!--- gbrain:facts:end -->\n","timeline":""},"expected":{"compiled_truth":"# Notes h-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| 3 | Erin-example joined omega-example in 2025 | event | 1.0 | private | medium | 2025-05-12 | | offer letter | |\n| 4 | Erin-example moved to the Lisbon office | event | 0.85 | private | low | 2026-03-03 | | relocation email | |\n<!--- gbrain:facts:end -->\n","timeline":""},"probe":null}
+{"id":"h-f-ex-02","set":"repairable","adversarial":null,"cls":"extra_cells","kind":"facts","section":"body","page_visibility":"private","tags":[],"note":"an empty cell after the confidence","page":{"compiled_truth":"# Notes h-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| 2 | Frank-example will mentor the new PMs | commitment | 0.8 | | private | medium | 2026-02-10 | | 1:1 notes | |\n<!--- gbrain:facts:end -->\n","timeline":""},"expected":{"compiled_truth":"# Notes h-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| 2 | Frank-example will mentor the new PMs | commitment | 0.8 | private | medium | 2026-02-10 | | 1:1 notes | |\n<!--- gbrain:facts:end -->\n","timeline":""},"probe":null}
+{"id":"h-f-ex-03","set":"repairable","adversarial":null,"cls":"extra_cells","kind":"facts","section":"body","page_visibility":"private","tags":["link"],"note":"an empty cell after the kind; a link source","page":{"compiled_truth":"# Notes h-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| 7 | Kappa-example added SAML login | event | | 0.9 | private | low | 2026-01-28 | | [changelog](https://example.com/cl/12) | |\n<!--- gbrain:facts:end -->\n","timeline":""},"expected":{"compiled_truth":"# Notes h-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| 7 | Kappa-example added SAML login | event | 0.9 | private | low | 2026-01-28 | | [changelog](https://example.com/cl/12) | |\n<!--- gbrain:facts:end -->\n","timeline":""},"probe":null}
+{"id":"h-f-ex-04","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 kind","page":{"compiled_truth":"# Notes h-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 | claim_metric | claim_value | claim_unit | claim_period |\n|---|-------|------|------------|------------|------------|------------|-------------|--------|---------|--------------|-------------|------------|--------------|\n| 5 | Widget-co net revenue retention | fact | | 0.85 | private | high | 2026-06-30 | | QBR deck | | nrr | 1.12 | ratio | annual |\n<!--- gbrain:facts:end -->\n","timeline":""},"expected":{"compiled_truth":"# Notes h-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 | claim_metric | claim_value | claim_unit | claim_period |\n|---|-------|------|------------|------------|------------|------------|-------------|--------|---------|--------------|-------------|------------|--------------|\n| 5 | Widget-co net revenue retention | fact | 0.85 | private | high | 2026-06-30 | | QBR deck | | nrr | 1.12 | ratio | annual |\n<!--- gbrain:facts:end -->\n","timeline":""},"probe":null}
+{"id":"h-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 h-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| 8 | Henry-example took over the design system | (interim) | event | 0.75 | private | medium | 2026-02-20 | | team update | |\n<!--- gbrain:facts:end -->\n","timeline":""},"expected":{"compiled_truth":"# Notes h-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| 8 | Henry-example took over the design system | event | 0.75 | private | medium | 2026-02-20 | | team update | (interim) |\n<!--- gbrain:facts:end -->\n","timeline":""},"probe":null}
+{"id":"h-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 h-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| 2 | Open banking APIs commoditize | | take | brain | 0.6 | 2026-03-09 | fintech panel |\n<!--- gbrain:takes:end -->\n","timeline":""},"expected":{"compiled_truth":"# Notes h-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| 2 | Open banking APIs commoditize | take | brain | 0.6 | 2026-03-09 | fintech panel |\n<!--- gbrain:takes:end -->\n","timeline":""},"probe":null}
+{"id":"h-t-ex-02","set":"repairable","adversarial":null,"cls":"extra_cells","kind":"takes","section":"body","page_visibility":"private","tags":["strike"],"note":"struck claim, empty cell after the kind","page":{"compiled_truth":"# Notes h-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| 6 | ~~Sigma-example stays independent~~ | bet | | people/henry-example | 0.35 | 2026-01-15 | dinner |\n<!--- gbrain:takes:end -->\n","timeline":""},"expected":{"compiled_truth":"# Notes h-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| 6 | ~~Sigma-example stays independent~~ | bet | people/henry-example | 0.35 | 2026-01-15 | dinner |\n<!--- gbrain:takes:end -->\n","timeline":""},"probe":null}
+{"id":"h-f-hu-01","set":"repairable","adversarial":null,"cls":"header_unmapped","kind":"facts","section":"body","page_visibility":"private","tags":[],"note":"`trust` is the confidence, written after the notability","page":{"compiled_truth":"# Notes h-f-hu-01\n\nWorking notes kept by the brain owner.\n\n<!--- gbrain:facts:begin -->\n| # | claim | kind | notability | trust | visibility | valid_from | valid_until | source | context |\n|---|---|---|---|---|---|---|---|---|---|\n| 1 | Omega-example's CTO is frank-example | fact | high | 0.95 | private | 2025-08-01 | | team page | |\n| 2 | Omega-example is rewriting its billing | idea | medium | 0.5 | private | | | standup | |\n<!--- gbrain:facts:end -->\n","timeline":""},"expected":{"compiled_truth":"# Notes h-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 | Omega-example's CTO is frank-example | fact | 0.95 | private | high | 2025-08-01 | | team page | |\n| 2 | Omega-example is rewriting its billing | idea | 0.5 | private | medium | | | standup | |\n<!--- gbrain:facts:end -->\n","timeline":""},"probe":null}
+{"id":"h-f-hu-02","set":"repairable","adversarial":null,"cls":"header_unmapped","kind":"facts","section":"body","page_visibility":"private","tags":[],"note":"`begins`, `expires` and `reference` are the dates and the source, written first","page":{"compiled_truth":"# Notes h-f-hu-02\n\nWorking notes kept by the brain owner.\n\n<!--- gbrain:facts:begin -->\n| # | claim | kind | begins | expires | reference | confidence | visibility | notability |\n|---|---|---|---|---|---|---|---|---|\n| 1 | Grace-example sits on the pricing council | fact | 2026-01-01 | 2026-12-31 | council charter | 0.9 | private | medium |\n| 2 | Grace-example covers the EMEA queue | fact | 2026-03-01 | 2026-03-31 | rota | 1.0 | private | low |\n<!--- gbrain:facts:end -->\n","timeline":""},"expected":{"compiled_truth":"# Notes h-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 | Grace-example sits on the pricing council | fact | 0.9 | private | medium | 2026-01-01 | 2026-12-31 | council charter | |\n| 2 | Grace-example covers the EMEA queue | fact | 1.0 | private | low | 2026-03-01 | 2026-03-31 | rota | |\n<!--- gbrain:facts:end -->\n","timeline":""},"probe":null}
+{"id":"h-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 a `learned from` column (the source); Tier 1 numbers the rows","page":{"compiled_truth":"# Notes h-f-hu-03\n\nWorking notes kept by the brain owner.\n\n<!--- gbrain:facts:begin -->\n| claim | kind | confidence | visibility | notability | learned from |\n|---|---|---|---|---|---|\n| Henry-example plays cello | fact | 0.8 | private | low | dinner |\n| Henry-example wants to teach a course | preference | 0.6 | private | medium | coffee chat |\n<!--- gbrain:facts:end -->\n","timeline":""},"expected":{"compiled_truth":"# Notes h-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 | Henry-example plays cello | fact | 0.8 | private | low | | | dinner | |\n| 2 | Henry-example wants to teach a course | preference | 0.6 | private | medium | | | coffee chat | |\n<!--- gbrain:facts:end -->\n","timeline":""},"probe":null}
+{"id":"h-f-hu-04","set":"repairable","adversarial":null,"cls":"header_unmapped","kind":"facts","section":"body","page_visibility":"private","tags":[],"note":"kind before claim and a `sharing` column (the visibility)","page":{"compiled_truth":"# Notes h-f-hu-04\n\nWorking notes kept by the brain owner.\n\n<!--- gbrain:facts:begin -->\n| # | kind | claim | confidence | sharing | notability | valid_from |\n|---|---|---|---|---|---|---|\n| 1 | event | Lambda-example signed widget-co | 0.9 | private | high | 2026-05-05 |\n| 2 | fact | Lambda-example bills quarterly | 0.8 | private | low | |\n<!--- gbrain:facts:end -->\n","timeline":""},"expected":{"compiled_truth":"# Notes h-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 | Lambda-example signed widget-co | event | 0.9 | private | high | 2026-05-05 | | | |\n| 2 | Lambda-example bills quarterly | fact | 0.8 | private | low | | | | |\n<!--- gbrain:facts:end -->\n","timeline":""},"probe":null}
+{"id":"h-t-hu-01","set":"repairable","adversarial":null,"cls":"header_unmapped","kind":"takes","section":"body","page_visibility":"private","tags":[],"note":"`believer` is the holder and `strength` the weight","page":{"compiled_truth":"# Notes h-t-hu-01\n\nWorking notes kept by the brain owner.\n\n<!--- gbrain:takes:begin -->\n| # | claim | believer | kind | strength | since | source |\n|---|---|---|---|---|---|---|\n| 1 | Kappa-example wins mid-market | people/erin-example | take | 0.7 | 2026-02-20 | pipeline review |\n| 2 | Kappa-example doubles headcount | people/erin-example | bet | 0.4 | 2026-02-20 | pipeline review |\n<!--- gbrain:takes:end -->\n","timeline":""},"expected":{"compiled_truth":"# Notes h-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 | Kappa-example wins mid-market | take | people/erin-example | 0.7 | 2026-02-20 | pipeline review |\n| 2 | Kappa-example doubles headcount | bet | people/erin-example | 0.4 | 2026-02-20 | pipeline review |\n<!--- gbrain:takes:end -->\n","timeline":""},"probe":null}
+{"id":"h-t-hu-02","set":"repairable","adversarial":null,"cls":"header_unmapped","kind":"takes","section":"body","page_visibility":"private","tags":["no_row_numbers"],"note":"no # column; `likelihood` is the weight and `noted` the since date","page":{"compiled_truth":"# Notes h-t-hu-02\n\nWorking notes kept by the brain owner.\n\n<!--- gbrain:takes:begin -->\n| claim | kind | who | likelihood | noted |\n|---|---|---|---|---|\n| Robotics funding recovers in 2027 | bet | brain | 0.5 | 2026-04-02 |\n| Sigma-example enters robotics | hunch | brain | 0.25 | 2026-04-02 |\n<!--- gbrain:takes:end -->\n","timeline":""},"expected":{"compiled_truth":"# Notes h-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 | Robotics funding recovers in 2027 | bet | brain | 0.5 | 2026-04-02 | |\n| 2 | Sigma-example enters robotics | hunch | brain | 0.25 | 2026-04-02 | |\n<!--- gbrain:takes:end -->\n","timeline":""},"probe":null}
+{"id":"h-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 empty cell","page":{"compiled_truth":"# Notes h-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 | Frank-example founded widget-co | fact | 1.0 | private | high | 2019-03-01 |\n| 2 | Frank-example is hiring a COO | | event | 0.7 | private | medium | 2026-06-01 | | recruiter call | |\n<!--- gbrain:facts:end -->\n","timeline":""},"expected":{"compiled_truth":"# Notes h-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 | Frank-example founded widget-co | fact | 1.0 | private | high | 2019-03-01 | | | |\n| 2 | Frank-example is hiring a COO | event | 0.7 | private | medium | 2026-06-01 | | recruiter call | |\n<!--- gbrain:facts:end -->\n","timeline":""},"probe":null}
+{"id":"h-t-mix-01","set":"repairable","adversarial":null,"cls":"mixed","kind":"takes","section":"body","page_visibility":"private","tags":[],"note":"a row above the header and a short row below it","page":{"compiled_truth":"# Notes h-t-mix-01\n\nWorking notes kept by the brain owner.\n\n<!--- gbrain:takes:begin -->\n| 1 | Lambda-example is overvalued | take | people/henry-example | 0.55 | 2026-05-01 | lunch |\n| # | claim | kind | who | weight | since | source |\n|---|-------|------|-----|--------|-------|--------|\n| 2 | Lambda-example cuts prices this year | bet | people/henry-example | 0.45 |\n<!--- gbrain:takes:end -->\n","timeline":""},"expected":{"compiled_truth":"# Notes h-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 | Lambda-example is overvalued | take | people/henry-example | 0.55 | 2026-05-01 | lunch |\n| 2 | Lambda-example cuts prices this year | bet | people/henry-example | 0.45 | | |\n<!--- gbrain:takes:end -->\n","timeline":""},"probe":null}
+{"id":"h-b-mix-01","set":"repairable","adversarial":null,"cls":"mixed","kind":"both","section":"body","page_visibility":"private","tags":["two_fences"],"note":"a facts fence without a header and a takes fence with a short row on one page (two model calls)","page":{"compiled_truth":"# Notes h-b-mix-01\n\nWorking notes kept by the brain owner.\n\n<!--- gbrain:facts:begin -->\n| 1 | Widget-co moved its warehouse to Reno | event | 0.9 | private | medium | 2026-02-01 | | ops email | |\n<!--- gbrain:facts:end -->\n\n<!--- gbrain:takes:begin -->\n| # | claim | kind | who | weight | since | source |\n|---|-------|------|-----|--------|-------|--------|\n| 2 | Widget-co regrets the Reno move | hunch | brain | 0.3 |\n<!--- gbrain:takes:end -->\n","timeline":""},"expected":{"compiled_truth":"# Notes h-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 | Widget-co moved its warehouse to Reno | event | 0.9 | private | medium | 2026-02-01 | | ops email | |\n<!--- gbrain:facts:end -->\n\n<!--- gbrain:takes:begin -->\n| # | claim | kind | who | weight | since | source |\n|---|-------|------|-----|--------|-------|--------|\n| 2 | Widget-co regrets the Reno move | hunch | brain | 0.3 | | |\n<!--- gbrain:takes:end -->\n","timeline":""},"probe":null}
+{"id":"h-adv-01","set":"adversarial","adversarial":"ambiguous","cls":"extra_cells","kind":"facts","section":"body","page_visibility":"private","tags":[],"note":"two confidence values","page":{"compiled_truth":"# Notes h-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| 3 | Omega-example hits its Q3 target | belief | 0.4 | 0.8 | private | medium | 2026-07-01 | | forecast sheet | |\n<!--- gbrain:facts:end -->\n","timeline":""},"expected":null,"probe":"| # | claim | kind | confidence | visibility | notability | valid_from | valid_until | source | context |\n|---|-------|------|------------|------------|------------|------------|-------------|--------|---------|\n| 3 | Omega-example hits its Q3 target | belief | 0.4 | private | medium | 2026-07-01 | | forecast sheet | 0.8 |"}
+{"id":"h-adv-02","set":"adversarial","adversarial":"ambiguous","cls":"extra_cells","kind":"takes","section":"body","page_visibility":"private","tags":[],"note":"two kinds (bet, hunch)","page":{"compiled_truth":"# Notes h-adv-02\n\nWorking notes kept by the brain owner.\n\n<!--- gbrain:takes:begin -->\n| # | claim | kind | who | weight | since | source |\n|---|-------|------|-----|--------|-------|--------|\n| 4 | Kappa-example gets acquired | bet | hunch | people/frank-example | 0.3 | 2026-03-03 | hallway chat |\n<!--- gbrain:takes:end -->\n","timeline":""},"expected":null,"probe":"| # | claim | kind | who | weight | since | source | resolved | quality | evidence | value | unit | by |\n|---|-------|------|-----|--------|-------|--------|----------|---------|----------|-------|------|----|\n| 4 | Kappa-example gets acquired | bet | people/frank-example | 0.3 | 2026-03-03 | hallway chat | | | hunch | | | |"}
+{"id":"h-adv-03","set":"adversarial","adversarial":"ambiguous","cls":"header_unmapped","kind":"facts","section":"body","page_visibility":"private","tags":[],"note":"a `team` column has no home in a facts table; the only free column is valid_until","page":{"compiled_truth":"# Notes h-adv-03\n\nWorking notes kept by the brain owner.\n\n<!--- gbrain:facts:begin -->\n| # | claim | kind | team | confidence | visibility | notability | valid_from | source | context |\n|---|---|---|---|---|---|---|---|---|---|\n| 1 | The hiring plan is frozen | event | platform | 0.85 | private | high | 2026-08-01 | leadership sync | |\n<!--- gbrain:facts:end -->\n","timeline":""},"expected":null,"probe":"| # | claim | kind | confidence | visibility | notability | valid_from | valid_until | source | context |\n|---|-------|------|------------|------------|------------|------------|-------------|--------|---------|\n| 1 | The hiring plan is frozen | event | 0.85 | private | high | 2026-08-01 | platform | leadership sync | |"}
+{"id":"h-adv-04","set":"adversarial","adversarial":"ambiguous","cls":"header_unmapped","kind":"takes","section":"body","page_visibility":"private","tags":[],"note":"a `rationale` column is neither a date nor a source, but the gates accept it in either free column","page":{"compiled_truth":"# Notes h-adv-04\n\nWorking notes kept by the brain owner.\n\n<!--- gbrain:takes:begin -->\n| # | claim | rationale | kind | who | weight |\n|---|---|---|---|---|---|\n| 1 | Widget-co raises prices in 2027 | pricing power | bet | people/grace-example | 0.6 |\n<!--- gbrain:takes:end -->\n","timeline":""},"expected":null,"probe":"| # | claim | kind | who | weight | since | source |\n|---|-------|------|-----|--------|-------|--------|\n| 1 | Widget-co raises prices in 2027 | bet | people/grace-example | 0.6 | | pricing power |"}
+{"id":"h-adv-05","set":"adversarial","adversarial":"ambiguous","cls":"short_row_gap","kind":"facts","section":"body","page_visibility":"private","tags":["date_meaning"],"note":"a notice-period date could be its start or its end","page":{"compiled_truth":"# Notes h-adv-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| 5 | Frank-example's notice period at kappa-example | fact | 0.8 | private | medium | 2026-03-31 | HR call |\n<!--- gbrain:facts:end -->\n","timeline":""},"expected":null,"probe":"| # | claim | kind | confidence | visibility | notability | valid_from | valid_until | source | context |\n|---|-------|------|------------|------------|------------|------------|-------------|--------|---------|\n| 5 | Frank-example's notice period at kappa-example | fact | 0.8 | private | medium | 2026-03-31 | | HR call | |"}
+{"id":"h-adv-06","set":"adversarial","adversarial":"ambiguous","cls":"short_row_gap","kind":"facts","section":"body","page_visibility":"private","tags":[],"note":"two free-text notes; neither reads clearly as the source or the context","page":{"compiled_truth":"# Notes h-adv-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| 6 | Grace-example is moving to the platform team | event | 0.7 | private | medium | Q3 offsite | budget review |\n<!--- gbrain:facts:end -->\n","timeline":""},"expected":null,"probe":"| # | claim | kind | confidence | visibility | notability | valid_from | valid_until | source | context |\n|---|-------|------|------------|------------|------------|------------|-------------|--------|---------|\n| 6 | Grace-example is moving to the platform team | event | 0.7 | private | medium | | | Q3 offsite | budget review |"}
+{"id":"h-spl-01","set":"adversarial","adversarial":"split_claim","cls":"extra_cells","kind":"facts","section":"body","page_visibility":"private","tags":["pipe"],"note":"the claim continues in the cell after it","page":{"compiled_truth":"# Notes h-spl-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| 7 | Churn fell to 2% | after the pricing change | fact | 0.8 | private | high | 2026-05-31 | | metrics review | |\n<!--- gbrain:facts:end -->\n","timeline":""},"expected":null,"probe":"| # | claim | kind | confidence | visibility | notability | valid_from | valid_until | source | context |\n|---|-------|------|------------|------------|------------|------------|-------------|--------|---------|\n| 7 | Churn fell to 2% | fact | 0.8 | private | high | 2026-05-31 | | metrics review | after the pricing change |"}
+{"id":"h-spl-02","set":"adversarial","adversarial":"split_claim","cls":"extra_cells","kind":"takes","section":"body","page_visibility":"private","tags":["pipe"],"note":"a takes claim cut in two","page":{"compiled_truth":"# Notes h-spl-02\n\nWorking notes kept by the brain owner.\n\n<!--- gbrain:takes:begin -->\n| # | claim | kind | who | weight | since | source |\n|---|-------|------|-----|--------|-------|--------|\n| 3 | Rates fall in 2026 | then rise in 2027 | bet | world | 0.4 | 2026-02-01 | macro notes |\n<!--- gbrain:takes:end -->\n","timeline":""},"expected":null,"probe":"| # | claim | kind | who | weight | since | source | resolved | quality | evidence | value | unit | by |\n|---|-------|------|-----|--------|-------|--------|----------|---------|----------|-------|------|----|\n| 3 | Rates fall in 2026 | bet | world | 0.4 | 2026-02-01 | macro notes | | | then rise in 2027 | | | |"}
+{"id":"h-spl-03","set":"adversarial","adversarial":"split_claim","cls":"short_row_gap","kind":"facts","section":"body","page_visibility":"private","tags":["pipe"],"note":"the claim is cut and the kind cell is missing, so the row has the canonical width and the second half sits in the kind column","page":{"compiled_truth":"# Notes h-spl-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| 8 | Revenue doubled | led by the EU | 0.9 | private | high | 2026-06-30 | | board deck | |\n<!--- gbrain:facts:end -->\n","timeline":""},"expected":null,"probe":null}
+{"id":"h-spl-04","set":"adversarial","adversarial":"split_claim","cls":"no_header","kind":"facts","section":"body","page_visibility":"private","tags":["pipe"],"note":"no header, and the claim continues in the next cell","page":{"compiled_truth":"# Notes h-spl-04\n\nWorking notes kept by the brain owner.\n\n<!--- gbrain:facts:begin -->\n| 2 | Omega-example hired a CRO | from widget-co | event | 0.9 | private | high | 2026-03-01 | | press release | |\n<!--- gbrain:facts:end -->\n","timeline":""},"expected":null,"probe":"| # | claim | kind | confidence | visibility | notability | valid_from | valid_until | source | context |\n|---|-------|------|------------|------------|------------|------------|-------------|--------|---------|\n| 2 | Omega-example hired a CRO | event | 0.9 | private | high | 2026-03-01 | | press release | from widget-co |"}
+{"id":"h-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 h-unr-01\n\nWorking notes kept by the brain owner.\n\n<!--- gbrain:takes:begin -->\n| # | claim | kind | who | weight | since | source |\n|---|-------|------|-----|--------|-------|--------|\n| 4 | Edge inference beats cloud for robots | take | people/henry-example | robotics panel |\n<!--- gbrain:takes:end -->\n","timeline":""},"expected":null,"probe":"| # | claim | kind | who | weight | since | source |\n|---|-------|------|-----|--------|-------|--------|\n| 4 | Edge inference beats cloud for robots | take | people/henry-example | 0.5 | | robotics panel |"}
+{"id":"h-unr-02","set":"adversarial","adversarial":"unrecoverable","cls":"short_row_gap","kind":"facts","section":"body","page_visibility":"private","tags":[],"note":"the notability is missing","page":{"compiled_truth":"# Notes h-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| 9 | Sigma-example rotated its API keys | event | 0.95 | private | 2026-02-14 | | security log |\n<!--- gbrain:facts:end -->\n","timeline":""},"expected":null,"probe":"| # | claim | kind | confidence | visibility | notability | valid_from | valid_until | source | context |\n|---|-------|------|------------|------------|------------|------------|-------------|--------|---------|\n| 9 | Sigma-example rotated its API keys | event | 0.95 | private | medium | 2026-02-14 | | security log | |"}
diff --git a/evals/fence-repair-tier3/oracle.ts b/evals/fence-repair-tier3/oracle.ts
index d8ce1bdc5a..bdd6ec57bb 100644
--- a/evals/fence-repair-tier3/oracle.ts
+++ b/evals/fence-repair-tier3/oracle.ts
@@ -8,8 +8,8 @@
* `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/ambiguous and split_claim: 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 that reaches Tier 3: a model answering HOLD is held as
* `llm_declined` (prompt v2).
@@ -17,7 +17,8 @@
* Every fixture must reach Tier 3 with the residual reason its class names,
* except the ones `FREE_TIER_PATH` lists, which the free tiers decide: `tier1`
* ones Tier 1 repairs to the ground truth byte for byte, `manual` ones it
- * holds before any model call.
+ * holds before any model call. Those come back as notes; anything else off
+ * its path is a violation.
*/
import { __setChatTransportForTests, type ChatResult } from '../../src/core/ai/gateway.ts';
import { dailyLedger, FENCE_REPAIR_LEDGER } from '../../src/core/budget/daily-ledger.ts';
@@ -38,14 +39,18 @@ const REASON_OF: Record<string, string | null> = {
/**
* Fixtures the free tiers decide without a model since the eval's fixes
* (#6188 T4): `tier1` rows have stray empty cells with exactly one valid
- * removal (Tier 1 `stray_empty_cell`); `manual` rows have extra cells that
- * removing empty cells cannot line up (a misplaced text cell, a duplicated
- * value, or a claim cut by an unescaped pipe), held as `extra_cells`.
+ * removal (Tier 1 `stray_empty_cell`); `manual` rows are held before any
+ * model call: extra cells that removing empty cells cannot line up (a
+ * misplaced text cell, a duplicated value, or a claim cut by an unescaped
+ * pipe), held as `extra_cells`, and a sentence in the facts `kind` column,
+ * held as `claim_split`. Round 1 ids, then the held-out set's (`h-`).
*/
export const FREE_TIER_PATH: Readonly<Record<string, 'tier1' | 'manual'>> = {
'f-ex-01': 'tier1', 'f-ex-02': 'tier1', 'f-ex-03': 'tier1', 'f-ex-04': 'tier1', 'f-ex-06': 'tier1', 'f-ex-07': 'tier1',
't-ex-01': 'tier1', 't-ex-02': 'tier1', 't-ex-03': 'tier1', 't-ex-04': 'tier1',
'f-ex-05': 'manual', 'f-adv-01': 'manual', 'f-adv-02': 'manual', 'f-adv-03': 'manual', 'f-adv-04': 'manual', 't-adv-01': 'manual', 'f-gl-02': 'manual',
+ 'h-f-ex-01': 'tier1', 'h-f-ex-02': 'tier1', 'h-f-ex-03': 'tier1', 'h-f-ex-04': 'tier1', 'h-t-ex-01': 'tier1', 'h-t-ex-02': 'tier1',
+ 'h-f-ex-05': 'manual', 'h-adv-01': 'manual', 'h-adv-02': 'manual', 'h-spl-01': 'manual', 'h-spl-02': 'manual', 'h-spl-03': 'manual',
};
export type AnswerFn = (f: Fixture, req: Tier3Request, variant: 'as_written' | 'blank_numbers') => string;
@@ -69,7 +74,9 @@ export const oracleAnswers: AnswerFn = (f, req, variant) => {
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[]> {
+export interface OracleResult { violations: string[]; notes: string[] }
+
+export async function runOracle(fixtures: readonly Fixture[], answer: AnswerFn): Promise<OracleResult> {
const engine = new PGLiteEngine();
await engine.connect({});
await engine.initSchema();
@@ -77,6 +84,7 @@ export async function runOracle(fixtures: readonly Fixture[], answer: AnswerFn):
const deps = { ledger: dailyLedger(engine, FENCE_REPAIR_LEDGER), store: attemptStore(engine), model: 'anthropic:claude-opus-4-7', capSource: 'default' as const,
perPageUsd: FENCE_REPAIR_DEFAULT_MAX_USD_PER_PAGE, perDayUsd: 1000, timeoutMs: 30_000, now: () => new Date() };
const violations: string[] = [];
+ const notes: 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'];
@@ -87,10 +95,12 @@ export async function runOracle(fixtures: readonly Fixture[], answer: AnswerFn):
if (path === 'tier1') {
if (analysis.status !== 'proposal') violations.push(`${f.id}: the free tiers returned ${analysis.status}; Tier 1 must repair it`);
else if (analysis.after.compiled_truth !== f.expected!.compiled_truth || analysis.after.timeline !== f.expected!.timeline) violations.push(`${f.id}: the Tier 1 repair differs from expected`);
+ else notes.push(`${f.id}: repaired by Tier 1 (${analysis.tier}) exactly as expected`);
continue;
}
if (path === 'manual') {
if (analysis.status !== 'manual') violations.push(`${f.id}: the free tiers returned ${analysis.status}; they must hold it before any model call`);
+ else notes.push(`${f.id}: held before Tier 3 (${analysis.reason})`);
continue;
}
if (analysis.status !== 'llm') {
@@ -115,9 +125,9 @@ export async function runOracle(fixtures: readonly Fixture[], answer: AnswerFn):
}
} 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`);
+ } else if (f.adversarial === 'unrecoverable') {
+ if (out.outcome === 'repaired') violations.push(`${tag}: the unrecoverable probe was accepted`);
+ } else if (f.probe && out.outcome !== 'repaired') violations.push(`${tag}: the ${f.adversarial} probe was rejected (${out.reason}${out.gate ? `, gate ${out.gate}` : ''}); the gates can already hold it`);
if (variant === 'as_written') {
__setChatTransportForTests(async () => result('HOLD'));
const declined = await runCase(engine, src!.incarnation, { ...f, id: `${f.id}~hold` }, deps);
@@ -129,5 +139,5 @@ export async function runOracle(fixtures: readonly Fixture[], answer: AnswerFn):
__setChatTransportForTests(null);
await engine.disconnect();
}
- return violations;
+ return { violations, notes };
}
diff --git a/evals/fence-repair-tier3/run-case.ts b/evals/fence-repair-tier3/run-case.ts
index 6821580e11..d6625e71de 100644
--- a/evals/fence-repair-tier3/run-case.ts
+++ b/evals/fence-repair-tier3/run-case.ts
@@ -4,13 +4,13 @@
* 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 repair is `repaired` with `tier1: 'proposal'`
- * (no call), a page they hold is `not_sent` with its manual reason, and a
- * page they leave for the model goes through `runTier3` with the real daily
- * ledger and attempt store of that brain: prompt v2 (a model may answer HOLD,
- * held as `llm_declined`), one call per fence, a corrective re-ask only after
- * a structural gate failure ((a) or (e)), gates (a)-(g) and the Tier 1 fixed
- * point. Nothing here re-implements a tier or a gate.
+ * fences` does; a page they leave for the model goes through `runTier3` with
+ * the real daily ledger and attempt store of that brain: prompt v2 (a model
+ * may answer HOLD, held as `llm_declined`), one call per fence, a corrective
+ * re-ask only after a structural gate failure ((a) or (e)), gates (a)-(g) and
+ * the Tier 1 fixed point. Nothing here re-implements a tier or a gate. A page the free
+ * tiers repair (`proposal`) or hold (`manual`) is reported with that tier's
+ * outcome, so a fence that a Tier 1 rule now handles is scored as Tier 1.
*
* `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
@@ -26,8 +26,10 @@ 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; `proposal` means they repaired it; `manual` means they held it. */
+ /** What the free tiers decided: `llm` means the page reached Tier 3. */
tier1: 'clean' | 'proposal' | 'manual' | 'llm';
+ /** The tier that produced the outcome (null for a page that already compiles). */
+ tier: 'deterministic' | 'resolver' | 'llm' | 'manual' | null;
/** Residual reasons Tier 1 left (location-only codes). */
residual: string[];
/** Model requests (fences) sent for this page. */
@@ -80,15 +82,18 @@ export async function runCase(engine: BrainEngine, incarnation: string, f: Fixtu
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: 'repaired', reason: analysis.tier, after: { compiled_truth: analysis.after.compiled_truth, timeline: analysis.after.timeline } };
+ if (analysis.status === 'clean') return { ...base, tier1: 'clean', tier: null, residual: [], outcome: 'not_sent', reason: 'clean' };
+ if (analysis.status === 'proposal') {
+ return { ...base, tier1: 'proposal', tier: analysis.tier, residual: [], outcome: 'repaired', reason: null,
+ after: { compiled_truth: analysis.after.compiled_truth, timeline: analysis.after.timeline } };
+ }
if (analysis.status === 'manual') {
- return { ...base, tier1: 'manual', residual: [analysis.reason], outcome: 'not_sent', reason: analysis.reason, gate: analysis.gate ?? null, rows: analysis.rows ?? [] };
+ return { ...base, tier1: 'manual', tier: 'manual', residual: [analysis.reason], outcome: 'held', 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 ?? [],
+ if (result.ok) return { ...base, tier1: 'llm', tier: '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', tier: '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
index 351dd1f38b..ef4243ff5d 100644
--- a/evals/fence-repair-tier3/score.ts
+++ b/evals/fence-repair-tier3/score.ts
@@ -9,17 +9,19 @@
* 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 repaired on the production path (by the
- * free tiers or by a Tier 3 repair that passed every gate), over repairable
- * items run.
- * - false-accept rate: repairable items repaired but not matching their
- * ground truth, over repairable items run.
- * `repairable.tier3` restricts both to the items that reached the model;
- * `tier1_repaired` and `held_before_model` count the free tiers' share, and
- * `declined` counts HOLD answers (`llm_declined`, prompt v2).
- * - held correctly: adversarial items that stayed held, over adversarial
- * items run.
+ * Metrics (preregistered in gbrain-evals, docs/benchmarks/2026-10-06-fence-repair-tier3-preregistration.md,
+ * amended for round 2 in 2026-10-06-fence-repair-tier3-amendment-1.md):
+ * - gate-pass rate: repairable items that reached Tier 3 and whose Tier 3
+ * repair passed every gate, over repairable items that reached Tier 3.
+ * - false-accept rate: of those, repaired but not matching the ground truth,
+ * over repairable items that reached Tier 3.
+ * - end to end: every repairable item whatever tier settled it (a Tier 1
+ * repair, a hold before Tier 3), with wrong writes per tier.
+ * - whole path: gate-pass and false-accept over every repairable item, a
+ * free-tier repair counting as repaired (scorer v2's definition), reported
+ * beside the preregistered Tier 3 rates; `declined` counts HOLD answers.
+ * - held correctly: adversarial items that stayed held by any tier, over
+ * adversarial items run, with how they were held.
* - 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.
*/
@@ -27,7 +29,7 @@ import { extractRawRows, primaryFence } from '../../src/core/fence-repair/raw-ro
import { collapse } from '../../src/core/fence-repair/schema.ts';
import type { FencePageText } from './generate-fixtures.ts';
-export const SCORER_VERSION = 2;
+export const SCORER_VERSION = 3;
type Section = 'compiled_truth' | 'timeline';
@@ -65,11 +67,13 @@ export interface ResultRow {
run: number;
id: string;
set: 'repairable' | 'adversarial' | 'gate_limited';
- adversarial: 'ambiguous' | 'unrecoverable' | null;
+ adversarial: 'ambiguous' | 'unrecoverable' | 'split_claim' | null;
cls: string;
kind: string;
tags: string[];
tier1: string;
+ /** The tier that produced the outcome (round 2 rows; round 1 rows all reached Tier 3). */
+ tier?: string | null;
/** Model requests (fences) the page sent; more calls than this means a corrective re-ask ran. */
requests: number;
outcome: 'repaired' | 'held' | 'not_sent';
@@ -115,9 +119,11 @@ 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>;
- tier1_repaired: number; held_before_model: number; declined: number; tier3: { n: number; repaired: number; false_accepts: number } };
- adversarial: { n: number; held: number; held_rate: number; ambiguous_n: number; ambiguous_held: number; unrecoverable_n: number; unrecoverable_held: number; declined: number; accepted_ids: string[] };
+ exact_matches: number; per_run_gate_pass: number[]; reask_used: number; reask_rescued: number; held_by: Record<string, number>; declined: number };
+ whole_path: { n: number; repaired: number; gate_pass: number; false_accepts: number; false_accept: number };
+ end_to_end: { n: number; repaired: number; wrong_writes: number; by_tier: Record<string, { runs: number; repaired: number; wrong_writes: number }> };
+ adversarial: { n: number; held: number; held_rate: number; ambiguous_n: number; ambiguous_held: number; unrecoverable_n: number; unrecoverable_held: number;
+ split_claim_n: number; split_claim_held: number; held_how: Record<string, 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 };
@@ -127,7 +133,8 @@ 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 allRep = mine.filter(r => r.set === 'repairable');
+ const rep = allRep.filter(r => r.tier1 === 'llm');
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');
@@ -138,6 +145,18 @@ export function summarize(rows: readonly ResultRow[]): ModelSummary[] {
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 spl = adv.filter(r => r.adversarial === 'split_claim');
+ const byTier: Record<string, { runs: number; repaired: number; wrong_writes: number }> = {};
+ for (const r of allRep) {
+ const t = byTier[r.tier ?? 'llm'] ??= { runs: 0, repaired: 0, wrong_writes: 0 };
+ t.runs++;
+ if (r.outcome === 'repaired') { t.repaired++; if (r.match_cells === false) t.wrong_writes++; }
+ }
+ const heldHow: Record<string, number> = {};
+ for (const r of adv.filter(r => r.outcome !== 'repaired')) {
+ const how = r.tier === 'manual' ? 'before_tier3' : r.gate ? 'gate' : r.reason === 'llm_declined' ? 'declined' : r.reason === 'llm_empty' || r.reason === 'llm_truncated' ? 'output_budget' : r.reason ?? 'other';
+ heldHow[how] = (heldHow[how] ?? 0) + 1;
+ }
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);
@@ -150,14 +169,15 @@ export function summarize(rows: readonly ResultRow[]): ModelSummary[] {
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,
- tier1_repaired: rep.filter(r => r.tier1 === 'proposal').length, held_before_model: rep.filter(r => r.tier1 === 'manual').length,
declined: rep.filter(r => r.reason === 'llm_declined').length,
- tier3: { n: rep.filter(r => r.tier1 === 'llm').length, repaired: repaired.filter(r => r.tier1 === 'llm').length, false_accepts: falseAccepts.filter(r => r.tier1 === 'llm').length },
},
+ whole_path: wholePath(allRep),
+ end_to_end: { n: allRep.length, repaired: allRep.filter(r => r.outcome === 'repaired').length, wrong_writes: allRep.filter(r => r.outcome === 'repaired' && r.match_cells === false).length, by_tier: byTier },
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, declined: adv.filter(r => r.reason === 'llm_declined').length,
+ unrecoverable_n: unr.length, unrecoverable_held: unr.filter(r => r.outcome !== 'repaired').length,
+ split_claim_n: spl.length, split_claim_held: spl.filter(r => r.outcome !== 'repaired').length, held_how: heldHow,
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() },
@@ -172,7 +192,13 @@ export function summarize(rows: readonly ResultRow[]): ModelSummary[] {
});
}
-/** The preregistered decision rule for one model's summary. */
+function wholePath(rows: readonly ResultRow[]): ModelSummary['whole_path'] {
+ const repaired = rows.filter(r => r.outcome === 'repaired').length;
+ const falseAccepts = rows.filter(r => r.outcome === 'repaired' && r.match_cells === false).length;
+ return { n: rows.length, repaired, gate_pass: rows.length ? repaired / rows.length : 0, false_accepts: falseAccepts, false_accept: rows.length ? falseAccepts / rows.length : 0 };
+}
+
+/** The preregistered decision rule for one model's summary (Tier 3 rates). */
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/llms-full.txt b/llms-full.txt
index 0c4a09c49c..ec8f341b17 100644
--- a/llms-full.txt
+++ b/llms-full.txt
@@ -11857,9 +11857,18 @@ sent again until the file, the model or the rules change.
The repair model is `models.fence_repair` when set. Unset, it is the first
model the fence-repair eval measured as accurate enough whose provider key the
-brain has: `openai:gpt-6.1-sol`, then `anthropic:claude-fable-5-1`. With
-neither key, model-tier fences wait as `no_measured_model` until the user
-picks a model.
+brain has: `openai:gpt-6.1-sol` with an OpenAI key, else
+`anthropic:claude-opus-5-5` with an Anthropic key (`anthropic:claude-fable-5-1`
+also met the bar). With neither key, model-tier fences wait as
+`no_measured_model` until the user picks a model.
+
+The gates check that no text is lost or rewritten; they cannot tell which of two
+free-text columns a moved cell belongs in, which is why only measured models
+are defaults. On 40 held-out synthetic malformed fences over three runs
+(`evals/fence-repair-tier3`), `openai:gpt-6.1-sol` and
+`anthropic:claude-opus-5-5` each repaired 95 of the 99 attempts that reached
+the model, none with a cell in the wrong column, and answered HOLD on the
+other 4; rows with stray empty cells were lined up by the free rule instead.
The session below is real output (volatile ids, hashes and times shown as
`<id>`, `<hash>`, `<time>`; `test/fence-walkthrough.test.ts` runs these
@@ -12018,7 +12027,7 @@ the next maintenance run, so pause first if you want to keep the original.
| `fences.repair.llm` | `true` | `false` keeps every repair to the free tiers; model-tier holds stay `llm_disabled`. |
| `fences.repair.max_usd_per_page` | `0.30` | The most one page may spend on the model, checked against each call's worst case (the prompt plus the full output ceiling, with 2,048 tokens for a reasoning model to think). `0` means no model spend. |
| `fences.repair.max_usd_per_day` | `1.00` | The most all processes together spend per UTC day, through a durable ledger. `0` means no model spend. |
-| `models.fence_repair` | unset: the first measured model with a key (`openai:gpt-6.1-sol`, then `anthropic:claude-fable-5-1`), else none | The model Tier 3 calls (`gbrain models` shows it). A model you set always runs; one gbrain has no price for runs under the default caps at an estimated ceiling (the highest chat rate gbrain knows; `gbrain pricing set` makes it exact) and waits for its price under a cap you set. |
+| `models.fence_repair` | unset: the first measured model with a key (`openai:gpt-6.1-sol` with an OpenAI key, else `anthropic:claude-opus-5-5` with an Anthropic key), else none | The model Tier 3 calls (`gbrain models` shows it). A model you set always runs; one gbrain has no price for runs under the default caps at an estimated ceiling (the highest chat rate gbrain knows; `gbrain pricing set` makes it exact) and waits for its price under a cap you set. |
| `fences.normalize` | `true` | `false` stops the inline rewrite on writes and syncs: a fixable fence is held or refused like any other. |
## Resume
diff --git a/skills/migrations/v0.60.102.0.md b/skills/migrations/v0.60.102.0.md
index 21916fd8cb..490a14092d 100644
--- a/skills/migrations/v0.60.102.0.md
+++ b/skills/migrations/v0.60.102.0.md
@@ -48,8 +48,8 @@ leave spend decisions to them (step 3).
the rest of the page, and the model answers HOLD instead of guessing when
a row has two readings. With `models.fence_repair` unset, the repair model
is the first model the fence-repair eval measured as accurate enough whose
- provider key the brain has: `openai:gpt-6.1-sol` (OpenAI key), then
- `anthropic:claude-fable-5-1` (Anthropic key). With neither key, model
+ provider key the brain has: `openai:gpt-6.1-sol` (OpenAI key), else
+ `anthropic:claude-opus-5-5` (Anthropic key). With neither key, model
repair stays off and those fences wait as `no_measured_model`; which model
to trust is the user's call (`gbrain config set models.fence_repair <provider:model>`;
a model set there always runs). Spend is capped at $0.30 per page
diff --git a/skills/skills.lock.json b/skills/skills.lock.json
index 3c5f530071..adcffb864d 100644
--- a/skills/skills.lock.json
+++ b/skills/skills.lock.json
@@ -153,7 +153,7 @@
"migrations/v0.59.10.0.md": "e0268a05ab184d5518f88747313e772629b2af91db59eacbba728f2ebd9db3cd",
"migrations/v0.59.2.0.md": "b6d61af8ef48c154a26e8d427dd6f6570e99efb82b891728426046eea493247b",
"migrations/v0.60.100.0.md": "63583a73e957c5421bb826f2be48ac1aafaaa994392c1a05f26d1516b48c8573",
- "migrations/v0.60.102.0.md": "b17c49ec53283eb8374f26cfdcb39a7847703a30a276d3b3d2b33b1441a0cb3f",
+ "migrations/v0.60.102.0.md": "be46986da0334071931b5a285a532335af92e50dee6559899ea07bb9cd03615e",
"migrations/v0.60.11.0.md": "1e503113f591c5cd142b78ab4472bbdbceb890c6cbac2fbdf8aa61cd087200b8",
"migrations/v0.60.20.0.md": "9266863a9f76164c64a72b1be17b8ddb3bb97e1c3c5db9f666b69ebc7a228fdd",
"migrations/v0.60.26.0.md": "30d761ef5a2361bad66053f97b7b659304a591274be33e281f4f6df0d7d5566e",
diff --git a/src/core/fence-repair/measured.ts b/src/core/fence-repair/measured.ts
index 25a83a596d..638f386d69 100644
--- a/src/core/fence-repair/measured.ts
+++ b/src/core/fence-repair/measured.ts
@@ -4,14 +4,17 @@
* updates both constants together.
*
* `FENCE_REPAIR_MEASURED_MODELS`: the models that met the preregistered
- * rule (gate-pass at least 80%, false accepts at most 1%), best first. With
+ * rule (gate-pass at least 80%, false accepts at most 1%) on both the round 1
+ * fixtures and the held-out set (round 2, prompt v2), best first by held-out
+ * gate-pass with ties to the cheaper model. With
* `models.fence_repair` unset, model repair uses the first one the brain has
* a provider key for; with none, model repair stays off by default
* (`no_measured_model`). An explicit `models.fence_repair` always runs.
*
* `FENCE_REPAIR_MEASURED`: the sentence the behavior-change notice prints
- * about how often the model's rewrites are accepted.
+ * about how often the model's rewrites are accepted. HTTP clients see it too,
+ * so it names no model or provider (`gbrain models` names the model).
*/
-export const FENCE_REPAIR_MEASURED_MODELS: readonly string[] = ['openai:gpt-6.1-sol', 'anthropic:claude-fable-5-1'];
+export const FENCE_REPAIR_MEASURED_MODELS: readonly string[] = ['openai:gpt-6.1-sol', 'anthropic:claude-opus-5-5', 'anthropic:claude-fable-5-1'];
-export const FENCE_REPAIR_MEASURED = 'How often the model\'s rewrites are accepted is not yet measured.';
+export const FENCE_REPAIR_MEASURED = 'On 40 held-out synthetic malformed fences over three runs, each measured default model repaired 95 of 99 attempts with no cell in the wrong column and declined the other 4.';
diff --git a/test/eval-fence-repair-tier3.test.ts b/test/eval-fence-repair-tier3.test.ts
index 1f900afd17..7a0c46fcf5 100644
--- a/test/eval-fence-repair-tier3.test.ts
+++ b/test/eval-fence-repair-tier3.test.ts
@@ -2,18 +2,21 @@
* 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, the free tiers
- * decide the fixtures the oracle lists as theirs, and a HOLD answer is held as
- * `llm_declined`); 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 off its listed path 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.
+ * Protects: the committed fixtures (round 1) and the held-out set (round 2)
+ * match their generator; round 1 keeps at least 60 repairable fences across
+ * every Tier 3 residual class plus both kinds of adversarial fence, and the
+ * held-out set at least 40 with ambiguous and split-claim adversarials; 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 and split-claim probe is
+ * accepted, each unrecoverable probe is rejected, the free tiers decide the
+ * fixtures the oracle lists as theirs, and a HOLD answer is held as
+ * `llm_declined`); and the scorer's match rule, its Tier 3 and whole-path
+ * rates and the decision boundary. Fails when: a fixture is hand-edited
+ * without regenerating, a Tier 1 or gate change moves a fixture off its listed
+ * path 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.
*/
@@ -22,12 +25,15 @@ 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 { HELDOUT_CASES } from '../evals/fence-repair-tier3/heldout-cases.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));
+const heldoutText = readFileSync(join(dir, 'heldout.jsonl'), 'utf8');
+const heldout: Fixture[] = heldoutText.trim().split('\n').map(line => JSON.parse(line));
afterAll(() => resetGateway());
@@ -48,11 +54,30 @@ describe('fixtures', () => {
expect(fixtures.filter(f => f.adversarial === 'unrecoverable').length).toBeGreaterThanOrEqual(3);
for (const f of fixtures) expect(f.expected === null).toBe(f.set === 'adversarial');
});
+
+ test('the held-out set matches its generator: at least 40 fences, the same classes, ambiguous and split-claim adversarials, no id shared with round 1', () => {
+ expect(heldoutText).toBe(fixturesJsonl(HELDOUT_CASES));
+ expect(heldout.length).toBeGreaterThanOrEqual(40);
+ const repairable = heldout.filter(f => f.set === 'repairable');
+ expect(repairable.length).toBeGreaterThanOrEqual(40);
+ 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(3);
+ }
+ expect(heldout.filter(f => f.adversarial === 'ambiguous').length).toBeGreaterThanOrEqual(5);
+ expect(heldout.filter(f => f.adversarial === 'split_claim').length).toBeGreaterThanOrEqual(3);
+ const roundOne = new Set(fixtures.map(f => f.id));
+ expect(heldout.filter(f => roundOne.has(f.id))).toEqual([]);
+ for (const f of heldout) 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([]);
+ test('every round 1 label holds under the production gates', async () => {
+ expect((await runOracle(fixtures, oracleAnswers)).violations).toEqual([]);
+ }, 60_000);
+
+ test('every held-out label holds under the production gates', async () => {
+ expect((await runOracle(heldout, oracleAnswers)).violations).toEqual([]);
}, 60_000);
});
@@ -76,12 +101,16 @@ describe('scorer', () => {
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)];
- rows[0] = { ...rows[0]!, tier1: 'proposal', calls: [] };
rows[10] = { ...rows[10]!, reason: 'llm_declined', gate: null };
const [s] = summarize(rows);
- expect(s!.repairable).toMatchObject({ n: 10, repaired: 9, gate_pass: 0.9, false_accepts: 1, false_accept: 0.1, tier1_repaired: 1, tier3: { n: 9, repaired: 8, false_accepts: 1 } });
- expect(s!.adversarial).toMatchObject({ n: 1, held: 1, declined: 1 });
+ 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, held_how: { declined: 1 } });
expect(s!.cost.usd_per_repair).toBeCloseTo(0.1 / 9, 10);
+ const freeTier = { ...rows[0]!, id: 't1', tier1: 'proposal', tier: 'deterministic', calls: [], spent_usd: 0 };
+ const [w] = summarize([...rows, freeTier]);
+ expect(w!.repairable).toMatchObject({ n: 10, repaired: 9 });
+ expect(w!.whole_path).toMatchObject({ n: 11, repaired: 10, false_accepts: 1 });
+ expect(w!.end_to_end.by_tier).toMatchObject({ deterministic: { runs: 1, repaired: 1, wrong_writes: 0 }, llm: { runs: 10, repaired: 9, wrong_writes: 1 } });
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);
diff --git a/test/repair-fences.test.ts b/test/repair-fences.test.ts
index 9598c4b130..e34ced58cf 100644
--- a/test/repair-fences.test.ts
+++ b/test/repair-fences.test.ts
@@ -224,7 +224,7 @@ test('preview lists every tier with its cost and calls no model; the printed app
const receipts = await engine.executeRaw<{ outcome: Record<string, any> }>("SELECT outcome FROM persistence_requests WHERE source_id=$1 AND outcome ? 'fence_repair' ORDER BY sequence", [s.id]);
expect(receipts.map(r => r.outcome.fence_repair.tier).sort()).toEqual(['deterministic', 'llm', 'resolver']);
const llmReceipt = receipts.find(r => r.outcome.fence_repair.tier === 'llm')!.outcome.fence_repair;
- expect(llmReceipt).toMatchObject({ actor: 'fence-repair', classes: ['no_header'], model: 'anthropic:claude-fable-5-1' });
+ expect(llmReceipt).toMatchObject({ actor: 'fence-repair', classes: ['no_header'], model: 'anthropic:claude-opus-5-5' });
expect(llmReceipt.cost_usd).toBeGreaterThan(0);
expectNoSecrets([holds, receipts.map(r => r.outcome.fence_repair), surfaceOf(applied), git(s.root, 'log', '--format=%B')]);
}), 240_000);
@@ -483,11 +483,11 @@ test('models.fence_repair: unset, the first measured model with a key (else none
try { await runModels(engine, ['--json']); } finally { process.stdout.write = write; }
return JSON.parse(chunks.join('')) as { per_task: Array<{ key: string; tier: string; resolved: string; source: string }> };
};
- expect(await resolveFenceRepairModel(engine, { ANTHROPIC_API_KEY: 'k' })).toBe('anthropic:claude-fable-5-1');
+ expect(await resolveFenceRepairModel(engine, { ANTHROPIC_API_KEY: 'k' })).toBe('anthropic:claude-opus-5-5');
expect(await resolveFenceRepairModel(engine, { ANTHROPIC_API_KEY: 'k', OPENAI_API_KEY: 'k' })).toBe('openai:gpt-6.1-sol');
expect(await resolveFenceRepairModel(engine, { GEMINI_API_KEY: 'k' })).toBeNull();
const before = (await report()).per_task.find(row => row.key === 'models.fence_repair')!;
- expect(before).toMatchObject({ tier: 'deep', resolved: 'anthropic:claude-fable-5-1', source: 'measured default' });
+ expect(before).toMatchObject({ tier: 'deep', resolved: 'anthropic:claude-opus-5-5', source: 'measured default' });
await engine.setConfig('models.fence_repair', 'anthropic:claude-sonnet-5-5');
const after = (await report()).per_task.find(row => row.key === 'models.fence_repair')!;
expect(after).toMatchObject({ resolved: 'anthropic:claude-sonnet-5-5', source: 'config: models.fence_repair' });