From dad065b9f6ec81d04749b8497c3e939b70b1a520 Mon Sep 17 00:00:00 2001 From: Branimir Georgiev <66906831+braboj@users.noreply.github.com> Date: Sat, 31 Oct 2026 12:52:26 +0200 Subject: [PATCH 1/4] docs(rounds): register round 5d, the hand-written file against round 5c Round 5d runs `hand` at K = 15 and three fresh `none` trials as a drift check, and reuses round 5c's `none`. H4 asks whether a person's file improves on none; H5 whether each templates arm holds against it. The CLI is pinned, because it updated itself in the middle of round 5c. Refs #89 Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01DpT5xPB8YTAMW2Msp4aPTX --- docs/rounds/README.md | 2 + docs/rounds/round-5d.md | 115 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 117 insertions(+) create mode 100644 docs/rounds/round-5d.md diff --git a/docs/rounds/README.md b/docs/rounds/README.md index c48ea82..f75858f 100644 --- a/docs/rounds/README.md +++ b/docs/rounds/README.md @@ -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, against round 5c | ## Reports @@ -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, against round 5c | — | diff --git a/docs/rounds/round-5d.md b/docs/rounds/round-5d.md new file mode 100644 index 0000000..6bf8457 --- /dev/null +++ b/docs/rounds/round-5d.md @@ -0,0 +1,115 @@ +# 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: the hand-written 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` | +| `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 | + +- The `hand` file is 39 lines and 1,376 bytes, sha256 + `25459854949f648837ac5ef37fca5d7472923b544dffb694cd40f8b8a53ec748`. +- It is kept verbatim, as it was written for round 3's brief. It is not edited + for round 5's. +- The reused trials come 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. + +### 13d.3 The order + +Two runs, in one run root of round 5d's own: + +| Run | Arms | Trials, in order | +| --- | --- | --- | +| 1 | `none`, `hand` | `none-1`, `hand-1`, `hand-2`, `none-2`, `none-3`, `hand-3` | +| 2 | `hand`, from `hand-4` | `hand-4` to `hand-15` | + +- The fresh `none` trials share blocks 1 to 3 with `hand`, so they see the same + days as the start of `hand`. +- Drift after block 3 goes unchecked. 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's `hand` runs days later and on its own, so nothing +would spread a further update. + +### 13d.4 Hypotheses + +Every contrast here is unpaired: `hand` and the 5c arms 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 `hand`. + +| | | +| --- | --- | +| 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 | + +**Secondary, no verdict:** every metric of [ch. +8.6](../architecture/08-crosscutting-concepts.md) for `hand` against round 5c's +`none`; the fresh `none` against round 5c's `none`; cost, turns, tokens and wall +time; and the words `hand` puts in context on every turn, beside each 5c arm's. + +### 13d.5 Before the first trial + +The harness and the report gain, each with a self-test: + +- K up to 15 for a run of `hand`, 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 18 trials take about +12 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. From 495a0ec9bc53d86965a5bb64f5f53f1b14cd09bb Mon Sep 17 00:00:00 2001 From: Branimir Georgiev <66906831+braboj@users.noreply.github.com> Date: Sat, 31 Oct 2026 13:11:29 +0200 Subject: [PATCH 2/4] feat(efficacy): generate short5, round 3's short from round 5's chain The generator gains short's budget again, 40 lines of 88 characters, stated in the instruction and refused whole when a file is over it. It makes `short5` from the templates at 9086e0ff in the inline model, in a directory of its own so round 3's `short` keeps its file and record. Round 5d now runs `short5` beside `hand` in every block, so H6, `short5` minus `hand`, compares the templates' content with a person's file at one length, paired. Refs #89 Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01DpT5xPB8YTAMW2Msp4aPTX --- docs/architecture/05-building-block-view.md | 2 +- docs/rounds/README.md | 4 +- docs/rounds/round-5d.md | 98 ++++++++--- tests/efficacy/arms/short5/CLAUDE.md | 40 +++++ tests/efficacy/arms/short5/generation.json | 174 ++++++++++++++++++++ tests/efficacy/generate_arm.py | 98 ++++++++++- tests/efficacy/harness.py | 5 +- 7 files changed, 382 insertions(+), 39 deletions(-) create mode 100644 tests/efficacy/arms/short5/CLAUDE.md create mode 100644 tests/efficacy/arms/short5/generation.json diff --git a/docs/architecture/05-building-block-view.md b/docs/architecture/05-building-block-view.md index 9edfa97..9725d7f 100644 --- a/docs/architecture/05-building-block-view.md +++ b/docs/architecture/05-building-block-view.md @@ -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//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//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 | diff --git a/docs/rounds/README.md b/docs/rounds/README.md index f75858f..cce1662 100644 --- a/docs/rounds/README.md +++ b/docs/rounds/README.md @@ -11,7 +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, against round 5c | +| [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 @@ -28,4 +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, against round 5c | — | +| 5d | Not run yet | Context file: a hand-written one and a 40-line one, against 5c | — | diff --git a/docs/rounds/round-5d.md b/docs/rounds/round-5d.md index 6bf8457..a7f034b 100644 --- a/docs/rounds/round-5d.md +++ b/docs/rounds/round-5d.md @@ -4,7 +4,7 @@ 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: the hand-written file, against round 5c +## 13d. Round 5d: a person's file and a 40-line file, against round 5c ### 13d.1 What it takes from round 5c @@ -20,46 +20,71 @@ Three things differ: the arms, the order, and a reuse of round 5c's `none`. | Arm | Trials | Where they come from | | --- | --- | --- | | `hand` | 15, fresh | `tests/efficacy/arms/hand/CLAUDE.md` as it is at `010ee36` | +| `short5` | 15, fresh | `tests/efficacy/arms/short5/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 | -- The `hand` file is 39 lines and 1,376 bytes, sha256 +**`hand`** is a person's file, written for round 3's brief. + +- 39 lines and 1,376 bytes, sha256 `25459854949f648837ac5ef37fca5d7472923b544dffb694cd40f8b8a53ec748`. -- It is kept verbatim, as it was written for round 3's brief. It is not edited - for round 5's. -- The reused trials come with round 5c's tool lock, so both rounds are measured - with one ruler. +- Kept verbatim. It is not edited for round 5's brief. + +**`short5`** is round 3's `short` 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 `short`'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,291 bytes, sha256 + `a028d5ee6e44b35329b580ea2b5ecda3c0823b4a1c30f22667dcadb652f220a8`, with its + generation record beside it. +- Round 3's `short` keeps its own file and record, made from round 1's + templates. + +**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 `short5`: 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. `short5` and +`hand` sit within a line of each other, so `short5` 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` | `none-1`, `hand-1`, `hand-2`, `none-2`, `none-3`, `hand-3` | -| 2 | `hand`, from `hand-4` | `hand-4` to `hand-15` | +| 1 | `none`, `hand`, `short5`, K = 3 | the rotated order, 9 trials | +| 2 | `hand`, `short5`, K = 15, from `short5-4` | blocks 4 to 15, 24 trials | -- The fresh `none` trials share blocks 1 to 3 with `hand`, so they see the same - days as the start of `hand`. -- Drift after block 3 goes unchecked. The CLI is pinned (13d.5), which holds - the one source of drift known to have moved. +- Run 1 starts `none-1`, `hand-1`, `short5-1`, and each block starts one arm + later. +- `hand` and `short5` share every block, so `short5` 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's `hand` runs days later and on its own, so nothing -would spread a further update. +across its arms. Round 5d runs days later, so nothing would spread a further +update across the two rounds. ### 13d.4 Hypotheses -Every contrast here is unpaired: `hand` and the 5c arms 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. +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 `hand`. +**The drift check.** Round 5c's `none` stands in for a `none` run beside the +round's arms. | | | | --- | --- | @@ -88,28 +113,47 @@ delivers. | 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 | `short5` 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` against round 5c's -`none`; the fresh `none` against round 5c's `none`; cost, turns, tokens and wall -time; and the words `hand` puts in context on every turn, beside each 5c arm's. +8.6](../architecture/08-crosscutting-concepts.md) for `hand` and `short5` +against round 5c's `none`; `short5` 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 -The harness and the report gain, each with a self-test: +Done with this registration: + +- `generate_arm.py` makes `short5` under its budget, and refuses a file over it +- `short5` is generated and committed with its record +- the harness knows `short5` as an arm + +The harness and the report still gain, each with a self-test: -- K up to 15 for a run of `hand`, 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 +- K up to 15 for a run of `hand` and `short5`, 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 +- the paired contrast of H6, 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 18 trials take about -12 hours at round 5c's pace and spend the plan's limit, so the run waits for +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. diff --git a/tests/efficacy/arms/short5/CLAUDE.md b/tests/efficacy/arms/short5/CLAUDE.md new file mode 100644 index 0000000..c507550 --- /dev/null +++ b/tests/efficacy/arms/short5/CLAUDE.md @@ -0,0 +1,40 @@ +# tariff + +Pricing and invoicing web app for Imbra Ltd: catalog, discount rules, tax +jurisdictions, customers, invoices. Python 3.12, Flask 3, Jinja, HTMX, +SQLite; uv, ruff, mypy strict, pytest. Runs locally only; no deploy target. +- Model: inline +## 1. Project +The pricing engine is a standalone, framework-free library with its own +public API, called by the Flask app and by another program, never the +reverse. See `README.md` for structure; do not duplicate it here. +```bash +uv run ruff check . && uv run mypy --strict . && uv run pytest +``` +## 2. Code conventions +- Branch-only commits, never `main`; commit `uv.lock`, never secrets, + `.env*`, or the SQLite file; off-limits: admin auth/session, migrations, secrets. +- Keep routes thin: decode, call the library/service, render; give the + library its own injectable logger and never print or configure logging. +- Store money as `Decimal` (minor units or decimal column), never `float`; + store timestamps in UTC; parameterize every SQL query. +- Hash the admin password with bcrypt/scrypt/Argon2; set session cookie + flags `HttpOnly`, `Secure`, `SameSite=Lax` with a 30-minute idle expiry; + require a CSRF token on every POST/PUT/PATCH/DELETE route. +- Never log a customer's name, email or address, only an opaque ID. Erase + personal data on request by hard delete or anonymization, never a + soft-delete flag alone, and provide a way to export one customer's data. +## 3. Quality and review +- Cover each discount rule, tax jurisdiction and invoice path, happy and + edge cases, with pytest; add a regression test per fixed bug; test + against a real SQLite file, never an in-memory substitute. Keep ruff, + mypy --strict and pytest green before merging. +- Self-review every change against this file (solo maintainer, no other + approver). Block a merge on a secret in the diff, a missing migration, + an unhandled failure path, or PII in a log line; tracking/release: open. +## 4. Session protocol +Run each item in order at session end, never skipped or summarized: +1. `uv run ruff check .`, `uv run mypy --strict .`, `uv run pytest` +2. Confirm no secret, `.env` value or the SQLite file is staged +3. Update `README.md`, `AGENTS.md` and this file if conventions changed +4. Review the staged diff for off-limits paths before committing diff --git a/tests/efficacy/arms/short5/generation.json b/tests/efficacy/arms/short5/generation.json new file mode 100644 index 0000000..c7e1223 --- /dev/null +++ b/tests/efficacy/arms/short5/generation.json @@ -0,0 +1,174 @@ +{ + "arm": "short5", + "kind": "model", + "output_model": "inline", + "ref": "9086e0ff", + "source": { + "remote": "https://github.com/solid-ai-dev/solid-ai-templates.git", + "ref": "9086e0ff", + "commit": "9086e0ffc454fbff1d234601822257ce5e40a004" + }, + "roots": [ + "backend-api", + "backend-auth", + "backend-database", + "frontend-ux", + "base-security", + "base-data-governance" + ], + "started_at": "2026-10-31T12:58:54", + "commit": "9086e0ffc454fbff1d234601822257ce5e40a004", + "resolved_files": [ + "templates/core/quality.md", + "templates/core/git.md", + "templates/core/docs.md", + "templates/core/testing.md", + "templates/core/review.md", + "templates/backend/http.md", + "templates/backend/api.md", + "templates/security/security.md", + "templates/backend/auth.md", + "templates/backend/database.md", + "templates/frontend/ux.md", + "templates/data/data-modeling.md", + "templates/data/data-governance.md" + ], + "prompt_chars": 83803, + "prompt_leak": null, + "prompt_file": "C:/efficacy/gen-short5\\arm-short5-prompt.txt", + "auth_probe": "ready", + "command": [ + "C:\\Users\\bgeorgiev\\.local\\bin\\claude.EXE", + "-p", + "--output-format", + "json", + "--model", + "claude-sonnet-5", + "--effort", + "high", + "--permission-mode", + "bypassPermissions", + "--setting-sources", + "", + "--settings", + "C:/efficacy/gen-short5\\home\\settings.json", + "--strict-mcp-config", + "--disallowed-tools", + "WebSearch", + "WebFetch" + ], + "model": "claude-sonnet-5", + "effort": "high", + "elapsed_s": 338.5, + "exit_status": 0, + "result": { + "duration_api_ms": 292689, + "stop_reason": "end_turn", + "session_id": "7f8bfcdf-46f7-4bee-b984-2efc60a2ba15", + "total_cost_usd": 0.9397698000000001, + "usage": { + "input_tokens": 46, + "cache_creation_input_tokens": 70964, + "cache_read_input_tokens": 1887709, + "output_tokens": 27828, + "output_tokens_details": { + "thinking_tokens": 18512 + }, + "server_tool_use": { + "web_search_requests": 0, + "web_fetch_requests": 0 + }, + "service_tier": "standard", + "cache_creation": { + "ephemeral_1h_input_tokens": 70964, + "ephemeral_5m_input_tokens": 0 + }, + "inference_geo": "global", + "iterations": [ + { + "input_tokens": 2, + "output_tokens": 884, + "cache_read_input_tokens": 95794, + "cache_creation_input_tokens": 270, + "cache_creation": { + "ephemeral_5m_input_tokens": 0, + "ephemeral_1h_input_tokens": 270 + }, + "type": "message" + } + ], + "speed": "standard", + "fallback_credit": null + }, + "modelUsage": { + "claude-sonnet-5": { + "inputTokens": 46, + "outputTokens": 27828, + "cacheReadInputTokens": 1887709, + "cacheCreationInputTokens": 70964, + "webSearchRequests": 0, + "costUSD": 0.9397698000000001, + "contextWindow": 1000000, + "maxOutputTokens": 64000, + "thinkingTokens": 18512, + "cacheCreationEphemeral5mInputTokens": 0, + "cacheCreationEphemeral1hInputTokens": 70964, + "canonicalModel": "claude-sonnet-5", + "provider": "firstParty", + "costBasis": "list" + } + }, + "permission_denials": [], + "terminal_reason": "completed", + "fast_mode_state": "off", + "fast_mode_disabled_reason": "sdk_opt_in_required", + "subagent_stats": { + "spawned": 0, + "requested": { + "background": 0, + "foreground": 0, + "unset": 0 + }, + "started_in_background": 0, + "max_depth": 0, + "spawned_by_subagents": 0, + "completed": 0, + "failed": 0, + "killed": { + "parent": 0, + "user": 0, + "system": 0 + }, + "refused": { + "depth_limit": 0, + "concurrency_limit": 0, + "budget": 0 + }, + "by_type": {} + }, + "safety_stops": 0, + "is_error": false, + "num_turns": 23, + "subtype": "success", + "api_error_status": null, + "result": "# tariff\n\nPricing and invoicing web app for Imbra Ltd: catalog, discount rules, tax\njurisdictions, customers, invoices. Python 3.12, Flask 3, Jinja, HTMX,\nSQLite; uv, ruff, mypy strict, pytest. Runs locally only; no deploy target.\n- Model: inline\n## 1. Project\nThe pricing engine is a standalone, framework-free library with its own\npublic API, called by the Flask app and by another program, never the\nreverse. See `README.md` for structure; do not duplicate it here.\n```bash\nuv run ruff check . && uv run mypy --strict . && uv run pytest\n```\n## 2. Code conventions\n- Branch-only commits, never `main`; commit `uv.lock`, never secrets,\n `.env*`, or the SQLite file; off-limits: admin auth/session, migrations, secrets.\n- Keep routes thin: decode, call the library/service, render; give the\n library its own injectable logger and never print or configure logging.\n- Store money as `Decimal` (minor units or decimal column), never `float`;\n store timestamps in UTC; parameterize every SQL query.\n- Hash the admin password with bcrypt/scrypt/Argon2; set session cookie\n flags `HttpOnly`, `Secure`, `SameSite=Lax` with a 30-minute idle expiry;\n require a CSRF token on every POST/PUT/PATCH/DELETE route.\n- Never log a customer's name, email or address, only an opaque ID. Erase\n personal data on request by hard delete or anonymization, never a\n soft-delete flag alone, and provide a way to export one customer's data.\n## 3. Quality and review\n- Cover each discount rule, tax jurisdiction and invoice path, happy and\n edge cases, with pytest; add a regression test per fixed bug; test\n against a real SQLite file, never an in-memory substitute. Keep ruff,\n mypy --strict and pytest green before merging.\n- Self-review every change against this file (solo maintainer, no other\n approver). Block a merge on a secret in the diff, a missing migration,\n an unhandled failure path, or PII in a log line; tracking/release: open.\n## 4. Session protocol\nRun each item in order at session end, never skipped or summarized:\n1. `uv run ruff check .`, `uv run mypy --strict .`, `uv run pytest`\n2. Confirm no secret, `.env` value or the SQLite file is staged\n3. Update `README.md`, `AGENTS.md` and this file if conventions changed\n4. Review the staged diff for off-limits paths before committing", + "ttft_ms": 88709, + "type": "result", + "duration_ms": 335915, + "uuid": "59df4ac0-0c4f-454d-aa5a-f7312b69f32c", + "ttft_stream_ms": 1806, + "time_to_request_ms": 393, + "first_content_frame_ms": 1806, + "queued_turn_count": 0, + "result_index": 0 + }, + "budget": [ + 40, + 88 + ], + "output_leak": null, + "outcome": "generated", + "output": "C:\\Work\\products\\solid-ai\\benchmark-round-5d\\tests\\efficacy\\arms\\short5\\CLAUDE.md", + "output_lines": 40, + "output_words": 366 +} \ No newline at end of file diff --git a/tests/efficacy/generate_arm.py b/tests/efficacy/generate_arm.py index 673adef..0748abe 100644 --- a/tests/efficacy/generate_arm.py +++ b/tests/efficacy/generate_arm.py @@ -6,11 +6,14 @@ - `reference` is fixed text naming each template of the chain - `inline` and `hybrid` are one non-interactive generation each, following `templates/core/agents.md` with no interview +- `short5` is the same generation in the inline model, held to 40 lines of + 88 characters - `skills` is what `resolve_chain.py --emit` builds, the facts filled from the brief It writes `arms//CLAUDE.md` (and, for `skills`, the skills beside it), -and refuses to keep a result the specification leaked into. +and refuses to keep a result the specification leaked into, or one over its +arm's budget. Run it once per arm. Re-running it produces a different file and therefore a different arm, so it refuses to overwrite an existing one without @@ -44,14 +47,19 @@ # The arms this module makes, each with the directory under `arms/` its file # and record live in, and how it is made: fixed text, a model generation in -# one of `agents.md`'s models, or the emitter. Round 3's arms (`full`, -# `short`, `hand`) keep their committed files and records; they were made -# through an interview that no longer ships upstream. +# one of `agents.md`'s models, or the emitter, and a model arm's budget as +# (lines, width) where it has one. Round 3's arms (`full`, `short`, `hand`) +# keep their committed files and records; they were made through an +# interview that no longer ships upstream. `short5` is `short` made again +# from round 5's chain under the same budget, in a directory of its own, so +# `short`'s file and record stay as round 3 left them. GENERATED = { "reference": {"dir": "reference", "kind": "fixed"}, "inline": {"dir": "inline", "kind": "model", "model": "inline"}, "hybrid": {"dir": "hybrid", "kind": "model", "model": "hybrid"}, "skills": {"dir": "skills", "kind": "emit"}, + "short5": {"dir": "short5", "kind": "model", "model": "inline", + "budget": (40, 88)}, } @@ -195,9 +203,46 @@ def record_path(arm): SLOT = re.compile(r"\{\{[^}]+\}\}") +# The budget clause. The width keeps a line from carrying a paragraph. The +# closing check adds no content; it asks the model to hold a bound it is +# already given, since a file over it is refused whole. +BUDGET = """\ +The finished `CLAUDE.md` MUST be at most {lines} lines, blank lines counted, +and no line may be longer than {width} characters. Keep the rules that matter +most for this project and leave the rest out; a rule that does not fit is left +out, not squeezed onto another rule's line. + +Before you answer, measure every line against {width} characters and shorten +or split each one over it, then count the lines again. A file over either +bound is refused whole, never trimmed.""" + + def arm_clause(arm): - """The model paragraph for one model arm's instruction.""" - return "## The output model\n\n%s\n" % MODELS[GENERATED[arm]["model"]] + """The model and budget paragraphs for one model arm's instruction.""" + entry = GENERATED[arm] + lines = ["## The output model", "", MODELS[entry["model"]]] + if entry.get("budget"): + count, width = entry["budget"] + lines.extend(["", "## The budget", "", + BUDGET.format(lines=count, width=width)]) + return "\n".join(lines) + "\n" + + +def over_budget(document, budget): + """Every way a file exceeds its (lines, width) budget, as sentences; + empty where it fits or has no budget.""" + if not budget: + return [] + lines, width = budget + text = document.rstrip("\n").split("\n") + findings = [] + if len(text) > lines: + findings.append("%d lines, over the budget of %d" % (len(text), lines)) + widest = max((len(line) for line in text), default=0) + if widest > width: + findings.append("a line of %d characters, over the width of %d" + % (widest, width)) + return findings def read_brief(path=BRIEF): @@ -396,13 +441,15 @@ def parse_args(argv): def self_test(): - """A scan that cannot fail is not a control, and neither is a fill. + """A scan that cannot fail is not a control, and neither is a fill or a + budget. Plants a specification-only token and requires the scan to report it, and a clean text to scan clean. Requires the reference text to name every file under the vendored path and to be the same twice. Requires a fact slot the brief does not fill to be refused, and every known slot - filled. + filled. Requires a file one line over the budget, and one a character + too wide, refused, and a file at both bounds kept. """ clean = "A pricing and invoicing web application with discount rules." if scan(clean, "clean", PROMPT_TOKENS) is not None: @@ -436,6 +483,30 @@ def self_test(): except TrialError: pass print("every known fact slot is filled, and an unknown one is refused") + + budget = GENERATED["short5"]["budget"] + lines, width = budget + at_bounds = "\n".join(["x" * width] * lines) + "\n" + if over_budget(at_bounds, budget): + print("FAIL: a file at both bounds was refused") + return 1 + long = "\n".join(["x"] * (lines + 1)) + "\n" + wide = "\n".join(["x" * (width + 1)] + ["x"] * (lines - 1)) + "\n" + if not over_budget(long, budget) or not over_budget(wide, budget): + print("FAIL: a file over the budget was kept") + return 1 + if over_budget(long, None): + print("FAIL: an arm with no budget refused a file") + return 1 + print("the budget keeps a file at %d lines of %d characters and refuses " + "one over either" % (lines, width)) + if "MUST be at most %d lines" % lines not in arm_clause("short5") \ + or "measure every line against %d" % width \ + not in arm_clause("short5") \ + or "budget" in arm_clause("inline").lower(): + print("FAIL: the budget clause is not in short5's instruction alone") + return 1 + print("the budget is stated in short5's instruction and no other") return 0 @@ -496,6 +567,17 @@ def main(argv): write_record(options.root, record, started_at) return 0 if record.get("outcome") == "dry-run" else 1 + # A file over its budget is refused whole rather than trimmed, since + # trimming would put a person's judgement into the arm. + record["budget"] = entry.get("budget") + over = over_budget(document, entry.get("budget")) + if over: + record["outcome"] = "refused: over budget" + record["over_budget"] = over + print("refused: the generated file is over its budget: %s" + % "; ".join(over)) + return write_record(options.root, record, started_at) or 1 + texts = [document] + list(skills.values()) leak = scan("\n".join(texts), "generated files", NON_INVENTABLE) record["output_leak"] = leak diff --git a/tests/efficacy/harness.py b/tests/efficacy/harness.py index 9d74489..091e2cd 100644 --- a/tests/efficacy/harness.py +++ b/tests/efficacy/harness.py @@ -127,7 +127,8 @@ # `arms/`. Arm `none` carries no file: it is the bare agent. The two files # round 1 ran keep the directories its generation record names. `inline`, # `reference` and `skills` are round 5's; `hybrid` was regenerated for it, -# and an arm's vendored ref comes from its generation record. +# and an arm's vendored ref comes from its generation record. `short5` is +# `short` made again from round 5's chain, so `short`'s own file stays. ARMS = { "none": {"label": "no context file", "context": None}, "full": {"label": "the templates' file, inline", @@ -144,6 +145,8 @@ "context": "inline/CLAUDE.md"}, "skills": {"label": "the emitted root file and task skills", "context": "skills/CLAUDE.md", "skills": "skills/skills"}, + "short5": {"label": "the templates' file, 40 lines, from round 5's chain", + "context": "short5/CLAUDE.md"}, } # Round 1 named its arms by letter and its trials `A1`, `B2`, `C3`. Its run From 12b6d76ae4c413f2c54eb304b3b34185cba82800 Mon Sep 17 00:00:00 2001 From: Branimir Georgiev <66906831+braboj@users.noreply.github.com> Date: Sat, 31 Oct 2026 13:29:01 +0200 Subject: [PATCH 3/4] feat(efficacy): make short from round 5's chain, in place of round 3's MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The templates are measured with one version of the benchmark, and an earlier round is re-run from the benchmark at its own commit, so round 3's `short` need not stay beside the new one. `short` is now generated from the templates at 9086e0ff under the same 40 × 88 budget, and the `short5` name is gone. Refs #89 Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01DpT5xPB8YTAMW2Msp4aPTX --- docs/architecture/05-building-block-view.md | 2 +- docs/rounds/round-5d.md | 42 ++--- tests/efficacy/arms/short/CLAUDE.md | 79 ++++----- tests/efficacy/arms/short/generation.json | 152 ++++++++--------- tests/efficacy/arms/short5/CLAUDE.md | 40 ----- tests/efficacy/arms/short5/generation.json | 174 -------------------- tests/efficacy/generate_arm.py | 24 ++- tests/efficacy/harness.py | 8 +- 8 files changed, 148 insertions(+), 373 deletions(-) delete mode 100644 tests/efficacy/arms/short5/CLAUDE.md delete mode 100644 tests/efficacy/arms/short5/generation.json diff --git a/docs/architecture/05-building-block-view.md b/docs/architecture/05-building-block-view.md index 9725d7f..7c27d48 100644 --- a/docs/architecture/05-building-block-view.md +++ b/docs/architecture/05-building-block-view.md @@ -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 | diff --git a/docs/rounds/round-5d.md b/docs/rounds/round-5d.md index a7f034b..3ea6470 100644 --- a/docs/rounds/round-5d.md +++ b/docs/rounds/round-5d.md @@ -20,7 +20,7 @@ Three things differ: the arms, the order, and a reuse of round 5c's `none`. | Arm | Trials | Where they come from | | --- | --- | --- | | `hand` | 15, fresh | `tests/efficacy/arms/hand/CLAUDE.md` as it is at `010ee36` | -| `short5` | 15, fresh | `tests/efficacy/arms/short5/CLAUDE.md`, made for 5d | +| `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 | @@ -30,18 +30,18 @@ Three things differ: the arms, the order, and a reuse of round 5c's `none`. `25459854949f648837ac5ef37fca5d7472923b544dffb694cd40f8b8a53ec748`. - Kept verbatim. It is not edited for round 5's brief. -**`short5`** is round 3's `short` made again from round 5's chain. +**`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 `short`'s budget: at most 40 lines, none over 88 characters. The +- 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,291 bytes, sha256 - `a028d5ee6e44b35329b580ea2b5ecda3c0823b4a1c30f22667dcadb652f220a8`, with its +- 40 lines and 2,173 bytes, sha256 + `8abbcf098312e768e5e01fb6266ec230c13877fa71f40a0bc3ec06e89cd63aea`, with its generation record beside it. -- Round 3's `short` keeps its own file and record, made from round 1's - templates. +- 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. @@ -50,9 +50,9 @@ 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 `short5`: 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. `short5` and -`hand` sit within a line of each other, so `short5` minus `hand` compares the +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 @@ -61,12 +61,12 @@ Two runs, in one run root of round 5d's own: | Run | Arms | Trials, in order | | --- | --- | --- | -| 1 | `none`, `hand`, `short5`, K = 3 | the rotated order, 9 trials | -| 2 | `hand`, `short5`, K = 15, from `short5-4` | blocks 4 to 15, 24 trials | +| 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`, `short5-1`, and each block starts one arm +- Run 1 starts `none-1`, `hand-1`, `short-1`, and each block starts one arm later. -- `hand` and `short5` share every block, so `short5` minus `hand` is paired. +- `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 @@ -118,14 +118,14 @@ templates delivers at least what a person's file of the same length delivers. | | | | --- | --- | -| Contrast | `short5` minus `hand`, paired within the block | +| 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 `short5` -against round 5c's `none`; `short5` against round 5c's `inline`, the same +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. @@ -134,13 +134,13 @@ every turn, beside each 5c arm's. Done with this registration: -- `generate_arm.py` makes `short5` under its budget, and refuses a file over it -- `short5` is generated and committed with its record -- the harness knows `short5` as an arm +- `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 harness and the report still gain, each with a self-test: -- K up to 15 for a run of `hand` and `short5`, with round 5's spec check; today +- 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 diff --git a/tests/efficacy/arms/short/CLAUDE.md b/tests/efficacy/arms/short/CLAUDE.md index 960265d..b17acb2 100644 --- a/tests/efficacy/arms/short/CLAUDE.md +++ b/tests/efficacy/arms/short/CLAUDE.md @@ -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. - - +# 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. diff --git a/tests/efficacy/arms/short/generation.json b/tests/efficacy/arms/short/generation.json index 6d26b7e..7862623 100644 --- a/tests/efficacy/arms/short/generation.json +++ b/tests/efficacy/arms/short/generation.json @@ -1,60 +1,44 @@ { "arm": "short", + "kind": "model", "output_model": "inline", - "budget": [ - 40, - 88 - ], - "ref": "v2.90.0", - "commit": "4b1be7d8dec1186cc63d22f01969fc0c93ac822b", + "ref": "9086e0ff", + "source": { + "remote": "https://github.com/solid-ai-dev/solid-ai-templates.git", + "ref": "9086e0ff", + "commit": "9086e0ffc454fbff1d234601822257ce5e40a004" + }, "roots": [ - "stack-flask", - "stack-htmx", + "backend-api", + "backend-auth", + "backend-database", "frontend-ux", - "frontend-quality" + "base-security", + "base-data-governance" ], + "started_at": "2026-10-31T13:22:29", + "commit": "9086e0ffc454fbff1d234601822257ce5e40a004", "resolved_files": [ - "templates/base/core/quality.md", - "templates/base/core/git.md", - "templates/base/core/docs.md", - "templates/base/core/readme.md", - "templates/base/core/testing.md", - "templates/base/core/review.md", - "templates/base/core/oop.md", - "templates/base/core/config.md", + "templates/core/quality.md", + "templates/core/git.md", + "templates/core/docs.md", + "templates/core/testing.md", + "templates/core/review.md", "templates/backend/http.md", + "templates/backend/api.md", + "templates/security/security.md", + "templates/backend/auth.md", "templates/backend/database.md", - "templates/backend/observability.md", - "templates/base/security/security.md", - "templates/base/infra/containers.md", - "templates/backend/quality.md", - "templates/backend/features.md", - "templates/backend/messaging.md", - "templates/base/infra/cicd.md", - "templates/base/security/devsecops.md", - "templates/base/data/data-modeling.md", - "templates/base/data/data-quality.md", - "templates/base/language/python.md", - "templates/base/core/cli.md", - "templates/base/workflow/quality-gates.md", - "templates/base/core/examples.md", - "templates/stack/python-lib.md", - "templates/stack/python-service.md", - "templates/stack/python-flask.md", - "templates/backend/templating.md", - "templates/stack/htmx.md", "templates/frontend/ux.md", - "templates/frontend/quality.md" + "templates/data/data-modeling.md", + "templates/data/data-governance.md" ], - "prompt_chars": 586564, - "model": "claude-sonnet-5", - "effort": "high", - "started_at": "2026-09-26T14:28:59", + "prompt_chars": 83803, "prompt_leak": null, - "prompt_file": "C:/efficacy/gen-r3-short-3\\arm-short-prompt.txt", + "prompt_file": "C:/efficacy/gen-short\\arm-short-prompt.txt", "auth_probe": "ready", "command": [ - "C:\\Users\\braboj\\AppData\\Roaming\\npm\\claude.CMD", + "C:\\Users\\bgeorgiev\\.local\\bin\\claude.EXE", "-p", "--output-format", "json", @@ -67,26 +51,28 @@ "--setting-sources", "", "--settings", - "C:/efficacy/gen-r3-short-3\\home\\settings.json", + "C:/efficacy/gen-short\\home\\settings.json", "--strict-mcp-config", "--disallowed-tools", "WebSearch", "WebFetch" ], - "elapsed_s": 11.7, + "model": "claude-sonnet-5", + "effort": "high", + "elapsed_s": 200.3, "exit_status": 0, "result": { - "duration_api_ms": 9944, + "duration_api_ms": 193738, "stop_reason": "end_turn", - "session_id": "4d857594-2f51-4a34-a266-6a766229ab49", - "total_cost_usd": 0.941656, + "session_id": "d648277b-ed48-47a3-8e32-165e689f9c29", + "total_cost_usd": 0.5512856, "usage": { - "input_tokens": 2, - "cache_creation_input_tokens": 233598, - "cache_read_input_tokens": 0, - "output_tokens": 726, + "input_tokens": 14, + "cache_creation_input_tokens": 60568, + "cache_read_input_tokens": 495278, + "output_tokens": 20993, "output_tokens_details": { - "thinking_tokens": 0 + "thinking_tokens": 17757 }, "server_tool_use": { "web_search_requests": 0, @@ -94,36 +80,39 @@ }, "service_tier": "standard", "cache_creation": { - "ephemeral_1h_input_tokens": 233598, + "ephemeral_1h_input_tokens": 60568, "ephemeral_5m_input_tokens": 0 }, - "inference_geo": "not_available", + "inference_geo": "global", "iterations": [ { "input_tokens": 2, - "output_tokens": 726, - "cache_read_input_tokens": 0, - "cache_creation_input_tokens": 233598, + "output_tokens": 1058, + "cache_read_input_tokens": 84624, + "cache_creation_input_tokens": 1044, "cache_creation": { "ephemeral_5m_input_tokens": 0, - "ephemeral_1h_input_tokens": 233598 + "ephemeral_1h_input_tokens": 1044 }, "type": "message" } ], - "speed": "standard" + "speed": "standard", + "fallback_credit": null }, "modelUsage": { "claude-sonnet-5": { - "inputTokens": 2, - "outputTokens": 726, - "cacheReadInputTokens": 0, - "cacheCreationInputTokens": 233598, + "inputTokens": 14, + "outputTokens": 20993, + "cacheReadInputTokens": 495278, + "cacheCreationInputTokens": 60568, "webSearchRequests": 0, - "costUSD": 0.941656, + "costUSD": 0.5512856, "contextWindow": 1000000, - "maxOutputTokens": 128000, - "thinkingTokens": 0, + "maxOutputTokens": 64000, + "thinkingTokens": 17757, + "cacheCreationEphemeral5mInputTokens": 0, + "cacheCreationEphemeral1hInputTokens": 60568, "canonicalModel": "claude-sonnet-5", "provider": "firstParty", "costBasis": "list" @@ -157,26 +146,29 @@ }, "by_type": {} }, + "safety_stops": 0, "is_error": false, - "num_turns": 1, + "num_turns": 7, "subtype": "success", "api_error_status": null, - "result": "# tariff \u2014 CLAUDE.md\n\nOwner: Imbra Ltd. Pricing and invoicing web app: catalog, discounts, tax, invoices.\nStack: Python 3.12, Flask 3, Jinja, HTMX, SQLite. Tools: uv, ruff, mypy strict, pytest.\nRuns locally; no deployment target; nothing reaches the network.\n\n## Structure\n- The pricing engine is a library that imports without Flask; Flask is one caller.\n- Flask app uses `create_app()`, blueprints, thin routes; logic lives in services.\n- Layout is in README.md; do not duplicate it here.\n\n## Personal data (GDPR)\n- Customers hold name, email, postal address; invoices name them.\n- Support erasure and export of one customer's data; keep invoice totals intact.\n- Never log or print personal data; never put it in fixtures, commits or errors.\n- One administrator signs in; CSRF on every state-changing request.\n\n## Code\n- Money is integer cents or Decimal, never float; timestamps in UTC.\n- Errors raised on purpose derive from one package base error.\n- Parameterized SQL only; migrations versioned, never edited once merged.\n- HTMX endpoints return partials when `HX-Request` is set; 422 on invalid forms.\n- Config from environment, validated at startup; `.env` is never committed.\n- Names carry meaning; no debug prints, no commented-out code.\n\n## Quality\n- Gates: `ruff check`, `ruff format`, `mypy --strict`, `pytest`; all must pass.\n- Test the engine without Flask; use a real SQLite file, not a mock.\n- Every public function has type hints and a Google-style docstring.\n\n## Git\n- Work on a branch, never on `main`; conventional commit prefixes, subject under 80.\n- Update README, CLAUDE.md and docs in the same commit as the change.\n\n## Off-limits without an approved plan\n- Auth and session code, migrations, `.env*`, and invoice export formats.\n- Propose the change with rollback and test coverage first.\n\n", - "ttft_ms": 9999, + "result": "# tariff\nPricing and invoicing web app for Imbra Ltd: catalog, discounts, tax\njurisdictions, customers, invoices. Python 3.12, Flask 3, Jinja, HTMX,\nSQLite, uv. One administrator; runs locally only, no deployment target.\nThe pricing engine is a library another program may import directly.\n- Model: inline\n## 1. Project\nSee README.md for the directory map; place code beside its layer.\n```bash\nuv run flask run # start the app\nuv run ruff check . && uv run ruff format --check . # lint\nuv run mypy --strict . && uv run pytest # types + tests\n```\n## 2. Code conventions\n- Work on a branch; never commit to `main`. Commit `uv.lock`, never\n `.env`, secrets, or build output.\n- Off-limits without approval: auth/session code, migrations, `.env*`.\n- Parameterize every SQL query; never interpolate input into SQL.\n- Store money as integer minor units or `Decimal`, never `float`.\n- Hash the administrator's password with bcrypt, scrypt, or Argon2.\n- Regenerate the session ID on login; expire idle sessions; set\n `HttpOnly`, `Secure`, `SameSite=Lax` cookies.\n- Give every state-changing HTMX/form request a CSRF token.\n- Encode all template output for context; never bypass autoescaping.\n- Run schema changes through a migration with up/down steps; never\n edit the SQLite file by hand.\n- Never log a customer's name, email, address, or any secret value.\n- Classify customer PII (name, email, postal address); export or erase\n it on request: hard delete or anonymize, never soft-delete alone.\n- Cover pricing, discount, and tax logic with edge-case unit tests.\n## 3. Review process\nReview in order: security, correctness, clarity, conventions.\n- [ ] No secret or PII value in a committed file or log.\n- [ ] Every SQL query parameterized; every migration has up/down.\n- [ ] Money uses integer minor units or `Decimal`, never `float`.\n## 4. Session protocol\n- Approver: the repository owner. Tracking: open, no tracker named.\n- Release: a tagged commit on `main` after lint, types, tests pass.\n- End of session, run in order: `ruff check .`, `mypy --strict .`,\n `pytest`; report any that did not run as not run, never as passed.", + "ttft_ms": 128419, "type": "result", - "duration_ms": 10068, - "uuid": "6303e425-2c4c-4318-a754-54f062a8aa2d", - "ttft_stream_ms": 3125, - "time_to_request_ms": 121, - "first_content_frame_ms": 3125, + "duration_ms": 197972, + "uuid": "b711c13a-688b-4a75-a566-6125baae94ef", + "ttft_stream_ms": 1871, + "time_to_request_ms": 419, + "first_content_frame_ms": 1871, "queued_turn_count": 0, "result_index": 0 }, + "budget": [ + 40, + 88 + ], "output_leak": null, - "over_budget": [], "outcome": "generated", - "output": "C:\\Workspace\\solid-ai-templates\\tests\\efficacy\\arms\\short\\CLAUDE.md", - "output_chars": 1896, - "output_lines": 39, - "output_width": 87 + "output": "C:\\Work\\products\\solid-ai\\solid-ai-benchmark\\tests\\efficacy\\arms\\short\\CLAUDE.md", + "output_lines": 40, + "output_words": 352 } \ No newline at end of file diff --git a/tests/efficacy/arms/short5/CLAUDE.md b/tests/efficacy/arms/short5/CLAUDE.md deleted file mode 100644 index c507550..0000000 --- a/tests/efficacy/arms/short5/CLAUDE.md +++ /dev/null @@ -1,40 +0,0 @@ -# tariff - -Pricing and invoicing web app for Imbra Ltd: catalog, discount rules, tax -jurisdictions, customers, invoices. Python 3.12, Flask 3, Jinja, HTMX, -SQLite; uv, ruff, mypy strict, pytest. Runs locally only; no deploy target. -- Model: inline -## 1. Project -The pricing engine is a standalone, framework-free library with its own -public API, called by the Flask app and by another program, never the -reverse. See `README.md` for structure; do not duplicate it here. -```bash -uv run ruff check . && uv run mypy --strict . && uv run pytest -``` -## 2. Code conventions -- Branch-only commits, never `main`; commit `uv.lock`, never secrets, - `.env*`, or the SQLite file; off-limits: admin auth/session, migrations, secrets. -- Keep routes thin: decode, call the library/service, render; give the - library its own injectable logger and never print or configure logging. -- Store money as `Decimal` (minor units or decimal column), never `float`; - store timestamps in UTC; parameterize every SQL query. -- Hash the admin password with bcrypt/scrypt/Argon2; set session cookie - flags `HttpOnly`, `Secure`, `SameSite=Lax` with a 30-minute idle expiry; - require a CSRF token on every POST/PUT/PATCH/DELETE route. -- Never log a customer's name, email or address, only an opaque ID. Erase - personal data on request by hard delete or anonymization, never a - soft-delete flag alone, and provide a way to export one customer's data. -## 3. Quality and review -- Cover each discount rule, tax jurisdiction and invoice path, happy and - edge cases, with pytest; add a regression test per fixed bug; test - against a real SQLite file, never an in-memory substitute. Keep ruff, - mypy --strict and pytest green before merging. -- Self-review every change against this file (solo maintainer, no other - approver). Block a merge on a secret in the diff, a missing migration, - an unhandled failure path, or PII in a log line; tracking/release: open. -## 4. Session protocol -Run each item in order at session end, never skipped or summarized: -1. `uv run ruff check .`, `uv run mypy --strict .`, `uv run pytest` -2. Confirm no secret, `.env` value or the SQLite file is staged -3. Update `README.md`, `AGENTS.md` and this file if conventions changed -4. Review the staged diff for off-limits paths before committing diff --git a/tests/efficacy/arms/short5/generation.json b/tests/efficacy/arms/short5/generation.json deleted file mode 100644 index c7e1223..0000000 --- a/tests/efficacy/arms/short5/generation.json +++ /dev/null @@ -1,174 +0,0 @@ -{ - "arm": "short5", - "kind": "model", - "output_model": "inline", - "ref": "9086e0ff", - "source": { - "remote": "https://github.com/solid-ai-dev/solid-ai-templates.git", - "ref": "9086e0ff", - "commit": "9086e0ffc454fbff1d234601822257ce5e40a004" - }, - "roots": [ - "backend-api", - "backend-auth", - "backend-database", - "frontend-ux", - "base-security", - "base-data-governance" - ], - "started_at": "2026-10-31T12:58:54", - "commit": "9086e0ffc454fbff1d234601822257ce5e40a004", - "resolved_files": [ - "templates/core/quality.md", - "templates/core/git.md", - "templates/core/docs.md", - "templates/core/testing.md", - "templates/core/review.md", - "templates/backend/http.md", - "templates/backend/api.md", - "templates/security/security.md", - "templates/backend/auth.md", - "templates/backend/database.md", - "templates/frontend/ux.md", - "templates/data/data-modeling.md", - "templates/data/data-governance.md" - ], - "prompt_chars": 83803, - "prompt_leak": null, - "prompt_file": "C:/efficacy/gen-short5\\arm-short5-prompt.txt", - "auth_probe": "ready", - "command": [ - "C:\\Users\\bgeorgiev\\.local\\bin\\claude.EXE", - "-p", - "--output-format", - "json", - "--model", - "claude-sonnet-5", - "--effort", - "high", - "--permission-mode", - "bypassPermissions", - "--setting-sources", - "", - "--settings", - "C:/efficacy/gen-short5\\home\\settings.json", - "--strict-mcp-config", - "--disallowed-tools", - "WebSearch", - "WebFetch" - ], - "model": "claude-sonnet-5", - "effort": "high", - "elapsed_s": 338.5, - "exit_status": 0, - "result": { - "duration_api_ms": 292689, - "stop_reason": "end_turn", - "session_id": "7f8bfcdf-46f7-4bee-b984-2efc60a2ba15", - "total_cost_usd": 0.9397698000000001, - "usage": { - "input_tokens": 46, - "cache_creation_input_tokens": 70964, - "cache_read_input_tokens": 1887709, - "output_tokens": 27828, - "output_tokens_details": { - "thinking_tokens": 18512 - }, - "server_tool_use": { - "web_search_requests": 0, - "web_fetch_requests": 0 - }, - "service_tier": "standard", - "cache_creation": { - "ephemeral_1h_input_tokens": 70964, - "ephemeral_5m_input_tokens": 0 - }, - "inference_geo": "global", - "iterations": [ - { - "input_tokens": 2, - "output_tokens": 884, - "cache_read_input_tokens": 95794, - "cache_creation_input_tokens": 270, - "cache_creation": { - "ephemeral_5m_input_tokens": 0, - "ephemeral_1h_input_tokens": 270 - }, - "type": "message" - } - ], - "speed": "standard", - "fallback_credit": null - }, - "modelUsage": { - "claude-sonnet-5": { - "inputTokens": 46, - "outputTokens": 27828, - "cacheReadInputTokens": 1887709, - "cacheCreationInputTokens": 70964, - "webSearchRequests": 0, - "costUSD": 0.9397698000000001, - "contextWindow": 1000000, - "maxOutputTokens": 64000, - "thinkingTokens": 18512, - "cacheCreationEphemeral5mInputTokens": 0, - "cacheCreationEphemeral1hInputTokens": 70964, - "canonicalModel": "claude-sonnet-5", - "provider": "firstParty", - "costBasis": "list" - } - }, - "permission_denials": [], - "terminal_reason": "completed", - "fast_mode_state": "off", - "fast_mode_disabled_reason": "sdk_opt_in_required", - "subagent_stats": { - "spawned": 0, - "requested": { - "background": 0, - "foreground": 0, - "unset": 0 - }, - "started_in_background": 0, - "max_depth": 0, - "spawned_by_subagents": 0, - "completed": 0, - "failed": 0, - "killed": { - "parent": 0, - "user": 0, - "system": 0 - }, - "refused": { - "depth_limit": 0, - "concurrency_limit": 0, - "budget": 0 - }, - "by_type": {} - }, - "safety_stops": 0, - "is_error": false, - "num_turns": 23, - "subtype": "success", - "api_error_status": null, - "result": "# tariff\n\nPricing and invoicing web app for Imbra Ltd: catalog, discount rules, tax\njurisdictions, customers, invoices. Python 3.12, Flask 3, Jinja, HTMX,\nSQLite; uv, ruff, mypy strict, pytest. Runs locally only; no deploy target.\n- Model: inline\n## 1. Project\nThe pricing engine is a standalone, framework-free library with its own\npublic API, called by the Flask app and by another program, never the\nreverse. See `README.md` for structure; do not duplicate it here.\n```bash\nuv run ruff check . && uv run mypy --strict . && uv run pytest\n```\n## 2. Code conventions\n- Branch-only commits, never `main`; commit `uv.lock`, never secrets,\n `.env*`, or the SQLite file; off-limits: admin auth/session, migrations, secrets.\n- Keep routes thin: decode, call the library/service, render; give the\n library its own injectable logger and never print or configure logging.\n- Store money as `Decimal` (minor units or decimal column), never `float`;\n store timestamps in UTC; parameterize every SQL query.\n- Hash the admin password with bcrypt/scrypt/Argon2; set session cookie\n flags `HttpOnly`, `Secure`, `SameSite=Lax` with a 30-minute idle expiry;\n require a CSRF token on every POST/PUT/PATCH/DELETE route.\n- Never log a customer's name, email or address, only an opaque ID. Erase\n personal data on request by hard delete or anonymization, never a\n soft-delete flag alone, and provide a way to export one customer's data.\n## 3. Quality and review\n- Cover each discount rule, tax jurisdiction and invoice path, happy and\n edge cases, with pytest; add a regression test per fixed bug; test\n against a real SQLite file, never an in-memory substitute. Keep ruff,\n mypy --strict and pytest green before merging.\n- Self-review every change against this file (solo maintainer, no other\n approver). Block a merge on a secret in the diff, a missing migration,\n an unhandled failure path, or PII in a log line; tracking/release: open.\n## 4. Session protocol\nRun each item in order at session end, never skipped or summarized:\n1. `uv run ruff check .`, `uv run mypy --strict .`, `uv run pytest`\n2. Confirm no secret, `.env` value or the SQLite file is staged\n3. Update `README.md`, `AGENTS.md` and this file if conventions changed\n4. Review the staged diff for off-limits paths before committing", - "ttft_ms": 88709, - "type": "result", - "duration_ms": 335915, - "uuid": "59df4ac0-0c4f-454d-aa5a-f7312b69f32c", - "ttft_stream_ms": 1806, - "time_to_request_ms": 393, - "first_content_frame_ms": 1806, - "queued_turn_count": 0, - "result_index": 0 - }, - "budget": [ - 40, - 88 - ], - "output_leak": null, - "outcome": "generated", - "output": "C:\\Work\\products\\solid-ai\\benchmark-round-5d\\tests\\efficacy\\arms\\short5\\CLAUDE.md", - "output_lines": 40, - "output_words": 366 -} \ No newline at end of file diff --git a/tests/efficacy/generate_arm.py b/tests/efficacy/generate_arm.py index 0748abe..2211958 100644 --- a/tests/efficacy/generate_arm.py +++ b/tests/efficacy/generate_arm.py @@ -6,7 +6,7 @@ - `reference` is fixed text naming each template of the chain - `inline` and `hybrid` are one non-interactive generation each, following `templates/core/agents.md` with no interview -- `short5` is the same generation in the inline model, held to 40 lines of +- `short` is the same generation in the inline model, held to 40 lines of 88 characters - `skills` is what `resolve_chain.py --emit` builds, the facts filled from the brief @@ -48,18 +48,16 @@ # The arms this module makes, each with the directory under `arms/` its file # and record live in, and how it is made: fixed text, a model generation in # one of `agents.md`'s models, or the emitter, and a model arm's budget as -# (lines, width) where it has one. Round 3's arms (`full`, `short`, `hand`) -# keep their committed files and records; they were made through an -# interview that no longer ships upstream. `short5` is `short` made again -# from round 5's chain under the same budget, in a directory of its own, so -# `short`'s file and record stay as round 3 left them. +# (lines, width) where it has one. Round 3's `full` and `hand` keep their +# committed files and records; they were made through an interview that no +# longer ships upstream. GENERATED = { "reference": {"dir": "reference", "kind": "fixed"}, "inline": {"dir": "inline", "kind": "model", "model": "inline"}, "hybrid": {"dir": "hybrid", "kind": "model", "model": "hybrid"}, "skills": {"dir": "skills", "kind": "emit"}, - "short5": {"dir": "short5", "kind": "model", "model": "inline", - "budget": (40, 88)}, + "short": {"dir": "short", "kind": "model", "model": "inline", + "budget": (40, 88)}, } @@ -484,7 +482,7 @@ def self_test(): pass print("every known fact slot is filled, and an unknown one is refused") - budget = GENERATED["short5"]["budget"] + budget = GENERATED["short"]["budget"] lines, width = budget at_bounds = "\n".join(["x" * width] * lines) + "\n" if over_budget(at_bounds, budget): @@ -500,13 +498,13 @@ def self_test(): return 1 print("the budget keeps a file at %d lines of %d characters and refuses " "one over either" % (lines, width)) - if "MUST be at most %d lines" % lines not in arm_clause("short5") \ + if "MUST be at most %d lines" % lines not in arm_clause("short") \ or "measure every line against %d" % width \ - not in arm_clause("short5") \ + not in arm_clause("short") \ or "budget" in arm_clause("inline").lower(): - print("FAIL: the budget clause is not in short5's instruction alone") + print("FAIL: the budget clause is not in short's instruction alone") return 1 - print("the budget is stated in short5's instruction and no other") + print("the budget is stated in short's instruction and no other") return 0 diff --git a/tests/efficacy/harness.py b/tests/efficacy/harness.py index 091e2cd..af1a902 100644 --- a/tests/efficacy/harness.py +++ b/tests/efficacy/harness.py @@ -127,13 +127,13 @@ # `arms/`. Arm `none` carries no file: it is the bare agent. The two files # round 1 ran keep the directories its generation record names. `inline`, # `reference` and `skills` are round 5's; `hybrid` was regenerated for it, -# and an arm's vendored ref comes from its generation record. `short5` is -# `short` made again from round 5's chain, so `short`'s own file stays. +# and an arm's vendored ref comes from its generation record. `short` was +# made again from round 5's chain, under round 3's budget. ARMS = { "none": {"label": "no context file", "context": None}, "full": {"label": "the templates' file, inline", "context": "full/CLAUDE.md"}, - "short": {"label": "the templates' file, 40 lines", + "short": {"label": "the templates' file, inline, 40 lines", "context": "short/CLAUDE.md"}, "hybrid": {"label": "the templates' file, hybrid", "context": "hybrid/CLAUDE.md", "vendor": VENDORED}, @@ -145,8 +145,6 @@ "context": "inline/CLAUDE.md"}, "skills": {"label": "the emitted root file and task skills", "context": "skills/CLAUDE.md", "skills": "skills/skills"}, - "short5": {"label": "the templates' file, 40 lines, from round 5's chain", - "context": "short5/CLAUDE.md"}, } # Round 1 named its arms by letter and its trials `A1`, `B2`, `C3`. Its run From a4d8a9d37f1fd4ff56910ccc8922dcc926df1139 Mon Sep 17 00:00:00 2001 From: Branimir Georgiev <66906831+braboj@users.noreply.github.com> Date: Sat, 31 Oct 2026 14:14:45 +0200 Subject: [PATCH 4/4] docs(rounds): the report already computes round 5d's H6 Refs #89 Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01DpT5xPB8YTAMW2Msp4aPTX --- docs/rounds/round-5d.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/docs/rounds/round-5d.md b/docs/rounds/round-5d.md index 3ea6470..001f91b 100644 --- a/docs/rounds/round-5d.md +++ b/docs/rounds/round-5d.md @@ -137,6 +137,8 @@ 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: @@ -147,8 +149,7 @@ The harness and the report still gain, each with a self-test: - 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 paired contrast of H6, the unpaired contrasts of H4 and H5, and the drift - check +- the unpaired contrasts of H4 and H5, and the drift check ### 13d.6 When it runs