fix(gatorwalk-factory): dispatch fidelity: subagents get the rendered prompt and product contract, and results are recorded as returned (swamp-club #2776) #390
Loading…
Reference in a new issue
No description provided.
Delete branch "cue/2776-gatorwalk-factory-dispatch"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Fixes swamp-club #2776. It also covers #2777 and #2779, which were closed as duplicates.
In a dispatch stage, what a subagent received and what got recorded were both whatever the driver retyped. After this change, the dispatch hands over a complete contract, ready to send, and the driver records the subagent's own output file.
1. The rendered prompt is sent verbatim. For a dispatch stage, the engine writes each subagent's whole prompt (
buildSubagentPrompts). It starts with the rendered prompt, byte for byte. A fixed section follows: the skill to follow, aswamp data getread for each injected product, and a result file for each product with its schema inline.dispatchrecords exactly these prompts (subagentPromptson the dispatch), so replay shows what was sent. The driver adds nothing.2. The packet names the products.
DispatchPacket.productslists every declared artifact and evidence, each with the schema its payload is checked against: the declared schema, the findings contract, both (asallOf), or the outcome contract for result evidence. A test pins thatartifactContractandevidenceContractaccept and reject the same payloads as recording. Schema notes (description,$comment) are stripped, following the #2804 rule.3. Results are recorded as returned.
dispatchtakes an optionalresultDir, which must be absolute and must exist. Without it, dispatch makes a temp directory, and removes it again if the dispatch records nothing. The driver records each result with--input payload=@<result-path>and never edits the file. When several subagents review into one artifact, their findings are joined with a documentedjq -sline, and each subagent prefixes its finding ids withS<n>-.Decisions made in planning: a ready-to-send
subagentPromptrather than a recorded addendum; schemas inline; the packet names the result path, underresultDirwith a temp-directory fallback;jqfor merging findings for now. Scope and severity wording in the example prompts is left to #2781. Only "Record findings" became "Report findings".Tests:
dispatch_test: products for a declared artifact, a findings artifact and a workflow result evidence, and the subagent prompts.payload_schema_test: contract parity and note stripping.run_ops_test: the record round trip.work_item_test:resultDirhandling, including relative paths refused;skill_test(real engine): the worked example's reviewers write result files, which are recorded withpayload=@, and the test asserts each stored review equals its file.The work-item model version is now 2026.09.30.1. gatorwalk-factory has no manifest, so nothing publishes.
Verification: verify-build and verify-reviews both passed on
f9ae98e2(attestation e6d36b62). This was the third round; the first two rounds' review findings are fixed in the second and third commits.🤖 Generated with Claude Code