Skip to content

fix(desktop): mechanisms print as their answers say, and a failed call leaves nothing behind - #358

Open
ManuelStaggl wants to merge 6 commits into
fix/print-check-auditfrom
fix/mechanism-audit
Open

ManuelStaggl wants to merge 6 commits into
fix/print-check-auditfrom
fix/mechanism-audit

Conversation

@ManuelStaggl

Copy link
Copy Markdown
Collaborator

Fixes the severity-A findings of the full audit (2026-11-12) in the mechanism tool (mechanisms.ts, mechanismTool.ts) and the hinged box template (templates.ts). Built on #353: every number below is measured with that print check (PLA, 0.4 mm nozzle, 45°) on SolidCraft 0.40.1 through the audit harness (tools/audit, cases mechanik-hinge and mechanik-others, 100 scenes), before and after.

Findings

Finding Before After
H-02 a failure after the build is reported as "Not built" while the geometry stays joint refused: 2 → 11 features, Base 4800 → 5333.7 mm³; same call again: 20 features 2 → 2 → 2 features, volumes unchanged; every step since the undo depth read before the build is undone with edit.undo in one batch
N-mechanik-17 SolidCraft's JSON reaches the model raw Not built: {\n "applied": [], … Not built: SolidCraft refused joint.as_built: <failed.error>. Everything was taken back.
N-mechanik-3 second hinge with the default name answer gives the first joint's limits, second joint limits: null, third call builds a third joint second joint Hinge (2) with its own limits [-67, 145]; the repeated call is refused before anything is built (2 joints, bodies unchanged)
N-mechanik-2 bead of a lid with walls reach past the box's wall 0.000 mm (also in the template) 0.250 mm in all eight scenes (walls 1.6 / 2 / 10, rooms 56×36 and 20×12, radius 0 / 2 / 8, flat lid, template); no shared volume
T5 level ceiling of the guide's groove 13.932 mm wide at the defaults, check warn 418 mm² (dovetail to plug: 389 mm²) roof at 45° with a 5 mm ridge where the moving body stands 8.8 mm over the rail's face: ready for both. Lower bodies and wider rails keep the flat ceiling (width 20: 838 mm², 60 × 20: 3058 mm², as before) and the answer says so, with how to lay the part
N-mechanik-6 "printed in one piece without support" for the guide in the description of every mechanism gone; description and answer say the two parts print apart
N-mechanik-4 "stand on webs …, so they print without support" check warn 90 mm² (barrel 6), 121 mm² (8), 619 mm² (40), up to 89.5°; on the template's shells 174 mm² ready in all four
N-mechanik-5 web drawn to the wall's plane where the wall has ended web foot 4.64 mm under a 3 mm lid plate, in the air no web for that body (its lowest point is the barrel again), and the answer names the body and what it needs
T3 template hingedBox without webs knuckles start 12.0 mm above the bed, check warn 189 mm² up to 87° ready; still no overhang finding after length 80, height 24; lid closes to the bead's snap at 175.6° as before

Along the way: the pin is flat underneath inside each moving knuckle (a level bridge from one fixed knuckle to the next), which also takes about 25 mm² off every hinge lying on the bed (default hinge 156 → 127 mm²). To keep that bridge at 10 mm or less, a lying hinge on 30 mm of line now gets 5 knuckles by default instead of 3; upright hinges keep the old rule.

Nothing got worse in the other scenes: 78 of 100 are unchanged in body count, shells, smallest gap, shared volume, limits and check; the 22 that differ are the ones above plus lying hinges with less overhang. One scene needs a word: a lid block whose wall ends 6.5 mm under the line (g1-lid-underside-lowest) had a web that just fitted and now gets none, since the full web needs 6.74 mm (check 25 → 50 mm²); the answer says so.

What the assistant is told now

  • Description, first sentence: "Build a mechanism between two bodies that exist, with the same gap everywhere; the answer says how it prints."
  • Description, hinge: "… printed in place as one piece." and "… carries knuckles that start above the bed on webs at 45° down to their own walls, where the wall reaches about one and a quarter barrel diameters below the line (the answer says where it does not, and what then needs support): add no supports of your own."
  • Description, slide: "The two print apart and the moving body is pushed onto the rail from an end. Where the moving body stands high enough over that face (8.8 mm at the defaults; the answer names it) the groove gets a roof at 45° and prints as it stands; otherwise its ceiling is flat and the answer says how to lay the part."
  • Hinge answer, all knuckles carried: "All 5 knuckles start above the bed and stand on webs at 45° that run from under the barrel down to their own wall, and the pin is flat underneath where it bridges from knuckle to knuckle, so the hinge prints as it stands, without support."
  • Hinge answer, a wall missing: "The knuckles start above the bed, and the 2 of Lid got no web: a web meets its wall 6.743 mm below the line at the most, and there is no wall there. They need support, or a wall that reaches down that far before the hinge is built. The 3 knuckles of Box stand on webs …"
  • Hinge answer, long bridge: "The pin bridges 13.9 mm inside each knuckle of Flap, more than prints clean (10 mm): use more knuckles."
  • Guide and dovetail answer, roofed: "The two print apart, each with up pointing up, and Stop is then pushed onto the rail from an end. Neither needs support: the rail's flanks and the roof over the groove lean 45°, and the roof's ridge is a bridge of 5 mm."
  • Guide and dovetail answer, flat: "… The groove's ceiling is flat and 13.9 mm wide, more than prints as a bridge (10 mm): a roof at 45° over it needs Carriage to stand 8.8 mm high over the face the rail is on, and it stands 6.4 mm. Print Carriage turned over instead, lying on its top with the groove open upwards (set that face as its print face), or make it higher and build this again."
  • Refusals: "… Everything was taken back." after a failure past the first step (or "What was begun could not be taken back: undo it before you call again." where SolidCraft's undo depth cannot be read); "the joint "Hinge" already joins Base and Flap as a hinge, and a second hinge between the same two bodies would bind it. Change that one instead: take it back with undo, or delete its features and its joint, then call again".
  • MECHANISM_GUIDANCE: "it builds the geometry with the right gaps" (was "the print-in-place geometry").

Contract test expectations changed (not run here)

apps/desktop/e2e/solidcraft.contract.spec.ts, each scene rebuilt in the harness to read the new answer:

  • hinged case: 3 knuckles → 5 knuckles; the web sentence → the new one; overhang … 25 mm² → no overhang finding.
  • hinged flap: 3 knuckles, barrel 6 mm → 5 knuckles, barrel 6 mm (limits -145° to 67° unchanged).
  • flap out of reach: Not built: 3 piece(s) … Everything was taken back; call again with the line moved. → Not built: 5 piece(s) … Everything was taken back.

Checked

  • pnpm run typecheck, eslint, vitest run in apps/desktop (720 passed).
  • Unit tests per finding in test/mechanism.test.ts and test/templates.test.ts, each with its counter-case.
  • Both mechanism cases of the audit harness, all 100 scenes, before and after, plus the scenes of the contract tests and the template after a change of its sizes.

Left open

  • The contract tests themselves were not run (no app, no window).
  • A hinge lying on the bed still shows the undersides of its barrels in the check (127 mm² at the defaults, T11), and webs at 45° are over the limit of a 40° material.
  • B and C findings of the same report that are not part of this change: N-mechanik-7 to -16, -18 to -20, W4 to W9, G1.
  • Template hingedBox with wall 3 mm: thin wall 0.26 mm between the knuckles' rooms and the lip's foot, as before this change (108 → 93 mm²).

🤖 Generated with Claude Code

ManuelStaggl and others added 6 commits November 12, 2026 14:23
…ck, not left under "not built"

A joint SolidCraft refused, or a guide whose travel could not be measured, left the
knuckles and cuts in the design while the answer said "Not built"; the next call
built them again (audit 2026-11-12, H-02: 2 -> 11 -> 20 features). Every step since
the undo depth read before the build is now undone in one batch, and the answer
names SolidCraft's failed command and its reason instead of its raw JSON.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…t twice between two bodies

SolidCraft takes a joint name twice; sweep and limits by that name then met the
first joint (audit 2026-11-12, N-mechanik-3: the answer gave the first hinge's
limits, the second had limits null, a third call built a third joint between the
same parts). Measured after: second joint "Hinge (2)" with limits [-67, 145], the
repeated call refused with the design unchanged.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…ille

The finger notch was cut after the bead and took away the part of it past the
wall's plane: the bead ended on the plane and caught nothing, in the tool and in
the hinged box template (audit 2026-11-12, N-mechanik-2). The notch is now cut
first. Measured: bead reach past the wall 0.000 -> 0.250 mm (walls 1.6, 2 and
10 mm, rooms 20x12 and 56x36, radius 0, 2 and 8, the template), flat lid 0.250 mm
as before, no interference.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…ys how the parts print

The groove's ceiling was level and 13.9 mm wide at the defaults (up to 102 mm), a
gap over the rail's head, while the tool called every mechanism "printed in one
piece without support" (audit 2026-11-12, T5 and N-mechanik-6). Where the moving
body stands high enough over the rail's face the ceiling is now a roof at 45° with
a ridge of 5 mm; where not, it stays flat and the answer says so, with how to lay
the part. The two parts print apart, which the description and the answer now say.

Measured with the print check of this branch, PLA 0.4: default guide warn 418 mm²
-> ready, dovetail to plug warn 389 mm² -> ready; gap, travel and body count as
before.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…all that is there

The answer said knuckles above the bed "stand on webs at 45°, so they print
without support", and the print check still found 90 mm² (barrel 6), 121 mm² (8)
and 619 mm² (40), up to 89.5° (audit 2026-11-12, N-mechanik-4): each web ended a
gap before the other body, so the far half of every barrel hung, and so did the
pin inside the moving knuckles. A web was also drawn to the wall's plane where the
wall had ended, 4.64 mm in the air under a lid plate (N-mechanik-5).

- The web starts where the barrel leans 45° on the far side; the other body is cut
  back by the same profile a gap further out.
- A second trial rod, inside each wall just under the web's foot, says whether the
  wall reaches down there: a body without it gets no web, and the answer names it.
- The pin is cut flat underneath inside each moving knuckle: a level bridge from
  one fixed knuckle to the next. The default knuckle count of a lying hinge keeps
  that bridge at 10 mm or less (30 mm of line: 5 knuckles, was 3).
- The answer says "without support" only where every knuckle stands on a web and
  the bridge is within 10 mm; otherwise what is left.

Measured, print check of this branch, PLA 0.4: hinge on 16 mm blocks warn 121 mm²
-> ready (barrel 6: 90 -> ready, 40: 619 -> ready), on the template's shells 174
-> ready; lid plate in the air: no web under it, said so. Gap 0.400 mm, no shared
volume, one shell per body, limits as before. The template keeps its joint on the
pin's round top and draws every profile at its own place.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…l's webs

The template built the hinge without the webs of the mechanism tool: its knuckles
began 12 mm above the bed in the air, under a file that says every template
prints without support (audit 2026-11-12, T3). It now names the walls of its two
halves and the bed, as the tool measures them, and the webs follow length and
height like the rest of the hinge.

Measured, print check of this branch, PLA 0.4: warn, overhang 189 mm² up to 87°
-> ready; after length 80, height 24: no overhang finding either. Gap 0.400 mm,
no shared volume, one shell per body, and the lid closes to the bead's snap at
175.6° as before.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
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