Skip to content

Triage agent should verify implementation-level code snippets against actual source before finalizing plan #6229

Description

@fullsend-ai-retro

What happened

On issue #6188, the triage agent's initial plan (run 31716452078) produced 4 concrete errors in code-level implementation details:

  1. Reversed function signature: Plan used mergeBaseIntoChild(&child, &base) but the actual signature is mergeBaseIntoChild(base, child *Harness) — base first, per compose.go:524.
  2. Missing required struct fields in test fixtures: Test sketches used bare Harness{Effort: level} which would fail validation on required Agent/Role fields before effort validation was reached.
  3. Missing plumbing step: The plan omitted threading Effort through the RunParams struct in internal/runtime/runtime.go and its construction site in internal/cli/run.go.
  4. Missing guard pattern: Plan didn't specify the if child.Effort == "" { ... } guard in composition, needed to match the existing Model field pattern.

The human (waynesun09) spent time validating the triage against main, wrote 4 detailed corrections, and re-triggered /fs-triage. The re-triage incorporated all corrections faithfully and the subsequent code agent run produced a clean implementation.

What could go better

The triage agent generated plausible-looking but incorrect code snippets without reading the actual source files it referenced. All 4 errors were verifiable by reading the files the plan already identified:

  • Reading compose.go would reveal the mergeBaseIntoChild(base, child *Harness) signature and the if child.Model == "" guard pattern.
  • Reading harness.go would reveal Agent and Role are required for validation to pass.
  • Reading runtime.go would reveal the RunParams struct that needs the new field threaded through.

This is related to #2251 (validate root-cause hypotheses by tracing code) but covers a distinct failure mode: feature-triage implementation plans containing hallucinated API contracts, rather than bug-triage misdiagnosis. The underlying principle — verify claims against source — is the same, but the fix targets a different triage phase (prescription vs. diagnosis).

Confidence: High that the errors occurred and were avoidable by reading source. Moderate that a verification step would reliably catch this class of error in general.

Proposed change

Add a verification step to the triage agent's planning phase: when the plan includes code-level implementation details (function calls, struct literals, test patterns, inheritance behavior), the agent should read the referenced source files to verify:

  1. Function signatures match actual definitions (argument order, types, receiver).
  2. Struct literals include all fields required for validation to reach the new code path.
  3. All plumbing steps are accounted for — if field A is added to struct X and consumed in function Y, verify the path from X to Y.
  4. Guard/inheritance patterns match existing sibling fields (e.g., the Model field pattern).

This change likely belongs in the triage agent definition or skills. The agents repo could not be discovered from the workflow run logs for this PR (no Fetching agent ... from ... pattern found). If the triage agent definition lives outside fullsend-ai/fullsend, this proposal should be re-targeted to the appropriate agents repo. As an alternative or supplement, AGENTS.md in this repo could include triage-specific guidance requiring implementation plan details to be verified against source.

Validation criteria

On the next 5 feature-triage runs in this repo where the plan includes code-level implementation details (function calls, struct patterns), check whether: (1) function signatures match actual source, (2) test fixture patterns include all required fields, (3) no plumbing steps are omitted. Success: 0 of 5 plans contain verifiable factual errors about the codebase's API contracts. Current baseline from this PR: 1 of 1 plans had 4 such errors.


Generated by retro agent from #6218

Metadata

Metadata

Assignees

No one assigned

    Labels

    agent/triageTriage agentfeatureFeature-category issue awaiting human prioritizationpriority/mediumNormal priority, plan for next cycleready-for-triageRetro-filed issue awaiting triage agenttriagedTriaged but awaiting human prioritization

    Type

    No type

    Projects

    Status
    Todo

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions