The Question

Ninety years after Fisher fitted a discriminant to these flowers, two studies in this repository have asked the obvious modern question — can anything from the last nine decades earn a keep-sized win over the 1936 rule on his own hard pair? — and both came back with no keep earned. Study 09 asks a different question, and it asks it first.

Can the comparison be won at all? Every one of those contests was decided against a resolution threshold: a challenger must improve by at least as much as the measurement's own noise. Brier scores cannot go below zero, so the largest gain arithmetically available to anyone is the incumbent's own score. When that score is smaller than the threshold, the contest is finished before the first fit — not lost, unwinnable. Study 08 worked that ratio out by hand, in a comment, after the fact. Study 09 registers it as the lead result and publishes it before any challenger number exists. That reordering — measurement permission, then model comparison — is the whole study.

The first lesson of data science, re-asked as six registered questions:

  1. RQ0 — claim permission. For each frozen challenger, is the Brier comparison arithmetically capable of clearing that challenger's own paired resolution threshold? And at the ledger's single-scalar scale, is a keep possible for anybody?
  2. RQ1 — the contest. At nominal rung 60, does any challenger clear both its candidate-specific bar and the registered selection guard, at an open rung?
  3. RQ2 — sample size. As training rows fall from 60 to 8, how do predictive risk and resampling instability move — and does shrinkage LDA lead plain LDA descriptively where covariance estimation is fragile?
  4. RQ3 — feature sufficiency. How much probability quality does petal-only LDA retain, and does the sepal-only positive control fire at every measurable rung?
  5. RQ4 — metric meaning. Where ranking metrics saturate, do the probability metrics still order the room?
  6. RQ5 — the simulation lane. Under four known data-generating processes, how do squared probability bias, training-set variance and irreducible uncertainty trade as n grows?

The lineage, declared before anything was measured. This is the third study on the same one hundred flowers. Study 07 published every row's values in its public ledger and sidecars; study 08 additionally published both of its sealed values and the full row-id lists of every arena partition. Nothing about these flowers is unseen. The rows behind this study's seal are procedurally fresh only — the registered protocol never conditions selection on them, but nobody is blind to them, and the words blind, independent replication, untouched and virgin data are banned from every artifact this study produces. Seeds, per-candidate bars, the guard family, the branch rules, the coda bands and the finalize paths were all locked before the first 09 measurement. That lock, not blindness, is the integrity claim.

One word to disarm in advance. The study completes carrying klein's exploratory label. That is a protocol-completion label, pre-registered as the Branch-B outcome before any run — it records which sealed path the record selected, not how good the evidence is, and it never translates into scientific language.

Method

Two headroom numerators, and you must name which one you mean. Headroom is a ratio of how much room exists above the incumbent to how coarse the ruler is. This study measures it at two scales, and they do not share a numerator:

h = \frac{\text{anchor declared dev}}{\delta} \qquad\qquad h_c = \frac{\text{anchor metrology mean}}{\mathrm{floor}_c}

The ledger scale asks whether a keep is arithmetically possible for anybody against the one scalar bar the ledger enforces; its numerator is E0001's declared-split score, 0.026409. The candidate scale asks whether one named challenger's comparison can be won at its own resolution; its numerator is the anchor's marginal mean Brier across the twenty paired redraws, 0.04302915. Different quantities, different denominators, different questions — and quoting one as the other is a banned claim here, precisely because the two are close enough to swap by accident.

The floors are clearance bars, not tie bars. Twenty group-aware redraws of the non-sealed rows, all ten families scored on the identical rows in each redraw, so the challenger-minus-anchor difference is paired by construction rather than by adjustment. Per candidate:

\mathrm{floor}_c = \max\left(2\,\mathrm{std}(d_c),\; \mathrm{range}(d_c)/2\right)

The direction matters more than the formula. In study 07 a per-method floor was a bar that bought a draw — a candidate was rewarded for its own noisiness, and that construction is banned here by name. Here the floor is a bar the candidate must clear, so a wide band penalises the case of the very candidate that produced it. Same arithmetic, opposite incentive.

The ledger's single scalar takes the widest challenger floor and rounds it up to three decimals — hgbt's 0.07959988633051922 was binding:

\delta = \lceil \mathrm{floor}_{\mathrm{hgbt}} \rceil_{0.001} = 0.08

Controls are excluded from that maximum by registration: a deliberately information-destroyed control may not set the ruler. Escalation is raise-only, and the floor is a location-invariant dispersion functional — no observed gain can tune it.

The arena. Ten seeded repeats of stratified group 4-fold over the non-sealed pool, with nested whole-group quota subsampling down to each nominal rung, the same rows served to every family. Stage A fits the anchor and the two controls only — 720 fold-evaluations — and commits the per-rung headroom table before any challenger arena number exists. Stage B then runs the seven-family roster for a further 1,680. A whole-group quota cannot always land on the number you asked for: at nominal rung 60 the realized training size is 60 rows in 23 of the 40 fold-evaluations and 59 in the other 17, while every lower rung landed exactly. The registered phrase is therefore always nominal rung 60, and "trained on 60 rows" without that qualifier is a banned sentence.

