Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions examples/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Examples

Studies run with Candler, kept with their kit, analysis and reports as a record of how Candler was
used.

| Folder | Study |
|---|---|
| [`colgrep-md-sections/`](colgrep-md-sections/README.md) | Does indexing markdown by heading section in colgrep change how Claude Code agents read and answer? Two colgrep builds, five open-weight models, 48 questions, 1,440 runs (December 2026). |
327 changes: 327 additions & 0 deletions examples/colgrep-md-sections/00-architecture_v0.md

Large diffs are not rendered by default.

375 changes: 375 additions & 0 deletions examples/colgrep-md-sections/01-architecture_v1.md

Large diffs are not rendered by default.

292 changes: 292 additions & 0 deletions examples/colgrep-md-sections/02-architecture_v2.md

Large diffs are not rendered by default.

56 changes: 56 additions & 0 deletions examples/colgrep-md-sections/03-gap_more_questions_v0.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
# Gap analysis: the colgrep markdown-sections study needs 48 questions, not 24

2026-12-03. Source of roadmap amendment A1 (`assemble/dry_run/questions_48.md`). Decided by Eliott on
2026-12-03 at the dry-run gate.

## Problem statement

Q1 is the primary read-count estimand, with a SESOI of 0.85. With 24 questions it is not powered at
that SESOI. The dry run and the literature-based known-truth run agree on this. Questions are the
units of the study, so more questions are the lever. Replicates help less.

## Evidence

MDE at 80 % power, from the dry-run leaf (`leaves/dry_run_v0.md` §MDE; jackknife-t, frozen
battery):

| Noise set | Questions | Q1 MDE | Q2 NI: true RD needed |
|---|---|---|---|
| literature | 24 | 0.794 | +4.1 pp |
| literature | 36 | 0.838 | +2.3 pp |
| dry point estimates | 24 | 0.805 | +4.1 pp |
| dry point estimates | 36 | 0.853 | +2.0 pp |

The MDE was scaled as 1/√questions on the log scale. On that scaling, Q1 reaches 0.85 at about
35–48 questions. Q3–Q5 would need about 90–170 questions at their SESOI of 0.90, which is more than
this pool and budget can carry.

The dry-run leaf's sweep at 36, 48, 60 and 80 questions, with H0 at 48, replaces these
extrapolations once it is committed.

## Root cause

The plan sized n from the budget and reported the MDE. It left the 24 → 36 lever to the dry-run
gate. The dry run's own spread between questions rests on 3 questions (2 degrees of freedom), so
it cannot narrow the planning value. The literature value stands.

## Decisions (Eliott, 2026-12-03)

- 48 questions, which doubles each stratum: paper 12 deep / 4 shallow, report 12 / 4, code
4 deep / 4 shallow / 8 code-answer. 5 models × 3 replicates × 2 arms gives 1,440 runs.
- Q1 and Q2 are the co-primary claim. Q3–Q5 are descriptive, with estimates and intervals but no
claim. Q6 stays a descriptive safety signal (8 code-answer questions).
- The 40-turn cap stays. Capped runs are scored as in LightOn's paper: the files the agent inspected
are its fallback submission, and an empty answer scores zero.
- No prompt sentence steering agents to colgrep, and no turn-reminder hook. The experiment first
establishes a baseline under the hooks as LightOn ran them.

## Impact

- Scope: 24 new questions, through the same inclusion rules, screens and adversarial verification
as the first 24. The existing 24 are unchanged.
- Dependencies: `full/` waits for this leaf as well as for `dry_run`. The kit's experiment files and
the battery's strata follow `kit/questions.toml`.
- Risk: the deep strata may run short of candidate passages. That is reported, never solved by
relaxing the 2,048-token threshold. The full run is about 9 h expected, and about 16 h if every
model is as slow as the slowest one, so it may take two nights.
119 changes: 119 additions & 0 deletions examples/colgrep-md-sections/04-findings_dogfooding_v0.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,119 @@
# Findings: Candler in use for the colgrep markdown-sections study (v0)

Candler `main` df2fbd27, built as `candler 0.20.0` (release, `colgrep-study-target`). Harness Claude Code 2.1.311. Written by the coordinator from [`dogfood-log.md`](dogfood-log.md) (D1–D59), which holds each entry in full; this report groups them and proposes changes.

