feat(lint): add needle_pivot_offset hub-referenced layout check#2744
Draft
xuanruli wants to merge 1 commit into
Draft
feat(lint): add needle_pivot_offset hub-referenced layout check#2744xuanruli wants to merge 1 commit into
xuanruli wants to merge 1 commit into
Conversation
Catches a gauge/clock/radar/dial pointer that rotates about the wrong pivot (center-of-rotation far from the dial hub). Deterministic: samples two material endpoints per frame via getScreenCTM, fits a circle to recover the true center-of-rotation, and compares to the dial hub (modal static-circle center, or arc-path center fallback). Suppresses multi-body orbit/atom systems (>=2 angular clusters on one hub) and never fires without a resolvable hub. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Fallow audit reportFound 14 findings. Duplication (12)
Health (2)
Generated by fallow. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What it catches
A gauge needle / clock hand / dial pointer / radar sweep that rotates about the wrong pivot — the recovered center-of-rotation sits far from the dial hub (e.g.
transform-originat the needle base or SVG element edge instead of the dial center). Visually the needle "wobbles" or orbits off-axis instead of sweeping cleanly about the hub.This is a genuine gap in the current checks:
rotation_pivot_drift(#2741) provably cannot catch it — a correct sweeping needle's bbox-center orbits identically to a broken one, so only a dial-hub reference distinguishes them. This is the separate hub-referenced check that analysis called for.How it works
getScreenCTM(honors the actual rendered transform, independent ofsvgOrigin).> 0.35 * pointer_length. One warning per hub.<svg>) so a pointer rotated by adivancestor is measured correctly.>= 2bodies at distinct angular positions on one hub = orbit/atom system, not a dial → suppressed.Corpus evidence (autonomous geometry-fuzz run, 81 fuzzed diagrams)
vlm_has_defects: false) — the deterministic hub-reference check beats the VLM on this defect class.divancestor) cleared by root-walk; fuzz055 (atom) cleared by the multi-body guard.Validation
checkPipeline.needlePivotOffset.test.ts) + full check suite pass;bun run buildgreen.🤖 Generated with Claude Code