Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
130 commits
Select commit Hold shift + click to select a range
e15e8aa
reports(analysis): hand the factor record redesign to planning
LittleCoinCoin Dec 3, 2026
edb3421
rdm(schemas): plan the configuration-by-reference campaign
LittleCoinCoin Dec 3, 2026
8ff992b
rdm(schemas): record the approved campaign spend cap
LittleCoinCoin Dec 3, 2026
cbd313d
reports(schemas): list every producer and consumer of the treatment form
LittleCoinCoin Dec 3, 2026
4ae5aed
reports(schemas): assign owners to the inventory's unowned rows
LittleCoinCoin Dec 3, 2026
f473ed8
merge(schemas): list every producer and consumer of the treatment form
LittleCoinCoin Dec 3, 2026
b7ee7de
reports(analysis): design the treatment record guard rows
LittleCoinCoin Dec 3, 2026
a88b11f
test(analysis): show the factor shapes the path record breaks
LittleCoinCoin Dec 3, 2026
3f50437
test(analysis): state that an undeclared leaf below a factor is refused
LittleCoinCoin Dec 3, 2026
5160296
merge(analysis): show the factor shapes the path record breaks
LittleCoinCoin Dec 3, 2026
359c9d0
rdm(schemas): record the depth 1 gate of the treatment record campaign
LittleCoinCoin Dec 3, 2026
80589c4
docs(design): configure agents by reference
LittleCoinCoin Dec 3, 2026
04b75ec
docs(design): record what each run receives as its treatment
LittleCoinCoin Dec 3, 2026
f271602
docs(readme): name the agent's configuration as what is under test
LittleCoinCoin Dec 3, 2026
bd5a735
reports(design): list where the design amendment landed
LittleCoinCoin Dec 3, 2026
cae0143
reports(design): record the go on the design amendment
LittleCoinCoin Dec 3, 2026
aeb804d
merge(design): configure agents by reference, record treatments
LittleCoinCoin Dec 3, 2026
58e1937
rdm(schemas): open depth 2 after the go on the design amendment
LittleCoinCoin Dec 3, 2026
888ad76
rdm(schemas): rule on the reference schemas joint
LittleCoinCoin Dec 3, 2026
60da94b
rdm(schemas): name the held-path catalogue and the widened field path
LittleCoinCoin Dec 3, 2026
b7243b5
reports(schemas): place the reference form in the experiment file
LittleCoinCoin Dec 3, 2026
5ba9b44
refactor(isolation): keep import package names free of hyphens
LittleCoinCoin Dec 3, 2026
66483e1
feat(schemas): allow a hyphen in a field path segment
LittleCoinCoin Dec 3, 2026
f0e4945
build(schemas): regenerate the evaluator models for the reference form
LittleCoinCoin Dec 3, 2026
5edba65
feat(schemas): accept a reference at the paths that take one
LittleCoinCoin Dec 3, 2026
ab85697
feat(schemas): name a reference from a build entry and pin it
LittleCoinCoin Dec 3, 2026
2c3531c
reports(schemas): close the reference schemas
LittleCoinCoin Dec 3, 2026
29bafac
refactor(schemas): keep the held-path catalogue inside the crate
LittleCoinCoin Dec 3, 2026
3d45903
reports(schemas): record the review fixes of the reference schemas
LittleCoinCoin Dec 3, 2026
2492856
merge(schemas): accept a reference at the paths a driver lays out
LittleCoinCoin Dec 3, 2026
7f15fd8
rdm(schemas): record the depth 2 gate and open depth 3
LittleCoinCoin Dec 3, 2026
e18e80d
rdm(schemas): rule on the depth 3 joint
LittleCoinCoin Dec 3, 2026
ad40fdc
rdm(api): move the staging collision test to the planner leaf
LittleCoinCoin Dec 3, 2026
a6ce253
reports(api): lay out references by driver
LittleCoinCoin Dec 3, 2026
3cbc17d
feat(schemas)!: let an instruction value be a pinned reference
LittleCoinCoin Dec 3, 2026
102bb55
feat(api): render only inline instruction text
LittleCoinCoin Dec 3, 2026
d54d362
feat(api): say where each driver lays out a reference
LittleCoinCoin Dec 3, 2026
517032b
docs(api): add the layout method to the driver contract page
LittleCoinCoin Dec 3, 2026
ef597f9
reports(api): close the driver layouts
LittleCoinCoin Dec 3, 2026
e311158
fix(api): keep the layout to what collect does not already exclude
LittleCoinCoin Dec 3, 2026
853cfc7
reports(api): record the go and the review fixes of the driver layouts
LittleCoinCoin Dec 3, 2026
6185c5b
merge(api): say where each driver lays out a reference
LittleCoinCoin Dec 3, 2026
c20821d
rdm(api): mark the driver layouts done
LittleCoinCoin Dec 3, 2026
89fb42b
rdm(resolve): give the planner leaf the --set source rule
LittleCoinCoin Dec 3, 2026
59ebc57
reports(resolve): pin every reference through one seam
LittleCoinCoin Dec 3, 2026
65b5051
feat(resolve): pin every reference of a cell
LittleCoinCoin Dec 3, 2026
fc37c01
docs(api): add the reference refusals and the skills path
LittleCoinCoin Dec 3, 2026
78cdd23
reports(resolve): close the reference resolver
LittleCoinCoin Dec 3, 2026
c1e96d5
fix(resolve): close the review findings of the reference pin
LittleCoinCoin Dec 3, 2026
6d8bb41
reports(resolve): record the go and the review fixes
LittleCoinCoin Dec 3, 2026
477ddcd
fix(resolve): give a refused reference its one code
LittleCoinCoin Dec 3, 2026
4a0863c
merge(resolve): pin every reference of a cell
LittleCoinCoin Dec 3, 2026
db46451
refactor(api): ask takes_reference which skill paths the layout holds
LittleCoinCoin Dec 3, 2026
78a3d06
rdm(schemas): record the depth 3 gate and open depth 4
LittleCoinCoin Dec 3, 2026
96ff60f
rdm(runner): start the planner and import leaves
LittleCoinCoin Dec 3, 2026
d96f873
rdm(importer): keep the old import rule from writing a reference
LittleCoinCoin Dec 3, 2026
fc99c22
rdm(runner): rule on the planner joint and move G7's run half
LittleCoinCoin Dec 3, 2026
31def63
reports(importer): import references by rule
LittleCoinCoin Dec 3, 2026
e3cfc4f
reports(importer): record the go for the import rules
LittleCoinCoin Dec 3, 2026
1d33611
reports(importer): withdraw R3 and record the old rule's ruling
LittleCoinCoin Dec 3, 2026
70c29b1
feat(importer): name a reference in the import rules
LittleCoinCoin Dec 3, 2026
ee648b2
reports(importer): close the import rules
LittleCoinCoin Dec 3, 2026
c4fc3fa
fix(importer): refuse an empty reference tag
LittleCoinCoin Dec 3, 2026
0320db4
merge(importer): import a reference by rule
LittleCoinCoin Dec 3, 2026
79cd6c8
rdm(importer): close the import rules leaf
LittleCoinCoin Dec 3, 2026
1071d17
reports(runner): plan and stage references
LittleCoinCoin Dec 3, 2026
19ea0c4
reports(runner): record the go and rulings for the planner
LittleCoinCoin Dec 3, 2026
999a867
feat(runner): pin each reference once and stage it from its layout
LittleCoinCoin Dec 3, 2026
6ee726c
reports(runner): close the planner and CLI
LittleCoinCoin Dec 3, 2026
357c14a
fix(runner): scan the cells' references for ground truth
LittleCoinCoin Dec 3, 2026
5f0904d
fix(runner): refuse a moved tag of a declared reference on resume
LittleCoinCoin Dec 3, 2026
922fc0c
fix(runner): refuse a value that is no reference at a skill path
LittleCoinCoin Dec 3, 2026
c86b522
fix(runner): refuse equal pins in the levels of a whole-table factor
LittleCoinCoin Dec 3, 2026
598373d
fix(runner): pin a tag-only reference once in the supervisor
LittleCoinCoin Dec 3, 2026
84b3048
test(runner): stage the reference bytes at the instruction file
LittleCoinCoin Dec 3, 2026
dee8ce6
test(cli): look for the process marker a reference pin leaves
LittleCoinCoin Dec 3, 2026
cb0f176
reports(runner): record the verifier fixes and what is not covered
LittleCoinCoin Dec 3, 2026
89438ab
merge(runner): plan, check and stage each reference once
LittleCoinCoin Dec 3, 2026
a446cd9
rdm(runner): record the depth 4 gate and carry its gaps forward
LittleCoinCoin Dec 3, 2026
24cc12d
rdm(schemas): rule on the manifest_v2 joint
LittleCoinCoin Dec 3, 2026
b3f93c7
rdm(schemas): sharpen the sweep and the digest check
LittleCoinCoin Dec 3, 2026
5c274b6
reports(schemas): plan the record's schema break
LittleCoinCoin Dec 3, 2026
54a589c
feat(schemas)!: record what each run receives as its treatment
LittleCoinCoin Dec 3, 2026
7f2eb62
fix(schemas): show the path a retired build entry held in its message
LittleCoinCoin Dec 4, 2026
37e0bc7
refactor(api)!: build every crate on the treatment record
LittleCoinCoin Dec 3, 2026
9255a2d
test(api): write every fixture in the reference form
LittleCoinCoin Dec 3, 2026
6c4caf5
reports(schemas): close the record's schema break
LittleCoinCoin Dec 3, 2026
2a717df
fix(api): keep the resolved version beside the reference
LittleCoinCoin Dec 3, 2026
3b1245f
test(api): run a no-skill experiment on instruction references alone
LittleCoinCoin Dec 3, 2026
f59c9f5
test(api): refuse a path absent at the pinned commit
LittleCoinCoin Dec 3, 2026
bc19de6
refactor(schemas): spell the retired treatment forms without their names
LittleCoinCoin Dec 4, 2026
073761d
refactor(api): drop the last retired names
LittleCoinCoin Dec 3, 2026
d1f6e93
fix(api): refuse a job spec that holds an unknown key
LittleCoinCoin Dec 3, 2026
27a1fb5
reports(runner): write the record from the plan
LittleCoinCoin Dec 3, 2026
03f1289
reports(schemas): record the gate, the sweep and the restored leaf
LittleCoinCoin Dec 3, 2026
e040171
fix(runner): keep the stored record on a forced resume
LittleCoinCoin Dec 3, 2026
7ad1fb3
merge(schemas): record what each run receives as its treatment
LittleCoinCoin Dec 3, 2026
f893020
docs(schemas): say the importer writes the record of an imported run
LittleCoinCoin Dec 4, 2026
3bcde9a
rdm(schemas): record the depth 5 gate and hand the bridge to readers
LittleCoinCoin Dec 3, 2026
137ae72
feat(importer): record one factor per varying leaf
LittleCoinCoin Dec 3, 2026
ff643b4
feat(schemas): hand back a document's schema tag error
LittleCoinCoin Dec 3, 2026
51d682a
reports(runner): close the record writers
LittleCoinCoin Dec 3, 2026
7bfb9f3
fix(run-store): refuse an old manifest with its schema tag code
LittleCoinCoin Dec 3, 2026
ad9eb18
reports(analysis): read the treatment record
LittleCoinCoin Dec 3, 2026
b12efd9
refactor(runner): one walk finds the references of a value
LittleCoinCoin Dec 3, 2026
693bc46
test(analysis): drop the confirm rows and the old form's remains
LittleCoinCoin Dec 3, 2026
6d5e3b3
feat(schemas): list the leaves a cell holds with their values
LittleCoinCoin Dec 3, 2026
1da058c
refactor(runner): resolve each reference-level tuple with its cells
LittleCoinCoin Dec 3, 2026
1c6d1db
reports(analysis): tick every row of the treatment inventory
LittleCoinCoin Dec 3, 2026
7b2ac02
feat(manifest): judge a comparison by what each factor owns
LittleCoinCoin Dec 3, 2026
ac184b7
test(api): record a reference factor crossed with models by level
LittleCoinCoin Dec 3, 2026
108c5e6
reports(analysis): delete the treatment inventory
LittleCoinCoin Dec 3, 2026
7841810
feat(analysis): read levels and ownership from the treatment record
LittleCoinCoin Dec 3, 2026
b08fc31
reports(runner): update the writers report
LittleCoinCoin Dec 3, 2026
268f101
test(importer): key the golden oracle by the reference form's cells
LittleCoinCoin Dec 3, 2026
66db512
reports(analysis): close the record readers
LittleCoinCoin Dec 3, 2026
5b807ff
feat(importer): own the input leaves that follow a reference
LittleCoinCoin Dec 3, 2026
dd657cd
test(importer): record the manifest bytes the import writes now
LittleCoinCoin Dec 3, 2026
cc38907
feat(manifest): match input entries against owns by whole path
LittleCoinCoin Dec 3, 2026
b363d70
merge(runner): write each run's treatment from the plan
LittleCoinCoin Dec 3, 2026
d61b158
reports(schemas): close the configuration-by-reference campaign
LittleCoinCoin Dec 3, 2026
c2e8b49
merge(analysis): read levels and ownership from the treatment record
LittleCoinCoin Dec 3, 2026
bcde094
docs(api): resolve the layout and the reference pin doc links
LittleCoinCoin Dec 3, 2026
e31d397
rdm(analysis): record the depth 6 gate and hand the old store's code on
LittleCoinCoin Dec 3, 2026
08e2021
merge(schemas): close the configuration-by-reference campaign
LittleCoinCoin Dec 3, 2026
80ebb43
rdm(schemas): record the depth 7 gate and close the campaign
LittleCoinCoin Dec 3, 2026
071e92f
fix(api): read inline instruction text as no reference
LittleCoinCoin Dec 4, 2026
693753c
fix(api): drop the retired treatment root from the control cell
LittleCoinCoin Dec 4, 2026
dafc0eb
fix(api): refuse a skill given as text, again
LittleCoinCoin Dec 4, 2026
5b9e2bc
fix(runner): compare a reference's identity when a stored cell answers
LittleCoinCoin Dec 4, 2026
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
1 change: 1 addition & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 8 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,19 +17,19 @@ with statistics that say what they can and cannot support.

## What it is, and what it is not

You describe an experiment in one file: the models, the agent harness, the treatment under test
(for example a skill), the budget and the factors that vary. Candler runs every cell of that
matrix in an isolated container, stores each run, grades the runs with evaluators you plug in,
and reports rates, intervals and comparisons.
You describe an experiment in one file: the models, the agent harness, the agent's configuration
(skills, instructions, hooks, MCP servers), the budget and the factors that vary. Candler runs
every cell of that matrix in an isolated container, stores each run, grades the runs with
evaluators you plug in, and reports rates, intervals and comparisons.

It is a tool for people and agents who need a result they can defend, not a benchmark suite, a
leaderboard or a hosted service. It names no domain: the science you evaluate arrives as
evaluator plug-ins, suites and fixtures.

## Main features

- **One experiment file.** Factors, replicates, budget, harness and treatment are declared in
TOML; every value Candler uses is shown with the source it came from.
- **One experiment file.** Factors, replicates, budget, harness and the agent's configuration are
declared in TOML; every value Candler uses is shown with the source it came from.
- **Isolated runs.** Each run executes in its own Docker container, with the tools and network
the experiment declares and a per-run budget.
- **Provenance.** Each run records what produced it, so two runs are compared only when their
Expand Down Expand Up @@ -62,8 +62,8 @@ List the experiment files of a fixture directory, which starts nothing and spend