Open and closed rungs. Each rung carries its own bar,

\delta_n = \max\left(\lceil 2 s_n \rceil_{0.001},\; 0.005\right)

where 0.005 is a registered constant, not an estimated noise quantity. A rung is OPEN when m_n \ge \delta_n: the anchor's own mean error is at least as large as the bar, so a perfect oracle could clear it. Closure gets a descriptive label — ceiling-closed when the anchor is simply too near perfect, fog-closed when the lottery's own spread has outgrown the error.

The guard, named honestly. Bar-1 forms each cell's paired improvement over the anchor, summarises it per repeat, computes a t-statistic, and then applies Rademacher sign flips at the repeat level — all 1024 enumerated — simultaneously across a family of 42 cells, seven challengers by six rungs, fixed before the sweep ran. A cell clears at an adjusted score of at most 0.05, which on a grid of 1/1024 means at most 51/1024. This is a registered selection guard under a symmetry assumption the design does not supply — never family-wise error control, never a statement about irises at large. And because the family size sits inside the statistic, a guard score here is not comparable with one from study 08's 113-cell family; the contract bans that comparison outright.

Bar-2 needs all three at once: the guard cleared, the mean gain at least that candidate's own floor, and the rung open. Note which threshold governs what — \delta_n governs the rung's openness, \mathrm{floor}_c governs the candidate's bar. The two are never swapped.

The split law applies inside everything. Under this study's registered seed the twin pair landed in TRAIN, putting a multi-row group in the non-sealed pool. Study 08's argument that a row-level inner cross-validation was lawful — because no multi-row group sat in its pool — therefore does not port. Every internal cross-validation here receives precomputed group-aware split policies, the sealed coda's own base included. That amendment is load-bearing, not decorative.

The seal is a band check, and nothing else. The frozen analysis picks the branch mechanically and writes a manifest before the confirmation phase; the sealed registry entries read it, so no code is edited after selection. Branch A would spend two looks; Branch B spends one and leaves the challenger seal shut. A band carries no nominal coverage once a winner has been chosen against the same folds that produced it, and this study never describes its coda as estimating anything.

Discipline that ran before the first gate. A pre-gate staging smoke scored development and sealed Briers under a candidate split seed. Nobody read the logs; they were deleted; the seed was retired and the split re-registered before the consult acknowledgement, with a standing law added that subagent smokes run on synthetic frames only. Two further seed namespaces were re-registered on build-time disclosures — a simulation truth seed colliding with training-draw seeds, a sensitivity seed sitting inside the arena's own subsampling range. All three fixes landed before any gate was recorded, and the near-misses stay in the sweep docstrings so they remain auditable.

Data

Everyone's first dataset is treated as innocent. It is not. Before any model ran, this study re-audited all 150 printed flowers from the committed bytes — not from citation, from the files in the repository — and the audit is the reason several later sentences are phrased the way they are.

The measurements are a lattice, not a continuum. All 600 measurement values sit exactly on the 0.1 cm grid. Petal width takes only 22 distinct values across 150 flowers. Calling these features continuous is a modelling convenience; the instrument was a ruler read to a tenth of a centimetre, and every claim about duplicates, near-duplicates and resolution downstream inherits that fact.

One exact duplicate, and it is famous. In the full 150 there is exactly one duplicated row-content group: iris rows 102 and 143, both virginica, (5.8, 2.7, 5.1, 1.9). Inside the hard pair it is the same single pair. The duplication is original to Fisher's own 1936 Table I — printed twice there — and the study carries the scope qualifier verbatim wherever it says so: "in the forensic sources we checked." Never "nobody ever noticed." At 0.1 cm resolution, identical measurements cannot be distinguished from two genuinely identical flowers, so the rows are never deleted. They share one group id and travel together through the outer split, all twenty metrology redraws, every arena fold and rung subset, and every inner cross-validation.

Five near-duplicates, ruled the other way. Five pairs in the full 150 are identical in three features and exactly one 0.1 cm step apart in the fourth — one of them inside the hard pair. The twin ruling is deliberately not extended to them: they differ in a recorded measurement, so they are distinct flowers, and saying so is a registered ruling rather than a judgement call made later.

The provenance diff, re-verified. scikit-learn ships the corrected copy of the table; the classic UCI file differs from it in exactly 3 cells, on two rows, both setosa. That was recomputed here from study 07's committed read-only UCI bytes rather than inherited as a citation — and the point of recomputing it is that the errata cannot touch a single hard-pair row.

Why setosa is dropped, in one number. Setosa's petal length stops 1.1 cm short of where the other two species begin: a clean one-feature gap. With setosa in frame, every method looks perfect and no method question can be asked. The three-class problem and the two-species hard pair answer genuinely different questions, and this study registers only the second — versicolor against virginica, the overlapping pair, 100 rows, with the full table's classes standing at exactly 50/50/50.

