Skip to content

fix: code agent missing structured output instructions and self-validation #22

Description

@waynesun09

What happens

The code agent fails validation with output/code-result.json not found because it never writes the required structured output file. This was first observed on run 28621163275 — the first run after agents were registered from this repo (commit e0b4d16b on .fullsend).

Both validation iterations (1 of 2, 2 of 2) the agent completed its code task (exit 0) but never produced code-result.json. The agent made code changes and committed them but didn't write the structured output.

Root cause

The code agent's instructions are missing the structured output guidance that review and fix agents already have:

1. agents/code.md — no structured output section

The code agent definition has zero mentions of code-result.json, FULLSEND_OUTPUT_DIR, FULLSEND_OUTPUT_FILE, fullsend-check-output, or the output schema. It simply says: "Follow the code-implementation skill for the step-by-step procedure."

Compare to agents/fix.md which has a dedicated "Structured output" section with:

  • "You MUST produce a JSON file..."
  • "Without this file, the post-script cannot communicate your work back to the reviewer."
  • Schema field documentation
  • fullsend-check-output validation instructions

2. skills/code-implementation/SKILL.md — output buried and no self-validation

The instruction to write code-result.json is buried in step 3 ("Discover repo conventions") among ~60 lines of unrelated instructions about build commands, linter config, and branch conventions. Problems:

  • Not a dedicated step — lost in context
  • No "MANDATORY" or "MUST" language
  • No fullsend-check-output validation (unlike review and fix skills)
  • No reminder at step 10 (commit) to verify the output file exists
  • No mention that the harness validation_loop will reject the run without it

Agent comparison

Agent Agent def has output section Skill has dedicated output step fullsend-check-output in skill Status
Review Yes (detailed) Yes (step 7) Yes Working
Fix Yes ("MUST") Yes (step 9, MANDATORY) Yes Working
Code No No (buried in step 3) No Broken

Proposed fix

A. Add "Structured output" section to agents/code.md

Between "Failure handling" and "Detailed implementation procedure", add a section modeled on agents/fix.md:

## Structured output

You MUST produce a JSON file at `$FULLSEND_OUTPUT_DIR/$FULLSEND_OUTPUT_FILE`
(typically `code-result.json`) that documents the target branch for PR creation.
The post-script reads this file to create the PR against the correct branch.
Without this file, the harness validation loop will reject the run.

Write this file early — during step 3 of the skill, after determining the
target branch — so it is available even if the agent hits a timeout later.

Include the schema fields, an example, and fullsend-check-output instructions.

B. Add output verification step to skills/code-implementation/SKILL.md

  1. Add MANDATORY language around the existing output writing block in step 3
  2. Add fullsend-check-output call after the write
  3. Add a new step 11 ("Verify structured output") as a final check before exit, with a recovery path if the file is missing

Context

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions