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
4 changes: 2 additions & 2 deletions docs/architecture/05-building-block-view.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ dependency with its keyword.

| Block | Responsibility | Reads | Writes |
| ----- | -------------- | ----- | ------ |
| `generate_arm.py` | Makes one arm's file once: fixed text, one non-interactive generation from `agents.md`, or the emitter. Scans prompt and output for leaks | `brief.txt`, the templates source | `arms/<arm>/CLAUDE.md`, `generation.json` |
| `generate_arm.py` | Makes one arm's file once: fixed text, one non-interactive generation from `agents.md`, under a line budget where the arm has one, or the emitter. Scans prompt and output for leaks, and refuses a file over its budget | `brief.txt`, the templates source | `arms/<arm>/CLAUDE.md`, `generation.json` |
| `harness.py` | Prepares each workspace, runs the agent in isolation, catches reach, freezes the result, keeps the run record current | The specs, the arm files, the change prompt | The run root |
| `reuse.py` | Copies an earlier round's trials and readings into a new root, with their tool lock | An earlier root | The run root, the scoring area |
| `progress.py` | Watches a run: one bar per arm, its voided tries, its cost and the trial running, redrawn every 30 s. Read-only | The run records | The console |
Expand Down Expand Up @@ -87,7 +87,7 @@ Every arm starts from an empty git repository holding `SPEC.md`. All but
|---|---|---|---|
| `none` | nothing: the bare agent | — | the baseline every file is compared with |
| `full` | the file the interview generates, inline | none | do the templates help as shipped |
| `short` | the file the interview generates, inline, under a budget | ≤ 40 lines, ≤ 88 characters wide | does a short generated file help |
| `short` | one generation from `agents.md`, inline, under a budget | ≤ 40 lines, ≤ 88 characters wide | does a short generated file help |
| `hybrid` | the file the interview generates in its hybrid model, with the templates vendored into the workspace | none | does the model the owner's projects use help |
| `hand` | a hand-written file | ≤ 40 lines | is the effect the templates, or merely having a file |

Expand Down
2 changes: 2 additions & 0 deletions docs/rounds/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ trial of that round has run. The rules every round shares are in
| [Round 5](round-5.md) | 2026-10-26, amended 2026-10-27, 2026-10-28 and 2026-10-29; stopped after its first start | Which way of delivering the rules gives the best and most consistent code |
| [Round 5b](round-5b.md) | 2026-10-29, after round 5 stopped; stopped after its first start | Round 5's question, with a prompt that tells every arm the spec is the approved plan |
| [Round 5c](round-5c.md) | 2026-10-29, after round 5b stopped | Round 5b's question, with each trial's workspace in a pen of its own |
| [Round 5d](round-5d.md) | 2026-10-31, while round 5c ran | Whether a person's short file does what the templates do, at their length and at its own |

## Reports

Expand All @@ -27,3 +28,4 @@ repository existed.
| 5 | Stopped 2026-10-29, after four trials | Context file: how the rules are delivered | — |
| 5b | Stopped 2026-10-29, after four trials | Context file: how the rules are delivered | — |
| 5c | Not run yet | Context file: how the rules are delivered | — |
| 5d | Not run yet | Context file: a hand-written one and a 40-line one, against 5c | — |
160 changes: 160 additions & 0 deletions docs/rounds/round-5d.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,160 @@
# Round 5d registration

Registered on 2026-10-31, while round 5c ran and before any round-5d trial ran.
Round 5c keeps its registration as it was when its first trial ran; this one is
a registration of its own.

## 13d. Round 5d: a person's file and a 40-line file, against round 5c

### 13d.1 What it takes from round 5c

Round 5d runs [round 5c's registration](round-5c.md) as it stood at `07d1641`:
block A, the spec at its registered sha256, `claude-sonnet-5` at effort `high`,
round 5b's prompt, the pen, the judge, the scoring and the code size rows, and
the margins of round 5's H1.

Three things differ: the arms, the order, and a reuse of round 5c's `none`.

### 13d.2 The arms

| Arm | Trials | Where they come from |
| --- | --- | --- |
| `hand` | 15, fresh | `tests/efficacy/arms/hand/CLAUDE.md` as it is at `010ee36` |
| `short` | 15, fresh | `tests/efficacy/arms/short/CLAUDE.md`, made for 5d |
| `none` | 3, fresh | The bare agent, as a check on drift |
| `none`, from 5c | 15, reused | Round 5c's `none-1` to `none-15`, scored and read |

**`hand`** is a person's file, written for round 3's brief.

- 39 lines and 1,376 bytes, sha256
`25459854949f648837ac5ef37fca5d7472923b544dffb694cd40f8b8a53ec748`.
- Kept verbatim. It is not edited for round 5's brief.

**`short`** is round 3's arm made again from round 5's chain.

- One generation by `claude-sonnet-5` at effort `high`, in `agents.md`'s inline
model, from the templates at `9086e0ff`, the brief and round 5's roots, with
no interview: the way `inline` was made.
- Held to round 3's budget: at most 40 lines, none over 88 characters. The
generator refuses a file over either bound rather than trimming it.
- 40 lines and 2,173 bytes, sha256
`8abbcf098312e768e5e01fb6266ec230c13877fa71f40a0bc3ec06e89cd63aea`, with its
generation record beside it.
- It replaces round 3's file, made from round 1's templates. An earlier round
is re-run from the benchmark at its own commit, so its files need not stay.

**The reused `none`** comes with round 5c's tool lock, so both rounds are
measured with one ruler.

Why `hand`: it is the only arm that separates the templates from having a file
at all (the decision of 2026-09-12). Round 5 left it out because each of its
arms is made from the templates at `9086e0ff`, and a person's file is not.

Why `short`: round 5c's templates files are 22 to 57 KB, and `hand` is 1.4 KB,
so `hand` against them changes the content and the size at once. `short` and
`hand` sit within a line of each other, so `short` minus `hand` compares the
content at one length, as round 2's `short` minus `hand` did.

### 13d.3 The order

Two runs, in one run root of round 5d's own:

| Run | Arms | Trials, in order |
| --- | --- | --- |
| 1 | `none`, `hand`, `short`, K = 3 | the rotated order, 9 trials |
| 2 | `hand`, `short`, K = 15, from `short-4` | blocks 4 to 15, 24 trials |

- Run 1 starts `none-1`, `hand-1`, `short-1`, and each block starts one arm
later.
- `hand` and `short` share every block, so `short` minus `hand` is paired.
- The fresh `none` trials share blocks 1 to 3 with them, so they see the same
days as the round's start.
- Drift after block 3 goes unchecked for the contrasts with round 5c. The CLI
is pinned (13d.5), which holds the one source of drift known to have moved.

Why the pin: the Claude CLI updated itself from 2.1.312 to 2.1.314 at 03:13 on
2026-10-30, in the middle of round 5c. Round 5c's interleaving spreads that
across its arms. Round 5d runs days later, so nothing would spread a further
update across the two rounds.

### 13d.4 Hypotheses

A contrast with a round 5c arm is unpaired: they never ran in one block. An
unpaired interval is wider than the paired one round 5 sized K on, so at K = 15
a row is harder to show as held.

**The drift check.** Round 5c's `none` stands in for a `none` run beside the
round's arms.

| | |
| --- | --- |
| Measure | each fresh `none` trial against round 5c's 15 |
| Holds | each trial's primary rows sit within the range of 5c's 15 |
| Fails | H4 and H5 read inconclusive, and the report says why |

**H4, a file at all.** A person's short file improves on no file.

| | |
| --- | --- |
| Contrast | `hand` minus round 5c's `none`, unpaired |
| Primary rows | as round 5's H1 |
| Supported | some primary row is better, and none is worse |
| Refuted | any primary row is worse |
| Otherwise | inconclusive |

**H5, the templates against a person's file.** Each templates arm, `inline`,
`hybrid`, `reference` and `skills`, delivers at least what a person's file
delivers.

| | |
| --- | --- |
| Contrast | each templates arm of round 5c, minus `hand`, unpaired |
| Primary rows | as round 5's H1 |
| Supported, per arm | every primary row is held or better |
| Refuted, per arm | any primary row is worse |

**H6, the templates' content at a person's length.** A 40-line file from the
templates delivers at least what a person's file of the same length delivers.

| | |
| --- | --- |
| Contrast | `short` minus `hand`, paired within the block |
| Primary rows | as round 5's H1 |
| Supported | every primary row is held or better |
| Refuted | any primary row is worse |

**Secondary, no verdict:** every metric of [ch.
8.6](../architecture/08-crosscutting-concepts.md) for `hand` and `short`
against round 5c's `none`; `short` against round 5c's `inline`, the same
generation without the budget; the fresh `none` against round 5c's `none`;
cost, turns, tokens and wall time; and the words each arm puts in context on
every turn, beside each 5c arm's.

### 13d.5 Before the first trial

Done with this registration:

- `generate_arm.py` makes `short` under its budget, and refuses a file over it
- `short` is generated and committed with its record
- the harness reads `short` from its new file
- the report already computes H6's contrast, `short` minus `hand`, paired, as
it did for round 2

The harness and the report still gain, each with a self-test:

- K up to 15 for a run of `hand` and `short`, with round 5's spec check; today
a run with no round-5 arm is capped at K = 5 and its spec is not checked
- the Claude CLI pinned at 2.1.314 for the round, with auto-update off and the
version recorded on every trial
- round 5c's `none` trials read with their scores, judgings, security readings
and tool lock, kept apart from round 5d's `none-1` to `none-3`, whose names
they share
- the unpaired contrasts of H4 and H5, and the drift check

### 13d.6 When it runs

After round 5c's last trial is in, scored and judged. Its 33 trials take about
22 hours at round 5c's pace and spend the plan's limit, so the run waits for
the owner's go.

Nothing in this registration changes once a round-5d trial has run.
79 changes: 40 additions & 39 deletions tests/efficacy/arms/short/CLAUDE.md
Original file line number Diff line number Diff line change
@@ -1,39 +1,40 @@
# tariff — CLAUDE.md

Owner: Imbra Ltd. Pricing and invoicing web app: catalog, discounts, tax, invoices.
Stack: Python 3.12, Flask 3, Jinja, HTMX, SQLite. Tools: uv, ruff, mypy strict, pytest.
Runs locally; no deployment target; nothing reaches the network.

## Structure
- The pricing engine is a library that imports without Flask; Flask is one caller.
- Flask app uses `create_app()`, blueprints, thin routes; logic lives in services.
- Layout is in README.md; do not duplicate it here.

## Personal data (GDPR)
- Customers hold name, email, postal address; invoices name them.
- Support erasure and export of one customer's data; keep invoice totals intact.
- Never log or print personal data; never put it in fixtures, commits or errors.
- One administrator signs in; CSRF on every state-changing request.

## Code
- Money is integer cents or Decimal, never float; timestamps in UTC.
- Errors raised on purpose derive from one package base error.
- Parameterized SQL only; migrations versioned, never edited once merged.
- HTMX endpoints return partials when `HX-Request` is set; 422 on invalid forms.
- Config from environment, validated at startup; `.env` is never committed.
- Names carry meaning; no debug prints, no commented-out code.

## Quality
- Gates: `ruff check`, `ruff format`, `mypy --strict`, `pytest`; all must pass.
- Test the engine without Flask; use a real SQLite file, not a mock.
- Every public function has type hints and a Google-style docstring.

## Git
- Work on a branch, never on `main`; conventional commit prefixes, subject under 80.
- Update README, CLAUDE.md and docs in the same commit as the change.

## Off-limits without an approved plan
- Auth and session code, migrations, `.env*`, and invoice export formats.
- Propose the change with rollback and test coverage first.

<!-- Generated with solid-ai-templates (github.com/braboj/solid-ai-templates) -->
# tariff
Pricing and invoicing web app for Imbra Ltd: catalog, discounts, tax
jurisdictions, customers, invoices. Python 3.12, Flask 3, Jinja, HTMX,
SQLite, uv. One administrator; runs locally only, no deployment target.
The pricing engine is a library another program may import directly.
- Model: inline
## 1. Project
See README.md for the directory map; place code beside its layer.
```bash
uv run flask run # start the app
uv run ruff check . && uv run ruff format --check . # lint
uv run mypy --strict . && uv run pytest # types + tests
```
## 2. Code conventions
- Work on a branch; never commit to `main`. Commit `uv.lock`, never
`.env`, secrets, or build output.
- Off-limits without approval: auth/session code, migrations, `.env*`.
- Parameterize every SQL query; never interpolate input into SQL.
- Store money as integer minor units or `Decimal`, never `float`.
- Hash the administrator's password with bcrypt, scrypt, or Argon2.
- Regenerate the session ID on login; expire idle sessions; set
`HttpOnly`, `Secure`, `SameSite=Lax` cookies.
- Give every state-changing HTMX/form request a CSRF token.
- Encode all template output for context; never bypass autoescaping.
- Run schema changes through a migration with up/down steps; never
edit the SQLite file by hand.
- Never log a customer's name, email, address, or any secret value.
- Classify customer PII (name, email, postal address); export or erase
it on request: hard delete or anonymize, never soft-delete alone.
- Cover pricing, discount, and tax logic with edge-case unit tests.
## 3. Review process
Review in order: security, correctness, clarity, conventions.
- [ ] No secret or PII value in a committed file or log.
- [ ] Every SQL query parameterized; every migration has up/down.
- [ ] Money uses integer minor units or `Decimal`, never `float`.
## 4. Session protocol
- Approver: the repository owner. Tracking: open, no tracker named.
- Release: a tagged commit on `main` after lint, types, tests pass.
- End of session, run in order: `ruff check .`, `mypy --strict .`,
`pytest`; report any that did not run as not run, never as passed.
Loading
Loading