**Verdict: Candler carried the study end to end, and no entry blocked it.**
- It ran 1,447 sealed attempts with the build as the only compared factor, and graded every run with two plug-ins.
- It cross-checked the success measures, and its findings agree with the study battery.
- Of the 59 entries, 42 cost the study time, a rebuild or a redesign; 17 cost nothing. 46 are Candler's; 13 belong to colgrep, RiVault, the study's own code, or the tooling.
- The costliest themes:
- **Analysis** stops at pass/fail and weights. Counts, pairing, clustering and non-inferiority all live in a study script.
- **The plug-in surface** works but is learned by failure: environment, metadata paths, inputs, the CA bundle, stale environments.
- **Two Candler bugs** distorted what a reader of the store would conclude: wall kills sealed as gateway errors (D56), and a stale plug-in environment (D58).

## Setup

| Item | Value |
|---|---|
| Candler | `main` df2fbd27, `candler 0.20.0`, built with `cargo build --release -j 4 -p candler` into `<worktrees>/Candler/colgrep-study-target` |
| Wrong binary seen | `<src>/CrackingShells/Candler/target/debug/candler` is 0.10.0 and refuses the experiment file; one false start, removed by path before the full run |
| Experiment | `kit/experiment.toml`: `request.treatment` with two tags of one treatment repository; blocks `model.id` × `prompt.values.question` |
| Plug-ins | `tool-roles@0.1.0` (role table and RiVault classifier for the residue), `reads@0.1.0` (read events, success gates, counts), in a uv project |
| Models | Qwen/Qwen3.8-27B, google/gemma-4-26B-A4B-it, deepseek-ai/DeepSeek-V4-Flash, nvidia/NVIDIA-Nemotron-3.5-Super-VL-120B-A12B, XiaomiMiMo/MiMo-V2.6-Pro-RL, all on RiVault |
| Store | `<study-dir>/store-full` (4.3 GB), kept until Eliott has read the reports |

## Runs

| Stage | What Candler did | Time | Entries |
|---|---|---|---|
| Probes (`probe_candler`, `probe_cache`) | treatment factor, trace fields, plug-in environment, metadata, inputs; one run per model | about a day of leaf work | D13–D15, D20–D30 |
| Kit (`experiment_kit`) | images under the 64 MiB context cap, `/opt/env` index, plug-ins graded twice | — | D35–D46 |
| Dry run | 24 runs + a replicate pair; `evaluate` 24 runs in 11 s; bare `analyze` | — | D47–D54 |
| Full run | job 01a23c44-ce56-7776-b589-ae2b21a25329: 1,447 attempts, 1,440 runs of record, `completed` | 6 h 43 m | D56, D57 |
| Evaluate | 1,447 attempts, 13,173 pass and 1,297 fail, 0 failed requests | 5 m 39 s | D58 |
| Analyze | bare `analyze --evaluator reads@0.1.0`: 240 blocks, 29.6 MB JSON | 2 m 50 s | D59 |

## Findings by kind

Severity is for this study: **costs** (time, a rebuild, a redesign or a weaker claim) or **none**. Within each kind the costlier entries come first. Owner "Candler" unless stated.

### Bugs (3)

| D | Where | Severity | What | Proposed change |
|---|---|---|---|---|
| D56 | `classify_end` rule 7 vs `qualify` (runner) | costs | A run killed by the per-run wall has no result line, so 0 tokens, and is sealed `gateway_error` before the expiry becomes `cap: wall`. 7 of 8 "gateway" ends were wall kills | Qualify a wall expiry before rule 7; keep `gateway_error` for runs with a failed request in the census |
| D58 | plug-in environment key (lock digest) | costs | An editable path source resolves to an absolute path the key does not cover; a removed worktree left a stale `.pth`, refused as `plugin.describe_failed` | Put the resolved source paths in the key, or check them before reuse; name the stale path in the refusal |
| D19 | colgrep fork `--json` spans (owner: colgrep fork) | costs | Section `line`/`end_line` in `--json` are inflated against the db and text output | Fix the span in the fork's JSON writer before proposing sections upstream |

### Gaps (21)

