Skip to content

Add cosmetic Component archetype axis with palette grouping and archetype-keyed affinity #79

Open

Description

@CuriouslyCory

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 Archetype union (client-safe, Zod/TS only — never a Prisma enum) and ARCHETYPE_META: Record<Archetype, { group }>, where group is the coarse palette header ("Databases", "Compute", …). ARCHETYPE_META stays lucide-free so it is server-importable later.
  • Add a required archetype field to every KindMeta row. "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 small KIND_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's kind → 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

  • Archetype union + ARCHETYPE_META added (client-safe, lucide-free); every kind declares a required archetype with STRUCTURAL for 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 check and pnpm test green

Blocked by

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    ready-for-agentFully specified, ready for an agent to implement AFK

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions