Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion docs/architecture/08-crosscutting-concepts.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ below. "No improvement shown" does not mean "no worse".
| Change-task churn, files and lines | relative % | 15 | 30 |
| Security probe pass rate (from round 3) | percentage points | 2 | 9 |
| Data-protection probe pass rate (from round 3) | percentage points | 10 | 30 |
| App code, lines and files (from round 5) | relative % | 20 | 40 |

- An adherence gain counts only if pass rate held. Following rules while
breaking the app is not an improvement.
Expand Down Expand Up @@ -595,8 +596,13 @@ its mean and interval and counts as neither a win nor a fail.
- **Better downward:** every static-analysis count, cognitive and cyclomatic
complexity, tokens, turns, wall time, cost, files, lines, artifacts nobody
asked for, change-task churn, axe violations, HTML errors.
- **Better downward, against a band:** from round 5, app code's lines and
files. A rise whose whole interval stays inside the margin of section 8.1.2
reads as held; only one wholly past it reads as worse.
- **Neutral, reported without a verdict:** maintainability index,
instability.
instability, test code's lines, from round 5 the source lines and files
that app code replaces, and before round 5 app code's rows, so an earlier
round rescored reads as it was reported.

### 8.7.3 What the report prints

Expand Down
1 change: 1 addition & 0 deletions docs/architecture/09-architecture-decisions.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ that mentions the design means the document these chapters replaced.
| 2026-10-27 | Each round names its builder models in its registration, and none comes from the vendor of the rounds' judge | The models are a knob a round sets, not a fixed list. A builder from the judge's vendor would bring back the self-preference the cross-check once answered, which no longer runs | — |
| 2026-10-27 | Round 5 runs block A alone, at K = 15 with no escalation, each block starting one arm later; adherence is held within 8 pp, and H2 reads the mean over pairs of trials. Blocks B and C wait for a later round | The report's rules, run on round 3's per-trial noise, decide almost nothing at K = 3: H1 is supported in 29 % of rounds when true, and a chance "worse" turns up in 36 %. At K = 15 those are 73 % and 12 %. On round 4's noise, B and C would contradict block A by chance at any affordable K | — |
| 2026-10-28 | A template change runs the baseline and the candidate head to head in the candidate's round, with one contrast, `candidate − baseline`, and no `none` arm; round 3 stays a reference without a verdict | A contrast pairing trials from different rounds gets no verdict, so round 3 as the baseline could decide nothing. Two arms answer "is the trim free" at the least cost | — |
| 2026-10-28 | From round 5, size reads app code's lines and files against a band of 20 %, smallest change 40 %; test lines are reported without a verdict; docs and configuration leave size; committed generated files count as artifacts nobody asked for | A better solution is often a little bigger, with tests and layering. Round 4's source lines missed templates, and its file count was mostly docs, templates and committed bytecode | — |

