Add submit_result typed reporting channel for Tier 3 leaves - #602
Merged
TheGreatAxios merged 2 commits intoAug 24, 2026
Merged
Conversation
Mounts on leaf-tier workers only (existing authority.ts/tier gate). DirectorPackage.reportContract.outputSchema is an optional JSON Schema; an invalid submit_result payload returns a correction (non-terminal, capped at 3 rounds) instead of failing the run. Requires a per-turn token generated at dispatch and echoed back, rejecting stale/superseded turns. Purely additive — the markdown report envelope path is untouched.
Replaces the draft-07 partial validator with ajv (already resolved transitively via @modelcontextprotocol/sdk) and surfaces its error output directly in the correction message sent back to the worker.
TheGreatAxios
force-pushed
the
cl-6946-submit_result-with-a-required-output-json-schema-replacing
branch
from
August 24, 2026 05:43
87ccc00 to
4244d37
Compare
TheGreatAxios
enabled auto-merge (squash)
August 24, 2026 05:43
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.
Summary
submit_resultmounts only on Tier 3 leaves (params.tier === "leaf", gated via the existing authority.ts/tier machinery — no parallel mechanism).DirectorPackage.reportContract.outputSchema(new optional field,src/agent/directors/types.ts) lets a director declare a JSON Schema for the payload, validated withajv.SUBMIT_RESULT_MAX_CORRECTIONS,src/subagent/submit-result.ts), using ajv's own error output for the correction message.submit_result; a stale/mismatched token is rejected.stop-policy.ts's listed functions or anything undervendor/.Note for part 2
The ticket assumed a pre-existing
ReportContracttype. No such type existed — the realexisting seam was
buildSubAgentReportContract()insrc/agent/prompts.tsplus thedirector-package concept. This PR adds
ReportContractfresh onDirectorPackagewithout renaming or removing anything. Part 2 should look there, not for a predating type.
Test plan
bun run check(lint, typecheck, build, full test suite) — green.src/subagent/submit-result.test.ts— valid submission succeeds; invalid submission returns a correction then resubmit succeeds; stale turn token rejected; correction cap enforced.