Skip to content

merge(api): close three M6 gaps before M7 - #85

Merged
LittleCoinCoin merged 42 commits into
mainfrom
fix/m6-gaps
Dec 1, 2026
Merged

LittleCoinCoin merged 42 commits into
mainfrom
fix/m6-gaps

Conversation

@LittleCoinCoin

Copy link
Copy Markdown
Member

Why

Closing M6.5 and M6d left three gaps on main. Each one makes a promise of the README untrue on its own terms.

  • A guard that proves a real OpenCode run can be stopped had failed since 8d88cb50, and no CI job ran it.
  • A run job refused at its start ended as job.ended {"reason":"failed"} and a line in supervisor.log. The code of the refusal reached no place a library, CLI or MCP consumer reads.
  • An evaluator's stage was sent as one request. A kind's stored outcome and its refusal therefore depended on the other kinds sent with it.

What changes

  • The OpenCode stop-script guard selects the export spec by variant, builds its own image and runs in the container-e2e job. The list of expected guards names it and guard_harness_check_refuses.
  • Every job kind ends through one end_job and leaves its refusal in jobs/<id>/refusal.json (refusal/1: code, side, pointer). job.ended gains no field. JobOutcome gains refusal: Option<RefusalRecord>, so code that builds one writes refusal: None. That is the fix(jobs)! commit, and the core goes from 0.19.0 to 0.20.0. A run job whose setup failed now also leaves its record.
  • An evaluator's stage is split by the needs of its dependency components. Kinds with equal needs still share a request and a digest. A kind's context digest no longer changes when a kind with other needs joins the suite, and a run that lacks a trace refuses only the kinds that need one. The fix(evaluation) commit lands in the same release.
  • A refused evaluation request carries its refusal/1 record in EvaluateReport and in the printed report, built by the same function as refusal.json: on a run with no trace, the trace kind fails with evaluation.run_part_missing. failed_requests becomes Vec<FailedRequest> (request, refusal) and the document drops reason, whose text is the record's message. That is a second fix(evaluation)! commit, in the same 0.20.0. There is no schemas@ or candler-evaluator@ release.

Hard parts

  • The server refusal row names jobs.server_exited_at_start, the code a server that exits at start raises (jobs.server_check_failed takes the same path).
  • The engine dropped a refused request's code where the typed error became a string, in send. The record builder had to move out of jobs, which builds on Unix only, so evaluation could call it; there is still one builder.
  • Outcomes stored from today's mixed batches miss reuse once. The commit body says so.
  • A mixed suite sends more requests: the largest engine fixture goes from 1 to 2 per run. The count equals the number of distinct needs sets among an evaluator's components. The plug-in of the golden suite is expected to declare one set per evaluator and stage; that is inferred from a plan, not counted.
  • Each guard was seen red before it passed, on the base or under a named bite. The review reruns of those bites gave the same results.

Not covered

  • Failed requests that hold no coded error (cancel, no slot, a failed dependency, a wrong id) carry candler.internal. No test reaches that fallback.
  • Dropping the record in session::run is caught by the Docker guard only, which container-e2e runs on this pull request.
  • Four refusal paths of run_job (plan, cells, gate_controls, session open) have no guard of their own.
  • Per-entry digests and refusals in one request (Idea B of the notice) are not built.

Observations

Nineteen observations, each with its location, are in __reports__/m6_gaps/00-knowledge_transfer_v0.md. The ones that matter next:

  • Cancel, no slot and a failed dependency carry candler.internal; codes of their own would let M7's show tell them apart.
  • M7's jobs and show can read refusal.json.
  • Three timing guards (guard_supervise, guard_protocol_client, guard_wiring) fail once under load and pass alone.

Gates on the tip: cargo fmt --check, cargo clippy --workspace --all-targets -- -D warnings, cargo nextest run --workspace (774 passed, 35 skipped) and cargo doc with warnings denied pass. The container selection passed 28 of 28 locally, including both named guards, and guard_harness_check_refuses passed again after the last change.

🤖 Generated with Claude Code

LittleCoinCoin and others added 30 commits December 1, 2026 14:54
Closing M6.5 and M6d left three gaps on main, and M7's jobs and show
ops would read what one of them decides. This roadmap fixes all three
in one small campaign first.

- opencode_stop_guard (O1): the ignored OpenCode stop-script guard
  takes the first collect spec, which is the file spec since 8d88cb5,
  and no CI job runs it. The leaf finds the export spec by variant,
  moves the guard into candler-core's container e2e module on an image
  it builds, and names it in container-e2e's expected list.
- job_refusal_record (O11): a job-start refusal's code reaches only
  supervisor.log. Every job kind now leaves refusal.json through one
  end_job shared by both runtimes. JobOutcome gains a field, so the fix
  is marked breaking and the core goes to 0.20.0.
- needs_batches (notice 04): requests split by the needs of each
  dependency component, so a kind's digest and refusal no longer
  depend on the kinds sent beside it.

Two adversarial reviews, each on validity and on how the change was
developed, what it leaves and how it is consumed, gate the two engine
leaves before they merge. A close-out runs the whole-suite and
container gates and writes the knowledge-transfer report.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The pre-conditions hold on fix/m6-gaps (cut from 830a48c, which
contains ad74ff9): each leaf worktree resolves to its own target
dir, Docker answers and 194 GiB are free.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
The ignored guard opencode_real_binary_is_interrupted_by_the_stop_script
failed with "no collect" since 8d88cb5, because it took the first
collect spec as the export one. It now finds the Exec spec by variant,
lives in candler-core's guard_container_e2e module, and builds the
OpenCode base image itself through the builder it shares with
version_probe_e2e, so no variable is needed and CI selects it.
container-e2e's expected list now names it and guard_harness_check_refuses.

Seen red on the base ("no collect", NotPresent) and under the bite of a
stop script that exits 0 without signalling (the run times out); green
in 7 to 8 s with a warm layer cache. The builder's image removal moved
into Drop, so a failed assertion leaves no image behind.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The server-exit test that reaches check_servers raises
jobs.server_exited_at_start, not jobs.server_check_failed; no test
reaches the latter, which goes through the same ServerCheckError path
and the same record builder, so a row for it would catch no bug the
server-exit row misses. The campaign gate and the leaf's gate now name
the raised code, and the leaf owns guard_server_check.rs (approved at
its first joint) and the refusal: None migrations its fix(jobs)! forces.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Merged as e1a5769. The whole-suite gates pass on the integration tip
after the merge: fmt, clippy, doc, and nextest 772 of 772 (35 skipped).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The leaf is done on fix/job-refusal-record (five commits, whole suite
772 of 772, G6 green), at $2.19 measured from its transcript against a
$3 estimate. Its one-pass review starts; the leaf merges after it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
guard_harness_check_refuses now reads jobs/<id>/refusal.json, the record a
consumer of the job's state reads, and asserts its schema, code, side and
pointer, and that the harness's own output is quoted, instead of searching
supervisor.log. It is red on the base because no run job writes the file.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
The record builder (record_of), write_refusal, REFUSAL_FILE and the new
end_job move out of the evaluate job's body into
jobs/runtime/refusal.rs. end_job writes the record when there is one and
then emits job.ended, so the order "record, then job.ended" has one home.
Evaluate's supervisor ends through it. No behaviour changes.

REFUSAL_FILE moves from jobs::runtime::evaluate to jobs::runtime::refusal;
candler's evaluate command imports it from there.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
A run job refused at start ended as job.ended {"reason":"failed"} plus a
line in supervisor.log, so its code reached no consumer. JobOutcome gains
`refusal`, `refused` takes the typed error and builds the record with
record_of (keeping its stderr line), every refusal path of run_job passes
its error, and session::run ends through end_job, which writes
refusal.json before job.ended, as evaluate jobs already did.

Guards: the job-start refusal tests of guard_config_check.rs and
guard_server_check.rs now read the record the job body returns (code, side,
pointer, message) instead of a child process's stderr; refusal_of,
CANDLER_CONFIG_CHECK_CHILD and CANDLER_SERVER_CHECK_CHILD are retired. One
test per refusal class: harness_rejected_input (harness finding),
config_check_failed (five rows: a check that did not run) and the server
that exits at start (jobs.server_exited_at_start). The server row stays in
guard_server_check.rs, whose setup (a job that declares mcp servers) differs
from the stand-in harness of guard_config_check.rs; it reads
outcome.refusal there.

BREAKING CHANGE: JobOutcome has a new public field `refusal:
Option<RefusalRecord>`. Where JobOutcome is built, add `refusal: None`.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
The architecture said only an evaluate job leaves refusal.json. Every job
kind does when an error ended it, written before job.ended.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Leaf report of job_refusal_record: G6 red on the base and under its bite,
the string-error bite on every refusal-class guard, the checks that a
successful job and a killed job leave no refusal.json, the gate results,
the deviations and the observations.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Cold review of fix/job-refusal-record on validity, develop, leave and consume. No blocking findings.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
When the supervisor's setup failed (no slot, an unreadable configuration,
a docker client that cannot be built), session::run ended the job without
a refusal.json, while an evaluate job writes one on the same kind of
failure. The Err arm now builds the record with record_of and ends through
end_job, so every job kind leaves its record when an error ended it, as
architecture.md says.