Each experiment file is listed, and a file that is not an experiment is listed as skipped with
the reason. Running needs Docker, and so does `candler resolve <experiment>`,
which prints every value an experiment comes to and checks that its treatment, harness and model
gateway are usable; a real experiment names a treatment repository and a model endpoint.
which prints every value an experiment comes to and checks that its references, harness and model
gateway are usable; a real experiment names the source of each reference and a model endpoint.

## Learn more

Expand Down
220 changes: 132 additions & 88 deletions __design__/architecture.md

Large diffs are not rendered by default.

114 changes: 114 additions & 0 deletions __reports__/analysis-factors/00-findings_factor_ownership_v0.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,114 @@
# Analysis factors — Findings: the record drops factor ownership (v0)

Date: 2026-12-03

---
type: findings
topic: analysis-factors
date: 2026-12-03
version: v0
prior-version: none
key-metric: readers that rebuild a factor's ownership from its path: 6 (prior: N/A, delta: N/A)
decision-required: confirm
---

## Headline Result

metric: readers that rebuild, from paths, what the plan knew about each factor
value: 6, each breaking a different factor shape
unit: readers
prior: N/A (first run)
direction: new

The experiment file gives every value of a cell exactly one owner, either `fixed` or one factor. The plan knows each cell's level of each factor. The run manifest keeps only the factor **paths**, so every analysis reader has to guess ownership and levels from paths and values. Each guess written so far breaks a different shape. An attempt to fix this with one more path-based guess was written, reviewed and scrapped on 2026-12-03 (see the table "What a path-based reading gets wrong"). The bug reported from htn-creator-eval stays open, and plain `analyze` is the workaround.

## Results Tables

### The concepts, as the file and the design define them
| Concept | Defined at | What it is | Relation to the others |
|:--|:--|:--|:--|
| Owner | `ExperimentFile::build`, `crates/candler-schemas/src/execution.rs` 1333-1360 | `fixed`, or one `[[factors]]` entry | Every leaf of a cell has exactly one owner |
| Factor | the file's `[[factors]] {path, levels}` (`Factor`, execution.rs:1000) | an owner with ordered levels | Its **footprint** is the set of leaves its levels fill (`Level::fills`, execution.rs:867; `footprint`, 1567). The path is only where the levels are written |
| Level | file | the values a factor writes on its footprint in one cell. A scalar, or a table that fills the values under the path (A:263) | A cell holds one level of every factor |
| Overlap | `check_overlaps`, execution.rs:1578 | two footprints share a leaf, or one leaf lies below another | Refused. Nested factor **paths** are admitted: `model` with levels `{id, effort}` plus a factor at `model.endpoint`, or `fixed model.endpoint` plus a factor `model` |
| Cell | `cells()` | the cartesian product of the factors' levels, plus `fixed` | What a run executes, and what `comparable` records |
| Treatment (skill) | `[treatment]`, typed root `treatment {name, tag?, commit?}` (A:1179) | the checkout under test. Every experiment must name one (`MissingField { field: "treatment" }`, execution.rs:1322) | In the cell digest |
| Treatment factor | `request.treatment` (A:290-297) | the one *setting* a factor may vary. Its levels are whole treatments, and they resolve into the typed root, never into `values` | A factor whose footprint is a typed root instead of value leaves |
| Block | analysis, A:1383 | for a comparison of factor F, the levels of the other declared factors | Not a separate concept: the other factors, seen from F |
| Comparison | A:1387 | one per (declared factor, pair of its levels) | Needs each run's level of each factor |
| Comparability verdict | I7 (A:1592), refusal A:1623 | arms may differ only on leaves that declared factors own | Needs each factor's footprint |

### What the plan knows and what the manifest keeps
| Fact about a factor | Known at plan time | Kept in `RunManifest` (execution.rs:2818) |
|:--|:--|:--|
| Its declared path | yes | yes, `factors: Vec<FieldPath>` |
| Its footprint (owned leaves) | yes, computed for `check_overlaps` | **no** |
| Which level this run holds (index, or the level as written) | yes, the cell is built from it | **no** |
| The treatment level as written (`source`, the tag before resolution) | yes | no. Only the resolved `treatment {name, tag, commit}` is kept, and `source` never enters the record |
| The cell's values | yes | yes, `comparable` (typed roots plus `values`, with table-valued paths folded) |

### The readers that rebuild ownership, and the shape each breaks
Shape numbers are the rows of [00-findings_probe_factor_shapes_v0.md](00-findings_probe_factor_shapes_v0.md).

| Reader | Location on main | Rule it applies | Shape it breaks |
|:--|:--|:--|:--|
| `experiment_factors` (`analyze --experiment`) | `crates/candler/src/commands/analyze.rs:140` | factors = `varying_paths(cells)`, the differing leaf paths | i, iii |
| `varying_paths` (and its doc, "a manifest's factors are exactly these") | execution.rs:1808 | the same | The doc is false for live runs, which record declared paths (`session.rs::cells_of`, 555) |
| `check_factors` | `crates/candler-core/src/analysis/report.rs:926` | refuses a recorded factor that is a strict prefix of a differing path, to protect `level_of` | ii |
| `level_of` | `crates/candler-core/src/analysis/blocking.rs:156` | level = the value at the factor's exact path | ii (null levels, hidden by the refusal), iii |
| `factors_between`, `declared_covers`, `treatment_explains` | report.rs:615, `manifest/compare.rs` 342, 381 | prefix tests, with an ad hoc `request.treatment` → `treatment` mapping in each | iii (the pair counts as "not one factor") |
| `declared_factors` (import) | `crates/candler-core/src/import/manifest.rs:212` | varying leaf paths, plus a collapse of the treatment paths | cannot group `model.id` and `model.effort` into one table-level factor. This is a real limit: an import has no file |

