Repository navigation
fix(server): t3_workflow_run typed spec, strict decoding and a forwarded judge contract - #22
Merged
Merged
Conversation
… its spec A stage with both agents and repeat ran its agents and silently dropped the repeat; unknown keys anywhere in a spec were stripped, so a run differed from what the model wrote. Both are now invalid_request with the stage named. Placeholders that mention a spec id but resolve to nothing are rejected, and until.path is checked against the judge's declared resultSchema. The judge no longer needs a parent-written resultSchema: the server gives it one with the field until reads, and adds the addAgents/rerun contract when the repeat has templates, so the judge sees the growth shape in its task. The tool description now types the spec as TypeScript. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…rtise as objects Codex parents sent every agent as a JSON string because the advertised schema gave agents no item type; agents (also inside repeat.stages) now advertise as objects. Inside a repeat, a stage may now read a same-loop stage that has not run yet this round: it gets last round's results, or null in round 1. A rewriter can fix its own previous version instead of failing with "has not run yet". The description says target can be omitted to inherit the parent's model and options, and that only a loop's judge adds agents, so round 1 belongs inside the loop. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… loop stages A repeat that names no judge now takes its last stage's only agent; Sol parents left judge out while naming that agent "judge". A loop's stage may start with no agents, as the slot its judge grows agents into. The description says target options must be ones that model lists, and that after a loop its inner stages are referenced, not the loop's id. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…a, until checks - A same-loop stage that has not run this round reads only the last round it ran in, never a sibling finishing first in the current round, including after a resume. A whole-stage read with nothing earlier is null, as an agent read is. - The generated judge schema writes until's field after the default feedback field, so until.path "feedback" or "feedback.ok" keeps its type. - until.path is rejected only when the judge's schema rules it out: a closed object (additionalProperties: false), or a path starting with one of the loop's own stage/agent ids that the schema does not declare. Open schemas stay valid. - A parent's own judge schema wins; the server only adds absent growth fields. - Description: cut 153 B and advertise equals as nullable. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ntil again The round-1 cut dropped the sentence linking the judge's result to until, and Luna then omitted until in both grow-critics trials. Restore it, worded for a parent schema or a generated one. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A closed judge schema (additionalProperties: false) still allows fields its patternProperties match, so until.path is now allowed when any pattern matches the segment, and descends into that pattern's schema. A pattern that fails to compile is treated as open and never rejects. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Size: L. Why L: description rewrite + the decoder fixes it needs; 391 of 626 added lines are tests. (6 commits.)
Problem
A plain-model eval (real T3 sessions of bare Claude Code and Codex, CLI subscriptions, no user instructions) showed that models rarely write a valid
t3_workflow_runspec on the first call: Haiku 0/10, Luna 4/10, Sol 1/10. A judge grew the run in only 1 of 12 growth trials. The server also accepted some wrong specs silently:agentsandrepeatran its agents and dropped the repeat.Fix
Server (each with a failing test first):
invalid_request, stage named):agents+repeatin one stage.StructWithRest, so the service's strict decode sees them.{{stage.draft}},{{draft.a.result}}).until.pathchecks: a path is rejected in only two cases. Either a segment falls on a closed object (additionalProperties: false) where neitherpropertiesnor anypatternPropertiespattern matches it, or the path starts with one of the loop's own stage/agent ids that the schema doesn't declare (thestage.agent.fieldguess). A matching pattern allows the segment and the check continues into that pattern's schema. A pattern that fails to compile counts as open and never causes a rejection. Open schemas stay valid. Both reviewer schemas complete, as they did on the base:{"properties":{"reason":…},"required":["ok"]}, and the closed{"properties":{"reason":…},"patternProperties":{"^ok$":{"type":"boolean"}},"additionalProperties":false,"required":["ok"]}, each withuntil.path:"ok".feedback: stringplus the fielduntilreads. That field is written last, sountil.path:"feedback"and"feedback.ok"keep their type; this is tested through the real result validator. With templates, the server addsaddAgents(template and stage enums) andrerun. If the parent gives a judge schema, the parent's schema wins. Its properties,required, and anyaddAgents/rerunit declares are kept as written; the server only adds growth fields the parent left out. A test pins this decision.judgedefaults to the last inner stage's only agent.agents: [], as a slot the judge grows into.null.repeat.stages) are typed as objects. Codex sent every agent as a JSON string when the array had no item type.advertisedJsonSchemadrops theallOf/additionalProperties: {}noise thatStructWithRestadds (unit test).Description: the spec is a compact TypeScript type.
equalsnow includesnull.Final description (1,261 B serialized)
Eval evidence (same bare harness,
eval-bare/run.cjs; 6 prompts × 3 models × 2 trials; trial prompts unchanged)723110641246e2bcdc35bbe4da2d06edda7a6354ddb61bd8e4154db3ec33Targets: Haiku ≥ 5, Luna ≥ 7, Sol ≥ 7, growth ≥ 6/12. Iteration 5 misses the Luna target (6/10); Haiku meets its target exactly.
Iteration 4's two Luna
until-omitted misses lined up with the cut dropping the sentence tying the judge's result tountil. Restoring it (iteration 5) left 0until-omitted misses.Iteration 5's first-call misses:
dry:0(must be 1–10).judgewith several agents in the last stage.fastMode/serviceTierintarget.options(see the finding below).{{revise.draft.writer}}.With 2 samples per case, iterations 3–5 put Luna at 7, 5, 6 and Haiku at 7, 7, 5.
Iteration 5 also:
¹ Iteration 2's matrix stopped on the harness's 8-minute trial watchdog during a long Haiku growth run. I resumed it, but my own source edits then restarted the resumed dev server mid-trial. Those resumed trials are excluded, so iteration 2 counts only the 31 trials recorded before the watchdog.
Harness notes
t3_workflow_run(0/30 every iteration)..t3. My runner moves that state aside between attempts, never deletes it.Finding outside this PR
T3 accepts a Haiku parent selection carrying
fastMode:false, then rejects those same inherited options when a child targets Haiku. This ischeckTarget, shared withdelegate_task, and it is 3 of Haiku's 5 first-call misses in iteration 5. The description says to omittarget; a server-side decision is a separate PR.Bytes
Tool list (
mcpToolListJsonBytes): 48,093. That is +987 overwf/integration(47,106) and +1,984 over upstreammain(46,109). Thet3_workflow_rundescription is 434 → 1,261 B: the round-1 cut saved 153 B and restoring theuntilsentence added 42 B back. Its input schema is 278 → 438 B. Agent instructions: +0 (Claude append 5,135, Codex additional context 6,865, both unchanged).agentContextBudget.jsonupdated.Gate
bash gate.sh fork/wf/integrationis green on0795c5b13e: lint 0 diagnostics on 8 files, fmt clean, typecheckapps/server+evals, 80 server tests in 4 changed files, 411 eval grader tests.AgentContextBudget.test.tsandadvertisedJsonSchema.test.tsalso pass. All 8 cases of the reviewer's round-2 probe (reviewer-probes-r2-extended.mjs) complete on this source, including the closed pattern schema. The round-2 fix is decoder-only and the description is unchanged, so iteration 5's eval numbers still apply.Implementer: Claude Opus 5.5 (T3 Code Nightly). Review rounds: 2 (Codex gpt-6.1-sol; round 1 FIX, round 2 one blocker on R3). Defects found in review and fixed here:
feedbackfield overwroteuntil's field.patternPropertiesallow the field.🤖 Generated with Claude Opus 5.5 in T3 Code Nightly