fix: normalize LLM-emitted scalar shapes on issue data#102
Closed
AbirAbbas wants to merge 1 commit into
Closed
Conversation
Live-build incident (deepseek-v4-pro): generate_fix_issues returned fix issues whose acceptance_criteria was a bare string. The raw dicts bypass validation (DAGState.all_issues is list[dict]), the executor's attribute assignment onto IssueResult.final_acceptance_criteria bypasses Pydantic, and the next DAGState re-validation (replanner context / checkpoint reload) failed with six list_type errors — killing a 48-minute build with zero deliverable after cleanup deleted the fix branches. Fix, both stacks: coerce str -> [str] at every LLM ingestion boundary (fix generator output, replan updates/additions) and make the re-validating models tolerant (IssueResult.final_acceptance_criteria, SplitIssueSpec and PlannedIssue list fields; Go StrList + asStringSlice string case) so old poisoned checkpoints still load. Internal trace: exec_20260720_110500_m36lxxcq. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
5 tasks
Collaborator
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes a build-killing crash found by live-benchmarking
swe-planner.buildonopenrouter/deepseek/deepseek-v4-pro:generate_fix_issuesreturned fix issues whoseacceptance_criteriawas a bare string, and 18 minutes later the replanner'sDAGStatere-validation failed with sixlist_typeerrors — a 48-minute build died with zero deliverable (cleanup then deleted the fix branches). Internal trace:exec_20260720_110500_m36lxxcq.The mechanics: raw issue dicts bypass validation (
DAGState.all_issuesislist[dict]), and the executor's attribute assignment ontoIssueResult.final_acceptance_criteriabypasses Pydantic (validate_assignmentis off), so the poison persisted into the checkpoint and only detonated on the next model re-validation. A second identical run happened to get lists from the model and passed — the failure is a coin flip on weak-model output shape.Fix (both stacks)
str → [str]coercion on issue list fields at every LLM ingestion point — fix-generator output, replannerupdated_issues/new_issues(normalize_issue_dict/dagutil.NormalizeIssueDict).mode="before"validators onIssueResult.final_acceptance_criteria,SplitIssueSpecandPlannedIssuelist fields; GoStrListtype +asStringSlicebare-string case — so pre-fix poisoned checkpoints still load and Go stops silently dropping bare-string values.Test plan
tests/test_llm_shape_normalization.py— the exact incident as a regression test (checkpoint reload with a poisonedcompleted_issue), boundary coercion, apply_replan normalization; Go mirrors ininternal/dagutil+internal/schemas.env): 1079 passed, 1 skipped + compileall cleango test -race -count=1 ./...withGOWORK=off🤖 Generated with Claude Code