The split, and the consequence it forced. The declared split is group-aware 60/20/20 under seed 20260912, with no redraw permitted under any outcome. The twin group landed in TRAIN — which means a multi-row group sits in the non-sealed pool, and study 08's argument that a row-level inner cross-validation was harmless does not survive the move. Every internal split in this study is group-aware by construction because of where two flowers happened to fall. That is the useful shape of a data ruling: it is not a paragraph in a card, it is a constraint that changes the code.

The seed itself has a history worth one line. An earlier candidate seed was retired before any gate, because a pre-gate staging smoke had scored development and sealed Briers under it. The logs were deleted, the seed was retired on the precedent set in study 07, and the split was re-registered before the consult acknowledgement — disclosed in the scouting ledger rather than quietly reused.

The Journey

The anchor, then the two things that are not challengers. E0001 put Fisher's four-feature LDA on the declared split and scored 0.026409 — a keep, because it is the first valid result on the track, not because it won anything. E0002 ran petal-only LDA at 0.03135 and E0003 sepal-only at 0.156308, both registered in advance as discards. The sufficiency exhibit and the positive control are load-bearing precisely because nobody expected them to win.

A floor that came out at exactly zero, and what it does not mean. The k-seed sweep refits the anchor with nothing varied but the seed. Its standard deviation is exactly 0 — LDA is closed form, so there is no optimizer, no subsampling and no initialization for a seed to perturb. The registered reading is narrow and was written before the sweep ran: zero algorithmic fit randomness under fixed inputs, and nothing more. Not "low variance", not "stable". Pasting a zero into the contract as a floor would have let any difference at all count as a keep — which is the exact dishonesty the measurement exists to prevent.

Metrology, then the floors. Twenty group-aware redraws, all ten families on identical rows each time, 200 sidecar rows in total. The widest challenger floor belonged to hgbt at 0.07959988633051922, so the ledger's single scalar rounded up to \delta = 0.08.

Then the door, before the arena. With the floor in the contract, the ledger headroom is h = 0.026408807494830228 / 0.08 = 0.330. Below one. DOOR-CLOSED: a scalar-delta keep was arithmetically impossible for every challenger on the roster. The branch had been written out as a sentence at scaffold time — this is the first shipped klein study to arm the harness's detection-limit audit — and the acknowledgement was recorded, with its pre-committed run-anyway note, before a single challenger arena number existed. The note says what the parade is for: "the arena with per-candidate floors and the selection guard is the registered evidence; ledger-scale keeps are acknowledged arithmetically impossible; no re-scope, no redraw."

Published in the same breath, the per-candidate map — the study's actual lead result. It uses the other numerator, the anchor's marginal metrology mean 0.04302915, over each challenger's own paired floor. Four comparisons come back not arithmetically excluded; three cannot be won at their own resolution no matter what the data says.

Per-candidate claim-permission map: h_c for each of the seven challengers against the permission line at one, four open and three measurement-closed

Stage A shut the ladder too. Fitting only the anchor and the controls, the per-rung table went in before any challenger touched the arena. All six rungs are CLOSED — nominal 60, 45, 30 and 20 ceiling-closed, 12 and 8 fog-closed. As the data shrinks the incumbent gets worse, and the bar for beating it gets worse faster.

Per-rung anchor mean error against that rung's own floor, with family means overlaid: ceiling-closed at the top four rungs, fog-closed at 12 and 8

The parade. Seven challenger transactions on the primary track in registry order: seven discards, zero keeps, zero crashes. And a genuinely awkward fact, published rather than buried: four of the seven beat the anchor's raw score on that one split — svm_rbf_platt 0.016995, qda 0.019434, tabpfn 0.019730 and logit_l2 0.025256 against 0.026409. The best gap is 0.0094, which is 0.12× the scalar bar — and svm's own comparison, metrology mean over its own paired floor, is measurement-closed at h_c = 0.958, so its impressive number arrives with no permission to be claimed. Score-beating is cheap.

