Repository navigation
fix(synthesis): only record rejected alternatives the input shows - #567
Merged
Merged
Conversation
…hema (#561) About 1 in 5 claude-cli commit drafts came back as the pasted JSON Schema itself rather than an answer. decisionDraftFromText found no decision or context, and draftDecisionSafe silently wrote the heuristic draft instead. Concurrency was not the cause: sequential runs failed the same way. - jsonInstruction describes each key in plain words and asks for the filled-in object, so there is no schema left to echo. - Unusable output throws UnusableOutputError with a classified reason (echoed the schema / no JSON object / missing fields), never the raw text. - The safe wrappers take one more sample on that error only; timeouts and CLI failures are not retried. - syncCommit returns fallbackReason; backfill flags each fallen-back commit and counts them apart from the commits the significance gate sent to the heuristic, and sync prints the reason. Live check on 90 claude-cli drafts at 4 workers: 17 fallbacks before, 0 after. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The decision schema gave alternatives_rejected no guidance, so drafts filled it with plausible but invented options; those also scaffold tripwires. Describe the field: list only alternatives named in the commit/PR text or visible as removed/replaced code, say where each came from, use [] when none, and never list the old behaviour being fixed. Measured on 30 merged OSS PRs (blinded judge with the diff): commit-only drafts went from 58 to 34 errors, conveyed design points 53 -> 55; alternatives listed 50 -> 12. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…print it Review follow-up for #561. The post-commit hook runs sync quietly, so the printed reason never reached the path where the fallback was seen. The decision's synth: evidence now carries fallback=<kind> (echoed-schema, no-json, empty, missing-fields or provider-error), which hunch review shows. The --deep ensemble keeps the first worker's cause in its error message. It stays a plain Error so the safe wrapper does not re-run every sample. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Commit and PR text can narrate superseded proposals and review requests the diff already satisfied; most contradicted claims in PR-context drafts came from reading those as the final state. Add evidence rules to the commit prompt: follow the diff where text disagrees, a later message overrides an earlier proposal, no review state, a bug fixed in review is not a rejected alternative, keep attribution direction. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- alternatives_rejected: count only code the diff replaces with a different approach to the same goal, not the defect being fixed; drop the per-entry provenance note, which broke exact-string dedup and fed tripwire symbols. - The DIFF and STRUCTURED CHANGES are the merged state; a partial DIFF does not contradict text about code it does not show (large-diff path). - Drop the oldest-to-newest claim: a squashed commit list may run either way. - CHANGELOG claims only what commit drafts receive today. - Test that the rules and the alternatives contract reach the prompt, including on the large-diff path. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Contributor
🧠 Hunch — Engineering Memory Guard⛔ Invariants directly in scope
ℹ️ Nothing here is a direct, high-confidence, non-stale blocking invariant — not blocking this PR. 🧠 Hunch · engineering memory · run 📜 Hunch Constitution — 2 policy receipt(s)
|
…k-retry # Conflicts: # src/synthesis/synthesize.ts
…to fix/synth-grounded-alternatives # Conflicts: # CHANGELOG.md # test/provider.test.ts
This branch was successfully deployed
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Problem
In an audit of synthesized decisions on 30 merged open-source PRs, about two thirds of the confirmed errors sat in
alternatives_rejected: with no guidance on that field, the model filled it with plausible options nobody considered. Those invented alternatives also seed draft tripwires (draftTripwires). Drafts whose commit body narrates earlier iterations (a squashed commit list or a PR description) had a second failure: they read a superseded proposal, or a review request the diff already satisfied, as the final state.Change
alternatives_rejectednow has a description: list only alternatives the input shows were considered and not taken (named in the commit/PR text, or code the diff replaces with a different approach to the same goal, not the defect being fixed); use[]otherwise.commitPromptends with short evidence rules: the DIFF and STRUCTURED CHANGES are the merged state, a later dated message overrides an earlier proposal, a partial DIFF does not contradict text about code it does not show, a bug fixed during review is not a rejected alternative, and reasons are attributed only to someone the text shows giving them.Prompt text only. No new provider or API path (con_2ce3f2a547); drafts stay advisory.
Evaluation
60 merged PRs: 30 open-source, 30 from private agent-authored repos. Gold design points extracted per PR; each draft judged by an adjudicating judge that must quote the input for every error it confirms. Only paired, same-run comparisons are reported, since re-judging identical drafts moves totals a lot.
On the private set the error mix shifted: fabricated 6 → 0, contradicted 2 → 5 (small counts; 95% CI of the error ratio [0.17, 1.40]).
Drafts that also saw the PR description and review thread (not what the product feeds today; #563 adds the description): errors 40 → 9 open-source, 9 → 3 private. An ablation in one judge run isolated the evidence rules on those drafts: schema description alone vs. description plus rules, open-source errors 14 → 5 (contradicted claims 9 → 4), design points 133 → 129. On the private set the counts were too small to separate (2 → 4).
Smoke re-check of the final wording on 6 open-source PRs (same judge run for both arms): commit-only errors 11 → 2, design points 11.0 → 12.5 of 39; with PR context, errors 5 → 3, design points 35.0 → 34.5. Six PRs only confirm the direction, not the size.
Compatibility with open PRs
Trial-merged with #563 and #564 locally: only append conflicts (CHANGELOG, test imports, one
synthBitsline between #563 and #564 themselves). Combined tree:tsc --noEmitexit 0; provider, synthesis, cliproviders, ensemble, provider-selection, pr-context, integration-externals, private-capture, provider-exec: 137 pass, 0 fail, 1 pre-existing skip. Under #564 the new field description is rendered as plain words, which the new prompt test still covers.Verification
npx tsc --noEmit: exit 0.commitPromptit fails.🤖 Generated with Claude Code