No existing test or its support reaches that arm, and a new fake was ruled
out, so the arm is covered by the shared end_job path only.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
A run job refused at job start ended as job.ended {"reason":"failed"}
and a supervisor.log line, so its code reached no consumer. The record
builder now lives in jobs/runtime/refusal.rs (record_of, write_refusal,
end_job) and both runtimes end through end_job: a run job's refusal,
or the error that ended its setup, is written to jobs/<id>/refusal.json
before job.ended, as evaluate jobs already did. JobOutcome gains
refusal: Option<RefusalRecord>; the commit that adds it is fix(jobs)!
and gives the migration (refusal: None), so the core goes to 0.20.0.

G6 reads the record instead of the log and the job-start guards read
JobOutcome.refusal, one test per refusal class
(experiment.harness_rejected_input, jobs.config_check_failed,
jobs.server_exited_at_start); their child-process helpers are retired.
Each was seen red on the base or under its bite. The one-pass review
found nothing blocking; its F2 (no record on a setup failure) is fixed
here, and F1, F3 and F4 are recorded as observations in the leaf report.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The review found nothing blocking; F2 was fixed on the leaf branch and
F1, F3 and F4 are observations in the leaf report. The leaf merged as
022db6f, and the whole-suite gates pass after it: fmt, clippy, doc,
and nextest 772 of 772 (35 skipped).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The engine reports a request refused while its context is assembled as
`EvaluateReport.failed_requests`, a request id and a text. The code
`evaluation.run_part_missing` is lost where `send` turns the assemble
error into a fault, so no consumer can read it. Carrying it would change
the report document, which this campaign does not own. The gate now
asks that only the kind that needs the missing part fails, and the lost
code goes to the close-out as an observation.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Two guards at engine scope with the test plug-in: on a run sealed with no
trace, a manifest-only kind is graded and a trace kind alone is refused;
on a run with a trace, a kind's stamped context digest is the same whether
the suite holds it alone or beside a trace kind. Both are red on the base:
the engine sends one request per evaluator and stage with the union of the
needs. Adds the kinds reads_manifest and reads_trace and two suites, and
says in the dependency guard's doc comment that its dependents declare
needs of their own.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
plan() keyed a batch by (stage, evaluator), so every kind of an
evaluator at one stage was sent in one request with the union of their
needs. A kind's context digest, and so its reuse key, changed when
another kind joined the suite, and a part the run lacked refused all the
kinds of the request.

A batch is now keyed by (stage, evaluator, needs), where needs is the
union over the members of one dependency component, compared as sets.
Entries that depend on each other in one evaluator are one component, so
they still share a request and the dependent still receives its prior.
Components with equal needs still share a request. Stages, send and
attempt do not change, and nothing changes on the wire.

Existing tests that asserted one request per evaluator and stage: none
had to change, because their kinds have equal needs or one component
(guard_engine independent_entries_of_one_evaluator_share_one_request and
the deadline guard); the first guard's doc comment and message now say
"as the needs are equal".

Outcomes stored from today's mixed batches miss reuse once, because
their context digest changes. Every record valid before stays valid.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
The Notes bullet said context and digest cover the request's kinds
together and a missing part refuses the request. A request now holds the
kinds with equal needs, so the bullet says that kinds with equal needs
share request and digest and a missing part refuses only them, with a new
stamp and the page's Notes still at 120 words. The doc comment of assemble
and the architecture's evaluator-protocol paragraph, the one other place
that states the union rule, say the same.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Leaf report: the probe's answer, the base and bite messages of both
guards, the fix, the docs, the whole-workspace gate and the observations
(the refusal code dropped at send, and the wiring timing guard under
load). The dependency guard's doc comment now names the failure its bite
produces.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Cold review of fix/needs-batches: validity, scope, leave, and request counts
on both branches, with both bites rerun. No blocking finding.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
needs_key built a JSON text and fell back to Null if serialising failed,
which would have restored the one-request grouping without a sign. The
key is now a typed NeedsKey: the three flags and the sets of artifact
globs, snapshot kinds, input kinds and metadata paths. It cannot fail and
is equal for equal needs whatever the order of their lists. Behaviour is
unchanged: the digest already sorts artifacts, snapshots and inputs and
holds metadata in a map, so list order never reached it.

The leaf report records the review's findings and their answers, and the
doc comment of the batching guard is rewrapped.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
One request per evaluator and stage carried the union of its entries'
needs. A kind's context digest, and so its reuse key, changed when
another kind joined the suite, and a part missing for one kind refused
every kind in the request.

The engine now keys a batch by stage, evaluator and the canonical needs
of each dependency component. Entries that depend on each other stay in
one request with their prior outcome. Stages, send and attempt are
unchanged, and nothing changes on the wire. Outcomes stored from mixed
batches miss reuse once.