ExpMetricStatusDescription
E00010.026409keepE0001 anchor_lda4 on the declared split (registered ladder step 1; the anchor IS the committed base config - allow-rerun per 07/08 mechanic); first valid result on this track
E00020.03135discardE0002 lda_petal sufficiency control (registered: discard expected; delta=0 era); did not improve track frontier 0.026409 by minimum_delta=0
E00030.156308discardE0003 lda_sepal positive control (registered: discard by a catastrophe margin); did not improve track frontier 0.026409 by minimum_delta=0
E00040.030051discardparade: lda_shrinkage at the declared split (descriptive under DOOR-CLOSED ack; per-candidate reading in RQ0 sidecar); did not improve track frontier 0.026409 by minimum_delta=0.08
E00050.019434discardparade: qda at the declared split (descriptive under DOOR-CLOSED ack; per-candidate reading in RQ0 sidecar); did not improve track frontier 0.026409 by minimum_delta=0.08
E00060.025256discardparade: logit_l2 at the declared split (descriptive under DOOR-CLOSED ack; per-candidate reading in RQ0 sidecar); did not improve track frontier 0.026409 by minimum_delta=0.08
E00070.028349discardparade: knn_tuned at the declared split (descriptive under DOOR-CLOSED ack; per-candidate reading in RQ0 sidecar); did not improve track frontier 0.026409 by minimum_delta=0.08
E00080.016995discardparade: svm_rbf_platt at the declared split (descriptive under DOOR-CLOSED ack; per-candidate reading in RQ0 sidecar); did not improve track frontier 0.026409 by minimum_delta=0.08
E00090.090989discardparade: hgbt at the declared split (descriptive under DOOR-CLOSED ack; per-candidate reading in RQ0 sidecar); did not improve track frontier 0.026409 by minimum_delta=0.08
E00100.01973discardparade: tabpfn at the declared split (descriptive under DOOR-CLOSED ack; per-candidate reading in RQ0 sidecar); did not improve track frontier 0.026409 by minimum_delta=0.08
E0011NAcrashSEALED T1 (Branch B): coda_primary = anchor on all train rows; band |sealed - 0.026409| <= 0.16; sentence selected from program.md §Sealed by the record; process exit code 1

Erratum E1, filed after finalize and stamped on this table: every ledger transaction above ran under train.py’s hardcoded seed 20260909 — the namespace this study had RETIRED before its first gate (scouting S10) — because the orchestrator’s retirement sweep missed one file. The numbers are internally consistent and honestly measured on that retired partition, but they are retired-partition quantities and E0001’s value matches one the pre-gate staging smoke had already computed. Every sweep in this study — the floors, the RQ0 candidate map, the entire arena, the guard, RQ4, the simulation lane — derives its pool from the contract and ran on the registered 20260912 split. The verdicts below this table stand on the sweeps. Findings C15 carries the full scope; claims.lock tags the affected entries.

Then the lottery reversed the impression. Across the registered rung-60 draw, only one family's mean paired gain is positive at all: lda_shrinkage at +0.004171, which is 0.15× its own floor, with a guard score of 0.39. Every other family is worse than the anchor on average — tabpfn −0.003983, qda −0.005546, logit_l2 −0.006875, knn_tuned −0.010625, svm_rbf_platt −0.011733, hgbt −0.059501. The two challengers that looked best on the declared split are both underwater across the lottery. One split is one draw; the lottery is the estimand. Both levels are published here because publishing only the flattering one is how a reader gets misled.

The coda, and the most instructive failure in the study. Branch B fired mechanically — no cell cleared Bar-2 at rung 60 — so the challenger seal stayed shut by rule and one sealed look remained: the anchor, against a registered band of \left| \text{sealed} - 0.026409 \right| \le 0.16. E0011 spent it and crashed:

RuntimeError: coda manifest (branch B) registers no family for track 'primary'

The seam is worth naming exactly, because it is ordinary. The roster module was built to look up a manifest key named primary; the frozen analysis wrote the key coda_primary. Each side had been integration-tested against its own mock manifest, and neither had ever been run against the real one. The traceback lands in the column-resolution call, before any model was built: zero sealed values were computed or observed.

And the seal was spent anyway. That is not a bug in the framework, it is the framework working: any final-test transaction burns the one-shot access before the child process launches, a spent seal stays spent, and the ledger refuses a second look. A seal that you could re-roll after an unlucky outcome would not be a seal. So the registered band check is UNFULFILLED — no retry exists and none was attempted.

What the record says about it was written before any run, in the pre-committed 备而不用 slot for a sealed outcome outside every registered case, and it is read verbatim rather than improvised:

"The sealed record shows a case outside every registered sentence. We stop at this sentence, file it in findings, and improvise no explanation."
「封存记录出现了登记之外的情形。我们停在这句话,写进 findings,不现编任何解释。」

Finalize then ran the pre-registered Branch-B path, --allow-exploratory, and verification came back 19 checks, 0 failed. The study completes with a spent seal, an unfulfilled band, and a written sentence it did not have to invent under pressure. That was the point of writing it first.

Findings

Seven challengers, 42 guard cells, six rungs, four known-truth worlds, one spent seal. Nothing cleared a bar that mattered — and the most useful result in the study is the one that was published before the contest ran.

Permission first: three contests that could never be won

The ledger door is closed: h = 0.026408807494830228 / 0.08 = 0.330. Below one means a scalar-delta keep was arithmetically impossible for every challenger before any of them ran, and every parade disposition below inherits that scope. Then the per-candidate map, whose numerator is a different quantity — the anchor's marginal metrology mean 0.04302915 — over each challenger's own paired floor:

