From 007bfe0ddc8035d7831dd7626dcf075f3c23b258 Mon Sep 17 00:00:00 2001 From: Branimir Georgiev <66906831+braboj@users.noreply.github.com> Date: Sun, 1 Nov 2026 17:20:18 +0200 Subject: [PATCH 1/2] docs: requirements in imbrain's format, coverage apart, chapter 10 as a pointer requirements.md now states each functional rule as "The benchmark shall" with the script that delivers it, adds quality requirements by ISO/IEC 25010:2023 characteristic and a table of test artefacts. The self-test labels move to coverage.md, which trace.py reads beside it. Chapter 10 points to both, and its measurements move to validation.md as tables. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01DpT5xPFWEQr1bipxbbKBRF --- AGENTS.md | 7 +- .../architecture/01-introduction-and-goals.md | 4 +- docs/architecture/06-runtime-view.md | 2 +- docs/architecture/08-crosscutting-concepts.md | 2 +- docs/architecture/10-quality-requirements.md | 347 +------------- docs/coverage.md | 192 ++++++++ docs/journeys/check/check-the-judge.md | 2 +- docs/requirements.md | 447 +++++++++++------- docs/validation.md | 267 +++++++++++ tests/efficacy/trace.py | 217 +++++---- 10 files changed, 880 insertions(+), 607 deletions(-) create mode 100644 docs/coverage.md create mode 100644 docs/validation.md diff --git a/AGENTS.md b/AGENTS.md index 41bc83c..de0b3aa 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -26,9 +26,10 @@ py tests/efficacy/trace.py py -m pyflakes tests ``` -`trace.py` runs every self-test and fails on a rule in -[`docs/requirements.md`](docs/requirements.md) whose checks no self-test -prints. A new rule gets a row there, and a new check its label. +`trace.py` runs every self-test and fails on a requirement in +[`docs/requirements.md`](docs/requirements.md) with no row in +[`docs/coverage.md`](docs/coverage.md), or on a label there no self-test +prints. A new rule gets a row in both, and a new check its label. A self-test makes no model call and runs no trial. Running a trial or a judging spends a plan's limit, so ask first. diff --git a/docs/architecture/01-introduction-and-goals.md b/docs/architecture/01-introduction-and-goals.md index 3ddb7ac..8e94fc4 100644 --- a/docs/architecture/01-introduction-and-goals.md +++ b/docs/architecture/01-introduction-and-goals.md @@ -52,8 +52,8 @@ What it is not: ## 1.2 Quality goals -The five goals that shape the architecture most, in order. Chapter 10 -gives each its scenarios. +The five goals that shape the architecture most, in order. The quality +requirements in [requirements.md](../requirements.md) make each measurable. | # | Goal | What it means | | - | ---- | ------------- | diff --git a/docs/architecture/06-runtime-view.md b/docs/architecture/06-runtime-view.md index 2966f04..b7d7ae6 100644 --- a/docs/architecture/06-runtime-view.md +++ b/docs/architecture/06-runtime-view.md @@ -78,7 +78,7 @@ built. **Bounds.** A trial ends at $100 of the CLI's own cost figure or at two hours. The timeout is the bound that shapes a trial; the budget stops a -runaway. [ch. 10.6](10-quality-requirements.md) gives the figures behind them. +runaway. [Validation](../validation.md) gives the figures behind them. **Records.** Transcript, token usage, turns, wall time and cost are kept, and the record says which bound ended the trial. The workspace is frozen as diff --git a/docs/architecture/08-crosscutting-concepts.md b/docs/architecture/08-crosscutting-concepts.md index a5f28e2..1a4c783 100644 --- a/docs/architecture/08-crosscutting-concepts.md +++ b/docs/architecture/08-crosscutting-concepts.md @@ -479,7 +479,7 @@ holding when it was never tested. **When to re-run it.** Whenever the judge model, its effort, or the rubric prompt changes. Each change silently invalidates every earlier reading. The -measured results are in [ch. 10.7](10-quality-requirements.md). +measured results are in [validation](../validation.md). #### Why the bases are pinned archives diff --git a/docs/architecture/10-quality-requirements.md b/docs/architecture/10-quality-requirements.md index 613ed73..f287990 100644 --- a/docs/architecture/10-quality-requirements.md +++ b/docs/architecture/10-quality-requirements.md @@ -1,340 +1,11 @@ # 10. Quality requirements -The quality goals of chapter 1, each made testable by scenarios. A -scenario names a stimulus, the response the benchmark must give, and the -[requirements](../requirements.md) it rests on, whose rows name the checks. - -## 10.1 Q1, fairness - -| # | Stimulus | Response | Rests on | -| - | -------- | -------- | ---------- | -| Q1-1 | The model's behaviour drifts during a round | The drift lands across every arm of a block, not on one arm | FR-02-01 | -| Q1-2 | An agent writes its own `ruff.toml` | Every arm is still measured under `toolconfig/` | FR-07-03 | -| Q1-3 | A trial packages its tests in an extra | Coverage still runs, from the trial's declared groups within the lock | FR-07-06 | -| Q1-4 | The spec requires HTMX, whose attributes HTML lacks | HTML validity sets aside `hx-*` errors and records how many | FR-09-03 | -| Q1-5 | The model drifts within one block | No arm always runs first or last: each block starts one arm later | FR-02-01 | - -## 10.2 Q2, pre-registration - -| # | Stimulus | Response | Rests on | -| - | -------- | -------- | ---------- | -| Q2-1 | In a round registered at K = 3, a primary's interval contains zero while its mean exceeds the smallest change that matters | The report names the rows that owe K = 5 and the command that settles it | FR-03-01 | -| Q2-2 | Someone asks for more blocks than the round allows | The harness refuses past 5, or past 15 for a round-5 run, and the report refuses a run past them | FR-03-02, FR-03-04 | -| Q2-3 | A check is added after the results were seen | It prints in its own section with no verdict | FR-12-08 | -| Q2-4 | A grader is found to measure something else | Every run that revision graded loses the metric, named with its reason | FR-12-09 | -| Q2-5 | A round-5 run holds fewer than its 15 blocks | The report calls it part-run and names the blocks still owed | FR-03-05 | - -## 10.3 Q3, isolation - -| # | Stimulus | Response | Rests on | -| - | -------- | -------- | ---------- | -| Q3-1 | The owner has a global `CLAUDE.md` | The bare arm never sees it, and the harness refuses a root a context file above it would reach | FR-05-01 | -| Q3-2 | A trial runs `git clone` of the hidden suite in its shell | The clone has no credentials, the transcript scan flags it, and the trial is voided and re-run once | FR-05-05, FR-05-07 | -| Q3-3 | An agent stops its dev server by process name | The command is denied. One that ran voids the trial | FR-05-06, FR-05-07 | -| Q3-4 | A background server outlives the CLI | Every process from the trial's directories is stopped before the freeze | FR-05-09 | - -## 10.4 Q4, honest measurement - -| # | Stimulus | Response | Rests on | -| - | -------- | -------- | ---------- | -| Q4-1 | A tool is pointed at an empty `src/` | The metric is missing, not zero, and the report shows the files and lines each tool saw | FR-06-01, FR-07-05 | -| Q4-2 | The judge returns scores without reading the code | The evidence check finds its quotes missing from the bundle | FR-10-06 | -| Q4-3 | A judge row cannot move | The control fixture shows it fail to fall on a damaged tree or rise on an improved one | FR-10-07, FR-10-09 | -| Q4-4 | An app will not sign in its administrator | Every probe that needs it fails with the reason, so the rate cannot rise by not reaching it | FR-06-03 | - -## 10.5 Q5, reproducibility - -| # | Stimulus | Response | Rests on | -| - | -------- | -------- | ---------- | -| Q5-1 | The run root is deleted after a round | The archive restores it, and scoring and judging run on the restored root | FR-13-05 | -| Q5-2 | A reading changes after the archive was verified | The report refuses to write under `docs/audits/` | FR-13-04 | -| Q5-3 | A run stops part way | The run record holds every trial it finished, and `--from` resumes at the next | FR-04-08 | -| Q5-4 | A later template revision is to be measured | The same harness runs it as a candidate against the baseline, both in one round | Design, [ch. 4.2](04-solution-strategy.md) | -| Q5-5 | A report is aimed at any `docs/audits/` before the round is archived | Refused, in the templates source as anywhere else | FR-13-04 | - -## 10.6 The numbers behind the rules - -**Why three trials cannot reach significance.** Three paired differences -give a bootstrap 27 distinct resamples and an exact sign test a minimum -two-sided p of 0.25. - -**Why the judge reads each tree three times.** - -- **Measured:** six judgings of one unchanged bundle returned readability - 4, 4, 4, 3, 4, 4. Mean 3.83, sample SD 0.41. -- **Effect:** about 0.33 standard error on a difference of two arm means at - K = 3. -- **Why it mattered:** readability was the only primary that moved in - rounds 1 and 2, so every verdict rested on the row that was not - reproducible. -- **The fix:** three judgings cut that standard error by about 40 %. -- **Rows that did not need it:** eight of the eleven returned the same - score on all six calls. - -**Why the budget is $100 and the timeout two hours.** The CLI prices -`claude-sonnet-5` at $5 per million input tokens and $25 per million output. -It checks the budget between turns, so a trial can pass it by one turn's -cost. The agent that built the hidden suite's reference implementation, on -a stronger model, spent about $13 at that rate in 26 minutes. At that pace a -two-hour trial stays under the cap. - -**How the hidden suite was validated.** - - -534 build checks across 18 modules and 74 change checks in -`braboj/tariff-hidden-suite`, validated before round 3's first trial. - - -- A reference implementation written from the spec alone passes every - build check, so a correct implementation is not marked wrong. -- A second agent made the change task on that reference from the change - prompt alone. It passes every change check, and the build suite still. -- A mutation control plants twelve spec violations one at a time, and the - suite catches all twelve. -- The pre-round-3 reference, which has no sign-in, fails the sign-in - module, so its checks cannot pass without a gate. - -## 10.7 Judge validation results - -Each run of the control fixture, dated, with the judge and rubric it read -under. A row is trusted once it falls and rises on its target trees under the -rounds' judge. - -### Before the primaries were anchored, 2026-09-18 - -Judge `gpt-6-astra` at effort `high`, evidence found 100 % on every judging. -Three trees; the rubric said only that 1 was poor and 5 excellent. - -| Dimension | base-1 | degraded-1 | improved-1 | -|---|---|---|---| -| design | 3 | **2** | 3 | -| maintainability | 3 | **2** | 3 | -| readability | 4 | **3** | 4 | -| dip | 5 | **1** | 5 | -| srp | 3 | **2** | 3 | -| error_design | 2 | **1** | **3** | -| ocp | 2 | 2 | **3** | -| lsp | 2 | 2 | **3** | -| isp | 4 | 4 | 4 | -| naming_and_abstraction | 4 | 4 | 4 | -| test_quality | 4 | 3 | 3 | - -`design` and `maintainability` fell on damage and did not rise on improvement. -On the improved tree the evidence line the judge quoted *for* `design` was -`class Rule(ABC):` — it cited the improvement and scored it 3 anyway. The -component rows moved in both directions. - -Six judgings of one byte-identical `base-1` bundle returned readability 4, 4, -4, 3, 4, 4 — mean 3.83, SD 0.41 — while eight of the eleven rows returned the -same integer every time. That is why a round judges each trial several times -and means them. - -### After anchoring, 2026-09-19 - -Six trees, one judging each unless stated, evidence 100 % on every judging -counted. A bold cell differs from `base-1` in the same run. - -#### gpt-6-astra at effort `high`, the judge the rounds use - -| Dimension | base-1 | degraded-1 | obscured-1 | improved-1 | improved-2 | improved-3 | -|---|---|---|---|---|---|---| -| **design** | 3 | **2** | 3 | 3 | **3.5** | **4** | -| **readability** | 3 | 3 | **1** | 3 | 3 | 3 | -| **maintainability** | 3 | 3 | 3 | 3 | 3 | **4** | -| dip | 5 | **1** | 5 | 5 | 5 | 5 | -| srp | 3 | **2** | 3 | 3 | 3 | 3 | -| error_design | 2 | **1** | 2 | **3** | **3** | **3** | -| ocp | 2 | 2 | 2 | **3** | **3** | **3** | -| lsp | 3 | **2** | **2** | 3 | 3 | 3 | -| isp | 4 | 4 | 4 | 4 | 4 | 4 | -| naming_and_abstraction | 4 | **3** | **2** | 4 | 4 | 4 | -| test_quality | 3 | 3 | **4** | **4** | **4** | **4** | - -`improved-2` holds two judgings, meaned. The top-up to three per tree stopped -on the judge plan's usage limit after one call; the next section completes it. - -#### Opus 5 through the claude backend, a cross-check on the rubric - -| Dimension | base-1 | degraded-1 | obscured-1 | improved-1 | improved-2 | improved-3 | -|---|---|---|---|---|---|---| -| **design** | 3 | **2** | 3 | **4** | **4** | **4** | -| **readability** | 4 | **3** | **2** | 4 | 4 | 4 | -| **maintainability** | 3 | **2** | 3 | **4** | **4** | **4** | -| dip | 4 | **1** | **5** | **5** | **5** | **5** | -| srp | 3 | 3 | 3 | **4** | **4** | **4** | -| error_design | 3 | **1** | 3 | **4** | 3 | **4** | -| ocp | 2 | 2 | 2 | **3** | **3** | **4** | -| lsp | 3 | **2** | 3 | **4** | **4** | **4** | -| isp | 4 | 4 | 4 | **3** | 4 | **3** | -| naming_and_abstraction | 4 | **3** | **2** | 4 | 4 | 4 | -| test_quality | 4 | **3** | 4 | 4 | 4 | 4 | - -Opus 5 shares a vendor with the generator, so it cannot judge a round. It is -here to ask whether the rubric's behaviour belongs to the rubric or to one -model. - -#### What the two say together - -Under both judges, every primary falls on the tree built to damage it and -rises on a tree built to improve it: - -- `design` falls to 2 on `degraded-1` and reaches 4 on the improved trees -- `readability` falls on `obscured-1`, to 1 under gpt-6-astra and to 2 under - Opus 5 -- `maintainability` reaches 4 once no layer names a kind, which is the tree - `improved-3` was built to be - -The judges differ in threshold, not in direction. Opus 5 credits the -improvement already at `improved-1`; gpt-6-astra waits for `improved-3`. An -arm has to improve more to register under the rounds' judge than under this -one. - -Single judgings vary between runs of the same prompt. `design` on -`improved-1` read 4 in three earlier anchored runs and 3 in this one, and -`maintainability` on `degraded-1` read 2 in two earlier runs and 3 in this -one. Those are the flips repeat judging exists to average out, and why a row -is read against its target tree across more than one run before it is -trusted. - -The repair is tracked in solid-ai-templates#1827. - -### Three judgings per tree, 2026-09-25 - -gpt-6-astra at effort `high`, the same root as the single judgings above, -topped up with `--repeat 3`. Evidence found 100 % on every judging. Each -cell is the mean, followed by the three scores; a bold cell differs from -`base-1`. - -| Dimension | base-1 | degraded-1 | obscured-1 | improved-1 | improved-2 | improved-3 | -|---|---|---|---|---|---|---| -| **design** | 3.00 (333) | **2.00** (222) | 3.00 (333) | **3.67** (344) | **3.67** (434) | **4.00** (444) | -| **readability** | 3.00 (333) | 3.00 (333) | **1.00** (111) | 3.00 (333) | 3.00 (333) | **3.33** (343) | -| **maintainability** | 3.00 (333) | **2.33** (223) | 3.00 (333) | 3.00 (333) | 3.00 (333) | **4.00** (444) | - -Averaged over three, every primary falls on the tree built to damage it and -rises on a tree built to improve it. `design` and `maintainability` fall on -`degraded-1`, `readability` falls on `obscured-1`, and all three rise on -`improved-3`. The one-point flips of single judgings remain inside each -triple, which is what the mean is there to absorb. - -### Five primaries, and a new judge, 2026-09-25 - -Every run below judges each tree three times; a cell is the mean. Evidence -was found 100 % on every judging. - -#### gpt-6-astra, security and data protection as first anchored - -The second application's trees, the only ones built to move these two rows: - -| Dimension | base-2 | insecure-1 | secured-1 | leaky-1 | protected-1 | -|---|---|---|---|---|---| -| security | 4.00 | **2.00** | 4.00 | 4.00 | 4.00 | -| data_protection | 5.00 | 5.00 | 5.00 | **2.00** | 5.00 | - -Both rows fell on the tree that damages them and rose on neither. `base-2` -already met most of what the 5s described, so no improvement had room to -register. The 3s were rewritten to describe the common defences and nothing -more, and the 5s to ask for what only the improved trees have. - -The re-run under those anchors stopped on the judge plan's weekly limit -after 16 of 33 judgings, with `secured-1` not yet judged. What it had read -put `base-2` at 3 on both rows, `insecure-1` and `leaky-1` at 1 on theirs, -and `protected-1` at 5. The plan allows about thirty judgings a week and a -round needs three times as many, so the rounds' judge became -`claude-opus-5-5` ([ch. 8.6.6](../architecture/08-crosscutting-concepts.md)). - -A first run through the claude backend recorded effort `high` but never -passed it, so the CLI ran at its own default. Its readings are not counted; -the backend now passes the effort, and a self-test check fails without it. - -#### claude-opus-5-5 at effort `high` - -| Dimension | base-1 | degraded-1 | obscured-1 | improved-1 | improved-2 | improved-3 | -|---|---|---|---|---|---|---| -| design | 2.00 | 2.00 | 2.33 | 3.00 | 3.00 | **4.00** | -| readability | 3.00 | 2.67 | **1.67** | 3.33 | 3.33 | **3.67** | -| maintainability | 3.00 | **2.00** | 3.00 | 3.00 | 3.00 | **4.00** | - -| Dimension | base-2 | insecure-1 | secured-1 | leaky-1 | protected-1 | -|---|---|---|---|---|---| -| security | 3.00 | **1.00** | **4.67** | 3.00 | 3.00 | -| data_protection | 3.00 | 3.00 | 3.00 | **1.00** | **4.00** | - -Four rows fall and rise. `design` rises but does not fall: the judge quoted -the same concrete-class dispatch for `base-1` and `degraded-1` and scored -both 2, reading the 3's description of that dispatch as a fault below it. -The damage `degraded-1` adds, the domain merged and importing Flask, moved -`maintainability` instead. The 1 now names that damage, and the 3 says the -dispatch alone, with the layers kept apart, is not lower. - -#### claude-opus-5-5 at effort `high`, design re-anchored - -The rounds' judge and rubric as they stand. - -| Dimension | base-1 | degraded-1 | obscured-1 | improved-1 | improved-2 | improved-3 | -|---|---|---|---|---|---|---| -| design | 2.67 | **1.00** | 3.00 | **3.67** | **4.00** | **4.00** | -| readability | 3.00 | 2.00 | **1.67** | 3.33 | 3.00 | 3.33 | -| maintainability | 3.00 | **2.00** | 3.00 | 3.00 | 3.00 | **4.00** | - -| Dimension | base-2 | insecure-1 | secured-1 | leaky-1 | protected-1 | -|---|---|---|---|---|---| -| security | 3.00 | **1.00** | **5.00** | 3.00 | 3.00 | -| data_protection | 3.00 | 3.00 | 3.00 | **1.00** | **4.00** | - -Every primary falls on the tree built to damage it and rises on one built to -improve it, and each row of the second application holds still on the trees -built to move another. The 33 judgings used about 1 % of the owner's weekly -plan. - -### gpt-6-astra as round 5 registers it, 2026-10-28 - -The judge round 5 registers: `gpt-6-astra` through `codex exec` at effort -`high`, three judgings per tree, under the rubric as it stands. All 33 -judgings took, with evidence found 100 % on every one. Each cell is the mean, -followed by the three scores; a bold cell differs from its application's base -tree. - -| Dimension | base-1 | degraded-1 | obscured-1 | improved-1 | improved-2 | improved-3 | -|---|---|---|---|---|---|---| -| design | 3.00 (333) | **1.00** (111) | 3.00 (333) | **4.00** (444) | **4.00** (444) | **4.00** (444) | -| readability | 3.00 (333) | 3.00 (333) | **1.00** (111) | 3.00 (333) | 3.00 (333) | 3.00 (333) | -| maintainability | 3.00 (333) | **1.33** (121) | 3.00 (333) | 3.33 (433) | 3.67 (434) | **4.00** (444) | - -| Dimension | base-2 | insecure-1 | secured-1 | leaky-1 | protected-1 | -|---|---|---|---|---|---| -| security | 3.00 (333) | **1.00** (111) | **5.00** (555) | 3.00 (333) | 3.00 (333) | -| data_protection | 3.00 (333) | 3.00 (333) | 3.00 (333) | **1.00** (111) | **5.00** (555) | - -Four primaries fall on the tree built to damage them and rise on one built -to improve them. `readability` falls on `obscured-1` but reads 3 on every -improved tree, none of which was built to improve it. So `clarified-1`, the -mirror of `obscured-1`, was added to the control and judged in the same root, -three times: - -| Dimension | base-1 | clarified-1 | -|---|---|---| -| design | 3.00 (333) | 3.00 (333) | -| readability | 3.00 (333) | **3.67** (434) | -| maintainability | 3.00 (333) | 3.00 (333) | - -`readability` rises on the tree built to improve it, and the other two rows -hold still there. With that, every primary falls on the tree built to damage -it and rises on one built to improve it. The rise is the smallest in the -run: one of the three judgings read 3, so a single judging would have missed -it. The second application's rows hold still on the trees built to move -another. - -The re-anchored rubric reads the same under gpt-6-astra as under -claude-opus-5-5, with sharper steps: `design` reaches 4 from `improved-1`, and -the four rows of the second application read 1 or 5 on all three judgings. - -`security` is also read on the first application, where no tree is built to -move it. There its triples spread from 2 to 4, a one-point flip between -judgings of the same bundle, which the three judgings per trial are there to -absorb. - -The first 33 judgings took 70 minutes and used about 11 % of the OpenAI -plan's weekly limit: it read 3 % used before and 14 % after. A block of 75 -trials at three judgings each would take about 75 %. The three judgings of -`clarified-1` came after. +The quality requirements, one section per ISO/IEC 25010:2023 +characteristic, are kept with the functional requirements in +[requirements.md](../requirements.md), so every requirement lives in one +place under one ID scheme. Chapter 1 ranks the five quality goals they make +measurable. + +The measurements behind them, the hidden suite's validation, the trial +bounds and every run of the judge's control fixture, are in +[validation.md](../validation.md). diff --git a/docs/coverage.md b/docs/coverage.md new file mode 100644 index 0000000..18b742f --- /dev/null +++ b/docs/coverage.md @@ -0,0 +1,192 @@ +# Requirement coverage + +- **Scope:** each live functional requirement of + [requirements.md](requirements.md), with the self-test checks that prove + it, or the reason it has none. +- **Checked by:** a module under `tests/efficacy/` and the label its + `--self-test` prints for the check, one per line. +- **Gaps:** a row of kind Missing names the issue that adds its check. + +`trace.py` runs every self-test, or reads their saved output, and fails +when: + +| Check | Fails when | +| ----- | ---------- | +| Every requirement | A live FR has no row, or a row names an FR that is removed or absent | +| Known kinds | A row's kind is not one of the Kinds table | +| Printed | A Self-test row names a label that module's self-test does not print | +| Gaps tracked | A Missing row names no issue | +| Reasons given | An Untestable row gives no reason | +| Well formed | A line opening an FR row does not parse | + +## Kinds + +| Kind | Use when | +| ---- | -------- | +| Self-test | One or more self-test checks prove the rule | +| Untestable | No script can see the rule, such as a working practice; the cell says why | +| Missing | A script follows the rule but no self-test plants it yet; the cell names the issue | + +## 01 Functional suitability + +| ID | Kind | Checked by | +| -- | ---- | ---------- | +| FR-01-01 | Self-test | `report.py` "one landed after the first trial is refused"
`report.py` "one merged after the first trial is read at the merge"
`report.py` "a registration landed before the first trial passes, across zones" | +| FR-01-02 | Self-test | `report.py` "one changed and not committed is refused"
`report.py` "an amendment on a branch of its own is refused" | +| FR-01-03 | Self-test | `report.py` "a trial on another spec is refused"
`report.py` "a trial on another prompt is refused"
`report.py` "every trial on the registered spec passes"
`report.py` "every trial on the one prompt passes" | +| FR-01-04 | Self-test | `report.py` "a scorable trial recording no spec is refused"
`report.py` "a scorable trial recording no prompt is refused" | +| FR-01-05 | Self-test | `harness.py` "a spec edited mid-run refuses the next trial unbuilt"
`harness.py` "a spec changed as it is copied refuses the trial and frees its slot"
`harness.py` "a round-5 run on other content is refused"
`harness.py` "round 5's registered digest is SPEC.md's content" | +| FR-01-06 | Self-test | `report.py` "a trial start with no UTC offset is refused" | +| FR-01-07 | Untestable | How a commit reached `main` is the owner's practice, and no script sees it. | + +## 02 Performance efficiency + +| ID | Kind | Checked by | +| -- | ---- | ---------- | +| FR-02-01 | Self-test | `harness.py` "each block starts one arm later"
`harness.py` "over five blocks every arm runs in every place" | +| FR-02-02 | Self-test | `report.py` "every pairing improves by the same amount -> better"
`report.py` "every pairing improves, unstably -> better"
`report.py` "three identical differences -> better"
`report.py` "the differences change sign -> no improvement shown"
`report.py` "a downward metric that fell -> better"
`report.py` "a downward metric that rose -> worse" | +| FR-02-03 | Self-test | `report.py` "10 more lines on 100 is preserved"
`report.py` "20 more lines on 100 is not"
`report.py` "1.5 more per KLOC on 20 is preserved"
`report.py` "3 more per KLOC on 20 is not"
`report.py` "no baseline makes no relative claim" | +| FR-02-04 | Self-test | `report.py` "every per-KLOC row carries the static margin"
`report.py` "every primary the judge asks for is led with, worded and given its margins" | +| FR-02-05 | Self-test | `report.py` "round 5 holds adherence within one item, 8 pp" | +| FR-02-06 | Self-test | `report.py` "a rise inside the band is held"
`report.py` "a rise wholly past the band is worse"
`report.py` "one that straddles the band is undecided"
`report.py` "a band that holds zero is held"
`report.py` "round 5 reads a 10 % rise in app code as held" | +| FR-02-07 | Missing | #109 | +| FR-02-08 | Missing | #109 | +| FR-02-09 | Self-test | `report.py` "from six blocks no interval is called descriptive"
`report.py` "a round too small to decide says so in the report and the appendix" | + +## 03 Trial count and escalation + +| ID | Kind | Checked by | +| -- | ---- | ---------- | +| FR-03-01 | Self-test | `report.py` "a crossing interval with an effect of 0.67 owes it"
`report.py` "an effect of 0.67 the other way owes it"
`report.py` "the same row on C-A owes it"
`report.py` "an effect of exactly 0.5 does not"
`report.py` "an interval clear of zero does not"
`report.py` "an interval not computed does not"
`report.py` "a row outside the primary dimensions does not" | +| FR-03-02 | Self-test | `harness.py` "a K past the escalation's ceiling refuses"
`harness.py` "the escalation runs its blocks from none-4"
`report.py` "an owed escalation's command names a trial the harness takes" | +| FR-03-03 | Self-test | `report.py` "an escalated report prints both vectors"
`report.py` "the report carries the escalation section"
`report.py` "a K = 5 run is judged on its first three blocks"
`report.py` "a K = 3 run is assessed on its own vector"
`report.py` "an open row leaves both inconclusive" | +| FR-03-04 | Self-test | `harness.py` "a round-5 run takes K = 15 and refuses more"
`harness.py` "a round-5d run of hand and short takes K = 15 too" | +| FR-03-05 | Self-test | `report.py` "one trial of the last block leaves the round part-run"
`report.py` "a round 5 run short of its last block says it is provisional"
`report.py` "a round-5 run owes no escalation and names the blocks still owed" | + +## 04 Failed and lost trials + +| ID | Kind | Checked by | +| -- | ---- | ---------- | +| FR-04-01 | Self-test | `harness.py` "a clean finish is completed"
`harness.py` "the budget cap is budget"
`harness.py` "one that never answers is ended at the timeout"
`score.py` "only completed, budget and timeout endings are offered, under the arms' words" | +| FR-04-02 | Self-test | `judge.py` "only a build that did not install goes unjudged"
`report.py` "a build that did not install has its judge rows missing" | +| FR-04-03 | Untestable | The harness has no path that re-runs a trial ended by the agent; FR-04-04 proves only a lost one re-runs. | +| FR-04-04 | Self-test | `harness.py` "a usage limit, by its wording is blocked"
`harness.py` "a rate limit, by its status is blocked"
`harness.py` "an error behind a zero status is blocked"
`harness.py` "an error subtype nobody listed is blocked"
`harness.py` "no JSON at all is blocked" | +| FR-04-05 | Self-test | `harness.py` "a blocked trial re-runs in its place"
`harness.py` "the re-run names the trial it substitutes"
`score.py` "a blocked trial yields to its re-run" | +| FR-04-06 | Self-test | `harness.py` "a voided workspace is kept under void/"
`harness.py` "a voided trial takes its whole pen and its tarball" | +| FR-04-07 | Self-test | `harness.py` "a second block stops the run" | +| FR-04-08 | Self-test | `harness.py` "--from short-2 starts there and keeps the order"
`harness.py` "--from an unknown trial refuses"
`harness.py` "no trial stays recorded as running" | + +## 05 Reliability + +| ID | Kind | Checked by | +| -- | ---- | ---------- | +| FR-05-01 | Self-test | `harness.py` "the scratch home is the home"
`harness.py` "the settings file carries the rules and the isolation"
`harness.py` "a trial reads the workspace's project settings and no other source" | +| FR-05-02 | Self-test | `harness.py` "ANTHROPIC_API_KEY is removed"
`harness.py` "CLAUDECODE is removed"
`harness.py` "VIRTUAL_ENV is removed"
`harness.py` "the interpreter leaves PATH" | +| FR-05-03 | Self-test | `harness.py` "other trials, their change tasks, home and void are denied"
`harness.py` "this repository and the scoring area are denied"
`harness.py` "tarballs and run records are denied"
`harness.py` "the templates source is denied whenever one is set"
`harness.py` "the trial's own workspace is not denied" | +| FR-05-04 | Missing | #109 | +| FR-05-05 | Self-test | `harness.py` "a planted Git helper answers outside a trial"
`harness.py` "it does not answer inside one" | +| FR-05-06 | Self-test | `harness.py` "every kill by name meets a deny rule" | +| FR-05-07 | Self-test | `harness.py` "every call reaching past the trial is flagged"
`harness.py` "the root, another pen and a climb out of the pen are flagged"
`harness.py` "a fetch of the templates is flagged, and only that"
`harness.py` "a kill by name that ran, or never answered, is a hit"
`harness.py` "a scorable trial with a reach becomes reached"
`harness.py` "the trial's own paths are not flagged, a pip extra included" | +| FR-05-08 | Self-test | `report.py` "its record's clean scan is read again and flagged"
`report.py` "a trial whose scan hit is named"
`report.py` "a reached build trial is left out whole" | +| FR-05-09 | Self-test | `harness.py` "the one running from the trial is stopped"
`harness.py` "two planted processes run and are listed"
`harness.py` "the record lists what was stopped" | + +## 06 Security + +| ID | Kind | Checked by | +| -- | ---- | ---------- | +| FR-06-01 | Self-test | `score.py` "empty tree: ruff is missing, not zero"
`score.py` "empty tree: mypy is missing, not zero"
`score.py` "empty tree: coverage is missing, not zero"
`score.py` "tools absent: ruff is missing, not zero"
`score.py` "tools absent: bandit is missing, not zero"
`score.py` "an empty tree reports nothing seen"
`score.py` "a failed listing is missing, never an empty list" | +| FR-06-02 | Self-test | `score.py` "a skipped check is recorded beside the rate"
`score.py` "a partial suite is flagged"
`score.py` "a suite that skipped nothing is not partial" | +| FR-06-03 | Self-test | `security.py` "an application that will not boot loses every runtime probe"
`security.py` "an administrator that cannot sign in loses what needs one"
`security.py` "the lost probes count against the rate" | +| FR-06-04 | Self-test | `security.py` "no report from the probe is missing, not lost"
`security.py` "an audit of nothing is missing, not zero"
`security.py` "a report that is not JSON is missing"
`security.py` "no roots is missing, not zero" | +| FR-06-05 | Self-test | `report.py` "an unmeasured column reads not measured"
`report.py` "an unmeasured run answers Not measured in every cell" | + +## 07 Maintainability + +| ID | Kind | Checked by | +| -- | ---- | ---------- | +| FR-07-01 | Self-test | `score.py` "the battery installs from a lock it resolved" | +| FR-07-02 | Self-test | `score.py` "only the tools reach the lock"
`score.py` "the lock carries none of the trial's dependencies" | +| FR-07-03 | Missing | #109 | +| FR-07-04 | Self-test | `score.py` "a scoring environment runs the spec's Python"
`score.py` "no Python at the spec's version refuses to score"
`score.py` "a score on another Python refuses the root"
`report.py` "scores on two Pythons are refused" | +| FR-07-05 | Self-test | `score.py` "the planted package is discovered"
`score.py` "an empty tree yields no roots" | +| FR-07-06 | Self-test | `score.py` "every extra and every group requirement is installed" | +| FR-07-07 | Missing | #109 | + +## 08 Flexibility + +| ID | Kind | Checked by | +| -- | ---- | ---------- | +| FR-08-01 | Self-test | `judge.py` "the trial's code reaches the bundle"
`judge.py` "scoring's output and the environment's stay out of the bundle"
`judge.py` "the skills arm's skills stay out of the bundle" | +| FR-08-02 | Missing | #109 | +| FR-08-03 | Self-test | `judge.py` "a path naming the trial is a leak"
`judge.py` "an escaped path naming the trial is a leak"
`judge.py` "a leak in a directory the copy skips is found"
`judge.py` "a bundle holding neither has no leak"
`generate_arm.py` "the leak scan reports a planted token and passes clean text" | + +## 09 Scoring + +| ID | Kind | Checked by | +| -- | ---- | ---------- | +| FR-09-01 | Self-test | `harness.py` "the scoring area lies outside the run root"
`harness.py` "this repository and the scoring area are denied" | +| FR-09-02 | Self-test | `score.py` "an application that seeds on start, and has no default secret, boots under scoring"
`score.py` "a build capped below Python 3.13 installs" | +| FR-09-03 | Self-test | `score.py` "an hx-* error is set aside and another counts" | +| FR-09-04 | Self-test | `score.py` "app code is the app's Python and templates, not its tests"
`score.py` "test code is a tests directory or a pytest name, anywhere"
`score.py` "docs and configuration count toward no size"
`score.py` "committed bytecode and a database are artifacts nobody asked for" | +| FR-09-05 | Missing | #109 | +| FR-09-06 | Missing | #109 | +| FR-09-07 | Self-test | `score.py` "churn counts an edit and a new file, not an environment"
`score.py` "the churn plant landed" | +| FR-09-08 | Self-test | `harness.py` "the change prompt names the API and fields the grader drives"
`harness.py` "the change prompt is read whole from its file" | +| FR-09-09 | Untestable | An order of work; the round's registration fixes it. | + +## 10 The judge + +| ID | Kind | Checked by | +| -- | ---- | ---------- | +| FR-10-01 | Self-test | `judge.py` "each tree is read three times by default"
`report.py` "a trial's repeats are meaned, and one judging means itself" | +| FR-10-02 | Self-test | `judge.py` "the default judge is gpt-6-astra through codex"
`judge.py` "the default effort is high"
`judge.py` "the codex command carries the model and the effort"
`judge.py` "the recorded effort is the one passed" | +| FR-10-03 | Self-test | `judge.py` "it may read and nothing else"
`judge.py` "the claude backend is not in plan mode" | +| FR-10-04 | Self-test | `report.py` "agreement is counted per row over the trials both read" | +| FR-10-05 | Self-test | `report.py` "a direction the other judge reverses loses its verdict"
`report.py` "a direction both judges read keeps its verdict"
`report.py` "a contrast the other judge did not read keeps its verdict"
`report.py` "the rounds' own judge is caught posing as the other" | +| FR-10-06 | Self-test | `report.py` "the judge is checked by its evidence, not a person" | +| FR-10-07 | Self-test | `control/control.py` "the domain imports flask"
`control/control.py` "ValidationError derives from TariffError"
`control/control.py` "the secret key is a literal"
`control/control.py` "customer data is written to the log" | +| FR-10-08 | Missing | #109 | +| FR-10-09 | Untestable | A judged control root is read by hand, and [validation](validation.md) records each reading. | + +## 11 Security and data protection + +| ID | Kind | Checked by | +| -- | ---- | ---------- | +| FR-11-01 | Self-test | `security.py` "exposed fails every probe"
`security.py` "hardened passes every probe"
`security.py` "exposed rates are zero"
`security.py` "hardened rates are whole" | +| FR-11-02 | Self-test | `security.py` "exposed signs in"
`security.py` "hardened signs in" | +| FR-11-03 | Self-test | `security.py` "every planted secret form is counted"
`security.py` "every planted debug form is counted"
`security.py` "every planted assembled statement is counted"
`security.py` "parameters, plain f-strings and constant names are not assembled SQL"
`security.py` "hardened source finds no secret" | +| FR-11-04 | Self-test | `security.py` "every vulnerability of every package is counted" | +| FR-11-05 | Self-test | `security.py` "public pages with a forgeable sign-in fail only its CSRF probe"
`security.py` "public pages with a token-checked sign-in pass every probe"
`security.py` "a refused forgery passes though a failed sign-in answers as a real one" | +| FR-11-06 | Self-test | `report.py` "every probe rate reads the rate security.py files" | + +## 12 The report + +| ID | Kind | Checked by | +| -- | ---- | ---------- | +| FR-12-01 | Self-test | `report.py` "a contrast crossing rounds carries no verdict and counts nowhere"
`report.py` "a comparison across rounds reads as not given, not too few runs" | +| FR-12-02 | Self-test | `report.py` "a contrast across rounds is unpaired, with a verdict"
`report.py` "a round-5d run reads H4 against a reused `none`, unpaired"
`report.py` "an unpaired contrast leaves out two trials, not blocks" | +| FR-12-03 | Self-test | `report.py` "it prints every declared contrast its arms ran"
`report.py` "a three-arm run prints only its own contrasts"
`report.py` "an earlier round computes no round-5d contrast" | +| FR-12-04 | Self-test | `report.py` "an earlier round rescored prints app code without a verdict"
`report.py` "round 5 reports the files it supersedes without a verdict" | +| FR-12-05 | Self-test | `report.py` "the report links its appendix, and the appendix the record"
`report.py` "the appendix holds what produced the results, the radar's axes and the verdict vector, and nothing else" | +| FR-12-06 | Self-test | `report.py` "the radar draws a panel per arm, with the bare ring, in both themes"
`report.py` "an axis is better minus worse over its rows with a verdict, None without one"
`report.py` "the summary is the radar, one image per theme" | +| FR-12-07 | Self-test | `report.py` "the report names each approach and its verdict in plain words"
`report.py` "a better primary and no worse answers Yes"
`report.py` "a worse primary answers Worse"
`report.py` "nothing separated answers No" | +| FR-12-08 | Self-test | `report.py` "the report prints the section"
`report.py` "its row carries no verdict"
`report.py` "its row is not in the verdict vector"
`report.py` "no after-the-results check is a verdict metric" | +| FR-12-09 | Self-test | `report.py` "withdrawal blanks every value of the row"
`report.py` "its verdict vector row reads withdrawn"
`report.py` "the withdrawal section names it and why"
`report.py` "a run graded by another revision withdraws nothing"
`report.py` "a metric not withdrawn keeps its verdict" | +| FR-12-10 | Untestable | A working rule; a re-grade and a first grade leave the same record. | + +## 13 Records and archive + +| ID | Kind | Checked by | +| -- | ---- | ---------- | +| FR-13-01 | Self-test | `harness.py` "the record is written as every trial starts and ends"
`harness.py` "every trial records the CLI's version, read as it starts" | +| FR-13-02 | Missing | #109 | +| FR-13-03 | Self-test | `archive.py` "readings, judgings, map and lock come; bundles do not"
`archive.py` "the original tarball's hash is recorded"
`archive.py` "the revisions are recorded"
`archive.py` "a reading changed in the archive fails the verify" | +| FR-13-04 | Self-test | `archive.py` "a reading changed after the stamp is a problem"
`archive.py` "the report refuses docs/audits/ without a current stamp"
`report.py` "a report into a templates source's docs/audits needs the stamp" | +| FR-13-05 | Self-test | `archive.py` "the restored root reads as the original does"
`archive.py` "a restored record points at the restored tarball and void"
`archive.py` "a restored transcript keeps its time" | + +## 14 One run at a time + +| ID | Kind | Checked by | +| -- | ---- | ---------- | +| FR-14-01 | Self-test | `score.py` "a live score.py run refuses a second"
`judge.py` "a live judge.py run refuses a second"
`security.py` "a live security.py run refuses a second" | +| FR-14-02 | Self-test | `harness.py` "an ended run is taken over"
`harness.py` "a live pid that is not the tool is taken over" | diff --git a/docs/journeys/check/check-the-judge.md b/docs/journeys/check/check-the-judge.md index 67cffd1..60eebdf 100644 --- a/docs/journeys/check/check-the-judge.md +++ b/docs/journeys/check/check-the-judge.md @@ -23,7 +23,7 @@ Assumptions: | 2 | Owner | Builds the control root | 2 min | Prints one line per entity it changed, read back off the trees | | 3 | Owner | Runs the tests in each built tree | 10 min | Every tree passes, so only structure separates them | | 4 | Judge | Reads the control root, three times per tree | 75 to 80 min | Twelve trees, 36 judgings | -| 5 | Owner | Reads each primary row: down on `degraded-1`, `obscured-1`, `insecure-1`, `leaky-1`, up on `improved-*`, `clarified-1`, `secured-1`, `protected-1` | 15 min | A row that does not move cannot decide a round. Results go in [ch. 10.7](../../architecture/10-quality-requirements.md) | +| 5 | Owner | Reads each primary row: down on `degraded-1`, `obscured-1`, `insecure-1`, `leaky-1`, up on `improved-*`, `clarified-1`, `secured-1`, `protected-1` | 15 min | A row that does not move cannot decide a round. Results go in [validation](../../validation.md) | | | | Total | about 1.5 hours | | ## Commands diff --git a/docs/requirements.md b/docs/requirements.md index d2bb778..84b3c3b 100644 --- a/docs/requirements.md +++ b/docs/requirements.md @@ -1,182 +1,269 @@ # Requirements -What the benchmark must do, one rule per row, each with the self-test checks -that prove it. - -- **IDs:** `FR--`. Cite a rule by its ID. A new rule takes the next - free number in its topic; a removed ID is never reused. -- **Why:** each topic names the - [chapter 8](architecture/08-crosscutting-concepts.md) section that explains - its rules. The quality scenarios in - [chapter 10](architecture/10-quality-requirements.md) name the rules they - rest on. -- **Checked by:** the module whose `--self-test` proves the rule, and the - label it prints for that check. `trace.py` fails when a label no self-test - prints is named here. -- **Untestable:** a rule no script can see, with the reason. -- **Gap:** a rule a script follows that no self-test plants yet, with the - issue that tracks it. - -## 01 Registration (ch. 8.1.1) - -| ID | Requirement | Checked by | -|---|---|---| -| FR-01-01 | From round 5, the report shall refuse a round whose registration landed on `main` after its first trial started, read on `main`'s first-parent line so a merge counts at the merge. | `report.py` "one landed after the first trial is refused"
`report.py` "one merged after the first trial is read at the merge"
`report.py` "a registration landed before the first trial passes, across zones" | -| FR-01-02 | The report shall refuse a registration that differs from `main`'s copy or has changes not committed. | `report.py` "one changed and not committed is refused"
`report.py` "an amendment on a branch of its own is refused" | -| FR-01-03 | The report shall refuse a trial built from a spec or prompt other than the ones its round registers, by content. | `report.py` "a trial on another spec is refused"
`report.py` "a trial on another prompt is refused"
`report.py` "every trial on the registered spec passes"
`report.py` "every trial on the one prompt passes" | -| FR-01-04 | The report shall refuse a trial with something to score that records no spec or no prompt. | `report.py` "a scorable trial recording no spec is refused"
`report.py` "a scorable trial recording no prompt is refused" | -| FR-01-05 | The harness shall check the spec before every trial, so an edit made mid-run refuses the trials after it unbuilt. | `harness.py` "a spec edited mid-run refuses the next trial unbuilt"
`harness.py` "a spec changed as it is copied refuses the trial and frees its slot"
`harness.py` "a round-5 run on other content is refused"
`harness.py` "round 5's registered digest is SPEC.md's content" | -| FR-01-06 | A trial shall record its start with its UTC offset, and the report shall refuse a start with none. | `report.py` "a trial start with no UTC offset is refused" | -| FR-01-07 | A registration shall land through a pull request's squash or rebase merge. | Untestable: how a commit reached `main` is the owner's practice, and no script sees it. | - -## 02 Reading a result (ch. 8.1.1, 8.1.2) - -| ID | Requirement | Checked by | -|---|---|---| -| FR-02-01 | The arms of a block shall run interleaved, each block starting one arm later, so drift lands on every arm. | `harness.py` "each block starts one arm later"
`harness.py` "over five blocks every arm runs in every place" | -| FR-02-02 | A contrast shall read better when its 95 % bootstrap interval lies wholly on the improving side of zero, worse when wholly on the other, and no improvement shown when it contains zero, by the metric's direction. | `report.py` "every pairing improves by the same amount -> better"
`report.py` "every pairing improves, unstably -> better"
`report.py` "three identical differences -> better"
`report.py` "the differences change sign -> no improvement shown"
`report.py` "a downward metric that fell -> better"
`report.py` "a downward metric that rose -> worse" | -| FR-02-03 | A metric shall read held only when the whole interval lies inside its registered margin, relative margins taken on the baseline arm's mean. | `report.py` "10 more lines on 100 is preserved"
`report.py` "20 more lines on 100 is not"
`report.py` "1.5 more per KLOC on 20 is preserved"
`report.py` "3 more per KLOC on 20 is not"
`report.py` "no baseline makes no relative claim" | -| FR-02-04 | Every primary and every per-KLOC row shall carry its registered margin. | `report.py` "every per-KLOC row carries the static margin"
`report.py` "every primary the judge asks for is led with, worded and given its margins" | -| FR-02-05 | Round 5 shall hold adherence within 8 pp, one checklist item of 13. | `report.py` "round 5 holds adherence within one item, 8 pp" | -| FR-02-06 | From round 5, app code's lines and files shall read held on a rise wholly inside the band, and worse only on one wholly past it. | `report.py` "a rise inside the band is held"
`report.py` "a rise wholly past the band is worse"
`report.py` "one that straddles the band is undecided"
`report.py` "a band that holds zero is held"
`report.py` "round 5 reads a 10 % rise in app code as held" | -| FR-02-07 | An adherence gain shall count only where the hidden-test pass rate held. | Gap: #109 | -| FR-02-08 | A trim shall be called free only where every metric held. | Gap: #109 | -| FR-02-09 | Below K = 6, the report shall call every interval descriptive. | `report.py` "from six blocks no interval is called descriptive"
`report.py` "a round too small to decide says so in the report and the appendix" | - -## 03 Trial count and escalation (ch. 8.1.3) - -| ID | Requirement | Checked by | -|---|---|---| -| FR-03-01 | The report shall owe an escalation to K = 5 where a primary's interval contains zero while its mean difference exceeds the smallest change that matters, in any contrast and either direction. | `report.py` "a crossing interval with an effect of 0.67 owes it"
`report.py` "an effect of 0.67 the other way owes it"
`report.py` "the same row on C-A owes it"
`report.py` "an effect of exactly 0.5 does not"
`report.py` "an interval clear of zero does not"
`report.py` "an interval not computed does not"
`report.py` "a row outside the primary dimensions does not" | -| FR-03-02 | An escalation shall run two more blocks, once, and K shall never pass 5 under it. | `harness.py` "a K past the escalation's ceiling refuses"
`harness.py` "the escalation runs its blocks from none-4"
`report.py` "an owed escalation's command names a trial the harness takes" | -| FR-03-03 | An escalated report shall print the K = 3 and K = 5 results side by side, and a row still open at K = 5 as inconclusive. | `report.py` "an escalated report prints both vectors"
`report.py` "the report carries the escalation section"
`report.py` "a K = 5 run is judged on its first three blocks"
`report.py` "a K = 3 run is assessed on its own vector"
`report.py` "an open row leaves both inconclusive" | -| FR-03-04 | A round registered at a larger K shall take no block past it. | `harness.py` "a round-5 run takes K = 15 and refuses more"
`harness.py` "a round-5d run of hand and short takes K = 15 too" | -| FR-03-05 | A run short of its registered K shall be part-run, and none of its verdicts the round's. | `report.py` "one trial of the last block leaves the round part-run"
`report.py` "a round 5 run short of its last block says it is provisional"
`report.py` "a round-5 run owes no escalation and names the blocks still owed" | - -## 04 Failed and lost trials (ch. 8.1.4) - -| ID | Requirement | Checked by | -|---|---|---| -| FR-04-01 | A trial that completed, or was ended by the budget cap or the timeout, shall be scored as it stands. | `harness.py` "a clean finish is completed"
`harness.py` "the budget cap is budget"
`harness.py` "one that never answers is ended at the timeout"
`score.py` "only completed, budget and timeout endings are offered, under the arms' words" | -| FR-04-02 | A build that did not install shall go unjudged, with its judge rows missing. | `judge.py` "only a build that did not install goes unjudged"
`report.py` "a build that did not install has its judge rows missing" | -| FR-04-03 | A failed trial shall never be re-run. | Untestable: the harness has no path that re-runs a trial ended by the agent; FR-04-04 proves only a lost one re-runs. | -| FR-04-04 | A trial the CLI ends with any error but the budget cap shall be lost: a usage limit, a rate limit, a crash, or no result. | `harness.py` "a usage limit, by its wording is blocked"
`harness.py` "a rate limit, by its status is blocked"
`harness.py` "an error behind a zero status is blocked"
`harness.py` "an error subtype nobody listed is blocked"
`harness.py` "no JSON at all is blocked" | -| FR-04-05 | A lost trial shall be re-run once, in its own place in the order, and its re-run read in its stead. | `harness.py` "a blocked trial re-runs in its place"
`harness.py` "the re-run names the trial it substitutes"
`score.py` "a blocked trial yields to its re-run" | -| FR-04-06 | A lost trial's workspace shall be kept under the run's `void/` directory and never scored. | `harness.py` "a voided workspace is kept under void/"
`harness.py` "a voided trial takes its whole pen and its tarball" | -| FR-04-07 | A second loss of the same trial shall stop the run. | `harness.py` "a second block stops the run" | -| FR-04-08 | A run that stopped part way shall resume with `--from` at the trial named, keeping the order. | `harness.py` "--from short-2 starts there and keeps the order"
`harness.py` "--from an unknown trial refuses"
`harness.py` "no trial stays recorded as running" | - -## 05 Isolation (ch. 8.2) - -| ID | Requirement | Checked by | -|---|---|---| -| FR-05-01 | A trial shall run under a scratch home and minimal settings, so the owner's global `CLAUDE.md`, hooks, memory and MCP never reach it. | `harness.py` "the scratch home is the home"
`harness.py` "the settings file carries the rules and the isolation"
`harness.py` "a trial reads the workspace's project settings and no other source" | -| FR-05-02 | A trial shall run in a cleaned environment, without the launching session's variables, interpreter or keys. | `harness.py` "ANTHROPIC_API_KEY is removed"
`harness.py` "CLAUDECODE is removed"
`harness.py` "VIRTUAL_ENV is removed"
`harness.py` "the interpreter leaves PATH" | -| FR-05-03 | The file tools shall be denied every path outside the trial's own workspace. | `harness.py` "other trials, their change tasks, home and void are denied"
`harness.py` "this repository and the scoring area are denied"
`harness.py` "tarballs and run records are denied"
`harness.py` "the templates source is denied whenever one is set"
`harness.py` "the trial's own workspace is not denied" | -| FR-05-04 | The web tools shall be disallowed. | Gap: #109 | -| FR-05-05 | Git credential helpers shall answer nothing inside a trial. | `harness.py` "a planted Git helper answers outside a trial"
`harness.py` "it does not answer inside one" | -| FR-05-06 | Commands that stop a process by name shall be denied. | `harness.py` "every kill by name meets a deny rule" | -| FR-05-07 | The transcript scan shall flag every tool call naming a forbidden path or repository; a hit voids the trial and re-runs it once. | `harness.py` "every call reaching past the trial is flagged"
`harness.py` "the root, another pen and a climb out of the pen are flagged"
`harness.py` "a fetch of the templates is flagged, and only that"
`harness.py` "a kill by name that ran, or never answered, is a hit"
`harness.py` "a scorable trial with a reach becomes reached"
`harness.py` "the trial's own paths are not flagged, a pip extra included" | -| FR-05-08 | The report shall scan every transcript again under the current rule. | `report.py` "its record's clean scan is read again and flagged"
`report.py` "a trial whose scan hit is named"
`report.py` "a reached build trial is left out whole" | -| FR-05-09 | Every process started from a trial's directories shall be stopped before the trial is frozen, and the record list them. | `harness.py` "the one running from the trial is stopped"
`harness.py` "two planted processes run and are listed"
`harness.py` "the record lists what was stopped" | - -## 06 Missing is not zero (ch. 8.3) - -| ID | Requirement | Checked by | -|---|---|---| -| FR-06-01 | A tool that scanned nothing, failed or timed out shall record its metric as missing, with the reason. | `score.py` "empty tree: ruff is missing, not zero"
`score.py` "empty tree: mypy is missing, not zero"
`score.py` "empty tree: coverage is missing, not zero"
`score.py` "tools absent: ruff is missing, not zero"
`score.py` "tools absent: bandit is missing, not zero"
`score.py` "an empty tree reports nothing seen"
`score.py` "a failed listing is missing, never an empty list" | -| FR-06-02 | A grader's skipped check shall not count as passed. | `score.py` "a skipped check is recorded beside the rate"
`score.py` "a partial suite is flagged"
`score.py` "a suite that skipped nothing is not partial" | -| FR-06-03 | A probe the trial keeps from running shall be lost, and count against the rate. | `security.py` "an application that will not boot loses every runtime probe"
`security.py` "an administrator that cannot sign in loses what needs one"
`security.py` "the lost probes count against the rate" | -| FR-06-04 | A probe the harness could not run shall leave the rate missing. | `security.py` "no report from the probe is missing, not lost"
`security.py` "an audit of nothing is missing, not zero"
`security.py` "a report that is not JSON is missing"
`security.py` "no roots is missing, not zero" | -| FR-06-05 | The report shall show an unmeasured value as not measured. | `report.py` "an unmeasured column reads not measured"
`report.py` "an unmeasured run answers Not measured in every cell" | - -## 07 One ruler (ch. 8.4, 8.6.2) - -| ID | Requirement | Checked by | -|---|---|---| -| FR-07-01 | The first trial scored shall freeze the tools to a lock, and every later trial install from it. | `score.py` "the battery installs from a lock it resolved" | -| FR-07-02 | The lock shall hold only the tools, never a trial's own packages. | `score.py` "only the tools reach the lock"
`score.py` "the lock carries none of the trial's dependencies" | -| FR-07-03 | The tools shall run under `toolconfig/` only, never the configuration the agent wrote. | Gap: #109 | -| FR-07-04 | Every build shall be scored on the spec's Python, and the report refuse a round scored on two. | `score.py` "a scoring environment runs the spec's Python"
`score.py` "no Python at the spec's version refuses to score"
`score.py` "a score on another Python refuses the root"
`report.py` "scores on two Pythons are refused" | -| FR-07-05 | The tools shall be pointed at the installed package and every top-level package, never an assumed `src/`. | `score.py` "the planted package is discovered"
`score.py` "an empty tree yields no roots" | -| FR-07-06 | The coverage run shall first install every extra and dependency group the trial declares, within the lock. | `score.py` "every extra and every group requirement is installed" | -| FR-07-07 | A declared test dependency that conflicts with the lock shall record coverage as missing, with the conflict. | Gap: #109 | - -## 08 Blindness (ch. 8.5) - -| ID | Requirement | Checked by | -|---|---|---| -| FR-08-01 | The judge's bundle shall hold the trial's code without the context file, the vendored templates, the skills, or scoring's output. | `judge.py` "the trial's code reaches the bundle"
`judge.py` "scoring's output and the environment's stay out of the bundle"
`judge.py` "the skills arm's skills stay out of the bundle" | -| FR-08-02 | The bundles shall be judged in an order shuffled at a recorded seed, with the unblinding map out of the judge's reach. | Gap: #109 | -| FR-08-03 | A bundle that still names its arm shall be refused. | `judge.py` "a path naming the trial is a leak"
`judge.py` "an escaped path naming the trial is a leak"
`judge.py` "a leak in a directory the copy skips is found"
`judge.py` "a bundle holding neither has no leak"
`generate_arm.py` "the leak scan reports a planted token and passes clean text" | - -## 09 Scoring (ch. 8.6.1 to 8.6.4) - -| ID | Requirement | Checked by | -|---|---|---| -| FR-09-01 | The hidden suite shall live outside every workspace, in a scoring area the trial is denied. | `harness.py` "the scoring area lies outside the run root"
`harness.py` "this repository and the scoring area are denied" | -| FR-09-02 | A build shall install in a clean virtualenv and boot under scoring as the hidden suite boots it. | `score.py` "an application that seeds on start, and has no default secret, boots under scoring"
`score.py` "a build capped below Python 3.13 installs" | -| FR-09-03 | HTML validity shall set aside the errors on HTMX's `hx-*` attributes, and count the rest. | `score.py` "an hx-* error is set aside and another counts" | -| FR-09-04 | Scope shall count app code apart from tests, docs and configuration, and name artifacts nobody asked for. | `score.py` "app code is the app's Python and templates, not its tests"
`score.py` "test code is a tests directory or a pytest name, anywhere"
`score.py` "docs and configuration count toward no size"
`score.py` "committed bytecode and a database are artifacts nobody asked for" | -| FR-09-05 | The adherence checklist's 13 items shall be read on every arm, the bare arm included. | Gap: #109 | -| FR-09-06 | The design-structure probes shall read layering, the import graph, extension points, kind ladders, boolean parameters, the public surface, IO isolation and hygiene. | Gap: #109 | -| FR-09-07 | Change-task churn shall count every edited and new file, and nothing in an environment. | `score.py` "churn counts an edit and a new file, not an environment"
`score.py` "the churn plant landed" | -| FR-09-08 | The change prompt shall state everything the grader drives. | `harness.py` "the change prompt names the API and fields the grader drives"
`harness.py` "the change prompt is read whole from its file" | -| FR-09-09 | The change-task acceptance modules shall be written before any change-task run. | Untestable: an order of work; the round's registration fixes it. | - -## 10 The judge (ch. 8.6.5 to 8.6.7) - -| ID | Requirement | Checked by | -|---|---|---| -| FR-10-01 | Each tree shall be judged three times, and its scores averaged. | `judge.py` "each tree is read three times by default"
`report.py` "a trial's repeats are meaned, and one judging means itself" | -| FR-10-02 | From round 5, the judge shall be `gpt-6-astra` through `codex exec` at effort `high`, with model and effort recorded. | `judge.py` "the default judge is gpt-6-astra through codex"
`judge.py` "the default effort is high"
`judge.py` "the codex command carries the model and the effort"
`judge.py` "the recorded effort is the one passed" | -| FR-10-03 | The judge may read the bundle and do nothing else. | `judge.py` "it may read and nothing else"
`judge.py` "the claude backend is not in plan mode" | -| FR-10-04 | A cross-check's agreement shall be counted per row over the trials both judges read. | `report.py` "agreement is counted per row over the trials both read" | -| FR-10-05 | A verdict shall lose its direction when the other judge's mean paired difference has the opposite sign, and keep it otherwise. | `report.py` "a direction the other judge reverses loses its verdict"
`report.py` "a direction both judges read keeps its verdict"
`report.py` "a contrast the other judge did not read keeps its verdict"
`report.py` "the rounds' own judge is caught posing as the other" | -| FR-10-06 | The report shall print the share of the judge's quotes found in its bundle. | `report.py` "the judge is checked by its evidence, not a person" | -| FR-10-07 | The control builder shall refuse when a mutation did not land, and print each change it read back. | `control/control.py` "the domain imports flask"
`control/control.py` "ValidationError derives from TariffError"
`control/control.py` "the secret key is a literal"
`control/control.py` "customer data is written to the log" | -| FR-10-08 | The control builder shall refuse a base archive whose sha256 is not the one recorded. | Gap: #109 | -| FR-10-09 | A primary shall count only if it falls on the control tree that damages it and rises on the one that improves it. | Untestable: a judged control root is read by hand, and ch. 10.7 records each reading. | - -## 11 Security and data protection (ch. 8.6.8) - -| ID | Requirement | Checked by | -|---|---|---| -| FR-11-01 | The 11 security and 3 data-protection probes shall fail an app built to fail them and pass one built to pass them. | `security.py` "exposed fails every probe"
`security.py` "hardened passes every probe"
`security.py` "exposed rates are zero"
`security.py` "hardened rates are whole" | -| FR-11-02 | A probe shall sign in the way the hidden suite does. | `security.py` "exposed signs in"
`security.py` "hardened signs in" | -| FR-11-03 | The source probes shall count every planted secret, debug and assembled-SQL form, and no safe one. | `security.py` "every planted secret form is counted"
`security.py` "every planted debug form is counted"
`security.py` "every planted assembled statement is counted"
`security.py` "parameters, plain f-strings and constant names are not assembled SQL"
`security.py` "hardened source finds no secret" | -| FR-11-04 | The dependency probe shall count every vulnerability of every installed package. | `security.py` "every vulnerability of every package is counted" | -| FR-11-05 | The CSRF probe shall fail a sign-in that accepts a forgery, and pass one that refuses it. | `security.py` "public pages with a forgeable sign-in fail only its CSRF probe"
`security.py` "public pages with a token-checked sign-in pass every probe"
`security.py` "a refused forgery passes though a failed sign-in answers as a real one" | -| FR-11-06 | The report shall read each probe rate as `security.py` files it. | `report.py` "every probe rate reads the rate security.py files" | - -## 12 The report (ch. 8.7) - -| ID | Requirement | Checked by | -|---|---|---| -| FR-12-01 | A paired contrast crossing rounds shall get no verdict and count nowhere. | `report.py` "a contrast crossing rounds carries no verdict and counts nowhere"
`report.py` "a comparison across rounds reads as not given, not too few runs" | -| FR-12-02 | A contrast a round registers against an earlier round's arm shall be read unpaired, with a verdict. | `report.py` "a contrast across rounds is unpaired, with a verdict"
`report.py` "a round-5d run reads H4 against a reused `none`, unpaired"
`report.py` "an unpaired contrast leaves out two trials, not blocks" | -| FR-12-03 | The report shall print every declared contrast its arms ran, and no other. | `report.py` "it prints every declared contrast its arms ran"
`report.py` "a three-arm run prints only its own contrasts"
`report.py` "an earlier round computes no round-5d contrast" | -| FR-12-04 | A neutral row shall print without a verdict. | `report.py` "an earlier round rescored prints app code without a verdict"
`report.py` "round 5 reports the files it supersedes without a verdict" | -| FR-12-05 | A round shall write a report, an appendix and a record, each linking the next. | `report.py` "the report links its appendix, and the appendix the record"
`report.py` "the appendix holds what produced the results, the radar's axes and the verdict vector, and nothing else" | -| FR-12-06 | The radar shall draw one panel per file arm against `none`, in both themes, each axis better minus worse over its rows with a verdict. | `report.py` "the radar draws a panel per arm, with the bare ring, in both themes"
`report.py` "an axis is better minus worse over its rows with a verdict, None without one"
`report.py` "the summary is the radar, one image per theme" | -| FR-12-07 | Each approach's verdict shall be Yes where a deciding measure is better and none worse, Worse where any is worse, and No where none moved. | `report.py` "the report names each approach and its verdict in plain words"
`report.py` "a better primary and no worse answers Yes"
`report.py` "a worse primary answers Worse"
`report.py` "nothing separated answers No" | -| FR-12-08 | A check declared after a run shall print in its own section, with no verdict, outside the verdict vector. | `report.py` "the report prints the section"
`report.py` "its row carries no verdict"
`report.py` "its row is not in the verdict vector"
`report.py` "no after-the-results check is a verdict metric" | -| FR-12-09 | A withdrawn metric shall lose every value on the runs its grader's revision graded, and keep them on the others. | `report.py` "withdrawal blanks every value of the row"
`report.py` "its verdict vector row reads withdrawn"
`report.py` "the withdrawal section names it and why"
`report.py` "a run graded by another revision withdraws nothing"
`report.py` "a metric not withdrawn keeps its verdict" | -| FR-12-10 | A corrected grader shall never re-grade the trials its earlier revision graded. | Untestable: a working rule; a re-grade and a first grade leave the same record. | - -## 13 Records (ch. 8.8) - -| ID | Requirement | Checked by | -|---|---|---| -| FR-13-01 | The harness shall write the run record as every trial starts and ends, with the CLI's version. | `harness.py` "the record is written as every trial starts and ends"
`harness.py` "every trial records the CLI's version, read as it starts" | -| FR-13-02 | The arm generator shall write `generation.json` beside every file it generates. | Gap: #109 | -| FR-13-03 | The archive shall carry every reading, judging, map and lock, with a hash per file, and fail its verify on a changed one. | `archive.py` "readings, judgings, map and lock come; bundles do not"
`archive.py` "the original tarball's hash is recorded"
`archive.py` "the revisions are recorded"
`archive.py` "a reading changed in the archive fails the verify" | -| FR-13-04 | The report shall refuse to write under `docs/audits/` once a reading changed since the archive was verified. | `archive.py` "a reading changed after the stamp is a problem"
`archive.py` "the report refuses docs/audits/ without a current stamp"
`report.py` "a report into a templates source's docs/audits needs the stamp" | -| FR-13-05 | A restored archive shall read as the original root does, its records pointing at the restored files. | `archive.py` "the restored root reads as the original does"
`archive.py` "a restored record points at the restored tarball and void"
`archive.py` "a restored transcript keeps its time" | - -## 14 One run at a time (ch. 8.9) - -| ID | Requirement | Checked by | -|---|---|---| -| FR-14-01 | A second `score.py`, `judge.py` or `security.py` run that finds a live claim on the root shall be refused. | `score.py` "a live score.py run refuses a second"
`judge.py` "a live judge.py run refuses a second"
`security.py` "a live security.py run refuses a second" | -| FR-14-02 | A claim naming a process that has ended shall be taken over, and the run say so. | `harness.py` "an ended run is taken over"
`harness.py` "a live pid that is not the tool is taken over" | +- **Scope:** what the benchmark must do, by capability, and how well, by + ISO/IEC 25010:2023 characteristic. +- **Terms:** defined in the [glossary](architecture/12-glossary.md). The + reasons behind each rule are in + [chapter 8](architecture/08-crosscutting-concepts.md). +- **IDs:** `FR--` or `QG--`; cite a + requirement by its ID. +- **Numbering:** a new requirement takes the next free number; a removed + ID is never reused. Before the baseline, a section may be renumbered. +- **Baseline:** none declared yet, so a requirement may still be reworded + in place. +- **Coverage:** [coverage.md](coverage.md) names, for each functional + requirement, the self-test checks that prove it. + +## Functional requirements + +- **Delivered by column:** the script expected to deliver a requirement + (-: a removed row). The scripts, all under `tests/efficacy/`: + - **Harness:** `harness.py`, which runs the trials. + - **Scorer:** `score.py`, which scores a frozen build. + - **Security reader:** `security.py`, which runs the probes. + - **Judge:** `judge.py`, which bundles a build and has a model score it. + - **Report:** `report.py`, which reads a round and writes its report. + - **Archive:** `archive.py`, which carries a round to the private archive. + - **Arm generator:** `generate_arm.py`, which writes a generated arm's file. + - **Control builder:** `control/control.py`, which builds the judge's + control trees. + - **Owner:** a working practice no script carries out. + +### 01 Registration + +| ID | Requirement | Delivered by | +| -- | ----------- | ------------ | +| FR-01-01 | The benchmark shall refuse, from round 5, a round whose registration landed on `main` after its first trial started, a merge counting at the merge. | Report | +| FR-01-02 | The benchmark shall refuse a registration that differs from `main`'s copy or has changes not committed. | Report | +| FR-01-03 | The benchmark shall refuse a trial built from a spec or prompt other than the ones its round registers, compared by content. | Report | +| FR-01-04 | The benchmark shall refuse a trial with something to score that records no spec or no prompt. | Report | +| FR-01-05 | The benchmark shall check the spec before every trial, and refuse unbuilt the trials after an edit made mid-run. | Harness | +| FR-01-06 | The benchmark shall record each trial's start with its UTC offset, and refuse a start with none. | Harness, Report | +| FR-01-07 | The benchmark shall land each registration through a pull request's squash or rebase merge. | Owner | + +### 02 Reading a result + +| ID | Requirement | Delivered by | +| -- | ----------- | ------------ | +| FR-02-01 | The benchmark shall run the arms of a block back to back, each block starting one arm later than the last. | Harness | +| FR-02-02 | The benchmark shall read a contrast as better when its 95 % bootstrap interval lies wholly on the improving side of zero, worse when wholly on the other, and no improvement shown when it contains zero. | Report | +| FR-02-03 | The benchmark shall read a metric as held only when the whole interval lies inside its margin, a relative margin taken on the baseline arm's mean. | Report | +| FR-02-04 | The benchmark shall give every primary row and every per-KLOC row its registered margin. | Report | +| FR-02-05 | The benchmark shall hold round 5's adherence within 8 pp, one checklist item of 13. | Report | +| FR-02-06 | The benchmark shall read app code's lines and files, from round 5, as held on a rise wholly inside the band and worse only on one wholly past it. | Report | +| FR-02-07 | The benchmark shall count an adherence gain only where the hidden-test pass rate held. | Report | +| FR-02-08 | The benchmark shall call a trim free only where every metric held. | Report | +| FR-02-09 | The benchmark shall call every interval descriptive below K = 6. | Report | + +### 03 Trial count and escalation + +| ID | Requirement | Delivered by | +| -- | ----------- | ------------ | +| FR-03-01 | The benchmark shall owe an escalation to K = 5 where a primary's interval contains zero while its mean difference exceeds the smallest change that matters, in any contrast and either direction. | Report | +| FR-03-02 | The benchmark shall run an escalation as two more blocks, once, and never past K = 5. | Harness, Report | +| FR-03-03 | The benchmark shall print an escalated round's K = 3 and K = 5 results side by side, and a row still open at K = 5 as inconclusive. | Report | +| FR-03-04 | The benchmark shall refuse a block past the K a round registers. | Harness | +| FR-03-05 | The benchmark shall call a run short of its registered K part-run, and give none of its verdicts as the round's. | Report | + +### 04 Failed and lost trials + +| ID | Requirement | Delivered by | +| -- | ----------- | ------------ | +| FR-04-01 | The benchmark shall score as it stands a trial that completed, or that the budget cap or the timeout ended. | Harness, Scorer | +| FR-04-02 | The benchmark shall leave unjudged a build that did not install, with its judge rows missing. | Judge, Report | +| FR-04-03 | The benchmark shall never re-run a failed trial. | Harness | +| FR-04-04 | The benchmark shall treat as lost a trial the CLI ends with any error but the budget cap: a usage limit, a rate limit, a crash or no result. | Harness | +| FR-04-05 | The benchmark shall re-run a lost trial once, in its own place in the order, and read the re-run in its stead. | Harness, Scorer | +| FR-04-06 | The benchmark shall keep a lost trial's workspace under the run's `void/` directory, and never score it. | Harness | +| FR-04-07 | The benchmark shall stop the run at a second loss of the same trial. | Harness | +| FR-04-08 | The benchmark shall resume a run that stopped part way with `--from` at the trial named, keeping the order. | Harness | + +### 05 Isolation + +| ID | Requirement | Delivered by | +| -- | ----------- | ------------ | +| FR-05-01 | The benchmark shall run each trial under a scratch home and minimal settings, so the owner's global `CLAUDE.md`, hooks, memory and MCP never reach it. | Harness | +| FR-05-02 | The benchmark shall run each trial in a cleaned environment, without the launching session's variables, interpreter or keys. | Harness | +| FR-05-03 | The benchmark shall deny the file tools every path outside the trial's own workspace. | Harness | +| FR-05-04 | The benchmark shall disallow the web tools in every trial. | Harness | +| FR-05-05 | The benchmark shall let no Git credential helper answer inside a trial. | Harness | +| FR-05-06 | The benchmark shall deny every command that stops a process by name. | Harness | +| FR-05-07 | The benchmark shall flag every tool call in a transcript that names a forbidden path or repository, void the trial and re-run it once. | Harness | +| FR-05-08 | The benchmark shall scan every transcript again, under the current rule, when it writes a report. | Report | +| FR-05-09 | The benchmark shall stop every process started from a trial's directories before the trial is frozen, and record each one. | Harness | + +### 06 Missing values + +| ID | Requirement | Delivered by | +| -- | ----------- | ------------ | +| FR-06-01 | The benchmark shall record as missing, with the reason, a metric whose tool scanned nothing, failed or timed out. | Scorer | +| FR-06-02 | The benchmark shall never count a grader's skipped check as passed. | Scorer | +| FR-06-03 | The benchmark shall count as lost, against the rate, a probe the trial keeps from running. | Security reader | +| FR-06-04 | The benchmark shall leave the rate missing for a probe it could not run itself. | Security reader | +| FR-06-05 | The benchmark shall show an unmeasured value as not measured. | Report | + +### 07 Tools and interpreter + +| ID | Requirement | Delivered by | +| -- | ----------- | ------------ | +| FR-07-01 | The benchmark shall freeze the tools to a lock at the first trial scored, and install every later trial's tools from it. | Scorer | +| FR-07-02 | The benchmark shall keep the lock to the tools, never a trial's own packages. | Scorer | +| FR-07-03 | The benchmark shall run the tools under `toolconfig/` only, never a configuration the agent wrote. | Scorer | +| FR-07-04 | The benchmark shall score every build on the spec's Python, and refuse a round scored on two. | Scorer, Report | +| FR-07-05 | The benchmark shall point the tools at the installed package and every top-level package, never an assumed `src/`. | Scorer | +| FR-07-06 | The benchmark shall install every extra and dependency group a trial declares, within the lock, before it runs coverage. | Scorer | +| FR-07-07 | The benchmark shall record coverage as missing, with the conflict, where a declared test dependency conflicts with the lock. | Scorer | + +### 08 Blind judging + +| ID | Requirement | Delivered by | +| -- | ----------- | ------------ | +| FR-08-01 | The benchmark shall give the judge a bundle holding the trial's code without its context file, vendored templates, skills or scoring output. | Judge | +| FR-08-02 | The benchmark shall judge the bundles in an order shuffled at a recorded seed, with the unblinding map out of the judge's reach. | Judge | +| FR-08-03 | The benchmark shall refuse a bundle that still names its arm. | Judge, Arm generator | + +### 09 Scoring + +| ID | Requirement | Delivered by | +| -- | ----------- | ------------ | +| FR-09-01 | The benchmark shall keep the hidden suite outside every workspace, in a scoring area the trial is denied. | Harness | +| FR-09-02 | The benchmark shall install each build in a clean virtualenv and boot it the way the hidden suite does. | Scorer | +| FR-09-03 | The benchmark shall set aside HTML validity errors on HTMX's `hx-*` attributes, and count the rest. | Scorer | +| FR-09-04 | The benchmark shall count app code apart from tests, docs and configuration, and name artifacts nobody asked for. | Scorer | +| FR-09-05 | The benchmark shall read the adherence checklist's 13 items on every arm, the bare arm included. | Scorer | +| FR-09-06 | The benchmark shall probe each build's layering, import graph, extension points, kind ladders, boolean parameters, public surface, IO isolation and hygiene. | Scorer | +| FR-09-07 | The benchmark shall count every edited and new file as change-task churn, and nothing in an environment. | Scorer | +| FR-09-08 | The benchmark shall state in the change prompt everything the grader drives. | Harness | +| FR-09-09 | The benchmark shall have the change-task acceptance modules written before any change-task run. | Owner | + +### 10 The judge + +| ID | Requirement | Delivered by | +| -- | ----------- | ------------ | +| FR-10-01 | The benchmark shall judge each tree three times, and average its scores. | Judge, Report | +| FR-10-02 | The benchmark shall judge from round 5 with `gpt-6-astra` through `codex exec` at effort `high`, recording the model and the effort. | Judge | +| FR-10-03 | The benchmark shall let the judge read the bundle and do nothing else. | Judge | +| FR-10-04 | The benchmark shall count a cross-check's agreement per row, over the trials both judges read. | Report | +| FR-10-05 | The benchmark shall withdraw a verdict's direction where the other judge's mean paired difference has the opposite sign, and keep it otherwise. | Report | +| FR-10-06 | The benchmark shall print the share of the judge's quotes found in its bundle. | Report | +| FR-10-07 | The benchmark shall refuse to build a control tree whose mutation did not land, and print each change it read back. | Control builder | +| FR-10-08 | The benchmark shall refuse a control base archive whose sha256 is not the one recorded. | Control builder | +| FR-10-09 | The benchmark shall count a primary only if it falls on the control tree that damages it and rises on the one that improves it. | Owner | + +### 11 Security and data protection + +| ID | Requirement | Delivered by | +| -- | ----------- | ------------ | +| FR-11-01 | The benchmark shall fail the 11 security and 3 data-protection probes on an app built to fail them, and pass them on one built to pass them. | Security reader | +| FR-11-02 | The benchmark shall sign a probe in the way the hidden suite does. | Security reader | +| FR-11-03 | The benchmark shall count every planted secret, debug and assembled-SQL form in the source, and no safe one. | Security reader | +| FR-11-04 | The benchmark shall count every known vulnerability of every installed package. | Security reader | +| FR-11-05 | The benchmark shall fail the CSRF probe on a sign-in that accepts a forgery, and pass it on one that refuses it. | Security reader | +| FR-11-06 | The benchmark shall read each probe rate as the security reader files it. | Report | + +### 12 The report + +| ID | Requirement | Delivered by | +| -- | ----------- | ------------ | +| FR-12-01 | The benchmark shall give no verdict to a paired contrast crossing rounds, and count it nowhere. | Report | +| FR-12-02 | The benchmark shall read unpaired, with a verdict, a contrast a round registers against an earlier round's arm. | Report | +| FR-12-03 | The benchmark shall print every declared contrast its arms ran, and no other. | Report | +| FR-12-04 | The benchmark shall print a neutral row without a verdict. | Report | +| FR-12-05 | The benchmark shall write a report, an appendix and a record for each round, each linking the next. | Report | +| FR-12-06 | The benchmark shall draw one radar panel per file arm against `none`, in both themes, each axis better minus worse over its rows with a verdict. | Report | +| FR-12-07 | The benchmark shall give each approach Yes where a deciding measure is better and none worse, Worse where any is worse, and No where none moved. | Report | +| FR-12-08 | The benchmark shall print a check declared after a run in its own section, with no verdict, outside the verdict vector. | Report | +| FR-12-09 | The benchmark shall blank a withdrawn metric on every run its grader's revision graded, and keep it on the others. | Report | +| FR-12-10 | The benchmark shall never re-grade, with a corrected grader, the trials its earlier revision graded. | Owner | + +### 13 Records and archive + +| ID | Requirement | Delivered by | +| -- | ----------- | ------------ | +| FR-13-01 | The benchmark shall write the run record as every trial starts and ends, with the CLI's version. | Harness | +| FR-13-02 | The benchmark shall write `generation.json` beside every file the arm generator writes. | Arm generator | +| FR-13-03 | The benchmark shall archive every reading, judging, map and lock, with a hash per file, and fail the verify on a changed one. | Archive | +| FR-13-04 | The benchmark shall refuse to write a report under `docs/audits/` once a reading changed since the archive was verified. | Archive, Report | +| FR-13-05 | The benchmark shall restore an archive so it reads as the original root does, its records pointing at the restored files. | Archive | + +### 14 One run at a time + +| ID | Requirement | Delivered by | +| -- | ----------- | ------------ | +| FR-14-01 | The benchmark shall refuse a second scoring, judging or security run that finds a live claim on its root. | Scorer, Judge, Security reader | +| FR-14-02 | The benchmark shall take over a claim naming a process that has ended, and say so. | Harness | + +## Quality requirements + +- **Numbering:** characteristics follow ISO/IEC 25010:2023 order, 01 + functional suitability to 09 safety. A characteristic with no goal here + is left out. +- **Sub-characteristic:** the ISO 25010 term the goal refines. +- **Goal:** what must hold, in plain words. +- **Target:** the measurable pass condition. +- **Motivation:** why it matters. +- **Quality goals:** chapter 1 ranks the five goals, Q1 to Q5, that these + requirements make measurable. + +### 01 Functional suitability + +| ID | Sub-characteristic | Goal | Target | Motivation | +| -- | ------------------ | ---- | ------ | ---------- | +| QG-01-01 | Functional correctness | Arms differ in their context file and in nothing else (Q1). | Every trial of a round built from the registered spec and prompt, under one model, one budget and one timeout, scored under one tool lock on the spec's Python, with each block starting one arm later. | A difference between arms from anything but the file would be read as the file's effect. | +| QG-01-02 | Functional correctness | The hidden suite marks a correct build correct and a wrong one wrong. | The reference implementation passes every build check; a change made from the change prompt alone passes every change check; the mutation control's 12 planted violations are each caught. | A suite that fails a correct build, or passes a broken one, makes task success measure the suite. | +| QG-01-03 | Functional correctness | Every primary judge row can move (Q4). | Under the rounds' judge, three judgings per tree, every primary falls on the control tree built to damage it and rises on the one built to improve it, read again whenever the judge model, its effort or the rubric changes. | A row that cannot move can never separate two arms. | +| QG-01-04 | Functional correctness | The judge reads the code it scores (Q4). | 100 % of the evidence lines quoted on every control judging found in their bundle. | A judge that never opened the code still returns plausible numbers. | +| QG-01-05 | Functional correctness | A value that was not measured never reads as a result (Q4). | Every planted empty, failed or skipped case in the self-tests reads missing, lost or not passed. | A zero from a tool that scanned nothing reads as a clean arm. | + +### 02 Performance efficiency + +| ID | Sub-characteristic | Goal | Target | Motivation | +| -- | ------------------ | ---- | ------ | ---------- | +| QG-02-01 | Resource utilisation | A trial stays within its bounds. | Every trial ends within its budget of $100 API-equivalent, plus at most one turn, and within two hours. | A trial without a bound can spend a plan's limit on one arm. | +| QG-02-02 | Capacity | A round's judging fits the judge's plan. | Three judgings of every trial of a K = 15 round within the judge plan's weekly limit. | A judging stopped at a usage limit leaves a round half-judged. | + +### 05 Reliability + +| ID | Sub-characteristic | Goal | Target | Motivation | +| -- | ------------------ | ---- | ------ | ---------- | +| QG-05-01 | Fault tolerance | A provider failure never changes which trials a round counts. | Every lost trial re-run once in its place; zero lost trials scored. | Re-running one arm's failures alone would quietly improve that arm. | +| QG-05-02 | Recoverability | A run that stops resumes where it stopped. | A stopped run resumed with `--from` runs the remaining trials in the registered order, with none left recorded as running. | A round restarted from scratch would run some trials twice and mix two days' model behaviour into one block. | +| QG-05-03 | Recoverability | A round can be restored and its report recomputed (Q5). | A round restored from the archive reproduces every figure of its report. | A deleted run root with nothing kept leaves no reading that can be re-run, re-judged or checked. | + +### 06 Security + +| ID | Sub-characteristic | Goal | Target | Motivation | +| -- | ------------------ | ---- | ------ | ---------- | +| QG-06-01 | Confidentiality | A trial reaches nothing it is defined not to have (Q3). | Zero counted trials whose transcript reaches the hidden suite, the templates source, another trial, the scoring area or the owner's home. | A trial that read the hidden suite measures the suite, not its context file. | +| QG-06-02 | Integrity | No rule for reading a result is chosen after the results (Q2). | From round 5, every round refused whose registration landed after its first trial or differs from `main`; every check declared after a run printed without a verdict. | Otherwise the bar moves with the results. | +| QG-06-03 | Accountability | Every reading names what produced it (Q5). | Every score, judging and reading records the revisions, model, effort and seed it was made under, and the archive holds a hash per file. | A figure that cannot be traced to its inputs cannot be checked or re-run. | + +### 07 Maintainability + +| ID | Sub-characteristic | Goal | Target | Motivation | +| -- | ------------------ | ---- | ------ | ---------- | +| QG-07-01 | Testability | Every rule has a check. | `trace.py` passes in CI: every live FR has a self-test check, a reason it is untestable, or an open issue for its check. | Rules with no check behind them are where review findings come from. | + +### 08 Flexibility + +| ID | Sub-characteristic | Goal | Target | Motivation | +| -- | ------------------ | ---- | ------ | ---------- | +| QG-08-01 | Adaptability | A later template revision is measured with the same harness. | A candidate and a baseline arm run head to head in one round, read as one contrast, with no change to the harness. | A harness rebuilt for every revision would compare revisions under different rulers. | +| QG-08-02 | Adaptability | The scripts run on the owner's Windows machine and on Linux. | Every self-test passes on the `windows-latest` and `ubuntu-latest` CI runners. | The owner runs rounds on Windows, and CI proves the POSIX paths. | + +## Test artefacts + +- **Use:** the quality goals are measured against these sets, suites and + setups. +- **Freeze:** an artefact a round reads is fixed with that round's + registration. + +| Artefact | Contents | Used by | +| -------- | -------- | ------- | +| Hidden suite | 534 build checks across 18 modules and 74 change checks, in the private `braboj/tariff-hidden-suite`. | QG-01-02 | +| Reference implementation | A build written from the spec alone, and the change task made on it from the change prompt alone. Private, beside the hidden suite. | QG-01-02 | +| Mutation control | Twelve spec violations, each planted alone in the reference implementation. | QG-01-02 | +| Control fixture | The judge's control trees, built by `control/control.py` from two pinned applications; see [validation](validation.md). | QG-01-03, QG-01-04 | +| Self-tests | Each script's `--self-test`, which plants the case each rule guards against. | QG-01-05, QG-05-01, QG-05-02, QG-06-01, QG-06-02, QG-07-01 | +| CI runners | `ubuntu-latest` and `windows-latest`, Python 3.12, stub agent CLIs that refuse to run. | QG-07-01, QG-08-02 | +| Private archive | `braboj/tariff-runs`, each round's run root and readings. | QG-05-03, QG-06-03 | diff --git a/docs/validation.md b/docs/validation.md new file mode 100644 index 0000000..327d5ec --- /dev/null +++ b/docs/validation.md @@ -0,0 +1,267 @@ +# Validation + +The measurements behind the benchmark's instruments: the hidden suite, the +trial bounds, and every run of the judge's control fixture. The rules they +support are in [requirements.md](requirements.md); the reasons are in +[chapter 8](architecture/08-crosscutting-concepts.md). + +## The hidden suite + + +534 build checks across 18 modules and 74 change checks in +`braboj/tariff-hidden-suite`, validated before round 3's first trial. + + +| Check | Result | +| ----- | ------ | +| A reference implementation written from the spec alone | Passes every build check | +| The change task made on it from the change prompt alone | Passes every change check, and the build suite still | +| Twelve spec violations, each planted alone | All twelve caught | +| The pre-round-3 reference, with no sign-in | Fails the sign-in module | + +## Trial bounds + +A trial is bounded by a budget of $100 and a timeout of two hours. + +| Fact | Figure | +| ---- | ------ | +| The CLI's price for `claude-sonnet-5` | $5 per million input tokens, $25 per million output | +| When the CLI checks the budget | Between turns, so a trial can pass it by one turn's cost | +| The reference implementation's agent, on a stronger model | About $13 in 26 minutes at that rate | + +At that pace, a two-hour trial stays under the cap. + +## Why three trials cannot prove + +| Test | With three paired differences | +| ---- | ----------------------------- | +| Bootstrap | 27 distinct resamples | +| Exact sign test | A two-sided p of at least 0.25 | + +## The judge's control runs + +Each run of the control fixture, newest first. A row is trusted once it +falls on the tree built to damage it and rises on the one built to improve +it, under the rounds' judge. The trees are described in +[ch. 8.6.7](architecture/08-crosscutting-concepts.md). + +| Date | Judge | Rubric | Outcome | +| ---- | ----- | ------ | ------- | +| 2026-10-28 | `gpt-6-astra`, high, ×3 | As it stands | Every primary falls and rises; `readability` rises only on `clarified-1` | +| 2026-09-25 | `claude-opus-5-5`, high, ×3 | `design` re-anchored | Every primary falls and rises | +| 2026-09-25 | `claude-opus-5-5`, high, ×3 | Five primaries anchored | Four rows fall and rise; `design` does not fall | +| 2026-09-25 | `gpt-6-astra`, high, ×3 | Security and data protection first anchored | Both fall, neither rises | +| 2026-09-25 | `gpt-6-astra`, high, ×3 | Three primaries anchored | Every primary falls and rises | +| 2026-09-19 | `gpt-6-astra` and Opus 5, ×1 | Three primaries anchored | Every primary falls and rises under both | +| 2026-09-18 | `gpt-6-astra`, high, ×1 | Not anchored | `design` and `maintainability` do not rise | + +In every table below, a bold cell differs from its application's base +tree. A cell with digits in brackets is the mean of three judgings, +followed by each score. + +### 2026-10-28: `gpt-6-astra`, as round 5 registers it + +`gpt-6-astra` through `codex exec` at effort `high`, three judgings per +tree, the rubric as it stands. All 33 judgings took, with evidence found +100 % on every one. + +| Dimension | base-1 | degraded-1 | obscured-1 | improved-1 | improved-2 | improved-3 | +|---|---|---|---|---|---|---| +| design | 3.00 (333) | **1.00** (111) | 3.00 (333) | **4.00** (444) | **4.00** (444) | **4.00** (444) | +| readability | 3.00 (333) | 3.00 (333) | **1.00** (111) | 3.00 (333) | 3.00 (333) | 3.00 (333) | +| maintainability | 3.00 (333) | **1.33** (121) | 3.00 (333) | 3.33 (433) | 3.67 (434) | **4.00** (444) | + +| Dimension | base-2 | insecure-1 | secured-1 | leaky-1 | protected-1 | +|---|---|---|---|---|---| +| security | 3.00 (333) | **1.00** (111) | **5.00** (555) | 3.00 (333) | 3.00 (333) | +| data_protection | 3.00 (333) | 3.00 (333) | 3.00 (333) | **1.00** (111) | **5.00** (555) | + +`readability` fell on `obscured-1` but read 3 on every improved tree, none +of them built to improve it. So `clarified-1` was added and judged in the +same root: + +| Dimension | base-1 | clarified-1 | +|---|---|---| +| design | 3.00 (333) | 3.00 (333) | +| readability | 3.00 (333) | **3.67** (434) | +| maintainability | 3.00 (333) | 3.00 (333) | + +- Every primary now falls on its damaged tree and rises on an improved one. +- `readability`'s rise is the smallest: one judging of three read 3, so a + single judging would have missed it. +- The second application's rows hold still on the trees built to move + another. +- Under this rubric `gpt-6-astra` steps more sharply than + `claude-opus-5-5`: `design` reaches 4 from `improved-1`, and the second + application's rows read 1 or 5 on all three judgings. +- On the first application, where no tree is built to move it, `security` + spread from 2 to 4 within a triple. +- The first 33 judgings took 70 minutes and about 11 % of the OpenAI plan's + weekly limit (3 % before, 14 % after). A round of 75 trials at three + judgings each would take about 75 %. + +### 2026-09-25: `claude-opus-5-5`, `design` re-anchored + +The rubric and judge the rounds used until round 5. Three judgings per tree; +a cell is the mean. + +| Dimension | base-1 | degraded-1 | obscured-1 | improved-1 | improved-2 | improved-3 | +|---|---|---|---|---|---|---| +| design | 2.67 | **1.00** | 3.00 | **3.67** | **4.00** | **4.00** | +| readability | 3.00 | 2.00 | **1.67** | 3.33 | 3.00 | 3.33 | +| maintainability | 3.00 | **2.00** | 3.00 | 3.00 | 3.00 | **4.00** | + +| Dimension | base-2 | insecure-1 | secured-1 | leaky-1 | protected-1 | +|---|---|---|---|---|---| +| security | 3.00 | **1.00** | **5.00** | 3.00 | 3.00 | +| data_protection | 3.00 | 3.00 | 3.00 | **1.00** | **4.00** | + +- Every primary falls on its damaged tree and rises on an improved one. +- Each second-application row holds still on the trees built to move + another. +- The 33 judgings used about 1 % of the owner's weekly plan. + +### 2026-09-25: `claude-opus-5-5`, five primaries anchored + +| Dimension | base-1 | degraded-1 | obscured-1 | improved-1 | improved-2 | improved-3 | +|---|---|---|---|---|---|---| +| design | 2.00 | 2.00 | 2.33 | 3.00 | 3.00 | **4.00** | +| readability | 3.00 | 2.67 | **1.67** | 3.33 | 3.33 | **3.67** | +| maintainability | 3.00 | **2.00** | 3.00 | 3.00 | 3.00 | **4.00** | + +| Dimension | base-2 | insecure-1 | secured-1 | leaky-1 | protected-1 | +|---|---|---|---|---|---| +| security | 3.00 | **1.00** | **4.67** | 3.00 | 3.00 | +| data_protection | 3.00 | 3.00 | 3.00 | **1.00** | **4.00** | + +- Four rows fall and rise. `design` rises but does not fall. +- The judge quoted the same concrete-class dispatch for `base-1` and + `degraded-1`, and read the 3's description of it as a fault below it. +- What `degraded-1` adds, the domain merged and importing Flask, moved + `maintainability` instead. +- **Fix:** `design`'s 1 now names that damage, and its 3 says the dispatch + alone, with the layers kept apart, is not lower. +- A first run through the claude backend recorded effort `high` but never + passed it. Its readings are not counted, and a self-test check now fails + without the effort. + +### 2026-09-25: `gpt-6-astra`, security and data protection first anchored + +The second application's trees, the only ones built to move these rows. +Three judgings per tree; a cell is the mean. + +| Dimension | base-2 | insecure-1 | secured-1 | leaky-1 | protected-1 | +|---|---|---|---|---|---| +| security | 4.00 | **2.00** | 4.00 | 4.00 | 4.00 | +| data_protection | 5.00 | 5.00 | 5.00 | **2.00** | 5.00 | + +- Both rows fell on their damaged tree and rose on neither: `base-2` + already met most of what the 5s described. +- **Fix:** the 3s describe the common defences and nothing more; the 5s ask + for what only the improved trees have. +- The re-run under the new anchors stopped at the plan's weekly limit after + 16 of 33 judgings. What it read: `base-2` at 3 on both rows, `insecure-1` + and `leaky-1` at 1, `protected-1` at 5. +- The plan allows about thirty judgings a week and a round needs three times + as many, so the rounds' judge became `claude-opus-5-5` until round 5. + +### 2026-09-25: `gpt-6-astra`, three judgings per tree + +The root of the 2026-09-19 run, topped up with `--repeat 3`. Evidence found +100 % on every judging. + +| Dimension | base-1 | degraded-1 | obscured-1 | improved-1 | improved-2 | improved-3 | +|---|---|---|---|---|---|---| +| design | 3.00 (333) | **2.00** (222) | 3.00 (333) | **3.67** (344) | **3.67** (434) | **4.00** (444) | +| readability | 3.00 (333) | 3.00 (333) | **1.00** (111) | 3.00 (333) | 3.00 (333) | **3.33** (343) | +| maintainability | 3.00 (333) | **2.33** (223) | 3.00 (333) | 3.00 (333) | 3.00 (333) | **4.00** (444) | + +- Every primary falls on its damaged tree and rises on `improved-3`. +- The one-point flips of single judgings stay inside each triple, which the + mean absorbs. + +### 2026-09-19: after anchoring, two judges + +Six trees, one judging each, evidence 100 % on every judging counted. +`improved-2` under `gpt-6-astra` holds two judgings, meaned: the third +stopped at the plan's usage limit. + +`gpt-6-astra` at effort `high`: + +| Dimension | base-1 | degraded-1 | obscured-1 | improved-1 | improved-2 | improved-3 | +|---|---|---|---|---|---|---| +| design | 3 | **2** | 3 | 3 | **3.5** | **4** | +| readability | 3 | 3 | **1** | 3 | 3 | 3 | +| maintainability | 3 | 3 | 3 | 3 | 3 | **4** | +| dip | 5 | **1** | 5 | 5 | 5 | 5 | +| srp | 3 | **2** | 3 | 3 | 3 | 3 | +| error_design | 2 | **1** | 2 | **3** | **3** | **3** | +| ocp | 2 | 2 | 2 | **3** | **3** | **3** | +| lsp | 3 | **2** | **2** | 3 | 3 | 3 | +| isp | 4 | 4 | 4 | 4 | 4 | 4 | +| naming_and_abstraction | 4 | **3** | **2** | 4 | 4 | 4 | +| test_quality | 3 | 3 | **4** | **4** | **4** | **4** | + +Opus 5 through the claude backend, a cross-check on the rubric: + +| Dimension | base-1 | degraded-1 | obscured-1 | improved-1 | improved-2 | improved-3 | +|---|---|---|---|---|---|---| +| design | 3 | **2** | 3 | **4** | **4** | **4** | +| readability | 4 | **3** | **2** | 4 | 4 | 4 | +| maintainability | 3 | **2** | 3 | **4** | **4** | **4** | +| dip | 4 | **1** | **5** | **5** | **5** | **5** | +| srp | 3 | 3 | 3 | **4** | **4** | **4** | +| error_design | 3 | **1** | 3 | **4** | 3 | **4** | +| ocp | 2 | 2 | 2 | **3** | **3** | **4** | +| lsp | 3 | **2** | 3 | **4** | **4** | **4** | +| isp | 4 | 4 | 4 | **3** | 4 | **3** | +| naming_and_abstraction | 4 | **3** | **2** | 4 | 4 | 4 | +| test_quality | 4 | **3** | 4 | 4 | 4 | 4 | + +- Under both judges every primary falls on its damaged tree and rises on an + improved one. +- The judges differ in threshold, not direction: Opus 5 credits the + improvement at `improved-1`, `gpt-6-astra` waits for `improved-3`. +- Opus 5 shares a vendor with the generator, so it read the rubric, not a + round. +- Single judgings flip between runs: `design` on `improved-1` read 4 in three + earlier runs and 3 here. That is why a row is trusted only across runs. +- The repair is tracked in solid-ai-templates#1827. + +### 2026-09-18: before the primaries were anchored + +`gpt-6-astra` at effort `high`, one judging per tree, evidence found 100 %. +The rubric said only that 1 was poor and 5 excellent. + +| Dimension | base-1 | degraded-1 | improved-1 | +|---|---|---|---| +| design | 3 | **2** | 3 | +| maintainability | 3 | **2** | 3 | +| readability | 4 | **3** | 4 | +| dip | 5 | **1** | 5 | +| srp | 3 | **2** | 3 | +| error_design | 2 | **1** | **3** | +| ocp | 2 | 2 | **3** | +| lsp | 2 | 2 | **3** | +| isp | 4 | 4 | 4 | +| naming_and_abstraction | 4 | 4 | 4 | +| test_quality | 4 | 3 | 3 | + +- `design` and `maintainability` fell on damage and did not rise on + improvement. +- On the improved tree the judge quoted `class Rule(ABC):` for `design`, + the improvement itself, and still scored it 3. + +**One tree, judged six times.** Six judgings of one byte-identical `base-1` +bundle: + +| Row | Scores | Mean | SD | +| --- | ------ | ---- | -- | +| readability | 4, 4, 4, 3, 4, 4 | 3.83 | 0.41 | +| Eight of the eleven rows | The same score all six times | — | 0 | + +- That spread is about 0.33 standard error on a difference of two arm means + at K = 3. +- Readability was the only primary that moved in rounds 1 and 2, so every + verdict rested on the row that was not reproducible. +- Three judgings per tree cut that standard error by about 40 %. diff --git a/tests/efficacy/trace.py b/tests/efficacy/trace.py index a694109..6eeaf01 100644 --- a/tests/efficacy/trace.py +++ b/tests/efficacy/trace.py @@ -1,9 +1,10 @@ -"""Trace every requirement to the self-test checks that prove it. +"""Trace every functional requirement to the self-test checks that prove it. -Each row of `docs/requirements.md` names, in its last cell, either the -self-test labels that prove the rule, why no script can test it, or the issue -that tracks its missing check. This reads every self-test's output and fails -on a rule that names none of the three, or on a label no self-test prints. +`docs/requirements.md` states each rule; `docs/coverage.md` gives each live +rule one row naming the self-test labels that prove it, why no script can +test it, or the issue that tracks its missing check. This reads every +self-test's output and fails on a rule with no such row, or on a label no +self-test prints. py tests/efficacy/trace.py py tests/efficacy/trace.py --outputs @@ -24,6 +25,7 @@ import lib # noqa: E402 REQUIREMENTS = os.path.join(ROOT, "docs", "requirements.md") +COVERAGE = os.path.join(ROOT, "docs", "coverage.md") # Every module with a self-test, by its path under tests/efficacy/. A label # is looked up only in the output of the module its row names. @@ -32,10 +34,10 @@ "security.py", "control/control.py") ROW = re.compile(r"^\| (FR-(\d{2})-(\d{2})) \| (.+?) \| (.+?) \|$") -TOPIC = re.compile(r"^## (\d{2}) ") +TOPIC = re.compile(r"^#{2,3} (\d{2}) ") CITED = re.compile(r'^`([\w/]+\.py)` "(.+)"$') -GAP = re.compile(r"^Gap: #\d+$") -UNTESTABLE = re.compile(r"^Untestable: \S") +ISSUE = re.compile(r"^#\d+$") +KINDS = ("Self-test", "Untestable", "Missing") def saved_name(module): @@ -67,14 +69,11 @@ def printed(lines, label): return False -def trace(text, outputs): - """The problems with a requirements document against the self-tests' - output, and the count of rows of each kind. - - `outputs` maps each module to the lines its self-test printed. - """ - problems = [] - counts = {"checked": 0, "untestable": 0, "gap": 0} +def rows(text, name, problems): + """Each FR row of a document, as (line number, ID, second cell, third + cell), in order, with a problem filed for each row that is malformed, + repeated, out of order or under another topic.""" + found = [] seen = set() topic = None last = None @@ -83,6 +82,7 @@ def trace(text, outputs): if heading: topic = heading.group(1) continue + # Markdown allows a table row a few spaces either side. line = line.strip() @@ -91,11 +91,11 @@ def trace(text, outputs): row = ROW.match(line) if not row: if re.match(r"^\|\s*FR-", line): - problems.append("line %d: a requirement row that does not " - "parse: %s" % (number, line)) + problems.append("%s line %d: a row that does not parse: %s" + % (name, number, line)) continue - rule, rule_topic, index, _, cell = row.groups() - where = "line %d, %s" % (number, rule) + rule, rule_topic, index, second, third = row.groups() + where = "%s line %d, %s" % (name, number, rule) # An ID is cited from other documents, so it must be unique, sit # under its own topic, and keep the order a reader looks it up by. @@ -107,16 +107,41 @@ def trace(text, outputs): if last and (rule_topic, index) <= last: problems.append("%s: out of order" % where) last = (rule_topic, index) + found.append((number, rule, second, third)) + return found - if UNTESTABLE.match(cell): - counts["untestable"] += 1 + +def trace(requirements, coverage, outputs): + """The problems with the requirements and their coverage against the + self-tests' output, and the count of covered rules of each kind. + + `outputs` maps each module to the lines its self-test printed. + """ + problems = [] + counts = {kind: 0 for kind in KINDS} + stated = rows(requirements, "requirements", problems) + + # A removed row keeps its ID so the number is never reused, and needs + # no coverage. + live = {rule for _, rule, text, _ in stated + if not text.startswith("Removed:")} + covered = set() + for number, rule, kind, cell in rows(coverage, "coverage", problems): + where = "coverage line %d, %s" % (number, rule) + covered.add(rule) + if rule not in live: + problems.append("%s: no live requirement has this ID" % where) + if kind not in KINDS: + problems.append("%s: an unknown kind, %s" % (where, kind)) continue - if GAP.match(cell): - counts["gap"] += 1 + if kind == "Untestable": + counts[kind] += 1 continue - if cell.startswith(("Gap", "Untestable")): - problems.append("%s: a gap names no issue, or an untestable rule " - "no reason" % where) + if kind == "Missing": + if ISSUE.match(cell): + counts[kind] += 1 + else: + problems.append("%s: a Missing row names no issue" % where) continue good = True for item in cell.split("
"): @@ -134,8 +159,10 @@ def trace(text, outputs): % (where, module, label)) good = False if good: - counts["checked"] += 1 - if not seen: + counts[kind] += 1 + for rule in sorted(live - covered): + problems.append("%s has no coverage row" % rule) + if not stated: problems.append("no requirement found") return problems, counts @@ -171,7 +198,7 @@ def saved_outputs(directory): def self_test(): - """Prove the trace passes a document whose every rule is accounted for, + """Prove the trace passes documents whose every rule is accounted for, and fails each way a rule can go unaccounted for.""" outputs = { "a.py": [" a planted check ok", @@ -180,68 +207,90 @@ def self_test(): "b/b.py": [" ok a mutation landed base-1=no improved-1=yes", " ok a mutation past the padding base-1=yes base-2=no"], } - - def document(*rows): - return "\n".join(("## 01 Topic", "", "| ID | Rule | Checked by |", - "|---|---|---|") + rows) + "\n" - - def problems_of(*rows): - return trace(document(*rows), outputs)[0] - - good = ( - '| FR-01-01 | A rule. | `a.py` "a planted check"
' - '`b/b.py` "a mutation landed" |', - '| FR-01-02 | A rule. | `a.py` "a label alone on its line" |', - "| FR-01-04 | A rule. | Untestable: no script sees it. |", - "| FR-01-05 | A rule. | Gap: #12 |", - ) - found, counts = trace(document(*good), outputs) + stated = ("| FR-01-01 | The benchmark shall do one thing. | Report |", + "| FR-01-02 | The benchmark shall do another. | Report |", + "| FR-01-03 | Removed: moved to FR-01-02. | - |", + "| FR-01-04 | The benchmark shall do a third. | Owner |", + "| FR-01-05 | The benchmark shall do a fourth. | Judge |") + good = ('| FR-01-01 | Self-test | `a.py` "a planted check"
' + '`b/b.py` "a mutation landed" |', + '| FR-01-02 | Self-test | `a.py` "a label alone on its line" |', + "| FR-01-04 | Untestable | No script sees it. |", + "| FR-01-05 | Missing | #12 |") + + def document(*lines): + return "\n".join(("### 01 Topic", "", "| ID | A | B |", + "| -- | - | - |") + lines) + "\n" + + def problems_of(*covering, requirements=stated): + return trace(document(*requirements), document(*covering), + outputs)[0] + + def one(*covering): + return len(problems_of(*covering, *good[len(covering):])) == 1 + + found, counts = trace(document(*stated), document(*good), outputs) checks = [ ("every rule accounted for passes", found == [], found), ("each kind of row is counted", - counts == {"checked": 2, "untestable": 1, "gap": 1}, counts), - ("a label no self-test prints fails", - len(problems_of('| FR-01-01 | A rule. | `a.py` "an absent check" |')) + counts == {"Self-test": 2, "Untestable": 1, "Missing": 1}, counts), + ("a live rule with no coverage row fails", + problems_of(*good[1:]) == ["FR-01-01 has no coverage row"], None), + ("a removed rule needs no coverage row", found == [], found), + ("a row for a removed rule fails", + len(problems_of(good[0], good[1], + "| FR-01-03 | Untestable | Gone. |", *good[2:])) == 1, None), + ("a label no self-test prints fails", + one('| FR-01-01 | Self-test | `a.py` "an absent check" |'), None), ("the start of a longer label is not a label", - len(problems_of('| FR-01-01 | A rule. | `a.py` "a planted" |')) == 1, - None), + one('| FR-01-01 | Self-test | `a.py` "a planted" |'), None), ("a label is looked up only in its own module", - len(problems_of('| FR-01-01 | A rule. | `b/b.py` "a planted check" |')) - == 1, None), + one('| FR-01-01 | Self-test | `b/b.py` "a planted check" |'), None), ("a module with no self-test fails", - len(problems_of('| FR-01-01 | A rule. | `c.py` "a planted check" |')) - == 1, None), + one('| FR-01-01 | Self-test | `c.py` "a planted check" |'), None), ("a long label meets the trees' columns after one space", - problems_of('| FR-01-01 | A rule. | ' - '`b/b.py` "a mutation past the padding" |') == [], None), + problems_of('| FR-01-01 | Self-test | ' + '`b/b.py` "a mutation past the padding" |', *good[1:]) + == [], None), ("an indented row is still traced", problems_of(good[0], - ' | FR-01-02 | A rule. | `a.py` "an absent check" |') - == ['line 6, FR-01-02: a.py prints no check "an absent check"'], - None), - ("a rule naming nothing fails", - len(problems_of("| FR-01-01 | A rule. | - |")) == 1, None), - ("a rule with an empty last cell fails", - len(problems_of(good[0], "| FR-01-02 | A rule. | |")) == 1, None), + ' | FR-01-02 | Self-test | `a.py` "an absent check" |', + *good[2:]) + == ['coverage line 6, FR-01-02: a.py prints no check ' + '"an absent check"'], None), ("a row with trailing spaces is still traced", problems_of(good[0], - '| FR-01-02 | A rule. | `a.py` "an absent check" | ') - == ['line 6, FR-01-02: a.py prints no check "an absent check"'], + '| FR-01-02 | Self-test | `a.py` "an absent check" | ', + *good[2:]) + == ['coverage line 6, FR-01-02: a.py prints no check ' + '"an absent check"'], None), + ("a row naming nothing fails", + one("| FR-01-01 | Self-test | - |"), None), + ("a row with an empty last cell fails", + len(problems_of(good[0], "| FR-01-02 | Self-test | |", *good[2:])) + == 2, None), + ("an unknown kind fails", one("| FR-01-01 | Gap | #12 |"), None), + ("a Missing row that names no issue fails", + len(problems_of(*good[:3], "| FR-01-05 | Missing | later |")) == 1, None), - ("a gap that names no issue fails", - len(problems_of("| FR-01-01 | A rule. | Gap: later |")) == 1, None), - ("an untestable rule with no reason fails", - len(problems_of("| FR-01-01 | A rule. | Untestable: |")) == 1, None), + ("an Untestable row with no reason fails", + len(problems_of(*good[:2], "| FR-01-04 | Untestable | |", good[3])) + == 2, None), ("an ID used twice fails", - len(problems_of(good[0], good[0])) == 2, None), + len(problems_of(good[0], *good)) == 2, None), ("an ID out of order fails", - len(problems_of(good[1], good[0])) == 1, None), + len(problems_of(good[1], good[0], *good[2:])) == 1, None), ("an ID under another topic fails", - len(problems_of(good[0].replace("FR-01-01", "FR-02-01"))) == 1, - None), + len(problems_of(requirements=(stated[0].replace("FR-01-01", + "FR-02-01"),) + + stated[1:])) >= 1, None), + ("a requirement row that does not parse fails", + len(problems_of(*good, requirements=stated + + ("| FR-01-06 | The benchmark shall. | |",))) + == 1, None), ("a document with no requirement fails", - trace("# Requirements\n", outputs)[0] == ["no requirement found"], + "no requirement found" in trace("# Requirements\n", "", outputs)[0], None), ] for label, ok, got in checks: @@ -254,13 +303,15 @@ def problems_of(*rows): def parse_args(argv): parser = argparse.ArgumentParser( - description="Trace every requirement to the self-test checks that " - "prove it.") + description="Trace every functional requirement to the self-test " + "checks that prove it.") parser.add_argument("--outputs", help="a directory holding each self-test's output as " ".txt; without it, every self-test runs") parser.add_argument("--requirements", default=REQUIREMENTS, - help="the requirements document to trace") + help="the requirements document") + parser.add_argument("--coverage", default=COVERAGE, + help="the coverage document to trace") parser.add_argument("--self-test", action="store_true", help="prove the trace on planted documents; run no " "self-test of another module") @@ -274,13 +325,17 @@ def main(argv): outputs = (saved_outputs(options.outputs) if options.outputs else run_self_tests()) with io.open(options.requirements, encoding="utf-8") as handle: - problems, counts = trace(handle.read(), outputs) + requirements = handle.read() + with io.open(options.coverage, encoding="utf-8") as handle: + coverage = handle.read() + problems, counts = trace(requirements, coverage, outputs) for problem in problems: print(" " + problem) lib.print_verdict( not problems, - "%d rule(s) checked, %d untestable, %d gap(s), %d problem(s)" - % (counts["checked"], counts["untestable"], counts["gap"], + "%d rule(s) checked by a self-test, %d untestable, %d missing a " + "check, %d problem(s)" + % (counts["Self-test"], counts["Untestable"], counts["Missing"], len(problems))) return 0 if not problems else 1 From c3bd6341a1ecdf01dc068979602b195ccb38bbdd Mon Sep 17 00:00:00 2001 From: Branimir Georgiev <66906831+braboj@users.noreply.github.com> Date: Sun, 1 Nov 2026 17:23:38 +0200 Subject: [PATCH 2/2] fix(efficacy): the trace refuses a requirement or coverage cell left blank A cell of spaces parsed as a cell, so an Untestable row with no reason passed. Every cell must now hold text, or the trace fails. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01DpT5xPFWEQr1bipxbbKBRF --- tests/efficacy/trace.py | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/tests/efficacy/trace.py b/tests/efficacy/trace.py index 6eeaf01..6436866 100644 --- a/tests/efficacy/trace.py +++ b/tests/efficacy/trace.py @@ -97,6 +97,13 @@ def rows(text, name, problems): rule, rule_topic, index, second, third = row.groups() where = "%s line %d, %s" % (name, number, rule) + # A cell of spaces parses as a cell, but says nothing: a reason, a + # kind or a requirement left blank. + second, third = second.strip(), third.strip() + if not (second and third): + problems.append("%s: a cell is blank" % where) + second = third = None + # An ID is cited from other documents, so it must be unique, sit # under its own topic, and keep the order a reader looks it up by. if rule in seen: @@ -124,13 +131,18 @@ def trace(requirements, coverage, outputs): # A removed row keeps its ID so the number is never reused, and needs # no coverage. live = {rule for _, rule, text, _ in stated - if not text.startswith("Removed:")} + if text is None or not text.startswith("Removed:")} covered = set() for number, rule, kind, cell in rows(coverage, "coverage", problems): where = "coverage line %d, %s" % (number, rule) covered.add(rule) if rule not in live: problems.append("%s: no live requirement has this ID" % where) + + # A blank row is already a problem; reading it further would only + # repeat it. + if kind is None: + continue if kind not in KINDS: problems.append("%s: an unknown kind, %s" % (where, kind)) continue @@ -277,6 +289,9 @@ def one(*covering): ("an Untestable row with no reason fails", len(problems_of(*good[:2], "| FR-01-04 | Untestable | |", good[3])) == 2, None), + ("an Untestable row whose reason is spaces fails", + problems_of(*good[:2], "| FR-01-04 | Untestable | |", good[3]) + == ["coverage line 7, FR-01-04: a cell is blank"], None), ("an ID used twice fails", len(problems_of(good[0], *good)) == 2, None), ("an ID out of order fails",