The planner also keeps its own copies: `treatment_levels`, `is_treatment_leaf`, `level_of_cell` and `overlaps` (`crates/candler-core/src/runner/plan.rs` 440-566). They read the file, not a record, so they produce no wrong output, but they are another definition of "which factor is the treatment".

### What a path-based reading gets wrong (the scrapped attempt)
The scrapped attempt defined a level as everything the comparable holds under the factor path. It added one `manifest::factor` module, an overlap refusal on declared paths, and a held-table arm in the verdict. An adversarial review, with mutations run one at a time, found:

| Rule tried | Counter-example | Effect |
|:--|:--|:--|
| level = everything under the path | `model` factor in a file whose `fixed` sets `model.endpoint` | The fixed endpoint appears inside every level and label. A value with embedded credentials would print |
| overlap = one declared path prefixes another | `model {id, effort}` + factor `model.endpoint`; `prompt.values {a}` + factor `prompt.values.b` | Refuses stores of files that `check_overlaps` admits |
| held-table arm: a difference at `prompt.values` is accounted for when the factor `prompt.values.a` differs | arms `{a:1, b:2}` vs `{a:2, b:3}`, declared `prompt.values.a` | Reported `Comparable` although `b` differs and is undeclared. This regresses I7, and no guard caught it |
| one parameterised CLI guard over shapes i-iii | the same rows | It went red on base for each shape, so the rows are worth keeping. Its oracle filtered levels to the keys the file writes, so it could not see the fixed endpoint |

## Observations

| Signal | Baseline / Expected | Observed [source] | Interpretation |
|:--|:--|:--|:--|
| Ownership in the record | analysis reads what the plan decided (AGENTS: one reader per consumer input) | only paths are persisted [execution.rs:2818] | **The root conflict.** Every reader is a second reading of the declaration, which AGENTS calls a defect |
| Where the split began | one definition | `2f52e9dc` (2026-11-05) defined factors as varying leaf paths; `cccf2c51` (2026-11-06) made live runs record declared paths; analysis (`bc6d5701`, `dc453814`, 2026-11-12) was built on the varying reading; m6a patched `request.treatment` into each reader one by one [git log] | Each patch fixed one shape. `--experiment` was never patched, and that is the bug |
| Blocks | a concept of their own? | A:1383 derives them from the other factors' levels [design] | Blocks need no record of their own, only each run's levels |
| "Treatment" | one meaning | the skill checkout (`[treatment]`, mandatory) and the design-of-experiments sense: I7 "declared treatment factors", A:244 "a treatment condition" [design] | See the open question on the term |
| README "the factors that vary" | the factors the experimenter varies | read in code as "the leaves where cells differ" [`varying_paths` doc] | Plain English that was over-read |

