Repository navigation
Try a small fix: repair a failing design without AI - #23
Merged
Merged
Conversation
A failing example offers "The design: try a small fix". The server tries the small repairs that undo the most common mistakes, one at a time (the mistake walker in a repair mode: limits one off in both directions, assigned values one off, a missing or extra !/~, conditions reversed as written), lines "Why not?" points at first, and keeps those after which every example passes. Each comes back as a one-line edit that keeps the line as written (sized numbers, redundant parentheses), with what it changes in the examples' outputs; "Use this change" commits it. Every planted mistake an example notices in the starters is repaired back to the exact original line (test). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
What
A failing example's Which is wrong? row gets a fourth button, The design: try a small fix. Without AI, the server tries the small changes that undo the most common mistakes, one at a time:
<for<=,==for!=)cnt == N→cnt == N - 1)!/~&&for||,-for+1'b0for1'b1)After each change every example is simulated, and only changes after which all of them pass are offered (up to three). The lines "Why not?" and "Why?" pointed at are tried first.
Each fix is shown as a one-line diff that keeps the rest of the line as written, with what it changes in the examples' outputs (from the existing behaviour compare). Use this change commits it. If nothing works, it says how many changes it tried, and a later "ask the AI to fix it" request includes that.
How
mistakes::Walkergains a repair mode (Walker::repairs). It adds one-off changes in both directions, changes to assigned constants and missing negations, writes reversals as one would (!rst_n), and never leaves lines out. Mistake mode is unchanged; its tests pass as before.fixes.rs: runs the search and turns each repair back into a text edit. A small tokenizer matches numbers by value (4'd7matches7), keeps a changed number's style (16'd7→16'd8), and skips redundant parentheses.POST /api/projects/{id}/spec/small-fix: editor only, 20 s budget, nothing saved.Checked
planted_mistakes_in_the_starters_are_repaired_exactly: across all 15 starters, every planted mistake that some example notices is written into the file. The fix search then has to restore the exact original file. All 82 sampled are restored.+/-, sized constants, line-preserving edits, and refusing a design whose examples already pass.cnt == Nin a local blinker test project. "Try a small fix" offeredcnt == N→cnt == N - 1(13 tried), and "Use this change" committed it. Both examples pass, and the file is byte-identical to before.-D warnings, workspace tests, web typecheck and build.Docs: user guide (design view), API reference, CHANGELOG.
Initiated by DigitalTwin Technology GmbH.
🤖 Generated with Claude Code