Skip to content

Try a small fix: repair a failing design without AI - #23

Merged
dtt-github merged 1 commit into
mainfrom
feature/small-fix
Nov 6, 2026
Merged

dtt-github merged 1 commit into
mainfrom
feature/small-fix

Conversation

@dtt-github

Copy link
Copy Markdown
Owner

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:

  • a comparison the other way round (< for <=, == for !=)
  • a limit one off in either direction (cnt == N → cnt == N - 1)
  • a condition reversed, or a missing or extra !/~
  • && for ||, - for +
  • an assigned value one off (1'b0 for 1'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::Walker gains 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'd7 matches 7), 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.
  • Web: button, results card with diff and effects, and a commit through the existing commits API.

Checked

  • New test, 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.
  • Unit tests: off-by-one, +/-, sized constants, line-preserving edits, and refusing a design whose examples already pass.
  • In the browser: I planted cnt == N in a local blinker test project. "Try a small fix" offered cnt == N → cnt == N - 1 (13 tried), and "Use this change" committed it. Both examples pass, and the file is byte-identical to before.
  • Local checks: fmt, clippy -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

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>
@dtt-github
dtt-github merged commit 2520877 into main Nov 6, 2026
2 checks passed
@dtt-github
dtt-github deleted the feature/small-fix branch November 6, 2026 19:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant