#3550·Archon

bug(sdlc): archon-deliver's sync-pr-body can return its intent JSON-wrapped, and publish-pr-body then fails on resume too

Author: Kash597Created Sep 29, 2026Updated Sep 29, 2026

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 at sync-pr-body with 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:

  1. Write {"change": false} to a file, intent.json.
  2. Run deliver/scripts/publish-pr-body.ts with bun, INPUTS_PR set to a valid PR record, and INPUTS_INTENT='{"intent": "/path/to/intent.json"}'.
  3. It fails with ENOENT … open '{"intent": …}'. With INPUTS_INTENT=/path/to/intent.json it 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 ENOENT reported as a missing runtime).

  • Solution steering: Hint, any of these would do:

    • tighten the schema, for example a pattern that rejects a leading {, so the existing re-ask corrects it;
    • say in sync-pr-body.md that the field holds the bare path;
    • have publish-pr-body.ts unwrap a JSON-wrapped value.

    I'm running the last two as a local override for now.