Two guards in guard_engine.rs state it from one kind's side, each seen
red on the base and under the old key. The review found nothing that
blocks; its small findings are fixed on the branch, and the refusal code
that reaches consumers as text only is recorded as an observation.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
LittleCoinCoin and others added 12 commits December 1, 2026 17:20
Write the knowledge-transfer report of the m6_gaps campaign: what each gap
was and what closed it, the guards and their bites, the review findings,
the version effect, the spend, the observations and the pull request text.
Accept notice 04 with Idea A narrowed, and mark O1 and O11 of the
observation rounds 05 and 06 closed.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
The close-out's spend table now carries the writer's and the lead's
measured figures and the totals. The needs batches leaf report gains the
review round it lacked: how F1, F3 and F6 were answered in the fix
commit, the spend as an observation, and the second test the per-entry
key turns red.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Every leaf and directory is done, and the campaign's success gates are
ticked where they are met. The two that need the integration pull
request, its container-e2e run and the 0.20.0 release after it merges,
stay open until the pull request is opened and merged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The batched-needs gate promised that kind B carries
`evaluation.run_part_missing` on a run with no trace. The engine
reports a failed request as text, and the gate was reworded at a joint
to the text instead of the code. That narrowed an approved gate.

Amendment A1 restores the gate and adds two nodes: the build leaf
`needs_refusal_code`, which carries the refusal/1 record of a refused
request into `EvaluateReport` and its document, and its cold review.
The gap report gives the evidence and the root cause. The tip gates are
reopened until A1 merges.

The roadmap tool failed its own write when it added the nodes (the
Nodes row landed after the table's blank line), so the Mermaid and
Nodes lines were written in its format by hand and validated.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
At the first joint of needs_refusal_code the record's message proved
equal to the reason text on every path, so the failure keeps no second
copy of it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
a_kinds_refusal_ignores_the_kinds_beside_it reads the report document and
expects B1's failure to carry the refusal/1 code evaluation.run_part_missing.
It is red on the base: the document holds {request, reason} only.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
A request the engine refuses was reported as its error text. It now
carries the refusal/1 record of its error, built by the one builder the
job's refusal.json uses, so a consumer reads the code, side and pointer
and no longer matches text. On a run with no trace, kind B's failure
carries evaluation.run_part_missing.

The builder `record_of` moves from jobs::runtime::refusal to
crate::refusal, beside `find`, with `fallback` for a failure that holds
no coded error (code candler.internal). The blocking closure of `send`
returns the Fault built from the typed assemble and materialise errors
instead of their text.

BREAKING CHANGE: EvaluateReport::failed_requests is Vec<FailedRequest>
and no longer Vec<(RequestId, String)>. FailedRequest is
#[non_exhaustive] with `request: RequestId` and
`refusal: RefusalRecord`. Migrate `.0` to `.request` and `.1` to
`.refusal.message()`; the code is `.refusal.code()`. In the report
document of `candler evaluate`, each failure is {request, refusal}: the
`reason` key is gone, its text is `refusal.message`.
jobs::runtime::refusal::record_of is now crate::refusal::record_of.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
The doc comments of to_document, record_of and fallback, and the
architecture paragraph on report.json, say that each failed request holds
the refusal/1 record built by the one builder the job's refusal.json uses.
No contract page lists the report keys, so none is regenerated.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
A request the engine refused reached the evaluate report as text only,
so a consumer could tell that kind B lacked its trace only by matching
`stores no trace`. Each failed request now holds its request id and its
refusal/1 record, built by the one builder that also writes a job's
refusal.json. That builder moved beside `crate::refusal::find`.
On a run with no trace, B carries `evaluation.run_part_missing` in
`EvaluateReport` and in the printed document.

`EvaluateReport::failed_requests` changes type, to a non-exhaustive
`FailedRequest`. The document drops `reason`, because the record's
`message` holds that text. The `fix(evaluation)!` commit gives the
migration, and the change rides on the 0.20.0 that `fix(jobs)!` causes.

Paths that hold no coded error carry the fallback `candler.internal`:
cancel, no slot, failed dependency, wrong id, and internal faults.
Giving them codes is left for later.

Amendment A1 of the M6 gaps campaign, reviewed cold before merge.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
needs_refusal_code and its review are done. The batched-needs gate
holds as approved: on a run with no trace, kind B carries
`evaluation.run_part_missing`. The tip gates are met again after the
merge (774 of 774, fmt, clippy, doc, contract pages, no `confirm_`),
and the Docker guard G6 passes alone.

The knowledge-transfer report gains the A1 section, its review
findings, the second `fix(evaluation)!` in the version effect, A1's
spend ($5.41) and four observations. The process lesson on gates now
says that a joint which would narrow an approved gate goes to the
maintainer. The pull-request text follows.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@LittleCoinCoin
LittleCoinCoin merged commit 89685f6 into main Dec 1, 2026
8 checks passed
@LittleCoinCoin
LittleCoinCoin deleted the fix/m6-gaps branch December 1, 2026 09:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant