Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Learning

For a site: a search box lets a visitor say what they need in their own words, and rings the card that fits. The model behind it ships with portal, trained on made-up sites only. A site asks for the box with search: in site.yaml (Content reference); an instance needs learn beside portal, which every release carries, and an encoder (Ollama with bge-m3) (Operations). A visitor’s words answer that visitor and are never kept.

This page is the notebook behind that model: how it is trained and measured, the numbers so far, and how to run a night. It is for whoever retrains the model or adds the next decision; writing or running a site needs none of it.

What the trainer measures, portal can learn from. learn/ is a second binary in this repo: it turns every run under runs/ and every night of synthetic data into one training set, trains a small decision model on the plan’s own truth, says how right and how sure it is, and answers the trainer and the interview over JSON. The local models are its data factory and its yardstick, never its teacher of taste.

This page is for whoever runs a night, reads the table, retrains the model or adds the next decision. How learn is built is in learn/README.md; how it ships beside portal is in Operations, the ranker.

Where things live. Rows, embeddings, models, the LLM reply cache and the reports are private, in ~/repos/sessions/learn/ (the sessions repo, uhhm/sessions): the rows carry real clients’ personas and page texts, and this repo is public. The one thing that comes back here is the shipped model, learn/models/route.{bpk,json}, and only when it was trained on fictional sites alone. Numbers about real clients leave the sessions repo as counts.

The commands below assume learn and portal on PATH (cargo build --release --manifest-path learn/Cargo.toml and cargo build --release --features ssr --bin portal, both into $CARGO_TARGET_DIR/release/), are run from the root of this checkout, and use

L=~/repos/sessions/learn

1. What the model is

A frozen multilingual encoder turns every context and every candidate into a unit vector: bge-m3 through Ollama’s /api/embed, 1024 numbers. A small predictor (Burn 0.22.1, about a million parameters) maps the context’s vector to a predicted target vector in the same space. A candidate’s score is its cosine to that prediction; the probabilities are a softmax over the candidates of one context, at a temperature fitted after training.

ẑ   = normalise(c + Linear_zero(GELU(Linear(LayerNorm(c)))))     1024 → 512 → 1024, dropout 0.1
s_i = ⟨ẑ, z_i⟩ / τ                                               τ = 0.05
p_i = softmax_i(s_i / T)                                         over the context's own candidates, at most 12

The predictor’s last layer starts at zero, so the untrained model is exactly the encoder’s own cosine between the visitor and each option: the zero-shot floor. Every table therefore has the floor in it. Training keeps epoch 0 when no later epoch beats it on dev, so a model cannot do worse than the floor on dev, and that is all it promises. Dev rows are new visitors at the sites the model trains on; on a site it has never seen, a trained model can do worse than the floor, and so far every route-v1 recipe tried has (Results so far). The model that ships today is the floor itself, written by learn train --epochs 0.

The predictor scores each candidate on its own and sums nothing over positions, so the order the options are listed in cannot move it: the order-flip control below checks that bit for bit. An LLM visitor reading the same page in the other order changes its mind on up to a third of the rows.

A second encoder can be compiled in (--features onnx, --encoder onnx:<dir>, paraphrase-multilingual-MiniLM-L12-v2, 384 numbers, no Ollama). It gets its own cache and its own models, and a model refuses vectors from an encoder other than the one its sidecar names. It is the road to learn rank without Ollama; it is not what ships.

2. The four decisions

Every decision is one row shape: a context text, candidate texts, and which candidates the world agreed with. decision picks the predictor. One ships.

  • route (ships). Which option on a page a visitor picks. Context: the visitor’s own words and nothing else (template route/v2): the persona, its addresses scrubbed, NFC-normalised and trimmed. The page’s question and what the page says first stay on the row as page_question and page_head, not in the text. Until 2026-10-22 the context was "{question}\n{head}\n\nVisitor: {persona}" (route/v1), and the page drowned the visitor out (Results so far). A model reads only its own template: rank, predict, eval, answer and visitor refuse a route/v1 model fed route/v2 text and the other way round (rank and predict exit 2), telling the two apart by v1’s \n\nVisitor: line. train refuses train rows that mix the two, and dev or held-out rows of a template the train rows lack. Candidates: the options as the visitor saw them, the whole card where the run had the content repo (when one option’s card is missing, every option of that row falls back to heading and description, so a row has one rendering), else heading and description, else the heading. Positives: the options the plan says lead to the visitor’s need.
  • framing (derived, no labels of its own). Which wording of one option to offer. Not a per-visitor decision: a framing is good when it pulls the people it is for and leaves the others alone, which the route model can score per persona. The extractor finds the cases where the same visitor met two wordings of one option on one page and one routed right and the other did not (271 contexts under 892 wordings so far); those train as pairs through the route predictor, on the same route/v2 context.
  • gap (rows from now on, no model yet). Which open gap an interview turn points at. Context: the last three questions and answers and the draft plan; candidates: what the checker finds missing, plus “nothing is missing”; positives: the gaps the turn closed. Free and deterministic: bratac interview writes all three into transcript.jsonl every turn.
  • next (rows only, later). Which state a case moves to next, from the simulated walks and later from real cases’ events.

3. The rows

learn extract reads every run once and writes the rows to $L/rows/rows.jsonl, one JSON line each, through one struct with one validator. A row, from the fixtures (a fictional machine-hire yard):

{"schema_version":1,"row_id":"r_44fb516731516db2","decision":"route",
 "site":"fjellstad-hire","site_class":"fictional","language":"en","group":"fjellstad-hire|garden-wall","split":null,
 "source":{"origin":"runs","run":"hire-2026-09-10","file":"tasks-full.jsonl","line":1,"task_id":"garden-wall@/",
   "labeller":"plan","visitor_model":"qwen3:8b","writer":"unrecorded","persona_writer":"human",
   "seed":null,"seeds_total":1,"mode":"full","rendering":"heading+description",
   "words_version":"questions","words_sha":"sha256:975cdadd…","template":"route/v2"},
 "context":{"text":"I am building a stone wall in the garden …",
   "persona_id":"garden-wall","persona_text":"I am building a stone wall …","need":"hire-request",
   "page":"/","page_question":"What brings you to Fjellstad Hire today?","page_head":null},
 "candidates":[{"id":"f7f260b020dda","text":"- Hire a machine for a while: For anyone who needs a digger …\n","need":"hire-request"},
               {"id":"fcc26235cf1ce","text":"- Set up an account for your firm: … Write to contact@example …\n","need":null}],
 "label":{"kind":"listwise","positives":[0],"soft":[1.0,0.0],"smoothing":0.0,"pair":null,"value":null,"weight":1.0}}

The rules that make it one training set:

  • row_id is a hash of what the row is (decision, site, context, sorted candidates, where it came from, seed), so re-extracting is byte-identical and replaces rather than duplicates. For a factory row “where it came from” is the site or framing label, not the night’s dated directory (that is in source.run), so the same row keeps its id from one night to the next.
  • A candidate’s id is its framing id, "f" and the first twelve hex digits of the sha256 of its text: the same text has the same id on any site, at any position, in any commit. Candidates are sorted by id; the order a visitor saw is in bratac answer --trace from now on.
  • Every @ address is scrubbed to contact@example before anything is hashed, on fictional and real rows alike, so ids are stable. A card that carries an address therefore gets a different id in learn than portal’s card::framing_id gives it.
  • group is site|persona. Every page, every wording and both languages of one persona stay on one side of every split.
  • site_class is fictional or real, from one site table (learn/src/sites.rs) keyed by run prefix. A run the table does not know is a hard error, and two client sites are never read at all.
  • writer (who wrote the candidate’s words) and persona_writer (who wrote the visitor) are both recorded, so self-play is one comparison.
  • A factory persona’s row may also say what the persona describes (persona_describes: problem, outcome or service), whether the margin guard marked it (persona_margin_flag) and the panel’s verdict (persona_valid). The three are optional: rows from before week 2 have none of them, and still read.

Labels: the plan’s truth, picks soft, judges never

  • Plan truth is the label. positives are the options the plan says lead to the visitor’s need (expect in the tasks iris writes). Every number in the table is scored against plan truth alone.
  • A visitor model’s picks are soft. When a model answered the same task under several seeds, its votes go into soft. Training mixes them in at λ = 0.3 (--picks on, or off, or another λ), and a row labelled by a visitor model rather than the plan weighs 0.3 of a plan row. Picks help: training without them was worse on each of the four held-out sites tried.
  • Judges are never a label. bratac prefer (“which is clearer”, “which is friendlier”) has no path into a row. A door rewrite a judge found clearer on 5 of 10 needs routed worse across three seeds (Training a site); preference can be printed beside a number, never trained toward.

What is in the rows now

$L/rows/manifest.json counts every row by decision × labeller × class × language × rendering, and every answers file by joined and dropped. The extraction behind the table (rows sha256 3b9e655b…, extractor at 488439b):

fictionalreal
route rows labelled by the plan3,288688
route rows labelled by a visitor model only032
framing pairs, by a visitor model67257
framing pairs, by a person (override files)027
in all3,3551,004

4,359 rows: 1,333 from the runs and 3,026 from the first factory night. English 1,506 fictional, Norwegian 1,849; by what the visitor read, 2,121 headings, 2,012 whole cards and 226 heading and description. The 82 answers files hold 2,429 lines: 2,397 joined to their task, 32 dropped because their run kept no tasks file (counted, listed). A file the join table does not cover stops the extractor. That extraction is route/v1’s; the route/v2 rows behind the shipped model (5,891 of them) are counted in Results so far.

4. Splits, and why the held-out site is the number

learn split writes every split file from one rows file:

splitwhat is held outwhat it answers
dev15% of each site’s personas, by hash, stratified by needthe model that ships: trained on every fictional site, calibrated on dev
loso-<site>one fictional site, all of ithow the model does on a business it has never seen. The headline
grouped-5fold-{0..4}a fifth of the personas, across all siteshow it does on new people at businesses it knows
real-clientsnothing trains; real rows onlysanity, reported as counts
pool-out-<b> (with --blocks)one block of new sites, all of ithow the model does on six businesses it has never seen, the level where week 2 chooses

Given the pool-out blocks (--blocks blocks.json), the loso folds are cut only for the sites outside every block, and each pool-out-<b> lists its inner sites: at most eight training sites, by hash, one per twin family, for every choice made inside the fold. --curve --k 8,16,32,50 --draws 3 --cap 120 and --volume 32x100,16x200 write the learning curve and the volume pair instead, per block: the first k sites of a draw’s order of the remaining sites train (twins drawn together, counted as two, so the k = 16 sites are within the k = 32 sites), at most --cap train rows per site by row-id hash, plus one uncapped split at the largest k. learn train --train-filter persona_valid|margin_ok drops train rows only, records the filter in the manifest, and exits 2 when a train row lacks the field.

The headline is the mean over the leave-one-site-out folds because that is the job: the model will be asked about a site somebody is building today, not about the eight it was trained on. A persona split within known sites is easier by a wide margin (compare the 5-fold and loso rows below), and an easy number is the one that would hide a model that has memorised the sites’ words. vestmark (English, pages of up to twelve options) and liail-il (Norwegian) are printed by name beside the mean.

