Repository navigation
Add cosmetic Component archetype axis with palette grouping and archetype-keyed affinity #79
Description
What to build
Introduce archetype — the behavioral family a Component kind belongs to (RelationalDatabase, ObjectStore, MessageQueue, ComputeRuntime, HttpApi, …) — as a new cosmetic facet of NodeKind. Archetype is the single behavioral + grouping axis; there is deliberately no separate category facet (it would be a near-duplicate partition that re-creates the drift the catalog refactor removed). Archetype confers no validation or authorization — it suggests palette grouping now, and (in a later slice) default spec kinds and doc scaffolds.
Scope:
- Add an
Archetypeunion (client-safe, Zod/TS only — never a Prisma enum) andARCHETYPE_META: Record<Archetype, { group }>, wheregroupis the coarse palette header ("Databases", "Compute", …).ARCHETYPE_METAstays lucide-free so it is server-importable later. - Add a required
archetypefield to everyKindMetarow."STRUCTURAL"is the honest escape hatch for kinds that are no behavioral family (GENERIC,REGION,MODULE,TABLE, …). Exhaustive both ways:Record<NodeKind, KindMeta>forces every kind to declare an archetype;Record<Archetype, …>forces every archetype to declare its meta. - Re-key affinity by archetype: change the suggestion map to
Record<Archetype | "ROOT", readonly NodeKind[]>plus a smallKIND_AFFINITY_OVERRIDE: Partial<Record<NodeKind, …>>that wins when present (for genuine vendor specifics). Affinity values stay concrete kinds (archetypes aren't pickable). The client maps the breadcrumb'skind→ archetype before lookup; archetype never goes onto the breadcrumb payload (ADR-0019 payload discipline). - Palette groups the "All kinds" tail by
ARCHETYPE_META[archetype].group; empty groups are dropped during search.
This slice ships only the existing (CORE) kinds — no GCP yet — so it is purely cosmetic regrouping.
Docs travel with the slice: ADR-0034 "Component archetype is a cosmetic facet, not a constraint" (depends-on ADR-0018/0019, amends ADR-0025; carries the explicit "a reviewer tightening this into enforcement regresses this ADR" clause), a new CONTEXT.md "Component archetype" entry (term: archetype, no user/code split), and the "Component kind" drives-list updated to mention palette-group.
Acceptance criteria
-
Archetypeunion +ARCHETYPE_METAadded (client-safe, lucide-free); every kind declares a requiredarchetypewithSTRUCTURALfor non-family kinds - Affinity re-keyed to
Archetype | "ROOT"with a per-kind override map; root and per-archetype suggestions verified in dev-browser - Palette tail renders archetype-grouped headers; empty groups suppressed during search
- ADR-0034 added; CONTEXT.md gains "Component archetype" and updates "Component kind"
- No enforcement anywhere — archetype is read only for presentation/suggestion
-
pnpm checkandpnpm testgreen
Activity