# E018-E025: Five-stage z3 builds: quality margin unmet; tokens fell in both runs

Condition: Generation · fresh codebase · 5 imperative stages · z3-checked algebra · Result: not supported · 2026-09-24

Here the algebra arm had to prove its design in .smt files with z3 before it wrote code. Its score stayed close to No docs and met the threshold in only one stage. It used fewer tokens than No docs in both runs and consistenly showed a lower average cyclomatic complexity.

## Results at a glance

| Run | Arm | Average score | Stages compared | Tokens | Time | Python CC |
|---|---|---:|---:|---:|---:|---:|
| E018 | No docs | 0.298 | 4 of 5 | 31.52M | 1:25:20 | 8.09 |
|  | **Algebraic docs + z3** | **0.323 (+0.025)** |  | **20.12M (−36%)** | **1:00:39 (−29%)** | **7.21** |

| Run | Arm | Average score | Stages compared | Tokens | Time | Python CC |
|---|---|---:|---:|---:|---:|---:|
| E025 | No docs | 0.280 | 4 of 5 | 22.95M | **1:05:59** | 6.58 |
|  | **Algebraic docs + z3** | **0.297 (+0.017)** |  | **21.29M (−7%)** | 1:12:01 (+9%) | **6.31** |


Scores average the stages every arm of the run scored: the stages compared. Tokens and time are each run's builder totals over every stage it worked. Brackets compare with No docs. Highlighted values mark the highest quality score and lowest recorded tokens, time, and Python CC within each run; ties share the highlight. This does not mean the success rule passed. Python CC means the recorded mean cyclomatic complexity of the Python code's functions, classes, and methods at the stage immediately before Rust conversion.


## What changed in this condition

The agent grows the application from an empty repository over five stages of imperative prompts. The last stage converts it to Rust. This condition has no Prose docs arm.

- **No docs** (control): No design method and no starting design. Before coding, it writes its own method, then its designs.
- **Algebraic docs + z3** (hypothesis arm): Algebraic docs, with each charter and proof also as a z3 file, and z3 installed. It must check its algebra with z3 before writing code, and every proof must pass when a stage ends.


**Runs:** 2 (E018, E025), repeats of one setup.

**Builder model:** gpt-6-sol · medium

**Agent harness:** `codex-cli`. **Judge:** `claude-opus-5-5-high`.


## Stage evidence

**Not supported.** Each part of the rule must hold in every run.

Stages:

1. `initial-build`
2. `telemetry-add`
3. `parity-substrate`
4. `process-ontology`
5. `rust-conversion`

**✗ Algebraic docs + z3 must score at least 0.1 above No docs in every graded stage, in every run: not met**

| Run | Arm | Met | 1 | 2 | 3 | 4 | 5 |
|---|---|---:|---:|---:|---:|---:|---:|
| E018 | **Algebraic docs + z3** | 1 of 4 | 0.00 | +0.02 | −0.03 | +0.11 ✓ | No docs failed |
| E025 | **Algebraic docs + z3** | 0 of 4 | +0.02 | +0.02 | −0.03 | +0.06 | failed |


Each cell is the arm's score minus the other arm's at that stage. ✓ marks a stage that meets that part of the rule; Met counts them, of the stages with a value. “failed” means that arm's grade failed at that stage, so the stage has no score.


**Noise.** Between runs that repeat the same setup, the same arm's score at the same stage moved by a median of 0.03 and at most 0.05, over 8 comparisons; none moved by 0.10 or more, the rule's threshold.


## Details

### The prediction, set before the runs

The test card names the arms as follows: `control` is No docs, `algebraic` is Algebraic docs + z3; `total_tokens` is tokens and `elapsed_s` is time.

> **Prediction.** The algebraic arm's quality score exceeds the semantic arm's by at least 0.1.
>
> **Falsifier.** The algebraic arm's quality score is no higher than the semantic arm's. A positive difference below 0.1 is inconclusive.

**Measured:** Each arm's judged `score` at each stage. Quality Δ is the arm's score minus No docs. A stage meets the quality target at +0.1 or above. Every counted check must pass in every run. A planned comparison with Prose docs could not be measured because that arm did not run.


### z3

| Run | Arm | Last stage | Proof goals | Proved | Disproved | Undecided | Stages the agent ran z3 |
|---|---|---:|---:|---:|---:|---:|---:|
| E018 | **Algebraic docs + z3** | 5 | 115 | 115 | 0 | 0 | 5 of 5 |
| E025 | **Algebraic docs + z3** | 5 | 92 | 90 | 2 | 0 | 4 of 5 |


After each stage, the system runs z3 on the proof goals in the design's z3 files and counts those it proves, disproves or leaves undecided. The counts are from the last stage that has them; — means none were recorded. The last column counts stages in which the agent itself ran z3. In E025, some goals were still disproved at the last stage.


### Runs

#### E018 — gpt-6-sol · medium

**Run ID:** `run-20260923T232241Z-59b76d12`  
**Started:** 2026-09-23  
**Harness status:** failed

The No docs arm's grade failed at stage 5 (`rust-conversion`): `cargo test` failed. Every earlier stage was graded.

#### E025 — gpt-6-sol · medium

**Run ID:** `run-20260924T031035Z-6515aace`  
**Started:** 2026-09-24  
**Harness status:** failed

The Algebraic docs + z3 arm's grade failed at stage 5 (`rust-conversion`): `cargo test` failed. Every earlier stage was graded.

The harness marks a run *failed* when any arm's grade fails. That stage has no score for that arm; the run's other stages still count.


### Source data

[View condition `E018-E025` in G001.json](https://mikereese.dev/data/experiments/G001.json). The run IDs above identify the counted runs. See [Data and methods](https://mikereese.dev/experiments/g001/#data-and-methods) for the export method and limits.