## Charts & Visualizations

```mermaid
flowchart LR
F["experiment file<br/>factors: path + levels"] --> P["plan<br/>footprint per factor<br/>level per cell"]
P -->|"keeps"| M["run manifest<br/>factors: paths only<br/>comparable: values"]
P -.->|"drops"| X(("footprints<br/>level per run"))
M --> R1["analyze --experiment<br/>varying_paths"]
M --> R2["check_factors<br/>prefix rule"]
M --> R3["level_of<br/>exact path"]
M --> R4["verdict<br/>prefix + treatment map"]
I["import<br/>no file"] -->|"varying leaves"| M
```
*Caption: what the plan knows reaches the manifest only as paths. Each reader on the right rebuilds the dropped part by its own rule.*

## Contradictions & Surprises
- The design's own example of a table level (`model` with provider settings, A:263) is the shape that analysis refuses.
- `request.treatment.tag`, which `--experiment` says the file declares, cannot be written as a factor path at all (`experiment.unknown_path`).
- The comparability verdict, the safeguard against undeclared differences, was the easiest thing to weaken without any guard noticing.

## Steering Questions
- [now] Confirm the direction: the record keeps what the plan knows about each factor, and analysis stops rebuilding it. The design is in [00-open_question_factor_record_v0.md](00-open_question_factor_record_v0.md).
- [now] Confirm that no interim fix lands. The `--experiment` refusal stays until the redesign, with plain `analyze` as the workaround.
- [next run] Decide the term "treatment" before the record's field names are fixed. See [00-open_question_treatment_term_v0.md](00-open_question_treatment_term_v0.md).
- [later] Import parity for table levels: once a native run records levels, can an import record one factor per varying leaf and say so, or must the two agree?

## Pointers
- `crates/candler-schemas/src/execution.rs` 867, 1000, 1312-1362, 1567-1600, 1808, 2818
- `__design__/architecture.md` 244, 259-297, 1165-1180, 1383-1394, 1467, 1592, 1623
- `AGENTS.md`: the integrity rules (one reader per consumer input)
- [00-findings_probe_factor_shapes_v0.md](00-findings_probe_factor_shapes_v0.md)
77 changes: 77 additions & 0 deletions __reports__/analysis-factors/00-findings_probe_factor_shapes_v0.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
# Analysis factors — Findings: what main does with each factor shape (v0)

Date: 2026-12-03

---
type: findings
topic: analysis-factors
date: 2026-12-03
version: v0
prior-version: none
key-metric: factor shapes analysed as the file declares them, both verbs: 2 of 5 (prior: N/A, delta: N/A)
decision-required: none
---

## Headline Result

metric: factor shapes that plain `analyze` and `analyze --experiment` both compare as declared
value: 2 of 5 (`instructions.global` table levels, `model.id` scalar levels)
unit: shapes
prior: N/A (first run)
direction: new

Observed on `main` at `df2fbd27` (Candler v0.20.0), with no source change. Every cell below comes from a run of the real binary on the fake docker world (`crates/candler/tests/it/support/cli_run.rs::World`). The probe was a throwaway test and is not kept.

## Results Tables

### How each shape was run
Each run used two levels and `replicates = 2`, so four sealed runs per shape. The steps were:
1. `candler resolve`, then `candler run`.
2. One `E1` outcome per run, written through `OutcomeWriter`.
3. `candler analyze`, then `candler analyze --experiment <same file>`.

Shape (i) uses two tagged commits (`v1` and `v2`) of one local skills repository.