Challengerh_cPermission
lda_shrinkage1.57open
logit_l21.36open
qda1.29open
tabpfn1.23open
svm_rbf_platt0.958measurement-closed
knn_tuned0.59measurement-closed
hgbt0.54measurement-closed

Three of seven comparisons could not be won at their own resolution, whatever the data said. Results there are descriptive only. "Open" carries its registered meaning and no more: not arithmetically excluded — never "plausible", never "likely".

The registered lever that broke, and why that is the good news

The contract predicted that the paired floors would exceed the anchor's marginal 2×std for at least 5 of 7 challengers; study 07's recomputation had given 5 of 6. Measured here: 2 of 7 — only knn_tuned at 0.0730 and hgbt at 0.0796 exceed the marginal 0.0501. FALSIFIED, on the record, by a study that wrote the prediction down first. The durable rule is not an ordering between the two floor types but measure both, name the estimand: which one is wider is a property of the geometry and the roster, not of the arithmetic.

The contest: nobody cleared their own bar

Bar-1: 0 of 42 cells cleared the registered selection guard. Bar-2: 0 — it additionally requires an open rung, and no rung opened. The fold-level sensitivity exhibit fires 0 cells too, so unlike study 08 this branch carries no lone fragile detection to caveat. The anchor stands by default, not by victory — the difference between a result and a coronation.

The ladder blinds the ruler faster than it separates the families

From nominal rung 60 down to 8, the anchor's mean risk grows 0.0332 → 0.1055 and its across-fold spread grows 0.0336 → 0.0867 — that spread is resampling instability, never model variance. The per-rung floor meanwhile grows 0.068 → 0.174, faster than the risk does. All six rungs are closed, the ratio of risk to bar between 0.47 and 0.61 throughout: 60/45/30/20 ceiling-closed, 12/8 fog-closed. Small n blinds the ruler, not just the models.

Inside that fog the descriptive board flips, exactly as scouted. At nominal rung 8 the leaders against the anchor are lda_shrinkage +0.0405 (clearing the registered 0.02 lever — HELD), qda +0.0285 and tabpfn +0.0265 — all at most 0.23× the 0.174 fog floor, guard scores 0.11 or worse. Shared-covariance estimation is the anchor's fragile joint when rows run out, and shrinkage buys the repair — stated as a descriptive pattern only. The mechanism demonstration lives in the simulation lane and nowhere else.

The instrument was alive the whole time

Petal-only LDA retains most of the probability quality — 0.03135 on the declared split against the anchor's 0.026409, and 0.0483 against 0.0332 across the rung-60 draw. The sepal-only positive control is the registered catastrophe: 0.156308 declared, 0.2146 across the lottery, worsening test firing at every one of the six rungs, p = 0.0010 against a Bonferroni bar of 0.0083, worsening between +0.15 and +0.19. An instrument that declared every contest closed can still see a real difference when one is there. The closures are about resolution, not blindness.

Where ranking goes silent

At nominal rung 60, ROC-AUC sits exactly at 1.0 on 55% of all 400 fold-evaluations — and on 77.5% of the anchor's own 40 — while the same fold-evaluations' Brier means span 0.029 to 0.215 and log loss spans 0.093 to 0.618. A saturated ranking gauge is silent exactly where the probability gauges are still ordering the room. That is the registered reason Brier is this study's primary metric, decided before any of it was measured.

Share of rung-60 fold-evaluations at the AUC ceiling per family, plotted against that family's mean Brier at the same rung

The simulation lane, behind its firewall

These are known-DGP teaching results. They are never the true iris data-generating process and never an empirical decomposition of studies 07–09; the decomposition is a plug-in over 100 registered draws per cell, not an unbiased population estimate. With that said, it closes to machine precision:

\left| \mathrm{total} - (\mathrm{irr} + \mathrm{bias}^{2} + \mathrm{var}) \right| \le 8.3 \times 10^{-17}

across all 164 populated cells. Four worlds, four lessons. G1, built to match LDA's assumptions: everyone converges to the irreducible floor 0.1113, and at n = 8 shrinkage beats plain LDA on total risk, 0.147921 against 0.152878, the whole difference sitting in variance (0.035580 against 0.040030). G2, the same signal plus 16 irrelevant dimensions: variance explodes at small n (plain LDA 0.133 at n = 12, shrinkage 0.121), and QDA is unfittable for n ≤ 30 — 400 recorded failures, published as data. Flexible covariance does not degrade gracefully; it exits. G3, unequal covariance: QDA's structural win, squared bias 0.0014 against LDA's 0.0320 at n = 500, a bias that never washes out. G4, XOR: the linear family plateaus at squared bias 0.216 for a total of 0.251 — marginally worse than the constant predictor's 0.25 — while hgbt reaches 0.051, and at n = 8 hgbt simply is the constant predictor, variance exactly 0.

Bias-squared, variance and irreducible risk against training size for four known data-generating processes

The interpretation, labeled as one

