bug(sdlc): archon-deliver's sync-pr-body can return its intent JSON-wrapped, and publish-pr-body then fails on resume too
Problem
In archon-deliver, the sync-pr-body agent node can return its whole output object as the value of its intent field. publish-pr-body then treats that JSON text as a file path and fails.
The node's recorded structured output was:
{"intent": "{\"intent\": \"…/pr-body-intent.json\"}"}The node declares output_format: { type: object, properties: { intent: { type: string } }, required: [intent] }, so the doubled value passes validation. The command's closing instruction is Return only `{"intent": "$ARTIFACTS_DIR/pr-body-intent.json"}` , and the model (Claude Sonnet 5 at the medium tier) put that whole object into the intent field through the StructuredOutput tool. The intent file itself was written correctly.
publish-pr-body then ran readFileSync('{"intent": "…"}'), which failed with ENOENT. That surfaced as the misleading "bun executable not found" message in #3549.
Why
The run had already implemented, reviewed, corrected and validated the change, and CI was green. It failed at the step that publishes the PR body, so the flip to ready never happened. Resuming could not recover: sync-pr-body is skipped as prior_success and its stored output is reused, so every resume fails the same way. The only way out was to finish the PR by hand.
Desired outcome
A delivery run gets past publish-pr-body whether the model returns a bare path or wraps it, or the wrapping is rejected at sync-pr-body, where a re-ask can correct it, rather than in a later script that resume cannot repair.
Acceptance
- With
sync-pr-body's structured output set to{"intent": "{\"intent\": \"<path>\"}"}, the run either publishes the body or fails atsync-pr-bodywith a schema error that triggers the structured-output re-ask. - A bare
{"intent": "<path>"}still works unchanged.
Evidence
Reproduction
Model-dependent, so not deterministic. It happened once; earlier archon-deliver runs on 0.11.1 passed this step. To exercise the downstream half directly:
- Write
{"change": false}to a file,intent.json. - Run
deliver/scripts/publish-pr-body.tswith bun,INPUTS_PRset to a valid PR record, andINPUTS_INTENT='{"intent": "/path/to/intent.json"}'. - It fails with
ENOENT … open '{"intent": …}'. WithINPUTS_INTENT=/path/to/intent.jsonit succeeds.
Environment
- Archon version or commit: 0.11.1 (Homebrew binary), bundled sdlc pack
- Platform or adapter: CLI
- Database: SQLite
- OS: macOS 15 (Darwin 24.6), Apple silicon
Logs or screenshots
node_completed event data for sync-pr-body (from remote_agent_workflow_events, path shortened):
"structured_output": {"intent": "{\"intent\": \"…/pr-body-intent.json\"}"},
"declared_fields": ["intent"],
"stop_reason": "tool_use"Constraints and related work
Related issues or PRs: #3549 (script-node
ENOENTreported as a missing runtime).Solution steering: Hint, any of these would do:
- tighten the schema, for example a
patternthat rejects a leading{, so the existing re-ask corrects it; - say in
sync-pr-body.mdthat the field holds the bare path; - have
publish-pr-body.tsunwrap a JSON-wrapped value.
I'm running the last two as a local override for now.
- tighten the schema, for example a
Source: coleam00/Archon