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
5 changes: 3 additions & 2 deletions docs/architecture/08-crosscutting-concepts.md
Original file line number Diff line number Diff line change
Expand Up @@ -382,7 +382,7 @@ No person scores the judge. Two automated checks do:
bundle it was quoted from, and the report prints the share found per
trial. A judge that never opened the code still returns plausible
numbers; this is what tells the two apart.
- **The control fixture:** eleven trees built from two pinned applications
- **The control fixture:** twelve trees built from two pinned applications
(`tests/efficacy/control/`). Every tree passes the same tests as its
application, so only what was changed separates them. Some are damaged,
some improved. A primary dimension counts only if it falls on the damaged
Expand Down Expand Up @@ -417,6 +417,7 @@ application's tests.
| `base-1` | the application as one trial generated it, unaltered |
| `degraded-1` | the domain merged into one module, `from flask import current_app` used inside `price`, and the package's exceptions reparented off `TariffError` |
| `obscured-1` | the pricing algorithm inlined into one long function with abbreviated names, and nothing else: the module boundaries, the error hierarchy and the dispatch are the base's |
| `clarified-1` | the mirror of `obscured-1`: the pricing module rewritten into short functions of one step each, with names that carry the intent, and nothing else changed |
| `improved-1` | a rule contract and self-registering kind registry, dispatch on concrete type removed from pricing and persistence, the hardcoded kinds tuple replaced by the registry, a `__class__.__name__` ladder removed from a template, and two stray error classes folded into the package hierarchy |
| `improved-2` | `improved-1`, and the store maps a rule's own terms onto its columns with a codec per column, so no module dispatches on a kind |
| `improved-3` | `improved-2`, and each kind declares the fields it asks a form for, so the form-building code and the template are derived from the registry and no layer names a kind |
Expand Down Expand Up @@ -458,7 +459,7 @@ about the instrument:

Which tree tests which row matters. `degraded-1` damages structure and leaves
every function body alone, so a flat `readability` there says nothing about
the row — that is what `obscured-1` is for. Read each row against the tree
the row — that is what `obscured-1` and `clarified-1` are for. Read each row against the tree
built to move it, and treat the others as a check that it is not moving on
noise.

