Repository navigation
fix(desktop): a check that runs beside a change no longer hides it from the view - #359
Open
ManuelStaggl wants to merge 1 commit into
Open
ManuelStaggl wants to merge 1 commit into
ManuelStaggl wants to merge 1 commit into
Conversation
…om the view A trial (print check, joint sweep, dimension probe) and the autosave end with a quiet revision check. When one ended between a change and the change's own check, it recorded the change's revision, the loud check saw no movement and the view kept the old design. The headless engine now keeps the two apart where the revision is recorded: a change PartBuddy made itself is always told (changed()), and a quiet check that records a moved revision while a tool call of the assistant is under way leaves it for that call's check. A trial alone still tells nobody. Co-Authored-By: Claude Fable 5.2 <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.
Symptom
The contract test "a slot built into a hinged flap stays in it when the flap turns (ADR 0027)" fails in about half of its runs: the log says "built the function block slot", SolidCraft has cut the slot (volume 4855.69 → 4683.37 mm³, faces 18 → 22), but the view stays at "2 bodies · 35 faces" until some later change. Print check and export preview stay on the old design with it.
Cause
HeadlessEngine.checkForChange(quiet)always recorded the revision it read and told the listeners only when it was not quiet and the revision had moved since the last check of either kind.applyBlock): it waits for running trials once, then reads sketch names, the component, and runsapplySteps.applyStepsand the change's own check; its quiet check records the revision the block made.The same holds for the autosave (
saveends with a quiet check) and for tool calls of the assistant, whose check incallTool'sfinallycan be overtaken by a quiet one in the same way.Fix: bookkeeping in the engine (way b), not one queue for everything (way a)
The engine keeps apart what the revision alone cannot tell, at the one place where it is recorded (
HeadlessEngine.check):changed(): after a change PartBuddy made itself (the nine places in the supervisor). The listeners are told even when a quiet check recorded the revision first.MirrorScheduleralready drops a revision it has delivered, so a change that left the revision alone costs nothing.unchanged(): after a trial or a save. Tells nobody. When it records a moved revision while a tool call of the assistant is under way, it leaves a note, and that call's own check tells the listeners.checkForChangeis gone from the public surface, so the supervisor cannot ask for the ambiguous "maybe" check any more; onlycallTooluses it.Why not the queue: it would put every tool call of the assistant, every trial and every autosave behind one another, a change in timing for the whole product that cannot be tried here without the app, with self-blocking to guard against (
applyBlockruns a trial for the bold font before it builds). And it holds only as long as every caller remembers to queue; the autosave does not go throughprobingtoday. The bookkeeping never makes anything wait and can only tell more often than before, never less.Known cost: a read of the assistant during which a trial ends is mirrored once more than needed, because the engine cannot know that the call only read. A trial alone, and a read after it, still mirror nothing.
Not changed: trials still run interleaved with tool calls of the assistant. Each trial is one batch that SolidCraft takes back itself, except the snap-fit test of a joint sweep, which reads where the joint stands and puts it back in a second batch; a
joint.driveof the assistant between the two would be taken back. That needs the queue and is left for its own change.The window mode is not affected: there SolidCraft reports each change itself with
design.changed, and PartBuddy keeps no revision of its own that a quiet check could move.A line in the log ("revision N was recorded before its change was told; telling it now") shows when the guard was needed.
Tests
apps/desktop/test/headless.test.ts, against a stand-in whose revision the test moves by hand (the first two fail without the fix):typecheck, eslint and
vitest run(721 passed) are green.🤖 Generated with Claude Code