Contract

The pinned identity of a manifest version is the FCID: contractHash(manifest). Every verdict cites one.

FCID

node node_modules/@usefragments/cli/dist/loop.js card | sed -n 2p   # FCID: `…`

The FCID appears on the card, in every receipt, and on the Contract page in Fragments Cloud. Change the manifest, get a new FCID, and pin it again before a pull request can pass. A head evaluated against a different FCID than the pin is indeterminate.

Shape of the file: fragments.manifest.json.

Rules the pin arms

Each rule emits a versioned FUI code. Explain pages live at /errors.

Components

Components rules
Rule
FUI code
Tier
Title
components/unknown-propFUI6005Opt-inComponent prop is unknown
components/forbidden-prop-valueFUI6004Opt-inProp value is forbidden
components/preferred-componentFUI1002Opt-inPreferred component should be used
components/prefer-libraryFUI1004ContractLibrary component should be preferred
components/shadow-componentFUI1007ContractComponent shadows a canonical primitive

Props

Props rules
Rule
FUI code
Tier
Title
props/invalid-valueFUI6002Opt-inProp value is invalid

Imports

Imports rules
Rule
FUI code
Tier
Title
imports/preferred-pathFUI1003Opt-inImport should use the preferred path

Styles

Styles rules
Rule
FUI code
Tier
Title
styles/no-raw-colorFUI2005Opt-inRaw color should use a token
styles/no-raw-dimensionsFUI2004Opt-inRaw dimension should use a token
styles/no-raw-spacingFUI2006Opt-inRaw spacing should use the scale
styles/no-raw-typographyFUI2016Opt-inRaw typography should use a token

Tailwind

Tailwind rules
Rule
FUI code
Tier
Title
tailwind/arbitrary-colorFUI2007Opt-inTailwind arbitrary color should use a token
tailwind/arbitrary-spacingFUI2008Opt-inTailwind arbitrary spacing should use the scale
tailwind/forbidden-paletteFUI2009Opt-inTailwind palette is forbidden
tailwind/off-scale-spacing-tokenFUI2011Opt-inTailwind spacing token is off scale
tailwind/raw-color-via-tokenFUI2010Opt-inTailwind color should use a resolved token
tailwind/unknown-classFUI2012Opt-inTailwind class is unknown

Tokens

Tokens rules
Rule
FUI code
Tier
Title
tokens/require-dual-fallbackFUI2003Opt-inToken fallback is required
tokens/css-vars-must-be-definedFUI2015ContractCSS variable is not in the contract vocabulary
tokens/upstream-driftFUI2017ContractLocal token differs from its declared upstream source

Theme

Theme rules
Rule
FUI code
Tier
Title
theme/no-theme-coupled-literalFUI2014Opt-inTheme-coupled literal should use a semantic token

Accessibility

Accessibility rules
Rule
FUI code
Tier
Title
a11y/required-accessible-nameFUI3001Opt-inAccessible name is required
a11y/standardFUI3002Opt-inAccessibility standard failed

Composition

Composition rules
Rule
FUI code
Tier
Title
composition/cardinalityFUI5003Opt-inToo many of a component in one region
composition/co-occurrenceFUI5004Opt-inRequired companion component is missing from the region

Config schema

Optional fragments.config.ts scopes token sources, topology, and rule records. The manifest is still the contract the loop and the gate evaluate.

Governance policy

Governance policy configuration fields
Field
Type
Required
Description
govern.agentobjectNoAgent repair-order guidance consumed when presenting deterministic fixes.
govern.agentsRecord<string, object>NoAgent-id keyed rule overrides for supported agent-specific governance policies.
govern.auditobjectNoReserved audit compatibility object; undeclared child keys are reported as inert.
govern.canonicalBridgesobject[]NoConfirmed mappings from an underlying library export to the approved local wrapper. The wrapper's implementationFiles scope permits its direct underlying import.
govern.canonicalSourcesobject[]NoCanonical component authorities: npm packages, repository directories, or registry receipts whose included exports arm canonical-component rules.
govern.ciobjectNoGovernance CI rendering options. Under `--ci`, `failOnWarnings` defaults to `true` when absent; set it to `false` to keep warning findings reported but advisory. `failOnInert` is opt-in and makes inert-config diagnostics (FUI9004-FUI9008) fail the verdict; `--allow-inert` bypasses the inert gates. `failOnAdoptionRegression` is opt-in and makes `check --ci` compare the current component-identity adoption percentage with the committed `.fragments/adoption-baseline.json` floor.
govern.componentsRecord<string, object>NoComponent-keyed governance records for canonical component metadata and prop policy.
govern.extendsstring[]NoShared governance config modules to extend before applying this file's declarations.
govern.jsxobject[]NoLegacy typed JSX-policy records, normalized into the active rule policy.
govern.overridesobject[]NoOrdered component-policy overrides selected by component identity fields.
govern.presetsstring[]NoVersioned governance presets to resolve before applying local rule overrides.
govern.rulesRecord<string, unknown>NoRule-id keyed enablement and severity overrides. Only fields consumed by the named rule are valid; unsupported fields are reported as inert config.
govern.runnersRecord<string, object>NoReserved runner compatibility map; undeclared child keys are reported as inert.
govern.scalesRecord<string, object>NoNamed numeric scales. Spacing rules bind through style.rawSpacing.mustMatchScale; the built-in spacing policy references `space`.
govern.severity"error" | "warn" | "info"NoDefault severity for governance rules that do not declare their own severity.
govern.stylesobject[]NoLegacy typed style-policy records, normalized into the active rule policy.
govern.tailwindobjectNoTailwind palette allow/deny policy used by Tailwind governance rules.

Token sources

Token sources configuration fields
Field
Type
Required
Description
tokens.aliasesRecord<string, string>NoExplicit local-name -> upstream-name mappings for cross-authority drift checks.
tokens.enabledbooleanNoEnable token comparison in style diffs (default: true)
tokens.excludestring[]NoGlob patterns to exclude
tokens.format"auto" | "css" | "scss" | "dtcg" | "tailwind"NoToken source format detection. "auto" infers supported formats from the file extension, including statically analyzable TypeScript/JavaScript modules.
tokens.includestring[]NoGlob patterns for files to scan for tokens e.g., ["src/styles/theme.scss", "src/styles/variables.css"]
tokens.namespacestringNoVendor namespace for Fragments extensions in DTCG files (default: 'com.usefragments')
tokens.packagesstring[]Nonpm package names whose shipped `fragments.json` token vocabulary seeds the known-token set (e.g. `["@usefragments/ui"]`). DECLARED-manifest ingest — the parser reads each package's published `fragments.json` and merges its token names into the vocabulary `tokens/css-vars-must-be-defined` consumes, so a consumer using those `--fui-*` vars is not flagged as drift. Never globs node_modules SCSS — only the declared manifest is trusted, keeping the no-inference mandate intact.
tokens.sourcesobject[]NoRepo-root-relative token source files/globs for monorepos and Cloud setup. Set each source to format "auto" for TypeScript or JavaScript token modules.
tokens.themeSelectorsRecord<string, string>NoMap CSS selectors to theme names
tokens.upstreamobject[]NoDeterministic pins for upstream token manifests; local scans never fetch them.

Local identity decisions

Local identity decisions configuration fields
Field
Type
Required
Description
identity.decisionsobject[]NoAuthored sanctions, rejections, and dismissals keyed by portable component identity.

Token modules

Point tokens.sources at a TypeScript or JavaScript module when tokens are not in CSS.

fragments.config.ts
import type { FragmentsConfig } from "@usefragments/core";

export default {
  tokens: {
    sources: [{ path: "src/theme/tokens.ts", format: "auto" }],
  },
} satisfies FragmentsConfig;

Worked config

fragments.config.ts
import type { FragmentsConfig } from "@usefragments/core";

export default {
  "app": {
    "path": ".",
    "include": [
      "src/**/*.{ts,tsx,css,scss}"
    ]
  },
  "components": [
    "src/components/**/*.tsx"
  ],
  "tokens": {
    "sources": [
      {
        "path": "src/theme.ts",
        "format": "auto"
      }
    ],
    "packages": [
      "@acme/design-tokens"
    ],
    "aliases": {
      "colors.brand": "--acme-color-brand"
    }
  },
  "govern": {
    "canonicalBridges": [
      {
        "underlying": {
          "packageName": "@mui/material",
          "exportName": "Button"
        },
        "local": {
          "componentKey": "src/components/Button#Button",
          "moduleSpecifier": "@/components/Button",
          "exportName": "Button",
          "implementationFiles": [
            "src/components/Button/Button.tsx"
          ]
        },
        "decision": {
          "state": "confirmed",
          "source": "authored"
        }
      }
    ],
    "styles": [
      {
        "kind": "style.rawColors.forbid",
        "except": [
          "transparent"
        ],
        "prefer": "token",
        "severity": "warn",
        "exclude": [
          {
            "glob": "src/legacy/vendor/**",
            "reason": "vendor drop, tracked in DS-611"
          }
        ]
      }
    ],
    "rules": {
      "styles/no-raw-color": {
        "enabled": true,
        "severity": "warn"
      }
    }
  }
} satisfies FragmentsConfig;

Next steps