Skip to content

Accept what the design did: fix a wrong example from the simulation - #19

Merged
dtt-github merged 1 commit into
mainfrom
feature/accept-design
Nov 6, 2026
Merged

dtt-github merged 1 commit into
mainfrom
feature/accept-design

Conversation

@dtt-github

Copy link
Copy Markdown
Owner

What

A new Which is wrong? answer in the Design view's What actually happened: The example: use what the design did. When the design is right and the example's timing or value was a guess, one click rewrites the failing check from the simulation:

  • the expected value appears a few cycles later/earlier → the check moves (a wait is added, or the one before it is shortened);
  • wait_until → given enough cycles;
  • expect_for that stops holding → covers only the cycles it held;
  • otherwise → expects the value the design gave, written the same way (0x/0b/decimal).

The changed example is simulated again (repeating for further failing checks); the changes are listed first and Change the example applies them only if the example then passes. No AI, no cost.

Files

  • apps/web/src/lib/fixexample.ts (new): oneFix / findFix.
  • apps/web/src/lib/replay.ts: Replay.read(port, cycle).
  • apps/web/src/components/Design.tsx: button, preview, apply.
  • Docs: docs/user-guide/design-view.md; CHANGELOG.

Checked

  • Browser, local: a check one cycle early → "Step 3 (expect led = 1): checked 1 cycle later", applied, saved, 2 of 2 passing; a wrong value → "Step 7 (expect for led = 1): expects led = 0 instead of 1", applied, 2 of 2 passing.
  • cargo fmt --check, clippy -D warnings, cargo test --workspace, web typecheck and build.

🤖 Generated with Claude Code

When an example fails and the design is right, "The example: use what the
design did" rewrites the failing check from the simulated values: moves it
a few cycles (adding a wait or shortening the one before), lengthens a
wait-until, shortens a hold, or expects the value the design gave, in the
same number base. It re-simulates until the example passes and lists the
changes before applying them. No AI and no cost.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@dtt-github
dtt-github merged commit 0d685c6 into main Nov 6, 2026
2 checks passed
@dtt-github
dtt-github deleted the feature/accept-design branch November 6, 2026 14:53
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