The rules, asserted again by learn train, which refuses a split file that breaks one and names the row:

  1. A real client’s row is eval-real in every split, never anything else. A model trained on one would carry what it learned into a public repo.
  2. Held-out first, then dev, by group. Three sites have a twin, the same business told in the other language (plans/*-nb.yaml, written for this); a fold that holds out one of the pair drops the other, because a translated persona is the held-out persona.
  3. Self-play: a training group whose persona was written by the model that wrote the words it is routed by moves to self-play, scored on its own line. A person, fallback and unrecorded are not a model. The current rows have none.
  4. A non-train row whose persona or context text also occurs in train is dropped and counted.
  5. A non-train persona whose bge-m3 cosine to any train persona is above 0.95 is dropped and counted (learn embed caches every persona text for this). A real row that rule 4 or 5 would drop stays eval-real and is flagged instead, and the sanity check leaves it out.

Rows whose persona a person wrote are the hard set (1,580 of them), reported apart from the synthetic personas so the easier synthetic distribution cannot hide a regression.

The sealed set. Week 2 adds a third site class, sealed: businesses made and locked before anything is trained, then opened once to test what was chosen. Their ids are s- and eight hex digits, so no training site can take one, and LEARN_SEALED_SITES lists them, one <id> <language> <plan> <half> per line, the half A or B. learn extract writes their rows only under LEARN_SEALED_DIR, and each row says its half in source.sealed_half. split, train, calibrate, lint, bench, eval, ltr, and embed into a cache outside that directory, refuse a rows file that holds a sealed row. They exit 2 and give the count by half, never the text. The way past is learn unseal --prereg <file>... --half A --sealed-dir <dir>. It checks that every PREREG file is committed, reads the scorer list’s sha256 from the freeze’s addendum (a line scorer-list sha256: <hex>), writes <dir>/UNSEALED-A and prints LEARN_UNSEALED=A:<sha>. With that token, and LEARN_SEALED_DIR set to the directory that holds the record, the readers take rows of half A, and only A. A second unseal of the same half is refused as spent.

5. Training, calibration and the gate

learn train fits one predictor per seed (three by default: 42, 43, 44) on the split’s train rows and keeps the first seed’s best epoch as the model:

  • Targets. Listwise rows: plan truth spread over the positives, the visitor’s votes mixed in at λ, the row’s weight. Framing pairs: Bradley-Terry on the two wordings’ scores. Plus a cosine term pulling the prediction toward the positive (weight 0.5).
  • Negatives. Each listwise row also gets options from other pages of the same site as extra wrong answers, one for every four of its own, redrawn every epoch, never more than twelve columns in all. Without them the model only ever compares options that sit together on one page.
  • Loop. Batches of 64 contexts; AdamW at 1e-3, weight decay 0.05, cosine decay over at most 60 epochs; dropout on the context side only. Early stop on dev NLL with patience 5. Epoch 0, the untrained floor, is a candidate for best, so the model is never worse than the floor on dev. --epochs 0 trains nothing and writes that floor as a model, with T and the gate fitted on dev as for any other.
  • The anchored head. --head anchor scores an option as the floor plus a shrunk residual, cos/τ + α·r, with r a rank-32 bilinear term that starts at zero, trained at α = 1 under an L2 pull toward zero (week 1’s anchored primary: 20 planned epochs, no cosine term). --alpha inner chooses α, the pull and the epoch count by leave-one-site-out over the split’s inner sites (its inner list, or every training site when it has none), from rows the split stamps train alone, and keeps the floor unless that gains more than 0.005; --alpha <a> holds α and chooses the rest. T and the gate are fitted on the pooled inner out-of-site logits, not on dev; --train-dev trains on the dev rows too. α = 0 is the floor to 1e-6, and the model directory’s config.json carries the chosen α. learn anchor runs the same choice as an experiment, every variant side by side.
  • Control. --control permute-labels relabels every row by a random permutation of its own candidates (a new one per seed), trains as usual, and must land within three binomial standard deviations of chance on dev, with the dev rows’ effective n over their clusters as n: n²/Σm² for clusters of m dev rows, since a cluster’s rows are right or wrong together (the 475 dev rows in 419 clusters, 12 of 5 and 8 of 2, count as about 309: about 5 points at three seeds, about 8 at one). If it does not, something other than the labels carries the answer. The permutation is drawn per cluster: rows are one example when their visitors have one text key (NFKC, lower case, punctuation and digits dropped, whitespace collapsed) or persona vectors within the split’s near-duplicate cosine (0.95), and their options match one to one by that key, a typo’s worth of edits (a swap of two letters is one) or option vectors within 0.95, but for at most one option of each dropped, added or replaced. An option only some rows of a cluster have takes a place of its own; a row without it walks the cluster’s shuffle past it. Every row of a cluster moves the same option to the same place. A train row that slipped into dev reworded, recased, repunctuated, with a typo fixed or one option fewer or more then carries its permuted label across, and the control goes red; on an honest split no dev row can be predicted. Context vectors are not compared: the page’s template makes two visitors on one page near-duplicates there.

Calibration is fitted on dev and nowhere else. The temperature T minimises dev NLL. The gate is the smallest top-1 probability at which the dev rows at or above it are right 90% of the time, with the share of rows it lets through (its coverage). A model whose dev rows never reach 0.9 has no threshold (null), and a null gate never acts. learn calibrate refits both on the same split and prints before and after; --require-calibrated fails a model whose ECE after T is worse than the floor’s. That floor is the cosine with its T fitted on the same dev rows, in-sample, in both commands: the gate compares two things calibrated the same way on the same rows, and neither may move without the other.

Serving reads the gate, never a bare score: at or above the threshold the model acts; below it, the interview asks and the trainer leaves things as they are. A low confidence is a question, never a guess.

A model directory, $L/models/route-<date>/, holds five files, the weights written last:

filewhat is in it
model.bpkthe weights (burnpack)
config.jsonwidth, hidden size, dropout, τ
calibration.jsonT, the gate (precision, threshold, coverage), the split it was fitted on, n
manifest.jsondecision, encoder and width, template, split, rows sha, training sites and their classes, git revision, burn version, backend, seeds, every hyperparameter, the headline metrics as mean ± sd over seeds
metrics.jsonthe floor, every seed’s dev and held-out numbers, the control’s verdict

The first bar was set before any number existed: route at least 10 points above the floor on the held-out-site mean, ECE at most 0.05 after T. That floor was the route/v1 cosine, which the page’s words had diluted, and no trained model met the bar. The bar now is against the person-only cosine, the model that ships, on the same rows. A trained model replaces it only when:

  • it beats the cosine on the held-out-site mean by more than its seed noise;
  • no held-out site is more than 5 points below the cosine;
  • it is at or above the cosine on a set of new sites that no choice was made on, and on the real clients;
  • its ECE is 0.08 or less on both;
  • the gutted twin stays within 5 points of chance and the permutation control at chance.

The gutted twin can be red without a model reading the options’ order: where a page’s answers are uneven, a fixed taste for one Option i lands on the commonest answer by luck, and best_fixed says how far that goes. So a gutted twin over chance + 5 points that is no higher than its best_fixed, with the gate abstaining on more than 95% of the gutted rows, is read as that position luck and does not block a replacement. That is the shipped cosine’s own case on the real clients and on moen-utleie (Results so far). A gutted accuracy above best_fixed, or a gate that acts on gutted rows, blocks it.

A floor that wins is a valid result, and today it is the one that ships.

6. The table

learn bench scores every scorer on every split and writes one table, $L/reports/<date>.md and the same numbers as .json, under a run id (a report another run already wrote for that day is kept, and the new one goes beside it as <date>-<run id>.md; --table is written as asked): b and twelve hex digits of a hash over the code revision, the rows’ sha256, every split file’s sha256, the scorer names and every model file it scored with. Same inputs, same id.

The scorers: uniform (chance, and the floor every Brier and ECE is read against); zero-shot (bge-m3 cosine at its own T, the untrained predictor; T is fitted on the split’s dev rows, else --calibrate-on’s, else the dev.json beside it, taking the first that has dev rows the line does not score, so a reported line is never calibrated on itself; a line that scores all of them, like the dev split’s own line, is at T = 1 and says so in fitted_on); route-v1 (bench trains one per split with learn train’s defaults and one seed, into $L/models/bench/route-v1/<split>-<rows sha8>/, with the decision in front of the split for any decision but route, and reuses a directory trained for the same decision on the same split, rows and recipe; the real-client split has no train rows and is scored with the dev model, which never saw a real client); route-v1-picks-off; model:<dir>; llm:<model>@<seeds>x<orders> (an LLM visitor from the reply cache, its vote share as p, a tie as an abstention); cached:<jsonl> (any scorer’s probabilities from a file, such as Laya below).

acc@1 credits a tie at the top with its share of positives, which is what a random tie-break gets on average. ECE is on top-1 confidence (10 bins under 2,000 rows, 15 above) with a 200-draw bootstrap interval. sel@50 and sel@80 are the accuracy on the most confident half and four fifths of the rows; cov@gate and acc@gate are how many rows the gate lets through and how many of those are right.

The headline, 2026-10-21

This is the last route/v1 bench, kept because it is the only one with the LLM visitors and Laya in it: their caches are keyed by row id, and every route row id changed with the template. The route/v2 numbers, and the model that ships now, are in Results so far.

Run be4afbcf74633 (git ec6060aa378a, rows sha256 3b9e655b…, 4,359 rows, bge-m3), pasted from reports/2026-10-21.md in the sessions repo. The real-client lines are counts only; their numbers stay in the sessions repo. Noise floor (two seeds of the qwen3:8b visitor disagree on the same task): 18.4% of 407 rows.

scorersplitnacc@1chanceNLLBrierECE [95% CI]sel@50sel@80cov@gateacc@gateguttedflipwrong personafull/skim
uniformdev4750.4130.4130.9320.5860.001 [0.000, 0.004]0.5000.4540.0%–ok 0.41/0.41ok bitwiseok 0.41/0.41n/a
uniformloso mean ± sd (8 folds)32880.411 ± 0.1230.411 ± 0.1230.940 ± 0.3410.588 ± 0.1220.001 ± 0.0040.418 ± 0.1150.413 ± 0.1200.0%–8/8 ok8/8 ok8/8 oknot run
uniformloso-vestmark7760.2660.2661.3310.7340.000 [0.000, 0.000]0.2820.2700.0%–ok 0.27/0.27ok bitwiseok 0.27/0.27n/a
uniformloso-liail-il3800.5000.5000.6930.5000.000 [0.000, 0.000]0.5000.5000.0%–ok 0.50/0.50ok bitwiseok 0.50/0.50n/a
uniformgrouped-5fold mean ± sd (5 folds)32880.413 ± 0.0060.413 ± 0.0060.932 ± 0.0170.586 ± 0.0060.001 ± 0.0010.500 ± 0.0000.455 ± 0.0070.0%–5/5 ok5/5 ok5/5 oknot run
zero-shotdev4750.6380.4130.8270.4980.081 [0.062, 0.135]0.7650.7080.8%1.000ok 0.44/0.41ok bitwiseok 0.41/0.41ok 0.66/0.63
zero-shotloso mean ± sd (8 folds)32880.587 ± 0.1980.411 ± 0.1230.865 ± 0.3620.525 ± 0.1610.134 ± 0.0500.632 ± 0.1940.600 ± 0.1930.1%1.000 ± 0.0007/8 ok8/8 ok7/8 ok6/8 ok
zero-shotloso-vestmark7760.4550.2661.1990.6630.083 [0.052, 0.118]0.5230.4850.0%–RED 0.34/0.27ok bitwiseok 0.30/0.27ok 0.48/0.43
zero-shotloso-liail-il3800.6740.5000.6260.4390.114 [0.080, 0.160]0.7160.6640.3%1.000ok 0.50/0.50ok bitwiseok 0.48/0.50ok 0.71/0.64
zero-shotgrouped-5fold mean ± sd (5 folds)32880.620 ± 0.0440.413 ± 0.0060.826 ± 0.0640.499 ± 0.0490.083 ± 0.0110.749 ± 0.0730.684 ± 0.0592.8%0.820 ± 0.1475/5 ok5/5 ok4/5 ok5/5 ok
route-v1dev4750.7960.4130.5290.2960.033 [0.025, 0.072]0.9330.86364.0%0.908ok 0.44/0.41ok bitwiseok 0.38/0.41RED 0.79/0.81
route-v1loso mean ± sd (8 folds)32880.503 ± 0.1470.411 ± 0.1230.905 ± 0.3340.563 ± 0.1290.073 ± 0.0330.551 ± 0.1820.526 ± 0.1629.9%0.820 ± 0.1618/8 ok8/8 ok4/8 ok6/8 ok
route-v1loso-vestmark7760.3430.2661.2820.7090.087 [0.058, 0.120]0.3810.3560.4%0.667ok 0.30/0.27ok bitwiseRED 0.32/0.27RED 0.33/0.37
route-v1loso-liail-il3800.5390.5000.7220.5130.118 [0.070, 0.170]0.6260.59228.2%0.617ok 0.51/0.50ok bitwiseok 0.52/0.50ok 0.55/0.52
route-v1grouped-5fold mean ± sd (5 folds)32880.755 ± 0.0390.413 ± 0.0060.591 ± 0.0630.335 ± 0.0370.047 ± 0.0220.925 ± 0.0330.833 ± 0.03569.8%0.866 ± 0.0433/5 ok5/5 ok5/5 ok0/5 ok
llm:qwen3:8b@3x2dev37 (of 475)0.8780.4201.5980.2090.063 [0.009, 0.135]0.9470.9330.0%–n/aok 15.3%n/an/a
llm:qwen3:8b@3x2loso mean ± sd (5 folds, 3 failed)2620.858 ± 0.0680.416 ± 0.1171.542 ± 1.0970.209 ± 0.1090.047 ± 0.0490.962 ± 0.0440.917 ± 0.0510.0%–not run3/5 oknot run1/1 ok, 4 not run
llm:qwen3:8b@3x2loso-vestmark50 (of 776)0.8030.2671.9520.2730.010 [0.017, 0.120]1.0000.8750.0%–n/aRED 33.3%n/an/a
llm:qwen3:8b@3x2loso-liail-il80 (of 380)0.8310.5000.8920.1940.027 [0.000, 0.062]0.9750.9140.0%–n/aRED 29.2%n/an/a
llm:qwen3:8b@3x2grouped-5fold mean ± sd (5 folds)2620.841 ± 0.0450.380 ± 0.0611.415 ± 0.7270.232 ± 0.0370.067 ± 0.0190.945 ± 0.0350.904 ± 0.0380.0%–not run2/5 oknot runnot run
llm:granite4.1:8bdev6 (of 475)0.8330.4084.6050.3330.167 [0.000, 0.500]0.6670.8000.0%–n/an/an/an/a
llm:granite4.1:8bloso mean ± sd (5 folds, 3 failed)380.957 ± 0.0640.415 ± 0.1161.184 ± 1.7650.086 ± 0.1280.043 ± 0.0640.921 ± 0.1140.950 ± 0.0750.0%–not runnot runnot runnot run
llm:granite4.1:8bloso-vestmark7 (of 776)0.8570.2863.9470.2860.143 [0.000, 0.429]0.7500.8330.0%–n/an/an/an/a
llm:granite4.1:8bloso-liail-il14 (of 380)0.9290.5001.9740.1430.071 [0.000, 0.286]0.8570.9170.0%–n/an/an/an/a
llm:granite4.1:8bgrouped-5fold mean ± sd (5 folds)380.960 ± 0.0560.384 ± 0.0481.116 ± 1.5410.081 ± 0.1120.040 ± 0.0560.960 ± 0.0890.953 ± 0.0650.0%–not runnot runnot runnot run
cached:laya.jsonldev4750.5470.4130.9090.5480.092 [0.059, 0.133]0.6640.6240.0%–n/aRED 32.8%n/aRED 0.54/0.56
cached:laya.jsonlloso mean ± sd (8 folds)32880.555 ± 0.1240.411 ± 0.1230.951 ± 0.3390.560 ± 0.1280.125 ± 0.0590.653 ± 0.1290.579 ± 0.1310.0%–not run2/8 oknot run3/8 ok
cached:laya.jsonlloso-vestmark7760.3310.2661.3210.7240.069 [0.044, 0.097]0.4510.3490.0%–n/aRED 58.6%n/aRED 0.28/0.39
cached:laya.jsonlloso-liail-il3800.5890.5000.7040.5020.127 [0.095, 0.182]0.6630.6020.0%–n/aRED 28.7%n/aok 0.61/0.58
cached:laya.jsonlgrouped-5fold mean ± sd (5 folds)32880.525 ± 0.0200.413 ± 0.0061.005 ± 0.1100.587 ± 0.0380.111 ± 0.0250.635 ± 0.0200.589 ± 0.0180.0%–not run0/5 oknot run1/5 ok

Real clients (real-clients, every row eval-real): 688 rows scored by uniform, zero-shot, route-v1 and Laya, 688 by qwen3:8b@3x2, 106 by granite4.1:8b. The real-client sanity check (accuracy there may not beat the held-out-site mean by more than the noise floor, or something real leaked into training) passes for every scorer.

How to read it:

  • On sites it has never seen, the trained model loses to its own floor: 0.503 against 0.587 over eight folds. That floor is the route/v1 cosine, which the page’s words diluted; the visitor’s words alone score 0.705 on the same folds, 20 points above route-v1. On new people at known sites route-v1 wins clearly (0.755 against 0.620 over five folds; 0.796 against 0.638 on dev): it learns who goes where on the sites it knows, not how a visitor’s words meet a door’s. Going from 8 to 24 sites shrank the loss but did not close it (Results so far).
  • Calibration holds where it was fitted. After T, ECE is 0.033 on dev and the gate lets 64% of dev rows through at 0.908 accuracy. A threshold fitted on known sites does not transfer: on held-out sites the gate lets through 9.9% at 0.820.
  • The 8B visitor is far ahead where it has been asked: 0.858 on the rows it answered in five of the eight held-out folds, against chance 0.416. Those are 262 rows sampled from the folds, not the predictor’s 3,288, so read the two as different samples. It changes its answer when the options are listed the other way round on 5% to 33% of rows, more than its own seed noise on five of the eleven fictional splits. The predictor’s flip is bitwise zero.
  • Laya (a general decision model, convaiinnovations/laya, Apache-2.0, run zero-shot by learn/scripts/laya.py on its ONNX exports, the English rows on its 421M checkpoint and the Norwegian on its 322M multilingual one, two orders, its own temperatures) does not beat cosine on bge-m3 here (0.555 against 0.587 held-out), and it is order-sensitive: listed the other way round, it changes its answer on 32% of the held-out sites’ rows (17.5% to 58.6% by site), above the noise floor on all but two. Its 192-token head keeps only the first 14-48 tokens of each card, which is why full cards do not help it. On this machine it took about 75 minutes for 7,952 sequences.
  • Controls. The gutted twin (every option replaced by Option i) falls to chance for the predictor on every held-out site; the label permutation lands 0.2 points from chance (0.415 against 0.413 on 475 dev rows). The wrong-persona control (each visitor swapped for another on the same page with different right answers) is red for route-v1 on four of eight held-out sites: there the model routes by what the page usually gets, not by who is asking. The rendering control (whole card beats heading alone, on rows asked both ways) is red for route-v1 on every 5-fold split: the card the visitors route better with is, to the model, mostly noise around the heading.

The bounds, each a red flag in the report when broken (consts in learn/src/bench/controls.rs): gutted twin accuracy at most chance + 5 points and the gate abstaining on more than 95% of rows (beside it, best_fixed: what always picking a page’s commonest answer position gets); order flip every probability within 1e-6, or for an LLM a flip rate at most its seed noise floor; wrong persona at most chance + 5 points; full above skim from 40 pairs; real-client sanity as above; label permutation within three binomial sd of chance, n the dev rows’ effective n over their clusters.

7. The data factory

The local models make data and are measured; they do not decide what is good. One Ollama slot, everything serial, each chat model loaded once a night, every call one line in the night’s calls.jsonl ({ts, job, model, site, seed, prompt_sha, reply_sha, duration_ms, ok, parse_ok, out}), and every job resumes by (job, site, seed, prompt_sha): a killed night sends only what is missing. The visitor’s answers go to bratac answer eight tasks to a call, each appended as it comes back, so a failed call or a stopped night loses at most eight. A site that fails (a tone build, iris) is reported, its calls are in the ledger, the next site still runs, and the job exits 1.

Why it speeds training up: a persona written for a need is labelled for free. Once it is in a site’s needs.yaml, portal iris --needs-tasks writes every page on that need’s path with the options the plan says are right, with no model call. Every framing of an option swapped into the page is another free context. The paid calls are the visitor’s soft votes and the baselines.

NUM_CTX is set per job: 4096 for the 8B visitors and persona writers, 8192 for the word writers. qwen3:8b at the engine’s default 32k context is almost four times slower (1.01 s against 0.27 s a short call). No chat model leaves bge-m3 room beside it on the 8 GB card, so bge-m3 runs in its own block with the chat model unloaded.

Night 1 measured every model (learn factory bench --out <night>: thirty identical short JSON prompts per model at its job’s NUM_CTX, thirty batches of a hundred texts to bge-m3), and night 1’s blocks measured the real jobs:

modeljobshort promptthe job, per call
qwen3:8b @4096persona writer (two a call); visitor (bratac answer, three seeds); LLM baseline0.27 spersonas 2.9 s; picks 1.0 s a task; baseline 0.44 s
qwen3:8b @32768(the engine’s default; not used)1.01 s
granite4.1:8b @4096second persona family; jury on dev and eval-real0.25 spersonas 3.8 s; jury 0.6 s
ornith:9b @4096third persona family0.33 spersonas 4.3 s
nemotron-3.5-lightning:30b-a3b @8192framing writer: bratac build with four tones0.52 s48 calls for 12 pages × 4 tones
qwen3-coder:30b @8192second framing writer0.53 s
qwen3.6:27b @8192strong visitor baseline, weekends4.78 sabout 9-10 s warm at 4096
mistral-medium-3.5:128b @8192out of the loop; a few spot checks a week19.6 s
bge-m3encoder; persona dedupe1.44 s per 100 texts

The jobs, learn factory <job> --out <night>:

  • personas: eight personas per need (--per-need), two per call, each on a grid of role × register × detail × what they describe, rotated from the seed, from the business and the plan’s own who, wants and about, never from the site’s words or a need’s facts. Half describe the problem (the situation and its symptoms, not what to buy), a third the outcome they want, a sixth the service by name. Night 1 accepted 964 and rejected 181 (66 named the business, 93 shared a 4-gram with the site’s words, 14 were too long, 7 did not parse, 1 duplicate). --writers a,b,c gives each need one writer: a site’s needs in the order of sha256(site|need), dealt in turn, so each writer’s share is within one (nemotron is short for nemotron-3.5-lightning:30b-a3b). The sidecar factory.json records each persona’s writer and what it describes.
  • picks: the plan-truth rows of every site and every persona (free), then the visitor with three seeds; --disagreement-only spends the seeds where earlier answers already disagree.
  • framings: four fixed tones through the writer, the words held to the site’s own by learn words check, split into one partial per tone by learn words split, and the site rebuilt once per tone without a model. Then picks on each rebuilt site with one seed: a framing’s label is the rate across personas, not across seeds.
  • words: one writer and one tone (--tone plain) for the sites of a week, from their plans (--plans <dir> --sites <id,id>). It builds the fallback rendering (the plan’s own wants and who), then bratac build --llm with the writer at NUM_CTX 8192, and holds every page’s reply to learn words check against the fallback’s words. Three findings only warn here, because the build renders neither and the job tidies the third: an icon off the list (blanked), a slot the page does not have beside a reply that keeps every slot it has (dropped), and an emptied road, who or form line (given the base’s line back). In the Monday probe these were all of qwen3-coder’s failures, on both sites. A page that fails is asked once more with the findings in its prompt (--llm-note); a second failure leaves the site without that rendering, and the summary says which page and why. The prompt shows a page’s slots, not its words, so a rule-1 note lists every option’s heading as it stands and names the two that read alike. Rule 1 is a mode: --rule1 off calls no encoder (the sealed night), record embeds the headings once and writes the pairs to words-lint.json, and reask runs in batched rounds: words for every site first, one bge-m3 block over the headings of every option set, then one re-ask per flagged set naming the two headings, two rounds at most (--rule1-rounds). What is left goes to words-lint.json. Every rendering is built twice, with the plan’s facts and with --facts off, into <words>-facts and <words>-bare, and the two may differ only in the cards’ features. Each site’s factory.json records the writer, the tone, which of the pair it is, and every rewrite.
  • jury: granite4.1:8b on the dev and real-client rows, for agreement with qwen3:8b, never as a judge.
  • baselines: the LLM visitors asked the trainer’s own question (answer_blind, the trainer’s shuffle) on held-out and real-client rows, into $L/cache/llm/<model>/, for the llm: scorers.
  • bench: night 1, above. interviews is named and not built yet.

The guards: a persona is 12 to 90 words, shares no 4-gram with the site’s headings, descriptions and questions, reads as the site’s language, is not closer to other doors than to its need’s (the margin guard, lint rule 2b below), and has bge-m3 cosine at most 0.92 to every persona the site already has; each rejection is counted by reason (margin for the margin guard). A persona the margin guard rejects is regenerated: its need gets one more call per two rejected, at most as many again as its own, with the next seeds, until no new rejection asks for more. The guard’s doors are the ones the night’s rows will carry: portal iris --needs-tasks --skim on a copy of the site under <night>/personas/<site>/doors/, with one probe persona (lint-probe-<need>) per need, the headings as a skim row has them and the cards as a full row has them. A need iris gives no doors for is counted unchecked, and its personas go on to the dedupe unscored. --margin-guard mark keeps a persona below the bar and records its margin and margin_flag; --margin-guard off never scores. --dedupe text drops a persona whose words, lowercased, equal another’s, or whose 5-grams overlap another’s on the same site above 0.6, instead of the bge-m3 cosine. With --margin-guard off --dedupe text the job never calls the encoder, which is how the sealed night runs it. learn words check holds a words file to the base before any build (no key the base lacks, no <WRITE left, icons from the list, equal storylines, no emptied description), so the contractor run’s reply that put the needs under doors and silently lost them would now be an error. The Norwegian twins (plans/contractor-nb.yaml, hire-nb.yaml, physio-nb.yaml) were written once by hand, so there is Norwegian beyond the football club.

The lints

Two rules from the 2026-10-22 comparison, both read off the person-only bge-m3 cosine. A row’s margin is cos(persona, its right door) − the largest cos(persona, another door on the page); margin < 0 is exactly the cosine floor’s error.

  • Rule 1, look-alike doors. Two doors on one page that lead to different needs, compared by their headings (never the whole card, whose cosines run about 0.17 higher and separate nothing): cosine 0.75 or more is a defect, rewrite one of the two; 0.70 to 0.75 is a warning. All four fictional heading pairs at 0.75 or above with five or more visitors a side were inseparable to the cosine (nordvik-bygg’s “Apply to work with us” against “Find a job with us”, 0.878).
  • Rule 2a, a door defect. On one page and rendering, with six or more personas reaching the door: 80% or more of their rows have margin < 0, and the mean margin is −0.06 or lower. The door’s words are the defect. It catches both nordvik-bygg survey doors that carried “Log a phone enquiry”; it does not catch a door whose own visitors still prefer it, which is what learn extract’s misworded guard is for.
  • Rule 2b, a persona defect. A persona whose mean margin over its rows is below −0.04. Against 290 hand-audited personas it flags 54, 76% of them judged the wrong need and 91% wrong or ambiguous. In learn factory personas it is the margin guard above.

learn lint --rows <rows.jsonl> --emb <emb dir> [--site <id>]... [--min-visitors <n>] runs the three over a rows file’s route rows with the plan’s truth: one JSON line per finding (rule, level, site, page, the doors or the persona, the numbers), then a summary line with what each rule checked and flagged by site class; it exits 1 when any finding is a defect. --min-visitors 5 keeps rule 1 to pairs whose separability the comparison could measure. On the comparison’s own rows it gives its counts: rule 1, 4 fictional pairs at 0.75 or above (7 when the visitors are not counted); rule 2a, 12 of 99 doors on the eight original sites and 3 of 142 on the 16 new ones; rule 2b, 54 of the 290 audited personas and 19 of the 492 on the new sites. On a real client’s site nothing is a defect: a finding is a warning for the owner (rule 2b flags 1 of the 35 human-written visitors, rule 2a no door).

Factory time only. Run rules 1 and 2a over a night’s rows (or a new site’s) before the night is trusted, and rule 2b runs inside learn factory personas. Never filter held-out, new-site or real-client rows by them: the margin is the floor itself, so dropping the rows it calls wrong inflates the floor by construction. Nothing marks rows already extracted: learn lint only prints its findings, and no row field, split, train or bench option reads them. To train without the flagged rows, take them out by hand from the rows learn split stamped train, never from the rows file before the split (that drops them from the held-out, new-site and real-client folds as well) and never from a dev, held-out or eval row; then report the scores of the model trained with them and of the one trained without.

What the factory makes next

The 2026-10-22 comparison says what data would let a learner show something, in this order:

  1. More businesses, not more personas per business. Going from 8 to 24 sites shrank route-v1’s held-out gap from −0.148 to −0.064, and the same 452 new rows spread over 16 sites instead of 4 gained 0.027. The target is about 48 sites, with 24 or more new kinds of business unlike the existing ones, about half of them Norwegian, about 100 plan rows each, and no twins: a twin costs a fold and adds no independent training.
  2. Harder pages. The 16 new sites average 3.0 doors a page, and 52% of their pages have two; the real clients’ pages average 4.0, and 20% have two. Pages with 4 to 6 doors whose needs sit next to each other (supplier against customer, a follow-up on a case against a new request) are where the cosine loses and a learner could win.
  3. A sealed test set. About 16 more sites under the same lints, never trained on and never looked at, kept as the next round’s new-sites test. The current 16 are training sites now: the shipped model’s T and gate have seen their dev rows.
  4. The lints at generation. Rules 1 and 2a over each new site before its night is trusted, rule 2b inside learn factory personas, and the extractor’s misworded guard kept for sites built before the lift_words fix.
  5. Later. qwen3:8b picks with three seeds on the new sites, so soft labels cover more than 8% of training rows if a residual is tried again. Outside the factory, more visitors written by people (owners’ interviews) would sharpen the real-client test more than any amount of synthetic data: it rests on 35 visitors.

Plans for new businesses

learn factory plans writes the plans of new fictional businesses, so the factory can grow past the sites people wrote:

learn factory plans --kinds $L/w2/training-kinds.yaml --assign $L/w2/training-assign.yaml \
  --select model --model <writer> --out <night> [--budget-seconds n] [--rule1 on|off] \
  [--plan-kind on|record|off] [--kind-catalogue <sectors.yaml>]
learn factory plans --validate-only <dir>/plan.yaml [--rule1 on|off] \
  [--plan-kind on|record|off --kind-catalogue <sectors.yaml> [--kind <id>]]

For each kind the assign file gives to --select, the model makes three kinds of call. First a name, built on a made-up place. Then the plan. Then, once per option set, the facts on its needs. The prompts are learn/prompts/plan.txt.

The plan comes back as two places, the front door and one door. Each place is two adjacent pairs, and each pair holds its two needs whole. The job puts them together in the schema of plans/*.yaml: four needs and the door on the front door, four behind the door. Each need gets its own bucket. Writers given the schema itself miscounted the needs per set, put one need of a pair on the other side of the door, and sent the same plan back when told.

What a plan must hold:

  • 6 to 8 needs;
  • at least two option sets with 4 to 6 options each;
  • on each such set, at least two adjacent pairs from a fixed list:
    • a new request against a follow-up;
    • a customer against a supplier, partner or job seeker;
    • urgent against routine;
    • private against business;
    • buying against renting;
    • a complaint against a question.

The pairs go to sitegen.json beside the plan, with the writer, the prompt’s sha and the number of tries. They never go into the plan.

The validator calls no chat model:

  • bratac build --plan makes the site with fallback words, so the builder’s own checks apply;
  • options are counted per page of the built site, as choose::is_option counts them;
  • each pair must name two needs on its set;
  • with --rule1 on, no two option headings on one set may have a bge-m3 cosine of 0.75 or more (rule 1 above). Training sites use it. The sealed night does not compute it.

Facts are asked per set. The writer sees the need, its siblings on the set and the set’s pairs, and is asked what a visitor choosing between them needs to know. Each public need gets 2 to 4 facts, in the site’s language. A fact may not give an order, ask a question or name a button (the same test as the lint’s feature-acts, copied verbatim into learn). It may not praise, and it gives a price only as a range or a starting price. No fact is on two needs.

On 2026-10-22 the probe on four training kinds chose the writer. nemotron wrote 4 valid plans of 4, at a median of 2.7 minutes a plan, about 1.4 of them for the facts. qwen3.6:27b took 8 to 11 minutes for one plan call on this box, and finished 1 plan of 4 in 40 minutes.

A failure goes back to the writer in words, at most three times for the plan and three times for its facts. A plan that never passes is recorded as invalid and dropped. Nobody fixes it by hand. Every call is in the night’s ledger, and a rerun replays the replies it has.

Is the plan about its kind? The checks above see shape, look-alike headings and the form of each fact. They do not see a plan that has left its kind. On 2026-10-23 nemotron, asked for redoal’s plan, had its first draft refused by rule 1; the retry copied the prompt’s own examples (a cold radiator, a monthly delivery, a noise complaint) and passed every check. Week 2’s lever is how many kinds of business the training sites cover, so a plan about something else is a silent loss.

--plan-kind on (the default) ranks the plan’s text against every kind in the catalogue: --kind-catalogue, else the sectors.yaml the kinds file names (90 kinds in week 2).

  • A kind’s text is its description and its setting in the plan’s language.
  • The plan is judged by what it offers. Its text is its pieces: each need’s who with its wants, and each fact’s title with its text. bge-m3 embeds each piece, and the plan’s vector is the mean of their unit vectors, so every need and every fact has one vote. The business name and about are left out, because they say only what the plan claims to be. Read as one text, the redoal plan ranked redoal first on its about alone. With the name and about as one more piece, a draft with eight generic needs (“a new customer: to ask what it costs”) and a plumber’s name ranked plumber first of 90.
  • The plan passes when its own kind is among the 3 kinds nearest that vector, by cosine. A rank needs no tuned threshold. Three, not one, because the catalogue has close siblings: the pharmacy plan ranks just behind the psychologist.
  • A draft that passes every other check is ranked before its facts are asked. If it drifted, the writer is asked once more, told its kind and that the draft drifted: one plan call over the three retries, at most once a plan. A draft that drifts again is dropped. So is a plan whose facts carry it out of the first three.
  • The re-ask names the plan’s own kind and no other. The catalogue holds the sealed pool, and no sealed kind may reach a training prompt. For the same reason the nearest kinds are not written to any file. Only --validate-only prints them, for whoever runs it.
  • kind_rank (the final plan’s, facts in), kind_rank_draft and kind_reasks go to sitegen.json and result.json. record ranks and records but fails nothing. off makes no encoder call; the sealed night runs off, because no encoder touches the sealed set.

Measured on 2026-10-23 with --validate-only (rule 1 off), needs and facts only:

plansown kind’s rank
the 16 in w2/plans (4 probe, 12 written by Claude, all on topic)1 of 90 for 15, 2 for the pharmacy (behind psychologist)
the same 16 as drafts, facts removed1 for 14, 2 for student welfare, 3 for upper secondary
R8’s nemotron redoal plan, redoal added as a 91st kind49 of 91 with its facts, 45 without (23 and 7 when the name and about counted)
R8’s qwen3:8b redoal plan (on topic, invalid by rule 1)1 of 91
20 swaps, plan X checked as kind Y18 fail (ranks 4 to 89)
38 plans named for another kind, with their own needs, generic needs, or the other kind’s aboutall fail (ranks 5 to 85)

The swaps that pass are near siblings: the campsite plan as cabin rental (2) and the haulage plan as a courier (3). Of all 1,424 swaps of the 16 plans, 32 would pass, at most two a plan, 12 of them in the same family. The check catches a plan that left its kind, not one that drifted to a sibling. The nearest miss among the named plans is eight generic needs under a plumber’s name: plumber ranks 5th, on needs such as booking a time and getting help today.

8. How portal calls learn

Four things call the ranker. Three run offline or in the interview. The fourth, the search box, is the one call in a visitor’s request, and only when the visitor asks it something.

As a visitor. engines/learn.sh is an engine like engines/ollama.sh: an answer_blind prompt on stdin, {"choice", "confidence"} on stdout, the calibrated top pick. learn visitor reads the prompt back into exactly the row the model was trained on (pinned by a golden test, learn/fixtures/expected/rank/visitor-parse.json); a prompt of another shape exits 1. So bratac answer, score, spread.sh and iris --needs-score run on the model with nothing changed on portal’s side, and learn answer is the same for a whole tasks file in one process. On the contractor plan, from nothing:

bratac build --plan plans/contractor.yaml --out out/nordvik
portal iris --path out/nordvik/questions --needs-tasks out/tasks.jsonl --needs-sim out/model.json
bratac answer --tasks out/tasks.jsonl --repo out/nordvik --llm engines/learn.sh > out/answers.jsonl
learn answer --tasks out/tasks.jsonl --repo out/nordvik --model learn/models/route.bpk > out/answers-learn.jsonl
portal iris --path out/nordvik/questions --needs-score out/answers.jsonl
learn visitor --parse < learn/fixtures/baselines/prompts/full-seed0-line1.prompt

That site is built without a word model (the fallback headings are the needs’ own wants), its eight tasks are answered in a tenth of a second with no LLM call, and with the route-v1 model shipped until 2026-10-22 iris said 7 of 8 routed right, the scaffolder sent to the job application, five of the seven right ones hesitant. The contractor is one of the sites the shipped model trained on, so this shows the plumbing, not a held-out result. learn answer and the engine path give the same picks, with confidences within 1e-6 of each other.

Choosing framings. bratac choose ranks candidate wordings of one option offline by routing gain: for each candidate, the page with that option swapped in, ranked for every persona whose simulated route crosses the page, in one learn rank batch; its score is the mean probability of the right option over the need’s own personas minus the mean over everyone else’s, and its gain is that score minus the live card’s. Candidates are checked first (slots, language, and every address, link, phone number and amount must be in the plan), and one the gate acted on for fewer than half its own personas is gated and never picked on its own. Winners become storylines appended behind the live one (Storylines):

bratac choose --plan plans/contractor.yaml --model model.json --repo <site dir> \
  --candidates framings.json --learn engines/learn.sh --out choose

It writes choices.jsonl, readback.md, winners.json (a --words partial), framings.json and tones.yaml (lines to paste under the plan’s tones:) under --out; --pick id,… overrides the automatic choice, and --validate <rows.jsonl> applies the same formula to the route rows’ wordings.

The interview’s gap read. bratac interview --rank learn (or --rank '<command>' that answers as learn rank does) asks the gap model every turn which open gap the conversation points at, in shadow: transcript.jsonl gains learn: {pick, confidence, would_skip, act} beside gaps_before, gaps and addressed, and the questions asked do not change. --gate lets a read that acts delay the readback when it still finds a gap the checker no longer does; it can never end an interview the checker has not passed, nor fail one it has: a hold that runs into the turn cap finishes the last draft it adopted when the checker still passes it (a refused draft is no verdict, nor is one refused as a repeat question; an adopted one that reopens a gap is, and the run stops). It stays off until the gap model’s held-out precision at its gate reaches 0.9. There is no gap model yet, so today every turn’s learn is {"error": …}; the rows for one accumulate with every interview.

The rows for it. bratac gaps --out gaps.jsonl <transcript.jsonl>... writes one line per turn that had a gap open: {source, business, language, context, candidates, positives, replayed}, where the context and candidates are what the gap read is asked on that turn and the positives are the gaps the turn closed. An interview writes the first half into its transcript as gap since 2026-11-26. A transcript from before is played again from what it holds, and a turn that does not come out the same (the draft before it does not give the gaps it logged) is counted and left out. The 11 transcripts there were on that day gave 26 rows over 41 turns, none left out. These are not yet learn’s rows: learn extract does not read them.

The search box. Where site.yaml asks for one (Content reference), a visitor can write what they need and be shown which option on the page is theirs. search_alternatives takes their words as a route/v2 context, as the model’s rows were made (NFC, addresses scrubbed, trimmed, at most 500 characters), and the options that page shows that visitor: the cards they can act on, as bratac choose and the model’s rows read a page (an overview card that repeats every option’s heading won the first live test on the contractor site, so it is left out), each rendered as bratac choose renders a candidate. It runs learn rank --ephemeral on the host, through Ollama, at most four at once and two at a time per caller (one address can be a whole office), waiting up to a second for a place. A search has three seconds from its start, that wait included. Where a learn serve serves the site over dhd/1, it is asked first: the same request and the same reply, with no process started, and a spawn only when none answers in half the three seconds, with what is left (Operations). The gate decides what the visitor is told: at or above it (0.856 for the shipped model, 90% precision on dev) the option is marked as theirs and the page moves to it; below it the nearest is marked as nearest, with a button that brings it into view, and the choice is left to them. Nothing is reordered or hidden.

The words are embedded in memory for that one call and never written to the embedding cache (--ephemeral, §9). Portal never logs them (the log says how a rank went, never what was asked, and never learn’s error text, which could repeat its input), never puts them in a URL (the form has no field name and the call is a POST) and never logs them: the one count, a line in the site’s log, carries the page, the top card’s framing id, the confidence, the gate, the storyline and which way learn answered (via: dhd or process), for counting which options people search their way to. A test captures every log line at every level across every way a rank can end and finds none of the words.

Whether the box shows is the instance’s, as a map is: a probe at start, every ten minutes, and within seconds of a reload that adds or changes the search block, ranks a fixed sentence with learn rank --ephemeral, and the box shows only while the last probe got a reply (search_ready in get_site). The sentence is never cached, so each probe reaches Ollama, which keeps bge-m3 resident (learn asks for 30 minutes on every call) and a visitor’s search off the 3.7 s cold path. When learn does not answer in time, cannot reach its encoder, fails, or no place comes free within a second (four searches, or two of this caller’s, already waiting), the visitor reads that search is not available right now and picks from the options as before. A search that finds learn itself gone (exit 3, or no answer in time) also takes the box away from the next page on and has the probe run at once, at most every 30 seconds, and every 30 seconds after that until learn replies; the box is back with that reply.

bratac search --repo <content dir> --page <id> [--storyline <n>] --texts <texts.jsonl> [--out <out.jsonl>] runs that path offline, before a site’s box meets a visitor: the cards a visitor with no account, link or chain is shown, the same candidates in the same order with the same ids (a test holds it to the server’s path on the contractor site), the words read as the server reads them, and one learn rank --ephemeral per text (--learn <cmd> for another, which must keep --ephemeral); each line says which way it was answered (via: process). Each line of --texts is {id, text}, with label_need or label_framing when the right option is known. Per text it prints the cards’ framing ids, the top, its p, the gate, the margin and where the label came; with labels, n, top-1, the act rate, the precision of the searches that acted and of those that only showed the closest, and the heading pairs between doors to different needs at cosine 0.70 and 0.75 (rule 1 of the lints, the headings embedded by learn embed into a cache of their own, removed after). A text is never logged, quoted in an error or written to --out, whose lines carry its id; for a real site, --out goes in the sessions repo.

Other things the trainer now keeps for learning: bratac answer --trace <file> writes {id, seed, order, prompt_sha, rendering} per task, the order the options were shown in; bratac rate --jsonl <file> writes each persona’s verdicts; bratac prefer --jsonl <file> writes every judge call, both orders, the raw reply and what it was decoded to (1, 2 or "unparsed").

Which binary, which model. Portal runs $LEARN_BIN, else learn beside its own binary, else learn on PATH, with a 10-second timeout (3 seconds for a search). learn takes the model from the request’s model (a path, or a name under models/ beside the binary), else --model, else $LEARN_MODEL, else models/<decision>.bpk beside itself. Exit 3 means the encoder could not be reached for a text the cache lacks, and portal reads it as no decision. A cold learn rank (model load, first encoder call) took 3.7 s, warm with new texts 0.2 s, fully cached 10 ms; a batch of 87 tasks in one process 88 ms against 1.3 s through the engine one prompt at a time. learn serve keeps the model loaded: without the encoder’s time, a warm request took 0.9 ms at the median against 7.2 ms for a spawned learn rank --ephemeral; through a real bge-m3 both took about 84 ms, nearly all of it the encoder’s.

What is never inferred about a visitor

A rule, not a setting:

  • Serving never calls the ranker to choose for a person. A visitor’s storyline stays uuid % arity, assigned evenly; nothing picks words for a person. The search box ranks only when a visitor asks it, only the options already in front of them, and only says which one fits; it reorders, hides and rewords nothing.
  • No visitor feature exists anywhere. A site records what was sent in and the storyline it was told in; /report leaves the site as counts, and the search log line (portal::search) counts which option came top, with nothing of what was asked.
  • What a visitor types into a form is never embedded, scored or trained on. What they type into the search box is embedded and scored once, in memory, to answer them, and is never cached, logged, stored, published or trained on. The route model reads plan personas, synthetic personas, and an owner’s own interview answers, which the owner gives by running the interview.
  • A real client’s rows are evaluation only for any model that ships, and the published numbers about them are counts.
  • Below the gate, nothing happens: the interview asks, the trainer leaves the words as they are, and the search box claims nothing for the visitor; it says which option is nearest and that the choice is theirs.

9. The JSON contract

learn rank reads one request and writes one reply:

{"decision":"route","context":{"text":"…"},"candidates":[{"id":"f1","text":"a"},{"id":"f2","text":"b"}],"model":"route"}
→ {"model":"route-2026-10-23-7f1c","encoder":"bge-m3","decision":"route","scores":[{"id":"f1","p":0.71,"cos":0.52},{"id":"f2","p":0.29,"cos":0.41}],"top":"f1","confidence":0.71,"margin":0.42,"gate":{"threshold":0.62,"act":true},"ms":{"embed":46,"score":2}}

or {"batch":[…]} for several, one reply each in order. p is calibrated, cos the cosine to the prediction, confidence the top p, margin the top minus the second; gate.act is true at or above the threshold and never when it is null. Scores come back in the request’s order. Both sides refuse a key they do not know. Exit 0 with a reply; 2 for a malformed request (not JSON, an unknown key, fewer than two candidates, a duplicate id, a decision the model was not trained for); 3 when the encoder cannot be reached; 1 for anything else. Every failure also prints {"error": "…"} on stdout.

printf '%s' '{"decision":"route","context":{"text":"I chair the board of a housing cooperative. Two ground-floor flats have damp in the walls."},"candidates":[{"id":"a","text":"- Someone qualified to come and look at it and say what it takes\n"},{"id":"b","text":"- Drawings, a permit application and a price\n"},{"id":"c","text":"- To be considered, without writing a letter\n"}]}' \
  | learn rank --model learn/models/route.bpk

The shipped model gives the survey 0.51 and the drawings 0.41, under its gate at 0.86, so it does not act, and below the gate nothing happens. The same request with v1’s "What we do\n\nVisitor: …" context exits 2, because the model was trained on route/v2 text. The texts are looked up in the embedding cache first ($LEARN_CACHE, else $L/emb; in memory for the one call if the directory cannot be written) and only the misses go to bge-m3. The cache is content-addressed: the key is the sha256 of encoder, width, normalisation and the NFC-trimmed text, so the same text in two rows or two nights is one vector, and a vector from another encoder can never be read as this one’s.

learn rank --ephemeral is for a context that must not be kept, a visitor’s own words in portal’s search box (§8). Each context is NFC-trimmed and embedded by the encoder in memory for that one call: it is never looked up in the cache and never written to it, and an error whose message would quote it (a vector refused with an excerpt of its text, a text too long to embed) is printed as “a context could not be embedded” with the reason withheld. The candidates are cached as without the flag, and the reply is the same, score for score. Because the context always goes to the encoder, an ephemeral rank needs Ollama even when every candidate is cached, and exits 3 without it.

learn serve --dhd (built with --features serve, as the release is) serves a site’s ranking over dhd/1: each question the site asks down its call is a request whose body is what learn rank --ephemeral reads on stdin, and the reply’s body what it prints on stdout. Every context is ephemeral there, always. Exit 2 is the service error 400, exit 3 is 503 and anything else 500, each with the {"error"} line as the body; a request turned away because the worker is stopping is 421 (Operations).

The other commands and their flags are in learn help; learn <command> --help prints one usage line.

10. Retraining the route model

From the runs and the factory nights to a model in this repo. The model that ships is the floor, so train runs with --epochs 0; drop the flag to train one, and ship it only if it meets the bar in §5:

export LEARN_EXTRA_SITES=$L/exp/sites/extra-sites.tsv
learn extract --runs ~/repos/sessions/runs --out $L/rows \
    --factory $L/factory/2026-10-21 --factory $L/exp/sites/night/2026-10-21
learn embed --rows $L/rows/rows.jsonl --out $L/emb
learn split --rows $L/rows/rows.jsonl --emb $L/emb --out $L/splits
learn train --rows $L/rows/rows.jsonl --split $L/splits/dev.json --emb $L/emb --epochs 0 --out $L/models/route-2026-10-22
learn calibrate --model $L/models/route-2026-10-22 --rows $L/rows/rows.jsonl --split $L/splits/dev.json --emb $L/emb
learn bench --rows $L/rows/rows.jsonl --splits $L/splits --emb $L/emb \
    --scorers uniform,zero-shot,model:$L/models/route-2026-10-22 --table $L/reports/2026-10-22.md
LEARN_BIN=$(command -v learn) learn/scripts/ship-model.sh $L/models/route-2026-10-22
cargo test --manifest-path learn/Cargo.toml --test ship_model

LEARN_EXTRA_SITES names fictional sites outside the built-in table (<id> <language> <plan path> a line); the 16 sites of 2026-10-22 are listed in that file, and extract and split must both see it. On 2026-10-22 these steps, run under $L/v2/, gave 5,891 rows (sha256 63694d0d…), 31 split files, every text already in the cache (0 encoder calls), and the model of Results so far: T 0.979, gate 0.856 at precision 0.9. With --epochs 0 the three seeds are the same untrained model and take a second. The bench’s model: line is refused on every fold, because dev.json’s model has seen every fictional row; the zero-shot line at each fold’s own dev T is that model held out.

One --factory per night directory; the extractor takes the latest night’s directory per site or framing variant. embed sends only the texts the cache lacks (Ollama must be up for those; it exits 3 if it is not), and a second run embeds nothing. split never calls an encoder. train checks that the split was cut from these exact rows before it reads anything, prints one JSON line per epoch on stderr and the metrics on stdout; three seeds on 2,880 training rows take about a minute and a half on the CPU. bench trains its own route-v1 per split (fifteen models with the permutation control, one seed each) unless a directory for the same split, rows and recipe is already there; from nothing it took 4m38s.

Each step is reproducible. On 2026-10-21, at 488439b, the route/v1 steps (no --epochs 0, one --factory, and route-v1 and the LLM visitors in the bench) gave the same rows sha256 as the report, split files identical byte for byte, a model whose weights and calibration (T 1.4959, gate 0.750 at coverage 0.64) are those of the learn/models/route.bpk shipped until 2026-10-22 (only the parameter ids in the file’s header differ), and, with the report’s scorers (uniform,zero-shot,route-v1,llm:qwen3:8b@3x2,llm:granite4.1:8b,cached:laya.jsonl), a report whose every table is identical to the one in §6; only the run id moves, because the code revision is in it.

ship-model.sh is the only thing that writes learn/models/. It copies the weights as route.bpk and the config, calibration and manifest as route.json (learn rank --pack makes the same pair), and it refuses, writing nothing, any model whose manifest does not say site_classes == ["fictional"]. A dev-split model trains on every fictional site and on nothing else, so it passes.

Before shipping, read the table. Until 2026-10-22 the shipped model beat the floor on known sites and lost to it on new ones; what ships now is the floor, written as a model file, and a trained model takes its place only when it meets the bar in §5 on sites it has not seen.

11. Running a night

learn/scripts/nightly.sh --help

learn/scripts/nightly.sh runs the blocks in order: framings (nemotron, two sites, four tones), personas, picks with three seeds, picks on the framing variants with one, the jury, then extract, embed, split, train, calibrate and bench. Each block runs under --budget-seconds, worked out from the bench night’s timings.json (calls the block is capped at × the measured median × how much longer its replies are than the bench’s, clamped to the schedule). The night’s own files go under $L/factory/<date>/, with its pid in nightly.pid. One night runs per $L whatever --night says (a flock on $L/nightly.lock: the pipeline steps write $L’s rows, embeddings, splits and models); INT or TERM to that pid stops the running step with it. Every factory step is given --sites $L/sites and --runs $RUNS, so a night under another LEARN_HOME never touches the real sites. At the end comes a README.md with every step’s status and seconds and the counts: calls, personas accepted and rejected by reason, route directories, rows by origin, the report. A step that fails is a line in that README, never the end of the night. --quick gives every block 60 seconds and two personas a need, for a smoke run; --sites and --framing-sites take site ids (nordvik-bygg is plans/contractor.yaml).

The schedule it was cut to, 22:00 to 07:00:

22:00  nemotron   framings, 2 sites × ~10 pages × 4 tones
22:50  qwen3:8b   personas for new sites and needs (≤ 250 calls)
23:25  qwen3:8b   route picks, 3 seeds, train sites (≤ 2,400 calls)
04:45  qwen3:8b   interviews (not built yet)
05:05  granite    jury on dev and eval-real (≤ 300 calls)
05:45  bge-m3     embed everything new
05:50  learn      extract → embed → split → train → calibrate → bench

Not in the script yet, for a weekend: learn factory baselines --out <night> --model qwen3.6:27b --budget-seconds <n> (held-out and real-client rows, one seed, one order, about ten hours for 4,008 rows) and learn factory baselines --out <night> --budget-seconds <n> (qwen3:8b, three seeds × two orders on the same rows, 24,048 calls, about four hours). Either with --dry-run says which rows it would ask and what the cache already holds, without a call.

12. Building it

learn is a nested package (learn/Cargo.toml, burn pinned to =0.22.1), so portal’s lock never sees Burn and the root cargo test never builds it. .gitea/workflows/learn.yml runs its tests and a release build when anything under learn/ changes, or any file outside it that its tests read (src/trainer/card.rs, src/trainer/build.rs, plans/, engines/learn.sh); the release workflow builds it beside portal and puts it in the same tarball with models/route.{bpk,json}.

Measured on the dev machine with the shared target directory: a cold release build 2m33s (2m15s with sccache warm); after a change to learn alone, 18 s for the release binary; portal’s own release build beside it 1m17s; cargo test for learn about 3 s of test time once built. The bare runner’s cold number is not measured yet: it comes from the first green learn.yml run, and goes in learn/README.md.

Results so far

Two rounds of experiments on the route decision, on 2026-10-21 and 2026-10-22. Each experiment was run by one agent and reproduced from scratch by another, with its own build, who also looked for leakage. Every number below reproduced, and none leaked. The outputs are in the sessions repo under $L/exp/.

The visitor was drowned by the page. route/v1 built the context as the page’s question, then what the page says first, then the visitor. The head is long, the same for everyone on the page, and often restates some of the options. So bge-m3’s vector of the context was mostly the page, and the cosine gave nearly everyone on a page the same answer. On haugland-bygg 97% of rows got the page’s commonest pick, and the floor there was at chance (0.264 with four options). Embedding the visitor’s own words alone, with nothing trained:

rowsroute/v1 contextthe visitor alone
the eight fictional sites, each held out in turn0.5870.705
16 new fictional sites, never used for any choice (1,610 rows, 492 visitors)0.6170.796

On the new sites the gain is 0.180, with a 95% interval of 0.154 to 0.208 when resampled by visitor. On the real clients (688 rows, 35 visitors) the visitor alone is ahead by about as much; those numbers stay in the sessions repo. The template was chosen after looking at the eight held-out sites, so their row is post hoc for it. The new sites’ row is not.

One data bug. On the factory’s nordvik-bygg, the survey door was headed “Log a phone enquiry” and the build door carried the survey’s words. The cause was lift_words in src/trainer/build.rs, which matched cards across pages by their record_as bucket, and three needs share enquiries. 78 rows were labelled with a door whose words name another need. lift_words now matches a form card by the need it files, read off its action, and the contractor rebuilt that way gives every enquiry card its own need’s heading. learn extract still drops a factory row whose right answer’s heading names another need, and lists it under misworded in the manifest, for the sites built before the fix: it dropped the same 78 rows from the rows the shipped model was fitted on.

Training adds no accuracy yet. Every way of training below was judged against the visitor-alone cosine on the same rows. It was judged first on held-out sites, then once on the 16 new sites and on the real clients, which chose nothing:

eight held-out sites16 new sitesreal clients
the cosine, nothing trained0.7050.796–
route-v1, defaults, trained on 8 sites0.5570.611below
route-v1, defaults, trained on 24 sites0.6410.686below
route-v1, recipe and epochs chosen with a training site held outepoch 0 in every foldepoch 0epoch 0
route-v1 with the LLM visitor’s votes as a second targetepoch 0 in every foldepoch 0epoch 0
a residual added to the cosine, its weight chosen the same way0.7030.805level
a ranker over 29 features that name no site (learn ltr)0.7170.802above, within noise
  • route-v1 with its defaults stops early on dev rows, which are new visitors at the sites it trains on. There it beats the cosine by 12 to 14 points; on a site it has not seen it loses 6 to 19 on average. It learns who goes where on the sites it knows, not how a visitor’s words meet a door’s. More sites shrink the loss, and the same rows spread over more sites help more than more rows on fewer. At 24 sites it is still behind on every test.
  • Chosen with a training site held out instead of dev, the best epoch is epoch 0, the cosine itself, every time. One epoch already costs about 0.14 on the site left out.
  • The residual and the ranker stay within two points of the cosine, and every 95% interval by visitor includes zero. The ranker picks what the cosine picks on 87% to 89% of rows. What it adds is calibration. A head that only reshapes the visitor’s cosine (its rank, margin and z-score in the row) gets the same calibration without changing one pick.

Calibration. The cosine at τ = 0.05 with nothing fitted is already calibrated where it is used: ECE 0.063 on the new sites, and under 0.08 on the real clients. A temperature fitted on the eight original sites’ dev rows (T = 1.16) makes it worse on both (0.094 on the new sites): those sites are harder than the ones the model is used on, so a T fitted there understates confidence elsewhere. Fitted on the dev rows of all 24 fictional sites, as the shipped model’s is, T comes out at 0.979, close to 1.

What ships. The route model with nothing trained, under the template route/v2: bge-m3’s cosine between the visitor’s words alone and each door, over τ = 0.05, written by learn train --epochs 0 with T and the gate fitted on dev like any model’s. It is dev.json’s model on the route/v2 rows of 2026-10-22: 5,891 rows (sha256 63694d0d…, after the guard dropped 78), of which 3,210 route rows on the eight original sites and 1,610 on the 16 new ones; 24 fictional sites, 4,113 listwise training rows, 707 dev rows, no real site. On dev:

accuracy0.751 (chance 0.406)
ECE after T0.049
T0.979
the gate at precision 0.90.856, letting 29.8% of dev rows through, 0.900 of them right

The comparison expected T 1.16, a gate near 0.95 and about 2% of dev rows through. Those figures came from the dev rows of the eight original sites alone. Dev now includes the 16 new sites, whose pages are easier (about half of them have two doors) and where the raw cosine was already calibrated, so T is close to 1 and the gate lets more through.

Bench b1c33a0ec9660 (reports/2026-10-22-route-v2.md in the sessions repo) cannot score the model itself on a fold, because dev.json’s model has seen every fictional row; it refuses each one. The zero-shot line at each fold’s own dev T is that same model with the site held out:

  • the eight original sites, each held out: 0.705 mean against chance 0.412, fold for fold the person-only floor of the comparison; ECE 0.040 pooled, 0.076 as the mean over folds.
  • the 16 new sites, each held out: 0.796 pooled (0.808 as the mean over sites), ECE 0.060 pooled. Only T and the gate have seen them, so accuracy is what it was, but they are no longer a sealed test.
  • the real clients, none of them ever trained on: well above both the old floor and the route-v1 model this replaces, with ECE inside 0.08 and the gate letting under a fifth of the rows through, nearly all of them right.

Three control lines are red. The gutted twin (every option replaced by Option i) is red on the real clients and on moen-utleie: with the words gone, the cosine gets no more than always picking a page’s commonest position gets, and the gate abstains on every gutted row, so nothing would act on it. The wrong-persona control is red on harbour-dental (0.488 against a bound of 0.479).

So the interview mostly asks, and bratac choose gates most candidates. That is right for a model that knows no more than its encoder. A trained model replaces it only when all of the following hold (the bar in §5):

  • it beats this cosine on the held-out-site mean by more than its seed noise;
  • no held-out site is more than 5 points below the cosine;
  • it is at or above the cosine on a set of new sites that no choice was made on, and on the real clients;
  • its ECE is 0.08 or less on both;
  • the gutted twin stays within 5 points of chance, or at most its best_fixed with the gate abstaining on more than 95% of the gutted rows, as the cosine’s is on the real clients and moen-utleie; and the permutation control is at chance.

What limits the tests. The real-client set has 35 visitors, so only differences of about 7 points or more show there. Three sites have a Norwegian twin, so the eight original held-out folds rest on five independent trainings. The 16 new sites have now been scored by every model, and the shipped model’s T and gate were fitted with their dev rows in, so the next comparison needs new sites that nothing has seen (What the factory makes next).

Known limits

  • The LLM visitors and Laya are not in the route/v2 bench. Their caches are keyed by row id, and every route row id changed with the template: 0 of 982 qwen3:8b rows and 0 of 150 granite4.1:8b rows join. Until they are asked again, §6’s table is the only one with them, and it is route/v1’s.
  • §6’s zero-shot lines need a rerun besides: they predate the change that keeps bench’s cosine from fitting T on the rows it scores.
  • The permutation control’s effective n in §5 (475 dev rows counting as about 309) was measured on the 4,359-row extraction, before a copy one option short or long joined its cluster; it has not been measured again on the real dev split. Such a copy inherits the permuted label only with probability about (k − 1)/k, so a weak leak of that kind slips through more easily than an exact copy.
  • No test checks a --require-calibrated pass. The tests pin where its floor is fitted and that a badly calibrated model fails.
  • A renamed dev-scheme split with a stale dev.json beside it. learn eval puts the cosine’s dev line of such a split at T = 1, with a note on stderr, rather than stopping. learn split always names that split dev, so this needs a hand-made or renamed file.
  • bratac interview --gate. A hold on the second-to-last turn followed by an adopted draft that reopens a gap stops at the cap with an error, where the same run ungated finishes; this is by design, since the checker’s latest verdict wins. The last transcript.jsonl line can show a refused working draft while plan.yaml holds the plan that was held.
  • The embedding cache and the factory ledger. An index entry past the end of vectors.f32 is a hard error. A blank meta.json over a non-empty index is refused, since the encoder cannot be recovered; over an empty index any encoder may claim it, and stray vector bytes are cut. A meta.json that is not UTF-8, or one in a read-only directory that is blank, falls back to memory. In the ledger, a call another process wrote whole that append() repairs shows in this handle’s calls only at the next open, and a call with a stray control character, NBSP, NUL or BOM beside it is dropped and asked again. The fsync order is tested through a seam, not checked against the real system calls in CI.

What is next

The generator side (portal propose), a per-framing /report, and a gap model. And more sites, harder pages and a sealed test set (What the factory makes next): the held-out-site number is the one that matters, and it moves with how many businesses the model has seen, not with how long it trains on the ones it has.