{
  "$description": "Shared design-canon record for the web and iOS palette guards (src/__tests__/paletteCanon.test.ts, ios/UserHappyTests/PaletteCanonTests.swift). See docs/design-canon-drift-guard-proposal.md for the decision this implements.",
  "$status": "Web paletteCanon reads swatches.web.hexes directly. iOS palette values and the ban matchers remain recorded from their guards; canonPropagation verifies the matcher wiring. design/theme-contract.json locks existing web token bindings and records exact interim exceptions. See docs/design-compliance.md.",
  "swatches": {
    "$note": "Recorded per-platform, verbatim, not harmonized. The two ALLOWED_HEXES sets differ in scope on purpose (web scans all sources; iOS scans only the token file) and should not be merged.",
    "web": {
      "source": "design/canon.json, consumed by paletteCanon, designCompliance and the ADSF source gate",
      "hexes": [
        "ea5f00",
        "b0a49d",
        "ffbc5a",
        "9fd8d9",
        "c75000",
        "565352",
        "e2dedc",
        "edeae8",
        "f3f3f3",
        "ffffff",
        "1a1430",
        "b34700",
        "7f7f7f",
        "000000",
        "4285f4",
        "34a853",
        "fbbc05",
        "ea4335"
      ],
      "$note": "The 12 UserHappy Colors variables, report-specific Medium Gray #7f7f7f ratified by Ashley on 2026-08-13, plus black (staff monochrome) and the four Google SSO brand hexes. The Figma file also carries Astriata Colors (the agency's own palette) and IA Colors; neither is canon here and the Astriata swatches are hard-banned — see bans."
    },
    "ios": {
      "source": "ios/UserHappyTests/PaletteCanonTests.swift testDesignTokensStayOnCanon allowed",
      "hexes": [
        "EA5F00",
        "B0A49D",
        "FFBC5A",
        "9FD8D9",
        "C75000",
        "565352",
        "B34700",
        "E2DEDC",
        "EDEAE8",
        "F3F3F3",
        "FFFFFF",
        "1A1430",
        "C62828",
        "FCEBEA",
        "F1C4C1",
        "15803D",
        "F0FDF4",
        "B45309",
        "FFFBEB",
        "FDE68A",
        "7E22CE",
        "FAF5FF"
      ]
    }
  },
  "roles": {
    "$note": "Partial by design — only the ink-role facts both guards already enforce today. The full role-to-swatch matrix (fill/border/surface/danger/success/warning) is future policy, not yet ratified, and is what the proposal's step-3 token-graph check would consume.",
    "ink": [
      {
        "swatch": "b0a49d",
        "allowed": false,
        "note": "fails AA on light surfaces (~2.8:1); stays canonical for fill/border"
      },
      {
        "swatch": "c75000",
        "allowed": false,
        "note": "fails AA on non-white canon grounds as text; stays canonical for non-text roles"
      },
      {
        "swatch": "b34700",
        "allowed": true,
        "note": "Text Orange — ink replacement for c75000. Ratified by Aline 2026-08-10 (Monday item 12715482042), superseding the interim a84200. Clears 4.5:1 on the three grounds orange words appear on: White 5.50, Page Wash f3f3f3 4.96, Very Light Gray edeae8 4.59. Does NOT clear Light Gray e2dedc (4.12) — out of scope, orange text never appears on Light Gray or darker."
      },
      {
        "swatch": "565352",
        "allowed": true,
        "note": "Ink — replacement for warm-gray text and for text-muted-foreground drift"
      }
    ]
  },
  "typefaces": {
    "web": {
      "body": "Mulish (--font-sans)",
      "display": "Poppins (--font-display)"
    },
    "ios": {
      "body": "Mulish",
      "display": "Poppins",
      "exemptions": [
        "SF Symbols icon glyphs (Image(systemName:), Label(, ProgressView()",
        "monospaced runs (design: .monospaced) — ids, hosts, emails",
        "italic runs (.italic()) — Mulish ships no italic static file"
      ]
    }
  },
  "exemptions": {
    "web": [
      "__tests__ files",
      "src/data/fixtures/** — customer-branding fixtures carry arbitrary customer colors",
      "*.d.ts",
      "src/index.css — canon token definitions + historical comments live here"
    ],
    "ios": [
      "Core/Design/UserHappyDesign.swift is exempt from the hex hard-bans (it is where hexes are defined), but not from the system-color bans"
    ]
  },
  "bans": [
    {
      "id": "brand-gray-text-ink",
      "reason": "Warm gray #b0a49d fails AA contrast on light surfaces (~2.8:1); stays canonical for fill/border, banned as text ink.",
      "platforms": [
        "web",
        "ios"
      ],
      "matchers": {
        "web": "text-\\[#b0a49d\\]|\\btext-brand-gray\\b",
        "ios": "foregroundStyle\\([^)]*0xB0A49D"
      }
    },
    {
      "id": "hover-brightness-fork",
      "reason": "brightness hover fork — use hover:bg-[#ea5f00] (rest #c75000 -> hover #ea5f00)",
      "platforms": [
        "web"
      ],
      "matchers": {
        "web": "hover:brightness-90"
      }
    },
    {
      "id": "accessible-orange-text-ink",
      "reason": "Accessible Orange (#c75000) as text ink fails AA on every non-white canon ground; use text-[#b34700] On iOS the role lives in the token, since SwiftUI has no property prefix to carry it: brandOrangeText for words, brandOrangeIcon for symbol glyphs, bare brandOrange for fills only.",
      "platforms": [
        "web",
        "ios"
      ],
      "matchers": {
        "web": "text-\\[#c75000\\]",
        "ios": "foregroundStyle\\([^)]*\\bbrandOrange\\b"
      }
    },
    {
      "id": "muted-foreground-drift",
      "reason": "muted-text drift — use text-text-muted (#565352)",
      "platforms": [
        "web"
      ],
      "matchers": {
        "web": "\\btext-muted-foreground\\b"
      }
    },
    {
      "id": "swiftui-system-color-in-a-color-position",
      "reason": "SwiftUI system color in any color position (foregroundStyle/tint/fill/background/stroke) — use a UserHappyDesign.Colors token. Was foregroundStyle-only, which missed .fill(.green) and .tint(.red).",
      "platforms": [
        "ios"
      ],
      "matchers": {
        "ios": "(?:foregroundStyle|foregroundColor|tint|fill|background|stroke)\\(\\s*(?:Color)?\\.(?:red|green|orange|yellow|blue|purple|pink|gray|teal|mint|indigo|brown|secondary)\\b"
      }
    },
    {
      "id": "swiftui-system-color-as-argument",
      "reason": "SwiftUI system color passed as an initialiser argument, e.g. SentimentBar(color: .green) — use a UserHappyDesign.Colors token. Twelve such sites were invisible to the previous guard.",
      "platforms": [
        "ios"
      ],
      "matchers": {
        "ios": "\\bcolor:\\s*(?:Color)?\\.(?:red|green|orange|yellow|blue|purple|pink|gray|teal|mint|indigo|brown|secondary)\\b"
      }
    },
    {
      "id": "unratified-off-palette-orange",
      "reason": "unratified off-palette orange — use Colors.brandOrange (#c75000) / brandOrangeBright (#ea5f00) / brandOrangeText (#b34700). #a84200 was removed from this ban on 2026-08-07 when it became the interim Text Orange; Aline replaced it with #b34700 on 2026-08-10 and #a84200 is off the palette again.",
      "platforms": [
        "ios"
      ],
      "matchers": {
        "ios": "(?i)0x(CB4E0B|A84200)"
      }
    },
    {
      "id": "tailwind-red-hex",
      "reason": "Tailwind red — use Colors.danger / dangerSurface (#c62828 / #fcebea)",
      "platforms": [
        "ios"
      ],
      "matchers": {
        "ios": "(?i)0x(B91C1C|DC2626|EF4444|FEF2F2)"
      }
    },
    {
      "id": "raw-rgb-color-literal",
      "reason": "Raw Color(red:green:blue:) literal. The hex bans match 0x literals only, so colours written as floats were invisible to the guard — 31 off-canon literals survived the 2026-08-03 sweep that way. Total ban: after the 2026-08-07 sweep there are no legitimate uses.",
      "platforms": [
        "ios"
      ],
      "matchers": {
        "ios": "Color\\(\\s*(?:\\.sRGB,\\s*)?red:"
      }
    },
    {
      "id": "astriata-colors-not-canon",
      "reason": "Astriata Colors is the agency's brand palette, not this product's. A swatch being a real Figma variable does not make it ours. e35f15 (Astriata Orange) briefly reached five participant-facing marks because canon was defined only as 'UserHappy Colors', leaving sibling collections structurally invisible — neither canon nor a violation. Banned by token spelling AND by raw value. Ruling: Ashley, 2026-08-11.",
      "platforms": [
        "web"
      ],
      "matchers": {
        "web": "--color-astriata-|\\\\b(?:${UTIL})-astriata-"
      }
    }
  ],
  "ratchet": {
    "description": "Per-file drift counts (default Tailwind color classes, non-canon hexes, oklch) that must never grow. A file may reduce its count, never grow it.",
    "baselineFile": "src/__tests__/palette-baseline.json"
  }
}