The anchor's standing on this data reads best as an inductive-bias match: four nearly sufficient, nearly Gaussian features — petal-only already carries most of the signal — an almost-linear boundary, small-to-medium n, and shared-covariance regularization. The same reading predicts its failure modes, and the simulation lane shows them: break equal covariance and QDA takes it; break linearity and the linear family lands behind a constant. 「口径:这是解读,不是登记过的分解量。」

What transfers is the process, not the winner. "Nobody displaced the anchor" only means something once you have said, first, that three of the seven contests could never have been won.

Coding Advice

Below is the study's entire mutable surface. In a klein v2 study, train.py is the only file a candidate transaction edits, and it edits exactly one line of it — FAMILY. Everything else is the registry, the split, and the registered auxiliary block. Read it as an argument about where the knobs should not be.

"""The only per-candidate mutable surface in a Klein v2 study.

Study 09 — the first lesson. E0001 re-establishes the 1936 anchor on the declared
split (seed 20260909); the parade then edits exactly one line (FAMILY) per
transaction across the 7-family challenger roster (`families.CHALLENGERS`, in
registry order), after the two controls. Candidate selection happens ONLY through
FAMILY (families.py registry); feature columns come from the registry so `species`
(a perfect target proxy) and `group_id` can never leak in.
Sealed-coda families (`coda_primary` / `coda_challenger`) are ordinary registry
entries whose factories read the committed `sweeps/coda_manifest.json` and bake its
pre-registered train positions — this file never grows a second knob. They route
through the same `families.build(FAMILY, y=..., groups=...)` call as every other CV
family, which is what makes 09's coda base group-aware inside the bake
(research_plan §7; 08's non-group `cv=3` argument does not port to seed 20260909).

The registered auxiliary block (study.yaml `auxiliary_metrics.registered`) rides
along in `extra=`: kleinlib prints val_auc / val_pr_auc / val_brier / val_logloss
itself, and `aux_metrics()` adds val_accuracy, val_f1, cal_intercept, cal_slope and
re-states val_logloss at the REGISTERED eps clip 1e-6. Secondary metrics never
overturn the registered primary verdict after results are known.
"""

from __future__ import annotations

import os
import time

import families
import numpy as np
from sklearn.linear_model import LogisticRegression
from sklearn.metrics import accuracy_score, f1_score, log_loss

import kleinlib
from kleinlib.data import load_prepared, three_way_split

#: The registered family this candidate runs. The ONE line the ladder edits.
FAMILY = "anchor_lda4"

RANDOM_SEED = 20260909
SMOKE = os.environ.get("KLEIN_SMOKE") == "1"
EXPERIMENT_ID = os.environ.get("KLEIN_EXPERIMENT_ID") or ("SMOKE" if SMOKE else None)
TRACK = os.environ.get("KLEIN_TRACK") or ("primary" if SMOKE else None)

PREPARED = "data/prepared/iris_hard_pair.csv"
TARGET = "is_virginica"

#: Registered clip for the log and logit transforms ONLY — never for Brier terms
#: (study.yaml auxiliary_metrics). sklearn's own log_loss clips at machine
#: epsilon (~2.2e-16), which is not the registered instrument.
AUX_EPS = 1e-6
#: val_accuracy / val_f1 are threshold-0.5 readings (kleinlib's val_f1_at_best
#: sweeps thresholds instead — the two are different registered quantities).
AUX_THRESHOLD = 0.5


def load_split(evaluation_kind: str):
    """Select development or the sealed final-test partition explicitly.

    Split = study.yaml's declaration verbatim: kind group (twins iris-102/143 share
    one group id and always travel together), seed 20260909 (derived inner seed
    20260910), 0.20/0.20 — the pre-committed fresh seed, disjoint from every 07 and
    08 namespace; NO redraw under any outcome. ``final_test`` fits the same
    train-only candidate and evaluates the sealed 20 (PROCEDURALLY FRESH ONLY — all
    100 values, and both predecessors' sealed values, are public). Band-check role
    per research_plan §7: the arena is the evidence; the seal is the discipline.
    """
    if evaluation_kind not in {"development", "final_test"}:
        raise RuntimeError(f"invalid KLEIN_EVALUATION_KIND={evaluation_kind!r}")
    df = load_prepared(PREPARED)
    y = df[TARGET]
    x_tr, x_dev, x_te, y_tr, y_dev, y_te = three_way_split(
        df,
        y,
        task="classification",
        strategy="group",
        development_size=0.20,
        test_size=0.20,
        seed=20260909,
        groups=df["group_id"],
    )
    columns = families.columns_for(FAMILY)
    g_tr = x_tr["group_id"]
    if evaluation_kind == "development":
        return x_tr[columns], x_dev[columns], y_tr, y_dev, g_tr
    return x_tr[columns], x_te[columns], y_tr, y_te, g_tr


