Skip to content

fix(build): Astryx surface inventory cannot see most of the design system #3868

Description

@Astro-Han

Problem

#3064 made the inventory check symmetric and #3646 kept it globally enforced. Both fixed the plumbing — whether the two halves agree and whether the gate runs. This is the third gap in the same file, and it is semantic: what the gate is able to detect at all.

The severity model only recognizes raw interactive primitives:

if (rawButton || rawInput || rawSelect) severity = 'blocker';
else if (rawTextarea) severity = 'polish';

1. A hand-rolled replacement for a shipped Astryx component scores aligned. It renders no raw control, so it is indistinguishable from a genuinely aligned file — and the inventory then certifies it. A surface added this way reads | … | none | aligned — no raw controls; no Astryx JSX usage | aligned |, moving the totals from aligned 212 to aligned 213. The rule as stated in docs/astryx-alignment-inventory.md:36 is "Raw <button> / <input> / <select> with Astryx twin" — it covers wrong primitive, not redundant component.

2. ASTRYX_COMPONENTS is a hand-maintained second representation of what Astryx ships. It holds 47 names; @astryxdesign/core/dist has 107 component directories. Timestamp is absent, so it appears 0 times across all 214 rows even though packages/ui/src/chat-turn.tsx imports and renders it. ChatMessage, ChatMessageMetadata, and Thumbnail are invisible the same way — so removing an Astryx component from a file leaves its row byte-identical, which is how this surfaced.

Desired outcome

  • Derive the known-component set from @astryxdesign/core instead of maintaining a second list, so the "Astryx used" column is a true record and design-system additions are picked up without a manual edit. This is the same root cause Astryx surface inventory check is one-directional and not wired into CI #3064 identified — a generated artifact whose input is hand-maintained drifts in whichever half the author forgets.
  • Add a severity tier for "re-implements a component Astryx already provides", so swapping an Astryx component for a local equivalent is visible in review.

Found while reviewing #3681.

AI use: Claude Code assisted with source and issue investigation; the analysis and conclusions are my own.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions