fix(core): tune ProtoScan Science after real-file dogfooding (EDET) - #4
Merged
Conversation
Five fixes surfaced by scanning a real Section-organised prototype (EDET): - metrics: forEachScreen now recurses SECTION nodes (mirrors the graph builder). Section-nested screens were invisible to metrics → score coverage on EDET went 50% -> 100%. - metrics: skip archived/backup frames (ARCHIVADO/BACKUP) so they do not pollute the score or emit findings (the nav/spatial checks already downgrade them). - balance: distribute each element's weight PROPORTIONALLY across the centerline instead of all-or-nothing by center, so a full-bleed background no longer reads as 100% one-sided (EDET balance 9 -> 63); mark na when a screen has < 3 weighted leaves. - scoring: topFixGroups() aggregates failing metrics by dimension with the global points recovered if fully addressed (meaningful on large files where per-node impact is ~0.1). Terminal/HTML/MCP show grouped fixes. - scanner: cap dual-emitted metric issues at 25/category. A deterministic per-node scan yields thousands of failures (EDET 12,564 -> 224 issues), which made reports unusable; full totals remain in the score + topFixGroups. Verified on EDET (PDShpnJG1i8wGIf4ErIiRL): 70/100, 100% coverage, all 8 dimensions, HTML report ~186KB. 88 tests passing (+5), tsc strict clean across core/cli/mcp. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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.
Summary
Follow-up to #3. Five correctness/UX fixes surfaced by dogfooding the engine on a real Section-organised Figma prototype (EDET) — issues that synthetic fixtures could not reveal.
Fixes
metrics/walk.ts):forEachScreennow recurses intoSECTIONnodes like the graph builder. Section-nested screens were invisible to the metrics → EDET score coverage 50% → 100% (all 8 dimensions now populated).metrics/walk.ts):ARCHIVADO/BACKUPframes no longer pollute the score or emit findings (the nav/spatial checks already downgrade them). Removed false-positive contrast noise.metrics/balance.ts): each element's visual weight is distributed proportionally across the centerline instead of all-or-nothing by center — a full-bleed background no longer reads as 100% one-sided (EDET balance 9 → 63).nawhen a screen has < 3 weighted leaves.scoring/score.tstopFixGroups): aggregates failing metrics by dimension with the global points recovered if fully addressed — meaningful on large files where per-node impact is ~0.1. Terminal/HTML/MCP updated.scanner.ts): metric failures dual-emitted as Issues are capped at 25/category. A per-node scan yields thousands (EDET 12,564 → 224 issues); full totals remain in the score +topFixGroups.Verification
Real run on EDET (
PDShpnJG1i8wGIf4ErIiRL): 70/100, 100% coverage, all 8 dimensions; HTML report ~186KB (was multi-MB). 88 tests passing (+5 regression tests: section recursion, archived skip, balance proportional/na,topFixGroups).tsc --noEmitstrict clean across core/cli/mcp.🤖 Generated with Claude Code