Skip to content

fix(core): stop stdlib helpers warning about their own internals - #7

Merged
asbis merged 4 commits into
masterfrom
claude/eager-williamson-2356c8
Sep 23, 2026
Merged

asbis merged 4 commits into
masterfrom
claude/eager-williamson-2356c8

Conversation

@asbis

@asbis asbis commented Sep 23, 2026 •

Copy link
Copy Markdown
Owner

Problem

Two stdlib helpers raised warnings about their own internal operations, which read to agents and users as mistakes they had made:

  1. holes.counterbore("M4", { plateThickness: 4 }) used through patterns.cutAt printed fuse #N: fuse produced no new material… once per placement (website/examples/pi-mount/plate.shape.ts, examples/stdlib/pcb-standoff-plate.shape.ts).
  2. placeOn(drawing, "YZ", { into: "+X", distance: 5 }) raised the extrude-plane hint whose preferred fix is placeOn itself (website/examples/bracket/bracket.shape.ts).

Cause

The extrude hint told user code from stdlib code by looking for /stdlib/ in the call stack. That holds when core runs from source, which is why tests never caught it, but not once core is bundled into the worker, the MCP server or the website: every frame points at one file.

The counterbore case is separate. In a plate no thicker than the pocket is deep (M4: 4.2 mm), the shaft lies wholly inside the pocket, so the fuse really does add nothing.

Fix

  • New asStdlibInternal() / inStdlibInternal() scope in stdlib/warnings.ts. It is explicit, so bundling doesn't break it.
    • The no-op fuse guard skips fuses made inside the scope and doesn't give them a number, so the user's fuse #N still matches their own .fuse() calls.
    • The extrude-plane hint and the pen-axis advisory treat the scope as stdlib origin.
  • Scoped: the extrudes in placeOn and extrudeCentered, and the cutter-building fuses in holes.counterbore, holes.teardrop, bearings.seat and the motor mount plates. The mount plates' boss fuse never adds material. placeOn's sketchOnPlane stays outside the scope, because the drawing is the user's and the pen-axis advisory still applies to it.
  • counterbore no longer fuses a shaft that lies inside its pocket. When the pocket is as deep as the plate, it says once that the head pocket cuts straight through and leaves no seat for the screw head. The returned geometry is unchanged.

Visible change: the pi-mount example (M4 counterbores in a 4 mm plate) goes from four fuse #N warnings to one warning about the missing seat. That warning is accurate, so the example's thickness may be worth raising above 4.2 mm.

Tests

The new regression tests fail on the old code and pass with this change. The OCCT tests run against real OCCT.

  • placement.test.ts: placeOn and extrudeCentered with the stack stubbed to look bundled, plus a control that a user's own sketchOnPlane("YZ").extrude(5) still warns.
  • holes.test.ts: a thin plate gives one "no seat" warning and no fuse warning. A 6 mm plate gives no warnings and the right volume removed. A user's own no-op fuse is still fuse #1.
  • executor.test.ts: the fuse guard ignores fuses inside the scope and doesn't number them.

pnpm lint is clean and pnpm test passes (60 files, 1173 tests).

Extension and mcp-server are bumped to 1.29.5 (master has already taken 1.29.1–1.29.4), with a CHANGELOG entry and the plugin manifest.

🤖 Generated with Claude Code

holes.counterbore via patterns.cutAt printed "fuse #N: fuse produced no
new material" once per placement, and placeOn raised the extrude-plane
hint whose preferred fix is placeOn itself.

The extrude hint told user code from stdlib code by looking for /stdlib/
in the call stack. That holds when core runs from source, so tests never
saw it, but not once core is bundled into the worker, the MCP server or
the website. Replace it with an explicit asStdlibInternal() scope: the
fuse guard skips (and doesn't number) fuses made inside it, and the
extrude hint and pen-axis advisory treat it as stdlib origin.

Scoped: placeOn's and extrudeCentered's extrudes, and the cutter-building
fuses in counterbore, teardrop, bearings.seat and the motor mount plates
(whose boss fuse never adds material).

counterbore no longer fuses a shaft that lies wholly inside its pocket.
When the pocket is as deep as the plate, it says once that there is no
seat for the screw head, which is the actual problem.

Bump extension and mcp-server to 1.29.1.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@vercel

vercel Bot commented Sep 23, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
shapeitup-landing Ready Ready Preview Sep 23, 2026 11:22am UTC

master shipped 1.29.1 (string params) and 1.29.2 (docs), so this fix
moves to 1.29.3: extension, mcp-server, plugin manifest, and a CHANGELOG
entry.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
master shipped the skill-path fix as 1.29.3, so this fix moves to 1.29.4
(extension, mcp-server, plugin manifest, CHANGELOG).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
master shipped the coplanar-face fix as 1.29.4, so this fix moves to
1.29.5 (extension, mcp-server, plugin manifest, CHANGELOG).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@asbis
asbis merged commit bc94aba into master Sep 23, 2026
4 checks passed

This branch was successfully deployed

1 active deployment
Preview — c3090b16 Deployed Sep 23, 2026 by vercel[bot]
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