Phone-hit guard: no blind spots for aliased, namespace and non-tsx IconButton; scope-aware PhoneHit check #156

Merged
void merged 1 commit from void/phone-hit-guard-hardening into dev 2026-11-13 23:46:38 +00:00
Member

Follow-up ratatoskr:follow_up:phone-hit-kit-residual, items (1) and (2); item (3) (UrlPreviewCard clipping) needs a render and is left.

  • The coverage test scans every script under src/, not only .tsx under src/app; the checker is an exported pure uncoveredIconButtons(src, fileName) returning { bare, unhandled }. Aliased and namespace-member IconButton tags are checked like plain ones; forms the guard cannot cover (as={IconButton}, rebinding, re-export, destructuring, value use) land in unhandled and fail the test loudly.
  • A shadowing inner binding of PhoneHit and import type of it no longer count as real use.
  • drawnPx/sizeProp read parsed attributes instead of regexing tag text.
  • Pins the emoji Sidebar column gap (the reading of 'SidebarContent gap unpinned' that matched code; if the finding meant components/sidebar/SidebarContent.tsx, which has no IconButton and no gap, this is the wrong target).

No production component changed; the guard finds nothing uncovered on dev. Untested: scope resolution is syntactic (no type checker); a with rebinding or class-static-block binding would not be seen.

🤖 Generated with Claude Code

Follow-up `ratatoskr:follow_up:phone-hit-kit-residual`, items (1) and (2); item (3) (UrlPreviewCard clipping) needs a render and is left. - The coverage test scans every script under `src/`, not only `.tsx` under `src/app`; the checker is an exported pure `uncoveredIconButtons(src, fileName)` returning `{ bare, unhandled }`. Aliased and namespace-member IconButton tags are checked like plain ones; forms the guard cannot cover (`as={IconButton}`, rebinding, re-export, destructuring, value use) land in `unhandled` and fail the test loudly. - A shadowing inner binding of PhoneHit and `import type` of it no longer count as real use. - `drawnPx`/`sizeProp` read parsed attributes instead of regexing tag text. - Pins the emoji `Sidebar` column gap (the reading of 'SidebarContent gap unpinned' that matched code; if the finding meant `components/sidebar/SidebarContent.tsx`, which has no IconButton and no gap, this is the wrong target). No production component changed; the guard finds nothing uncovered on dev. Untested: scope resolution is syntactic (no type checker); a `with` rebinding or class-static-block binding would not be seen. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Phone hit guard: see every spelling of IconButton, read scope and the AST
All checks were successful
Build pull request / Build pull request (pull_request) Successful in 4m54s
0271d5f692
The coverage guard now scans every script file under src, resolves aliased and
namespace-member IconButton tags, and fails loudly on any other mention
(as={IconButton}, rebinding, re-export, destructuring, element access). A
PhoneHit that an inner scope rebinds, or that is imported as a type, no longer
counts. drawnPx/sizeProp read the parsed tag, not its text. The emoji Sidebar
column's 4 px gap is pinned.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
void merged commit da822e9e4e into dev 2026-11-13 23:46:38 +00:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
GameCult/Ratatoskr!156
No description provided.