Repository navigation
fix(desktop): the assistant sees the print check of its changes, blocks measure before they cut - #357
Open
ManuelStaggl wants to merge 12 commits into
Open
ManuelStaggl wants to merge 12 commits into
ManuelStaggl wants to merge 12 commits into
Conversation
Audit findings W1, N-bloecke-2 (A) and the "other bodies" part of W2/T4 and N-bloecke-1 (A). Measured before on real SolidCraft: `screwHole body: "A"` with a point on B cut B (−181.6 mm³) and answered "Built screwHole on A"; a body named "Ghost" went through the same way; on an edge two bodies share, both were cut; a slot without depth cut every body behind it. - Every step of a block names its body (`targets` / `body`). - The tool refuses a body that does not exist and lists the bodies there are. - After building it compares the volumes of all bodies: a block that changed another body, or nothing on its own, is undone step by step and refused with the reason. A block that fails half way leaves nothing behind. - `docs/engineering-notes.md`: why the way back is `edit.undo` (a `rollback` batch and `edit.restore_checkpoint` both fail on SolidCraft 0.40.1). Measured after, SolidCraft 0.40.1, the audit's cases `bloecke-w1` / `bloecke-w2` (39 cases pass): all 14 wrong calls are refused with 0 mm³ changed on either body; on the shared edge only A is cut (−90.792 mm³); the bodies behind a through slot stay whole. Still open (own PR): a through hole or slot in a hollow body still goes through both of its own walls. Checked: typecheck, eslint, 713 unit tests. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: ManuelStaggl <17688572+ManuelStaggl@users.noreply.github.com> Co-authored-by: Claude Fable 5.2 <noreply@anthropic.com>
…ll that made it Audit R1: reading the check after the last change was only asked of the assistant, so a turn could end on a blocked part it never saw checked. The work log now hands every answer of a call that moved the design's revision to the check: it waits up to 5 s for the mirror and the check of that revision and puts the findings behind the answer, or says that the check is still running. All three routes share this tool chain. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
… did not Audit R3: "ready to print, nothing found" and "the print check still judges what you build" promised more than the check covers. The note now lists what was checked and what was not (strength and layer direction, chosen fits and hole allowances, fine details, bed-edge chamfers), and the standard topics say that the check does not test their rules. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…ds and odd insert seats (#355) Audit findings W3, S-02/T8 and N-bloecke-4 (A), measured on real SolidCraft before: - `text` without `text` built the form's placeholder word "PartBuddy" and answered "Built text …". - `tappedHole` built modelled threads from M2 (core 1.6 mm) without a warning, while `kind: screw` refuses a printed thread under M5 ("strips"). - `insertSeat diameter: 500, depth: 500` drilled the whole carrier away (143 623 mm³) and answered "Built"; `0.01` built a hole of no volume. Now, in the assistant's block tool: - text needs its words; - a tapped hole under M5 is refused with a pointer to `insertSeat` (one rule, `TAPPED_FROM`, for block and screw joint); - an insert seat stays within a tenth of the maker's hole and between one and three insert lengths deep; a boss keeps the maker's wall. Checked: typecheck, eslint, the block tests (one new test holds the measured cases). Not in this PR: the form of the user (BlockPanel) still offers tapped holes under M5 (finding T8, B). 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: ManuelStaggl <17688572+ManuelStaggl@users.noreply.github.com> Co-authored-by: Claude Fable 5.2 <noreply@anthropic.com>
…the plan's frontier model (#354) PartBuddy passed no `--model`, so a new chat ran Claude Code's own default – the frontier model of the user's plan – and the menu showed that entry as "Default (recommended)", as if PartBuddy recommended it. - Without a kept choice a chat starts with `opus` at `medium` effort (`CLAUDE_STANDARD`); a plan without it falls back to its first model. - Claude Code's "Default (recommended)" entry is left out of the model list. A kept choice of it falls back to the standard. - Provisional: the models are compared on PartBuddy's own tasks in phase 7 of the audit of 2026-11-12. Checked: typecheck, eslint, 715 unit tests. The E2E expectations for the chip text are adapted but were not run here. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: ManuelStaggl <17688572+ManuelStaggl@users.noreply.github.com> Co-authored-by: Claude Fable 5.2 <noreply@anthropic.com>
…s cuts need Audit R54: the blocks named what the surrounding plastic must be only in their answer and built without measuring. A keyhole and a magnet pocket are now measured on trial before anything is cut (the pocket with what must stay round and under it, laid in as a probe body), the seat of an insert is checked by the volume it takes, and a block that leaves the body in pieces is taken back, each with the measured value. What is still not measured (wood screw, the wall round an insert) says so in the answer. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…sees what a change saved Reported 2026-11-12: the user had to ask for print time and material to be optimised every time. A fifth design rule group (on by default, switched off in the settings or with partbuddy_design_rules) tells the assistant what the shape decides of both, with the wall and layer sizes of the printer in use, and what stays the slicer's. The print check now carries per body the solid volume, the height and layers as it prints, the area on the bed and the area that leans past the overhang limit, so the numbers come with every check. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…ules # Conflicts: # apps/desktop/src/main/agents/blockTool.ts # apps/desktop/test/blockTool.test.ts
…when the design changed Review of PR 357. With two bodies or a joint the mesh check now goes ahead of the clearance and joint measures and is told as preliminary, so no step waits for SolidCraft's measuring (waits set from timings at the engine). A call counts as a change by the undo history, not by the revision that trials and saves move too. The same verdict is told in full once per turn and then in one line. The drawing tools are changing tools. A body that cannot be measured no longer holds the report back, and the measures say what solid volume overstates and carry a shell estimate. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Review of PR 357: half to three quarters of the wall is the rule of injection moulding against sink marks; on a 0.9 mm wall it gave a rib of one line, under the thinnest wall the print check accepts. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
… curved faces pass Review of PR 357. The plastic a block needs is measured from under the face on, so a curved or sloping face is not read as a gap. The seat of an insert and a countersunk hole are given no direction: it is read from what the cut took out of the body, and the wall round and the plastic under them are measured after the cut, which is taken back when they are missing (a plate just as thick as the seat is deep, a pilot hole through the part). The threshold stands on shares measured at SolidCraft 0.40.1. 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.
A-findings of the full audit (2026-11-12) on the rules for the assistant round the print check, on top of #353, plus the report of 2026-11-12 that the assistant does not optimise print time and material on its own, and the points of the independent review of this PR.
origin/mainis merged in (undo pattern of #348, block refusals of #355).R1 – the check reaches the assistant in the turn that changed the design
Before: "Read them after your last change, before you call the part done" was a request. The check reached the model with the next user message; a turn could end on status
blockit never saw.After: the work log (
workLog.ts) reads SolidCraft's history before and after every changing call. When the design changed, it hands the tool's answer towithCheckOfChange(printCheckNote.ts), which waits until the mirror has delivered that revision and the renderer has reported its check, and puts the note behind the answer. It waits outside the work log's queue.Why this and not a step at the end of the turn: Claude Code (gate proxy), ChatGPT and local models (
loop.ts) all call tools through the one chaintrack(upstream)inindex.ts. One hook there covers all three; a turn-end step would have needed three implementations and a guard against loops. A tool answer cannot loop: no change, no note.Details, after the review:
measuring: true) and the full check when SolidCraft has measured clearance and joints. The answer waits up to 1.5 s for the full check, then takes the mesh check marked as preliminary; after 3 s without any check it says so. Timings at SolidCraft 0.40.1 without a window (median of 5): mirror and mesh check 211 ms for a box with its lid, 141 ms for a hinge; the hinge's two joint sweeps 498 ms;inspect.clearance1 ms for both; the renderer adds 250 ms of quiet time. Not measured: the renderer's own check time in the app.designChanged). The revision alone does not: trials, saves and a block that was taken back move it. Measured: a probe batch that is rolled back leaves revision, undo and redo as they were;body.print_facemoves revision and undo depth, so it gets its check.CheckToldgives the full note the first time in a turn and whenever status, findings or the preliminary mark change; else one line plus the measures that changed. A new user message starts over.partbuddy_place_drawingandpartbuddy_move_drawing(check, queue, lock while a question is open, a line in the work log). The other PartBuddy tools (view,standard,ask,plan,assembly,design_rules) change no geometry.Texts to the assistant:
PartBuddy checks the part for printing after every change and shows the result to the user as a light; the findings come behind the answer of each tool call that changed the design, and partbuddy_view gives the latest ones.[PartBuddy: the ready-to-print check of the latest change is still running; call partbuddy_view for it before you call the part done.]partbuddy_viewitself:[PartBuddy: the ready-to-print check of the latest change is still running; it will be here in a moment.]Preliminary: clearance and joints still being measured (bodies that overlap or come closer than a push fit, joints that stop before a limit); call partbuddy_view for the full check before you call the part done.A clean preliminary check readsnothing found so far (build volume, wall and floor thickness, overhang angle, area on the bed, open bodies, failed features, bodies that touch).[PartBuddy: ready-to-print check after this change: unchanged, still not ready to print, the same 1 finding as before.]/… unchanged, nothing found.], followed byMeasures that changed:and those lines when there are any.R3 – a clean check says what it looked at
Before:
ready to print, nothing found./The print check in partbuddy_view still judges what you build.After (from the finding kinds of
printCheck.ts,withClearance,withMotion):… nothing found in what it checks (build volume, wall and floor thickness, overhang angle, area on the bed, open bodies, failed features, bodies that touch, bodies that overlap or come closer than a push fit, joints that stop before a limit).and at the endNot checked: strength and layer direction under load, the fits and hole allowances you chose, details and text too fine to print, bed-edge chamfers. Judge those yourself.Not checked: …sentence.None of this has been printed by PartBuddy yet, and the print check does not test these rules: measure what you built against them.R54 – blocks measure the plastic they need
One measure for all four: a probe cylinder is laid in as a body in a batch that is rolled back, and
inspect.interferencesays how much of it lies in the part. The cylinder starts under the face (behind a keyhole's lip, at half the depth of a pocket, seat or countersink), so a curved or sloping face is not read as a gap.solid.holenames no direction); taken back when short0.6 mmunder a seat and under a countersink are our own choice (three layers), marked so in the code.Refusals, as the engine gave them:
Not built: at [220, 30, 0] P3 has 3 mm of plastic where 6.7 mm are needed (the mean over a width of 9 mm; the far side, an edge or another cut takes the rest); a keyhole needs the part 6.7 mm thick behind its entry and its slot. Thicken the part there, move the keyhole away from edges and other cuts, or use woodScrew.(an entry over the edge names the entry:at [30, -3, 0] … 2.51 mm)… has 3 mm of plastic where 3.3 mm are needed (the mean over a width of 8.7 mm; …); a pocket needs 1.2 mm of plastic round it and 0.6 mm under it. Thicken the part there, move the pocket away from edges and other cuts, or take a thinner magnet.… has 6.54 mm of plastic where 7.3 mm are needed (the mean over a width of 8 mm; …); the seat of an M3 insert needs 2 mm of plastic round it and 0.6 mm under it. Thicken the part there, move the seat away from edges and other cuts, or use a boss.With nothing under the probe's start:has less than 3.35 mm of plastic.…; a countersunk hole for a 4 mm wood screw needs 4 mm of plastic round the countersink and a plate at least 2.65 mm thick. Thicken the plate, or move the hole away from edges and other cuts.Not built: it would leave 2 bodies where Strip was one (Strip (1)): the cut goes right through the part there. Give a point with more plastic round it, or a smaller sizeSuccess answers end with
PartBuddy measured that plastic before building: it is there.(keyhole, magnet),PartBuddy measured that plastic: it is there.(insertSeat, woodScrew), orPartBuddy could not measure that plastic this time: check it yourself.insertSeat addsEach seat needs 2 mm of plastic round it and 0.6 mm under it.At the engine (SolidCraft 0.40.1, audit harness):
bloeckecases (40) pass.Not measured: the same conditions in
mechanismTool.ts(others work there), and whether two pockets of one call leave enough plastic between each other (each is measured against the body before the cuts).Material and print time (reported 2026-11-12)
Rule group
economy(fifth group, on by default; settings switch "Design lean" / "Sparsam konstruieren",partbuddy_design_rules { economy }). Text for a 0.4 mm nozzle and 0.2 mm layers:The report line becomes
After each design step, name what you added on your own, what you did for material and print time and the sizes you snapped in one short line, e.g. "…, shell 1.35 mm with two ribs instead of a solid block".Measures with every check (tool answers, next message,
partbuddy_view), computed in the renderer from the mirrored mesh withmeshMetricsandoverhangOf:The shell estimate: surface × two lines, never more than the solid, plus 15 % of the rest. A block 40 × 40 × 20 mm reads 32 cm³ solid and about 9.7 cm³ as a shell; a wall of four lines reads the same in both. Six bodies are listed, the rest counted; volumes under 1 cm³ are given in mm³. No mass: the material profiles carry no density. A body that cannot be measured is left out and named in the log; a report the main process refuses is sent again without measures.
packages/geometryis unchanged;laid(print face down) andsmallOverhangReachare not exported there, sobodyMeasures.tsrepeats the pose and the reach (markedshortcut:).Yardstick
Test expectations changed
test/printCheckNote.test.ts:ready to print, nothing found→ the new clean text andNot checked: ….test/standardTool.test.ts: closing sentence of a standard topic.test/blockTool.test.ts: the keyhole sends a trial batch (solid.cylinder inspect.interference … sketch.inspect) before its cuts;MAGNEThasaroundandunder; the R54 cases run on a plate that answers probes and holes as the engine does.test/designRules.test.ts: rule list and defaults carryeconomy; the report line names material and print time; ribs.e2e/app.spec.ts: the list of rule switches carrieseconomy.e2e/solidcraft.contract.spec.ts(wall plate): the answers must carryPartBuddy measured that plastic before building: it is there.after the keyholes and the magnets andPartBuddy measured that plastic: it is there.after the wood screws.test/checkOfChange.test.ts(both routes, no change, bounded wait, two stages, moved revision without change, a failing call that changed the design, undo, two calls at once, unreadable history, drawing tools, told once),test/bodyMeasures.test.ts.Checked
pnpm run typecheck,eslint .andvitest runinapps/desktop. Audit harness against SolidCraft 0.40.1:bloecke(40 cases), the block cases on flat, sloping and curved faces, the probe shares and the timings above. Not run locally: the app, Playwright E2E and contract tests (CI runs them), a real chat.🤖 Generated with Claude Code