partforge 0.55.0 → 0.55.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "partforge",
3
- "version": "0.55.0",
3
+ "version": "0.55.1",
4
4
  "description": "Turn a declarative part definition into a parametric-CAD web app (three.js + Manifold/Replicad). Requires a Vite-based consumer.",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -215,12 +215,25 @@ export async function handle(kernel, part, msg, post, opts = {}) {
215
215
  // The view is built HERE rather than inside measure, and handed down through
216
216
  // `opts.built`, because optional match scoring needs the same meshes: one build
217
217
  // feeds the measurement and the six silhouette rasterizations both.
218
- const built = buildView(kernel, part, msg.view, msg.params ?? {});
219
- const measured = measure(kernel, part, msg.view, msg.params ?? {}, { minWall: true, built });
218
+ //
219
+ // The default matters and must match measure()'s own: buildView has NO view
220
+ // default — viewSubParts(part, undefined) returns [] without erroring — so an
221
+ // inspect with no `view` (partforge-cloud's requestReport has always sent
222
+ // undefined, meaning "the current view") built an EMPTY view here, and every
223
+ // downstream consumer degraded silently: measure reported zero subparts and a
224
+ // [0,0,0] bbox, match scored nothing, and verify still passed. Pre-0.55,
225
+ // measure built internally and its own signature default hid this. Found by a
226
+ // live browser check, not by tests: this suite passes explicit views, and the
227
+ // cloud's unit tests fake the worker.
228
+ const view = msg.view ?? Object.keys(part.views)[0];
229
+ const built = buildView(kernel, part, view, msg.params ?? {});
230
+ const measured = measure(kernel, part, view, msg.params ?? {}, { minWall: true, built });
220
231
  const report = {
221
232
  measure: measured,
222
233
  verify: verify(kernel, part, {
223
- view: msg.view,
234
+ // The defaulted view, not msg.view: the seed below was measured on it, and
235
+ // verify's seed reuse is only sound when both name the same view.
236
+ view,
224
237
  seed: { params: msg.params ?? {}, result: measured },
225
238
  }),
226
239
  };