¹ This agrees with Anthropic's guidance on context engineering, which asks for the
smallest set of high-signal tokens: [Effective context engineering for AI
Expand Down
2 changes: 1 addition & 1 deletion docs/primer.md
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ own, in any order.
| **Attack probes** | 11 security attacks and 3 personal-data checks, each set read as its own pass rate | passed, of 11 and of 3 |
| **Judge's scores** | The blind judge reads the code three times and scores design, readability, maintainability, security and data protection | 1 to 5 |
| **Conventions** | Code tools check a 13-item checklist, such as lint, types and test coverage | met, of 13 |
| **Size** | The lines and files the agent wrote | lines |
| **Size** | The lines and files of app code the agent wrote, tests counted apart. A small rise reads as held | lines |
| **Cost** | The dollars, turns and minutes the run took | $ |

### 4.4 Reading the result
Expand Down
2 changes: 1 addition & 1 deletion docs/rounds/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ trial of that round has run. The rules every round shares are in
| Round | Registered | Asks |
| ----- | ---------- | ---- |
| [Round 4](round-4.md) | Before its first trial, after round 3 | Does a file supply what a thin spec leaves out, and help a weaker model more |
| [Round 5](round-5.md) | 2026-10-26, amended 2026-10-27 | Which way of delivering the rules gives the best and most consistent code |
| [Round 5](round-5.md) | 2026-10-26, amended 2026-10-27 and 2026-10-28 | Which way of delivering the rules gives the best and most consistent code |

## Reports

Expand Down
26 changes: 25 additions & 1 deletion docs/rounds/round-5.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
Registered in the design on 2026-10-26, before any round-5 trial ran, and
amended twice on 2026-10-27, still before any trial: once to change the judge,
and once to size the round from the noise of rounds 3 and 4 (#38). Moved here
unchanged but for its links.
unchanged but for its links, and amended on 2026-10-28, still before any trial,
to read code size as app code and test code (#39).

## 13. Round 5: how the rules are delivered

Expand Down Expand Up @@ -170,3 +171,26 @@ from build to build rather than from re-reading one app, so more blocks, not mor
readings, buy the precision.

Nothing in this section changes once a round-5 trial has run.

### 13.6 Code size

Amended on 2026-10-28 (#39), before any round-5 trial. Round 5 reads size as app
code and test code, against a band, in place of source lines and files:

| Row | What it counts | Direction | Margin | Smallest change that matters |
| --- | --- | --- | --- | --- |
| App code, lines | The app's Python outside its tests, with its templates, styles and scripts | down | 20 % relative | 40 % |
| App code, files | The same files | down | 20 % relative | 40 % |
| Test code, lines | Python under a `tests` directory or named `test_*.py`, `*_test.py` or `conftest.py` | none | — | — |

- An app-code row is **held** where the whole interval sits below the margin,
even above zero, and **worse** only where it sits wholly past it.
- Docs and configuration count toward no size.
- Committed bytecode, caches, databases and coverage data count as artifacts
nobody asked for.
- Source lines and files are still printed, without a verdict.

Why: a better solution is often a little bigger, with tests, error handling and
layering, so a small rise should not read as worse. In round 4's trees, tests
were 10 to 40 % of the Python lines, and docs, templates and config outnumbered
the app's modules, so the old rows measured neither code nor bulk cleanly.
122 changes: 116 additions & 6 deletions tests/efficacy/report.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,23 @@
# a round can afford rules out a loss of less than one.
ROUND5_MARGINS = dict(MARGINS, adherence=("8 pp", 0.08, ABSOLUTE))

# Round 5 reads app code's size against a band rather than zero. A better
# solution is often a little bigger, with layering and error handling, so a
# rise inside the margin reads as held and only one wholly past it as worse.
ROUND5_MARGINS.update((key, ("20 % relative", 0.20, RELATIVE))
for key in ("app_lines", "app_files"))
BANDED = ("app_lines", "app_files")

# The size rows round 5 replaces with app code. Source lines miss templates
# and count tests kept in the package; files count docs and configuration.
# They are still printed, without a verdict, so nothing reads them twice.
SUPERSEDED_IN_ROUND5 = ("source_lines", "tracked_files")

# The app-code rows decide from round 5 on. An earlier round rescored by the
# current scorer carries them too, but was registered on source lines and
# files, so it prints them without a verdict and reads as it was reported.
FROM_ROUND5 = ("app_lines", "app_files")

# The practical thresholds that can owe the one
# escalation to K = 5. Only a primary dimension triggers it, so no other
# metric's threshold is carried here, where something could come to read it.
Expand Down Expand Up @@ -365,6 +382,12 @@ def pattern_count(trial, verdict):
lambda t: metric_value(t, "scope", "source_lines")),
("tracked_files", "Files", DOWN,
lambda t: metric_value(t, "scope", "tracked_files")),
("app_lines", "App code, lines", DOWN,
lambda t: metric_value(t, "scope", "app_lines")),
("app_files", "App code, files", DOWN,
lambda t: metric_value(t, "scope", "app_files")),
("test_lines", "Test code, lines", NEUTRAL,
lambda t: metric_value(t, "scope", "test_lines")),
("unasked_artifacts", "Artifacts nobody asked for", DOWN,
lambda t: metric_value(t, "scope", "unasked_artifacts")),

Expand Down Expand Up @@ -498,6 +521,22 @@ def bca_interval(differences, seed):
DISAGREE_VERDICT = "no verdict: the two judges disagree on its direction"


def banded_verdict(interval, direction, margin):
"""Better, worse, held or no improvement shown, where a loss inside
`margin`, in the metric's own units, reads as held rather than worse."""
low, high = interval.get("low"), interval.get("high")
if low is None or high is None:
return "not computed"
loss_low, loss_high = (-high, -low) if direction == UP else (low, high)
if loss_high < 0:
return "better"
if loss_low > margin:
return "worse"
if loss_high <= margin:
return "held"
return "no improvement shown"


def verdict(interval, direction):
"""Better, worse, or no improvement shown — read against the direction."""
low, high = interval.get("low"), interval.get("high")
Expand Down Expand Up @@ -705,8 +744,11 @@ def crossed_labels(trials):

def collect(trials, metrics=METRICS):
"""Metric values by metric, arm and trial index."""
superseded = SUPERSEDED_IN_ROUND5 if is_round5(trials) else FROM_ROUND5
table = {}
for key, label, direction, accessor in metrics:
if key in superseded:
direction = NEUTRAL
row = {}
for name, trial in sorted(trials.items()):
try:
Expand Down Expand Up @@ -750,12 +792,18 @@ def contrasts(table, seed, crossed=(), margins=None):
interval = bca_interval(pairs, seed)
observed = [value for value in right.values() if value is not None]
across = label in crossed
read = verdict(interval, entry["direction"])
band = (margins or MARGINS).get(key)
if key in BANDED and band and observed and statistics.fmean(
observed):
read = banded_verdict(interval, entry["direction"],
band[1] * abs(statistics.fmean(
observed)))
per_contrast[label] = {
"pairs": pairs,
"mean": round(statistics.fmean(pairs), 4),
"interval": interval,
"verdict": (CROSSING_VERDICT if across
else verdict(interval, entry["direction"])),
"verdict": CROSSING_VERDICT if across else read,
"non_inferior": None if across else non_inferior(
key, interval, entry["direction"],
statistics.fmean(observed) if observed else None,
Expand Down Expand Up @@ -1592,7 +1640,12 @@ def score(wins, fails):

# The arm every file arm is read against: the bare agent.
BARE = "none"
SIZE = (("lines", "source_lines"), ("files", "tracked_files"))

# Code size, by the rows earlier rounds read and the app-code rows round 5
# reads. A run gives a verdict on one pair only: round 5 reports the earlier
# rows without one, and earlier rounds have no app-code scores.
SIZE = (("lines", "source_lines"), ("files", "tracked_files"),
("lines", "app_lines"), ("files", "app_files"))
COUNTED = ("no", "one", "two", "three", "four", "five")
NOT_MEASURED = "not measured"

Expand Down Expand Up @@ -2048,6 +2101,8 @@ def size_cell(table, results, name):
only the ones the interval separated."""
parts, measured = [], False
for word, key in SIZE:
if key not in results:
continue
cell = share_cell(table, results, key, name, None)
measured = measured or cell != NOT_MEASURED
if cell not in (None, NOT_MEASURED):
Expand All @@ -2061,7 +2116,7 @@ def reads_cell(answered, results, name):
"""One phrase from the answer and the size and cost verdicts."""
if answered == "Not measured":
return NOT_MEASURED
bulk = any(results[key][name]["verdict"] == "worse" for _, key in SIZE)
bulk = any(read_as(results, name, key, "worse") for _, key in SIZE)
if answered == "Yes":
return "quality, %s bulk" % ("with" if bulk else "no")
added = (["bulk"] if bulk else []) + (
Expand Down Expand Up @@ -2093,6 +2148,7 @@ def reading(answers, lengths):
# the follow-up change's churn, and what the judge read — each phrase said
# only where its metric was read better or worse.
STRUCTURE = (("more files", "tracked_files"), ("more code", "source_lines"),
("more files", "app_files"), ("more code", "app_lines"),
("more public names beyond the spec", "surface_extra"))
EFFORT = (("turns", "turns"), ("tokens", "output_tokens"),
("time", "wall_seconds"), ("cost", "cost_usd"))
Expand All @@ -2110,7 +2166,7 @@ def reading(answers, lengths):


def read_as(results, name, key, verdict):
return results[key][name]["verdict"] == verdict
return results.get(key, {}).get(name, {}).get("verdict") == verdict


def counted(n):
Expand Down Expand Up @@ -2513,7 +2569,9 @@ def contrast_cell(contrast, verdicts=True):
return body
verdict_text = contrast["verdict"]
inferiority = contrast.get("non_inferior")
if inferiority and verdict_text == "no improvement shown":
if inferiority and verdict_text == "held":
verdict_text += " within %s" % inferiority["margin"]
elif inferiority and verdict_text == "no improvement shown":
verdict_text += (", preserved within %s" % inferiority["margin"]
if inferiority["within"] else
", not preserved within %s" % inferiority["margin"])
Expand Down Expand Up @@ -2678,6 +2736,57 @@ def lost_checks():
and "no run record" in unrecorded_row[0]["reason"])]


def band_checks(seed):
"""App code's size reads against a band: a rise inside the margin is
held, only one wholly past it worse; round 5 reports the rows it
supersedes without a verdict, and an earlier round keeps them."""

# A margin of 20 lines: the loss side of each interval, for a metric that
# improves downward, placed against it.
checks = [(label, banded_verdict({"low": low, "high": high}, DOWN, 20)
== expected, banded_verdict({"low": low, "high": high},
DOWN, 20))
for label, low, high, expected in (
("a rise inside the band is held", 5, 15, "held"),
("a band that holds zero is held", -5, 10, "held"),
("a fall wholly below zero is better", -10, -2, "better"),
("a rise wholly past the band is worse", 25, 40, "worse"),
("one that straddles the band is undecided", 10, 30,
"no improvement shown"))]

# Skills writes 10 % more app code than none in every block, and twice the
# files of a tree that also holds docs.
def trial(app, files):
return {"scores": {"scope": {"value": {
"app_lines": app, "app_files": 10, "source_lines": app,
"tracked_files": files}}}}
trials = {}
for index in (1, 2, 3, 4, 5, 6):
trials["none-%d" % index] = trial(1000 + index, 20)
trials["skills-%d" % index] = trial(1100 + index + index % 2, 40)
results = contrasts(collect(trials), seed, (), ROUND5_MARGINS)
app = results["app_lines"]["skills-none"]["verdict"]
files = results["tracked_files"]["skills-none"]["verdict"]
earlier = {name.replace("skills", "full"): value
for name, value in trials.items()}
reread = contrasts(collect(earlier), seed)
kept = reread["tracked_files"]["full-none"]
later = reread["app_lines"]["full-none"]["verdict"]
shares = size_cell(collect(earlier), reread, "full-none")
checks.extend([
("an earlier round rescored prints app code without a verdict",
later == "reported without a verdict", later),
("and names each size share once",
shares == "lines +10 %, files +100 %",
shares),
("round 5 reads a 10 % rise in app code as held", app == "held", app),
("round 5 reports the files it supersedes without a verdict",
files == "reported without a verdict", files),
("an earlier round still reads its files row", kept["verdict"]
== "worse", kept["verdict"])])
return checks


def registration_checks():
"""A round is refused when its registration landed on the main branch
after its first trial, has not landed, is changed and not committed, or
Expand Down Expand Up @@ -3531,6 +3640,7 @@ def self_test(seed):
checks.extend(cross_checks(seed))
checks.extend(exclusion_checks())
checks.extend(round5_checks())
checks.extend(band_checks(seed))
checks.extend(failed_build_checks())
checks.extend(record_checks())
checks.extend((label, ok, ok) for label, ok in reach_checks())
Expand Down
Loading
Loading