Expand Down
52 changes: 52 additions & 0 deletions docs/architecture/10-quality-requirements.md
Original file line number Diff line number Diff line change
Expand Up @@ -286,3 +286,55 @@ 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.
4 changes: 2 additions & 2 deletions docs/journeys/check/check-the-judge.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ Assumptions:
| 1 | Owner | Runs the control's self test | 2 min | Builds in a temporary directory and checks every mutation landed |
| 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 | 30 to 60 min | Eleven trees, 33 judgings |
| 5 | Owner | Reads each primary row: down on `degraded-1`, `obscured-1`, `insecure-1`, `leaky-1`, up on `improved-*`, `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) |
| 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) |
| | | Total | about 1.5 hours | |

## Commands
Expand Down
48 changes: 35 additions & 13 deletions tests/efficacy/control/control.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
MERGED = ("errors", "models", "rules", "pricing")

TRIALS = ("base-1", "degraded-1", "improved-1", "improved-2",
"improved-3", "obscured-1")
"improved-3", "obscured-1", "clarified-1")

# The second application's trees: its security and its handling of personal
# data, each damaged in one tree and improved in another.
Expand Down Expand Up @@ -319,6 +319,20 @@ def obscure(tree):
os.path.join(tree, "tariff", "pricing.py"))


def clarify(tree):
"""Improve what a reader has to hold in their head, and nothing else.

The mirror of `obscure`: only the pricing module is rewritten, into short
functions that each do one step, with names that carry the intent and no
expression that needs a second reading. The module boundaries, the error
hierarchy and the dispatch on concrete rule classes stay the base's, so
the readability row has something to rise on and every other row has
nothing.
"""
shutil.copy2(os.path.join(OVERLAY, "pricing_clarified.py"),
os.path.join(tree, "tariff", "pricing.py"))


def edit(tree, rel, *swaps):
"""Apply `(old, new, where)` swaps to one file of the tree, in order."""
text = read(tree, rel)
Expand Down Expand Up @@ -484,34 +498,35 @@ def protect(tree):
LANDINGS = (
("tariff/core.py exists", lambda t: os.path.isfile(
os.path.join(t, "tariff", "core.py")),
{"base-1": False, "degraded-1": True, "improved-1": False, "improved-2": False, "obscured-1": False, "improved-3": False}),
{"base-1": False, "clarified-1": False, "degraded-1": True, "improved-1": False, "improved-2": False, "obscured-1": False, "improved-3": False}),

# Read against the domain alone: the web package imports flask in every
# tree, so a whole-tree probe would answer yes whatever was done.
("the domain imports flask", lambda t: "from flask import current_app"
in domain(t), {"base-1": False, "degraded-1": True,
in domain(t), {"base-1": False, "clarified-1": False, "degraded-1": True,
"improved-1": False, "improved-2": False, "obscured-1": False, "improved-3": False}),
("ValidationError derives from TariffError",
lambda t: "class ValidationError(TariffError):" in whole(t),
{"base-1": True, "degraded-1": False, "improved-1": True, "improved-2": True, "obscured-1": True, "improved-3": True}),
{"base-1": True, "clarified-1": True, "degraded-1": False, "improved-1": True, "improved-2": True, "obscured-1": True, "improved-3": True}),

# The damaged tree keeps the ladder: merging the modules moves it into
# core.py rather than removing it. Only the improved tree loses it.
("pricing dispatches on concrete type",
lambda t: "isinstance(r, TieredRule)" in whole(t),
{"base-1": True, "degraded-1": True, "improved-1": False, "improved-2": False, "obscured-1": True, "improved-3": False}),
lambda t: ("isinstance(r, TieredRule)" in whole(t)
or "isinstance(rule, TieredRule)" in domain(t)),
{"base-1": True, "clarified-1": True, "degraded-1": True, "improved-1": False, "improved-2": False, "obscured-1": True, "improved-3": False}),
("the rules declare a contract", lambda t: "class Rule(ABC):" in whole(t),
{"base-1": False, "degraded-1": False, "improved-1": True, "improved-2": True, "obscured-1": False, "improved-3": True}),
{"base-1": False, "clarified-1": False, "degraded-1": False, "improved-1": True, "improved-2": True, "obscured-1": False, "improved-3": True}),
("the kinds are hardcoded",
lambda t: 'KINDS = ("percentage", "bulk", "tiered", "coupon")'
in whole(t), {"base-1": True, "degraded-1": True,
in whole(t), {"base-1": True, "clarified-1": True, "degraded-1": True,
"improved-1": False, "improved-2": False, "obscured-1": True, "improved-3": False}),
("an error class sits outside the hierarchy",
lambda t: "class _BadRequest(Exception):" in whole(t),
{"base-1": True, "degraded-1": True, "improved-1": False, "improved-2": False, "obscured-1": True, "improved-3": False}),
{"base-1": True, "clarified-1": True, "degraded-1": True, "improved-1": False, "improved-2": False, "obscured-1": True, "improved-3": False}),
("the template branches on a class name",
lambda t: "__class__.__name__" in whole(t),
{"base-1": True, "degraded-1": True, "improved-1": False, "improved-2": False, "obscured-1": True, "improved-3": False}),
{"base-1": True, "clarified-1": True, "degraded-1": True, "improved-1": False, "improved-2": False, "obscured-1": True, "improved-3": False}),

# The seed fixture names a kind per sample row in every tree, and has to:
# that is data. What this reads is whether the store DISPATCHES on kind,
Expand All @@ -520,18 +535,24 @@ def protect(tree):
lambda t: ('kind == "tiered"' in store(t)
or "isinstance(rule, TieredRule)" in store(t)
or "_TO_ROW = {" in store(t)),
{"base-1": True, "degraded-1": True, "improved-1": True,
{"base-1": True, "clarified-1": True, "degraded-1": True, "improved-1": True,
"improved-2": False, "obscured-1": True, "improved-3": False}),

("the pricing algorithm is broken into named steps",
lambda t: "def _price_line(" in whole(t),
{"base-1": True, "degraded-1": True, "improved-1": True,
{"base-1": True, "clarified-1": True, "degraded-1": True, "improved-1": True,
"improved-2": True, "obscured-1": False, "improved-3": True}),

("the invoice's discounts are a step of their own",
lambda t: "def _apply_invoice_rules(" in whole(t),
{"base-1": False, "clarified-1": True, "degraded-1": False,
"improved-1": False, "improved-2": False, "improved-3": False,
"obscured-1": False}),

("the form names a rule kind",
lambda t: ('kind == "percentage"' in form(t)
or "Buy (bulk)" in form(t)),
{"base-1": True, "degraded-1": True, "improved-1": True,
{"base-1": True, "clarified-1": True, "degraded-1": True, "improved-1": True,
"improved-2": True, "improved-3": False, "obscured-1": True}),
)

Expand Down Expand Up @@ -697,6 +718,7 @@ def build(root):
improve_further(made["improved-2"])
improve_form(made["improved-3"])
obscure(made["obscured-1"])
clarify(made["clarified-1"])

second = extract(pinned(BASE_2, BASE_2_SHA256), scoring, TRIALS_2)
insecure(second["insecure-1"])
Expand Down
Loading
Loading