def build_model(y_tr, g_tr):
    # CV families receive group-aware inner splits (twins never straddle an
    # inner boundary — the gate law applied inside the estimators). The coda
    # entries take y and groups too: they subset BOTH by their baked positions
    # before deriving their base's splits (families.py §CODA AMENDMENT).
    return families.build(FAMILY, y=y_tr, groups=g_tr)


def aux_metrics(model, X_dev, y_dev) -> dict[str, float]:
    """The 09 additions to kleinlib's printed aux block (registry order).

    ``val_logloss`` is RE-STATED here at the registered eps clip 1e-6; it is the
    same key kleinlib prints, so the sidecar and the parsed block both carry the
    registered instrument (kleinlib's line still prints first, unclipped —
    the difference is itself an RQ4 reading, not an error).
    """
    p_raw = model.predict_proba(X_dev)[:, 1]
    p = np.clip(p_raw, AUX_EPS, 1.0 - AUX_EPS)
    y = np.asarray(y_dev)
    predicted = (p_raw >= AUX_THRESHOLD).astype(int)

    # Cox recalibration on the eval predictions: y ~ sigmoid(a + b*logit(p)),
    # perfect calibration = (0, 1). Unpenalized by construction — an L2 prior
    # would shrink b toward 0 and report miscalibration that is not there.
    # Under a saturated (perfectly separated) eval set the MLE diverges and
    # lbfgs returns the max_iter-truncated value: read it as "slope unbounded",
    # never as a fitted constant. RQ4 is exactly about that regime.
    logit = np.log(p / (1.0 - p))
    recalibration = LogisticRegression(penalty=None, solver="lbfgs", max_iter=1000)
    recalibration.fit(logit.reshape(-1, 1), y)

    return {
        "val_logloss": float(log_loss(y, p, labels=[0, 1])),
        "val_accuracy": float(accuracy_score(y, predicted)),
        "val_f1": float(f1_score(y, predicted, zero_division=0)),
        "cal_intercept": float(recalibration.intercept_[0]),
        "cal_slope": float(recalibration.coef_[0][0]),
    }


def main() -> None:
    t0 = time.time()
    evaluation_kind = os.environ.get("KLEIN_EVALUATION_KIND")
    if SMOKE:
        evaluation_kind = evaluation_kind or "development"
    missing = [
        name
        for name, value in (
            ("KLEIN_EVALUATION_KIND", evaluation_kind),
            ("KLEIN_EXPERIMENT_ID", EXPERIMENT_ID),
            ("KLEIN_TRACK", TRACK),
        )
        if value is None
    ]
    if missing:
        raise RuntimeError(
            "train.py must be invoked through `klein run-one`. For a pre-run "
            "syntax/shape check use `KLEIN_SMOKE=1 python train.py` — it prints "
            "the canonical block, writes no sidecars or snapshots, and is not "
            "evidence. Missing: " + ", ".join(missing)
        )
    X_tr, X_dev, y_tr, y_dev, g_tr = load_split(evaluation_kind)
    model = build_model(y_tr, g_tr)
    fit_start = time.time()
    model.fit(X_tr, y_tr)
    fit_seconds = time.time() - fit_start
    kleinlib.eval.evaluate(
        model,
        X_dev,
        y_dev,
        exp_id=EXPERIMENT_ID,
        study_dir=".",
        t0=t0,
        fit_seconds=fit_seconds,
        train_n=len(X_tr),
        val_n=len(X_dev),
        metric_name="val_brier",
        metric_goal="lower",
        extra=aux_metrics(model, X_dev, y_dev),
    )


if __name__ == "__main__":
    main()

Read the bytes above with erratum E1 in hand: line 78 hardcodes seed=20260909, the retired namespace — the exact defect class friction #5 asks the framework to make impossible (an evaluator that can silently split differently from the fingerprinted contract). We publish the file as committed, defect and all; that is what a ledger is for.

  1. Publish the permission map before the tournament. One table — each candidate's headroom against its own floor — told this study, before any challenger ran, that 3 of 7 comparisons could not be won at their own resolution and that no scalar-bar keep was available to anyone. That is not a footnote; it is what makes "nobody displaced the anchor" a sentence worth printing rather than a shrug. Compute it, commit it, and only then run the roster.

  2. Name the estimand of every floor, out loud, in the contract. A resolution threshold without a named estimand is not a decision rule, it is a number. This study registered paired-comparison and published the marginal spread beside it — and was rewarded with a falsified prediction: 2 of 7, where 5 of 7 had been registered. If it had quoted only one floor type it would have been wrong and would never have found out.

  3. Keep the two headroom numerators apart by force. The ledger's numerator is a declared-split score; the per-candidate numerator is a metrology mean over redraws. They sit close enough together that prose will swap them. Ban the conflation in the contract, and print each numerator's name in the sidecar column header, as this study's headroom table does.

  4. Controls prove the instrument; they are not padding. Two extra registered families cost minutes and bought the strongest sentence in the findings: an apparatus that closed every contest still separated the sepal-only control at all six rungs. Without it, "nothing cleared the bar" is indistinguishable from "the ruler was broken."

  5. Pass group-aware split policies, never split indices. A group-aware outer split proves nothing if a calibration wrapper or a hyper-parameter tuner resplits rows internally. Study 08 could argue its way out because no multi-row group sat in its pool; one different seed later, the twins landed in TRAIN and that argument evaporated. Precomputed policies survive the move; absolute index lists are correct exactly once, on the data they were computed from.

  6. Two smoke laws, and the second one cost a seal. First: any subagent smoke runs on synthetic frames only — never the real prepared file, never the declared split. This study wrote that law after a pre-gate staging smoke forced it to retire a split seed. Second, and this is the lesson E0011 paid for in full: smoke the exact sealed configuration before you record the confirmation acknowledgement. The crash was a manifest-key mismatch between two modules that had each been integration-tested against their own mock manifest and never against the real one. A one-line dry run of the real configuration would have caught it. The seal spent anyway, because a seal that survives an unlucky outcome is not a seal.

  7. Assert your seed domain in every file that generates seeds — including derived ones. Both predecessors crashed a namespace on the same overflow. Derived schemes are where it bites: a base plus an offset plus an index is easy to write and easy to push out of range. Assert in the header, not in the postmortem.

  8. Capture your tooling's stdout into committed logs. Verification and the frozen analysis both print to a console nobody keeps. A capture wrapper turns "we checked" into an artifact a reviewer can open — which is how the 19-check verification and the guard's own seed disclosures became evidence rather than recollection.

  9. Full precision in the lock; round only at presentation. The binding floor in this study is 0.07959988633051922 and the scalar derived from it is 0.08. Both live in the artifacts at full width; the rounding happens in a sentence, once, where a reader can see it. A lock that stores the rounded value has quietly thrown away the only thing that makes the derivation checkable.

The pattern underneath all nine: none of the findings here transfer, and all of the habits do. Nothing about a hundred irises tells you anything about your data. Measuring the resolution before the contest, naming what each threshold is a threshold of, and keeping the failures where a reviewer trips over them — that survives the change of subject.

Next Steps

Frictions filed against the framework

  1. Refresh the split fingerprint at the DATA gate. Scaffolding freezes that fingerprint from a placeholder seed, and the DATA gate then refreshes the prepared-data hash but not the split hash — so any study that edits its seed before the first transaction hits a preflight failure and must touch generated state by hand. Two predecessors regenerated their state wholesale; this one refreshed the single field and disclosed it. The gate should simply do it. P1.

  2. Let the noise-floor command emit its own estimand. The schema requires estimand: once a bounded metric is declared, and the tool that writes the block still cannot produce the line. It was hand-added again here. A generator that cannot emit a field its own validator demands is a trap for the next first-time user. P1.

  3. Give the sealed final-test a dry-run mode. This is the one the crash paid for. There is no way to exercise a sealed configuration's code path — build the model, resolve the columns, read the manifest — without touching a partition, so an ordinary interface defect costs the seal itself. A --final-test --dry-run that stops short of any data access would have turned E0011 into a two-second fix. P1, and the strongest case in this repository for one.

  4. Resolution is not materiality — assessed, deliberately not implemented. Every klein threshold is a measurement-resolution threshold, and no decision-value model exists anywhere in the repository, so no artifact may call clearing a floor economically meaningful. A future optional contract block with its own provenance — who priced the consequence, in what currency, dated — is sketched and stays unimplemented until a study registers one.

  5. A small one worth copying. On near-separable evaluation folds the recalibration intercept and slope are separation markers, not calibration readings: E0001 reports 16.99 and 8.27, which say the maximum-likelihood fit diverged, not that the model is badly calibrated. Any small-n study should carry that caveat in its registered auxiliary block.

Open questions for a study 10

A sealed re-check needs a new protocol, not a retry. This study's band check is unfulfilled and its seal is spent; nothing about that is repairable inside its own ledger. What a successor can do is register a new protocol — new split, new bands, its own branch sentences — and smoke the sealed configuration before the confirmation acknowledgement, which is precisely the repair the crash argues for. The unfulfilled band stays unfulfilled in the record either way.

Run the learning-curve arena where headroom actually exists. Study 08's closing suggestion survives its successor unchanged, and now with a sharper reason: across three studies on this pair, the incumbent's error and the lottery's own spread scale together at every rung, so shrinking the data fogs the game rather than opening it. The question "does a modern tabular model earn its keep when data runs out" needs a problem where the incumbent sits many floor units above zero. The motor-insurance frequency and severity studies and the hurricane return-level work are all in this repository.

The companions. Study 07 asked the question with six challengers and one sealed look; study 08 re-asked it with a larger roster and a data ladder; study 09 asks what the ruler could have resolved in the first place. Read in order they make one point: the third study exists because the first two published enough detail to be attacked, including by themselves.

The repository, all three studies, and the framework that enforced them are at github.com/Xiang-Shan/klein-auto-research.