### P1: shape by verb
| # | factor in the file | manifests' `factors` | comparable paths that differ | plain `analyze` | `analyze --experiment` |
|:--|:--|:--|:--|:--|:--|
| i | `request.treatment`, table levels `{name, tag = v1 \| v2, source}` | `["request.treatment"]` | `treatment` (`tag`, and the `commit` resolved from it) | 1 comparison, levels = the two typed treatments | refused `analysis.experiment_disagrees`: "declares `request.treatment.tag`", record has `request.treatment` |
| ii | `model`, levels `{id=a, effort=low}`, `{id=b, effort=high}` | `["model"]` | `values:model.id`, `values:model.effort` | refused `analysis.factor_broader_than_variation` | refused, same code (the prefix refusal runs first) |
| iii | `prompt.values.a`, scalar levels `x`, `y` | `["prompt.values.a"]` | `values:prompt.values` (`{a:x}` vs `{a:y}`, one folded value) | exit 0, **0 comparisons**, `pairs_not_one_factor = 1` (silent drop) | refused `analysis.experiment_disagrees`: "declares `prompt.values`" |
| iv | `instructions.global`, table levels | `["instructions.global"]` | `values:instructions.global` (whole table) | 1 comparison | accepted, same comparison |
| v | `model.id`, scalar levels (control) | `["model.id"]` | `values:model.id` | 1 comparison | accepted, same comparison |

`resolve` and `run` accepted every shape and sealed all four runs.

### P2: can Candler's own run path make a two-treatment-level store?
| Question | Answer | Evidence |
|:--|:--|:--|
| From two real tags, with no resolution patched by hand? | **Yes, through the binary** | The cells' `comparable.treatment` was `{demo, v1, 8377da53…}` and `{demo, v2, 7e1f5415…}`, with `factors = ["request.treatment"]` |
| At core integration scope? | **No** | The loop that resolves each treatment level from its tag lives in the binary: `crates/candler/src/commands/run.rs` 180-286 (`treatment_levels`, `plan_runs`, `levels`). Core tests build each level's `Resolution` by hand (`guard_known_truth.rs` 539-562). A core guard would therefore test a composition the test wrote, not the run path |

## Observations

| Signal | Baseline / Expected | Observed [source] | Interpretation |
|:--|:--|:--|:--|
| (i) `--experiment` | agrees with the run that wrote the store | refuses [probe run] | The CLI recomputes the factors with `varying_paths` (leaf paths), while the run recorded the declared path. This is the htn-creator-eval P2 bug |
| (ii) table level at an ordinary path | one factor, two levels (design A:263 uses this exact example) | refused by both verbs [probe run] | The design's own example cannot be compared at all |
| (iii) factor below a folded table root | one comparison | silently dropped, or refused naming a path the file never declared [probe run] | Two verbs give two different wrong answers |
| (iv) whole table-valued root | one comparison | one comparison [probe run] | It works because the declared path, the differing path and the level all coincide |
| Fake-agent integrity | valid runs | every run sealed `invalid(reader_error)` [probe run] | The fake agent writes no harness stream. The probe set `integrity = {"kind":"valid"}` in each sealed manifest, which is outside the cell digest. Any guard on this world must do the same |

## Contradictions & Surprises
- Shape (i) has "differ only in `tag`" true of the file, but the cells also differ in `commit`, because the commit is resolved from the tag.
- `resolve` needs a model endpoint that answers, and `run` does not. The probe passed a stub that answers 200 to `resolve` only, through `--set model.endpoint=…`.

## Steering Questions
- [now] A guard of the redesign needs one row for each of shapes i, ii and iii, which are distinct equivalence classes. Shapes iv and v behave as the control.
- [now] The guard runs through the binary with `World`, because P2 rules out core scope unless the per-level resolution loop moves into core.
- [later] Should the per-level treatment resolution loop move from `commands/run.rs` into core? Every consumer is meant to go through candler-core operations, and today no surface other than the CLI can reuse this loop.

## Pointers
- `crates/candler/tests/it/support/cli_run.rs` (`World`, `tag_new_commit`, `launch`, `sealed_runs`)
- `crates/candler/tests/it/guard_cli_observe.rs::o1_resolve_accepts_an_experiment_with_two_treatment_levels`
- `crates/candler/src/commands/run.rs` 180-286
- `crates/candler-core/tests/it/guard_known_truth.rs` 539-562
- [00-findings_factor_ownership_v0.md](00-findings_factor_ownership_v0.md): why each shape breaks
- Cost: 7-12 s per shape end to end
Loading