Skip to content

fix(boot-hook-puller): rod/blade tangency constraint in the Studio dialect - #188

Merged
aldoruizluna merged 1 commit into
mainfrom
fix/geo-stab-constraint-boot-hook-puller
Oct 18, 2026
Merged

aldoruizluna merged 1 commit into
mainfrom
fix/geo-stab-constraint-boot-hook-puller

Conversation

@aldoruizluna

Copy link
Copy Markdown
Contributor

Why

constraints[1] (error) joined its two comparisons with the word or. The Studio evaluates constraints[].expression with safeFormula, which has no word operators. It parses hook_d <= blade_t - 0.35, meets or as an unexpected trailing token, and throws. useConstraints swallows the error, so the rule never fired: a rod within 0.35 mm of the blade thickness (tangent faces, a broken union) was never flagged.

Found by the keystone's note-only constraint-dialect rule (hyperobjects-spec 0.17.0, main 73f092cf; landed in madfam-org/hyperobjects-spec#66), lane K's whole-commons run: 8 notes on 6 cartridges. x-carriage was fixed in #180. This PR is one of the five follow-ups, one cartridge per PR.

What changed

  • constraints[1].expression: hook_d <= blade_t - 0.35 or hook_d >= blade_t + 0.35 becomes hook_d <= blade_t - 0.35 || hook_d >= blade_t + 0.35. The semantics are identical.
  • Severity (error) and the es/en message are unchanged.

Only boot-hook-puller/project.json changes. No geometry, parameters, presets or docs change.

How verified

Before, at origin/main 11f16f7, keystone main 73f092cf (0.17.0), whole commons:

note boot-hook-puller: constraint-dialect: constraints[1].expression 'hook_d <= blade_t - 0.35 or hook_d >= blade_t + 0.35' (severity error) has an unexpected trailing token 'or'; the Studio's safeFormula parser throws, useConstraints swallows it, and the constraint never fires

After, on this branch:

$ y4d-spec check ./boot-hook-puller/ -v        # keystone main 73f092cf (0.17.0)
ok boot-hook-puller (./boot-hook-puller/)
y4d-spec check: cartridges=1 failures=0 notes=0 geometry=NOT verified (pass --render) renders=0 presets=0 skipped=0

$ y4d-spec check ./boot-hook-puller/ -v        # SPEC_PIN 70fe821 (0.15.0), the CI pin
ok boot-hook-puller (./boot-hook-puller/)
y4d-spec check: cartridges=1 failures=0 notes=0 geometry=NOT verified (pass --render) renders=0 presets=0 skipped=0

All five constraint PRs applied together on origin/main, whole commons (512 cartridges): keystone main gives failures=0 notes=36, down from 43, with 0 constraint-dialect notes left. SPEC_PIN 70fe821 gives failures=0 notes=36.

Semantics: safeFormula's precedence is ternary, then ||, then &&, then comparison, then additive, then multiplicative (yantra4d apps/studio/src/lib/safeFormula.ts). So the rewritten expression groups exactly as the authored one was meant to. &&/|| return Boolean(left) op Boolean(right). The default and every preset were evaluated against the new expression with a plain Python evaluator.
At the default and both presets: satisfied (3 of 3 points).

Not run: a render. This is a manifest-only change, and CI's render lane decides the scope for changed cartridges.

Risk / rollback

Low. The constraint was dead before and is live now, so the Studio can show this message where it did not before. Rollback: revert this one commit.

Needs the owner

Nothing.

🤖 Generated with Claude Code

…alect

constraints[1] joined its two comparisons with the word `or`, which the
Studio's safeFormula parser does not have: it stops at `or` as a trailing
token and throws, useConstraints swallows the error and the rule never fired.
`||` binds looser than the comparisons in safeFormula, so the rewrite has the
same meaning. Severity and both messages are unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Aldo Ruiz Luna <aldo.ruiz.luna@gmail.com>
@aldoruizluna
aldoruizluna merged commit 9db8c26 into main Oct 18, 2026
7 checks passed
@aldoruizluna
aldoruizluna deleted the fix/geo-stab-constraint-boot-hook-puller branch October 18, 2026 13:30
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