| D | Where | Severity | What | Proposed change |
|---|---|---|---|---|
| D2, D8, D9 | `analyze` (`commands/analyze.rs`), `show.rs:88-111`, `inspect.rs:197-298`, `outcome-record.md` | costs | `analyze` ignores outcome values, counts cannot be weights (`num = den` for a pass), per-run values are only in `inspect`, one run per call | A count outcome kind tested by a stratified permutation and a ratio interval; per-run values in `--table runs` |
| D6 | `docs/statistics.md` | costs | No paired or blocked test, no clustering by a factor, no non-inferiority | Clustered (by a named factor) intervals and a margin option in `analyze` |
| D27, D33 | `analyze` `runs[]`, `inspect`, `needs.metadata` | costs | The arm (treatment tag) of a run is only in `manifest.json` `comparable.treatment`; one dataset row needs three reads | Carry the treatment tag in `analyze` runs and `inspect` |
| D35 | `supervise/git.rs` `ARCHIVE_LIMIT`, `resolve/steps/identity.rs` | costs a redesign | A tagged build context is capped at 64 MiB; the refusal names neither the cap nor the tree | Say the cap and the tree in the refusal, and document it in the experiment-file contract |
| D40 | uv plug-in environment | costs, silent | uv's own CPython ignores the host CA bundle; every classifier call ended `unparsed`, and plug-in stderr is not shown | Show plug-in stderr on `not_measured`; let a manifest declare `SSL_CERT_FILE` or use the system store |
| D43 | `prior[].outcome.evidence` | costs, silent | A dependent kind's only channel to its parent is free evidence strings; one extra note broke three expectations | A typed payload from producer to dependent, or a schema per evidence note |
| D41 | helper `INSTRUMENTS` | costs | A path dependency is refused, editable is always dirty, git needs a commit that holds its own lock; no outcome is tied to the kit commit | Accept a path source with its git commit and dirty flag |
| D46 | evaluator versions | costs | Re-grading after a code change stores outcomes under the same `name@version`; only a manual bump separates code states | Record the plug-in's lock and source digest with each outcome |
| D45 | evaluate prerequisites | costs | Required variables and a reachability check have no place in the manifest; a shell wrapper enforces them | `needs.env` in the plug-in manifest, checked before any request |
| D57 | job end, `ps`, `watch` | costs | A replicate with no valid run after its one retry leaves the job `completed` with nothing said | Report missing replicates in `ps`, `watch` and `job.ended` |
| D1 | evaluator evidence (`evaluator-protocol.md`) | costs | Evidence is `{ref?, note?}`; an evaluator cannot attach a file it wrote | Allow an evaluator-written evidence file, stored as a blob |
| D4, D26 | `engine/mod.rs:531-552`, `:210`, `:541` | costs | The evaluator inherits the whole shell environment, keys included; only `CANDLER_STORE_ROOT` is filtered | An allowlist declared by the plug-in |
| D13 | `[env]` reserved names, `driver.rs:37` | costs | No way to add a request body field (RiVault `no-cache`) or redirect Claude Code | Document the nonce-hook pattern for proxies that cache |
| D18 | colgrep (owner: colgrep) | costs | A search needs a writable index directory (lock files) | Upstream: read-only search mode |
| D51 | study design (owner: study) | costs | The dry slice had too few classifier reads to test κ on classifier labels | — (decided at the gate) |
| D11 | trace `tool_call.argv` | none | Thought to be Bash-only; corrected by D22 | — |
| D48 | `analyze --experiment` | none for the study | Refused because manifests record `request.treatment` and the file expands `request.treatment.tag` | Fix upstream (known) |

### Documentation (14)

