/** * `catalog-fixture-a` — the committed reference catalog shared by the contract * acceptance cases (contract-identity ACCEPTANCE §1–§4) and the Cloud-side * parity test. Small but full-surface: components with props, tokens, one * confirmed + one proposed canonical mapping, a policy with rules, a * composition pattern, and one authored waiver. * * `CATALOG_FIXTURE_A_FCID` is the golden value for * `contractHash(projectContractPreimage(catalogFixtureA))`. Cloud's Convex * parity test imports BOTH from here, so an intentional projection change is * updated in exactly one place and every runtime follows (ACCEPTANCE §1). */ import type { ContractCatalogInput } from "./preimage.js"; export const catalogFixtureA: ContractCatalogInput = { components: [ { name: "Button", props: ["variant", "size", "disabled"], contract: { bans: [{ prop: "style", reason: "token-governed surface" }] }, }, { name: "Card", props: ["padding"], compoundChildren: ["Card.Header", "Card.Body"], }, { name: "Card.Header", parentName: "Card", props: ["title"], }, ], tokens: [ { name: "--fui-color-accent", value: "#3366ff", type: "color" }, { name: "--fui-space-2", value: "8px", type: "dimension" }, { name: "--fui-radius-md", value: "6px", type: "dimension" }, ], canonicalMappings: [ { component: "LegacyButton", canonical: "Button", status: "confirmed", propMapping: [{ rawProp: "kind", canonicalProp: "variant" }], }, { component: "AppCard", canonical: "Card", status: "proposed", }, ], policy: { rules: { tokens_hardcoded_values: { enabled: true, severity: "error" }, components_prefer_library: { enabled: true, severity: "warning" }, }, compositionPatterns: [ { id: "card-structure", region: "Card", require: ["Card.Header"], severity: "warning" }, ], waivers: [ { id: "waiver-001", target: "FUI4001", reason: "legacy promo banner, replacement tracked in #482", expiresOn: "2026-09-30", }, ], }, }; /** * Golden fcid for {@link catalogFixtureA}. Regenerate only on an intentional * projection change: `contractHash(projectContractPreimage(catalogFixtureA))`. */ export const CATALOG_FIXTURE_A_FCID = "41ae847b36618f25a9aa73bda47851f6467e30ce4bcfb5a5aa25d27fee3fee54"; /** * The same fixture expressed as Cloud-shaped mint materials: the * `code-contracts` payload body and the DTCG token document that assemble to * exactly {@link catalogFixtureA} through the adapters. Kept here so a fixture * edit happens in one file — the core §1 test guards the payload↔components * equivalence, and Cloud's parity test asserts the golden fcid end to end. */ export const catalogFixtureAContractPayload = { fragments: [ { meta: { name: "Button" }, props: { variant: {}, size: {}, disabled: {} }, contract: { bans: [{ prop: "style", reason: "token-governed surface" }] }, }, { meta: { name: "Card" }, props: { padding: {} }, structure: { compoundChildren: [{ name: "Card.Header" }, { name: "Card.Body" }], }, }, { meta: { name: "Card.Header", parentComponentName: "Card" }, props: { title: {} }, }, ], }; /** DTCG form of {@link catalogFixtureA}'s tokens (flattened Cloud-side). */ export const catalogFixtureATokensDtcg = { "--fui-color-accent": { $value: "#3366ff", $type: "color" }, "--fui-space-2": { $value: "8px", $type: "dimension" }, "--fui-radius-md": { $value: "6px", $type: "dimension" }, };