Skip to content

fix(evaluate): fail a mate connector outside its part, as review_cad does - #1029

Merged
w1ne merged 1 commit into
developfrom
fix/evaluate-connector-in-solid
Oct 17, 2026
Merged

w1ne merged 1 commit into
developfrom
fix/evaluate-connector-in-solid

Conversation

@w1ne

@w1ne w1ne commented Oct 17, 2026

Copy link
Copy Markdown
Owner

Problem

evaluate_script, and therefore open_in_studio, accepted DRAW 01 v8 rev 9 with 47 assembly.mechanical.connector-not-in-solid errors. The connectors were 2.6–130 mm from their parts, and only review_cad reported them. A publish gate must not pass what review flags as an error.

Change

  • connectorsInSolidDiagnostics(arm) in mechanicalPlausibility.ts runs review's own checkMateConnectorsInSolid: same code, same 6 mm bounding-box tolerance, same error severity.
  • evaluate_script runs it on every captured assembly of a successful build and merges the errors into diagnostics. Any such error makes ok:false.
  • skipMechanismCheck: true opts out of this check together with the rest of the mechanism gate. Existing fixtures that use the opt-out keep passing.
  • The tool description and the public-contract fixture name the new rule.

Cost

One local bounding box per mated part, read from the already lowered (cached) BREPs, with no meshing. On DRAW 01 v8 (69 parts, 64 fastened mates) this takes 16 ms and yields 47 errors, the same count review_cad reports. The first message is: "Mate 'front-panel-3mm-fixed' connector 'front-panel-3mm.seat' is 38.0 mm away from modeled material on part 'front-panel-3mm'."

Tests

  • evaluateScript.connectorGate.test.ts: a fastened mate whose connector is 60 mm from both parts gives ok:false with 2 errors. Negative control: the same mate with the connector on the shared face gives ok:true and no such errors.
  • All 90 test files that use evaluate_script / callMcpTool pass (770 tests). The diagnostics, public-contract and quality-ratchet tests also pass. Typecheck and eslint are clean.

…does

evaluate_script (and so open_in_studio) accepted DRAW 01 v8 rev 9 with 47
assembly.mechanical.connector-not-in-solid errors that only review_cad
reported. A publish gate must not pass what review flags as an error.

evaluate_script now runs the same rule (connectorsInSolidDiagnostics:
review's checkMateConnectorsInSolid, same 6 mm tolerance, severity
error) on every captured assembly of a successful build and returns
ok:false. skipMechanismCheck opts out with the rest of the mechanism
gate. Cost: one bounding box per mated part from the cached BREPs,
16 ms on the 69-part DRAW 01 v8.
@w1ne
w1ne enabled auto-merge October 17, 2026 17:20
@w1ne
w1ne merged commit a943bb3 into develop Oct 17, 2026
16 checks passed
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