| D | Where | Severity | What | Proposed change |
|---|---|---|---|---|
| D36 | `isolation/layout.rs` `CONTAINER_ENV`, `hardening()` | costs a rebuild | The root filesystem is read-only, and `/opt/env` is the only writable place that carries image content; nothing says so | One paragraph in the isolation contract |
| D23 | `plugin-manifest.md`, `engine/mod.rs:548` | costs | `project` must be a subdirectory; the command runs in the project dir; a path dependency in the lock is relative to it | Fix the manifest page; ship a working uv example |
| D24 | `needs.metadata` | costs | Paths must match `comparable.values` exactly; `prompt.values` is one object | Document the exact-path rule with an example |
| D28, D32 | `analyze --format`, `candler ls` | costs | `--format` is `text|csv` and `--table` needs `csv`; `ls` counts are not the store's runs; a workspace inside the store is refused | Correct the help and contract pages; make `ls` count runs |
| D29 | evaluator helper models | costs | `RootModel` and `MISSING` sentinels break `str()` and `json.dumps` silently | Helpers that return plain values, or documented accessors |
| D39 | helper README, `artifact_files[].abs` | costs | `path` is not relative to `root` for artifacts; the diet example reads it the wrong way | Fix the README and the diet example |
| D47 | `candler run` | costs | `run` exits after starting a detached job; waiting on it is a false "done" | Say it in `run --help`; point to `watch` |
| D5 | experiment-file contract | costs | The `request.treatment` level syntax is in no contract page (`plan.rs:435`); a stale diet comment says it is refused | Document the level table; remove the stale comment |
| D14 | RiVault (owner: RiVault) | costs | No cache header; a hit shows only as an identical response id | Note in Candler's gotchas: assert distinct ids across replicates |
| D22 | trace `event.ext.input`, `raw/stdout.jsonl.gz` | none | Every tool's input is in the trace; output frame `n` is line `n+1` | Document both in `trace-file.md` |
| D25 | evaluator `inputs[]` | none | `path` is a directory, `at` is ignored for evaluators | Document |
| D34 | `inspect` record order | none | The newest record per expectation is the first; outcomes carry no timestamp | Add a timestamp or document the order |
| D54 | bare `analyze` | none | Refused with two evaluators in the store; `--evaluator` works | Document in the refusal text |

### Frictions (20)

| D | Where | Owner | Severity | What | Proposed change |
|---|---|---|---|---|---|
| D21 | `isolation.build.dockerfile` | Candler | costs | The Dockerfile is read from the working tree, not the tag; a table level may not carry other settings | Allow `treatment:` for the Dockerfile |
| D37 | config check mount | Candler | costs a retry | `bind source path does not exist` twice after re-creating the store, likely a Docker Desktop race | Retry the config check once; keep failed jobs out of `ps` |
| D38 | `evaluate` | Candler | costs | Outcomes all present, any status, count as complete; only `--runs '*'` re-grades | Re-grade `not_measured` by default |
| D10, D12 | evaluator cache, dependency blocking (`engine/write.rs:88`) | Candler | costs | No shared state directory; a failed dependency blocks every dependent gate | A per-evaluator state directory; an option to keep gates on a dependency failure |
| D16, D17 | colgrep ONNX download, image CA bundle | colgrep / kit | costs | ONNX Runtime URLs 404; slim image lacks CA certificates | Upstream colgrep: a fallback for the runtime download |
| D31, D55 | colgrep MCP `index_build`, `search` with `pattern` | tooling | costs | One path only; regex pre-filter over heading-less papers ranks unrelated units | Report to colgrep-mcp (out of scope here) |
| D52, D53 | study `roles.py` | study | costs | Redirects before a pipe sent table-decidable calls to the classifier | Fixed in the kit |
| D44 | study plan | study | would have biased Q1/Q5 | Gates computed from read paths, not cited locations | Fixed before data |
| D49 | `kit/commands.sh` | study | none | A stamp line without an evaluation | Read the last stamp |
| D59 | `analyze` weighted-outcome record | Candler | none (cosmetic here) | `interval_reading: "effect"` next to `reject: false`; the pooled ratio weights long citations | Say which test the reading follows, or align them |
| D3, D7, D15, D30, D42, D50 | trace text, commit scope, inline hook files, one-level factor, image names, `locations` prompt | Candler / study | none | Minor; see the log | — |

### Works (1)

| D | What |
|---|---|
| D20 | `request.treatment` as a factor of two tags: resolves, plans the cells, builds one image per arm. The study's design rests on it |

## What would most help the next study

1. **Count outcomes in `analyze`** (D2, D6, D8, D9, D27, D33): a ratio-of-means test, clustered by a named factor, with a margin option, plus the treatment tag in `runs[]`. That would replace most of the study battery's export.
2. **The plug-in surface documented from a working example** (D23–D25, D29, D39, D40, D45): one uv plug-in that reads trace, inputs, metadata and artifacts, and declares its environment.
3. **The two bugs** (D56, D58), which mislead without failing.

## Notes for the reader

- The earlier `probe_candler` and `corpus_questions` leaf commits carry Sonnet co-author trailers. The kit and dry-run fix commits were rewritten to Opus on the unpushed branch; those two were not.
- Nothing has been pushed, and nothing has been sent to lightonai/next-plaid.
Loading