Documentation

Configuration reference

The field inventory comes from the same Zod schemas that validate fragments.config.ts; descriptions come from the shipped public type declarations.

Schema reference

These fields cover governance policy, token discovery, and local identity decisions. Unsupported or misspelled keys are reported as inert configuration instead of being treated as active.

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: `failOnWarnings` makes warning findings fail the `--ci` verdict, `failOnInert` makes inert-config diagnostics (FUI9004-FUI9008) fail it. Both are opt-in; `--allow-inert` bypasses the inert gates.
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.

TypeScript and JavaScript token modules

Keep format: "auto" for statically analyzable TypeScript and JavaScript modules. Fragments routes the source by its file extension; js and ts are not separate format enum values.

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

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

Scoping a rule off a path

Every global govern.styles and govern.jsx record accepts an exclude list, as does each entry under govern.rules. Entries are a bare glob or a { glob, reason } record. An exclude scopes only the policy that declares it—the path stays governed by every other rule—which is what separates an exemption from a baseline.

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

export default {
  govern: {
    styles: [
      {
        kind: "style.rawColors.forbid",
        except: ["transparent"],
        prefer: "token",
        severity: "warn",
        // Scopes THIS record off the path. Other rules still run over these files.
        exclude: [{ glob: "src/legacy/vendor/**", reason: "vendor drop, tracked in DS-611" }],
      },
    ],
    // The rule-id keyed form takes the same list, and scopes every record of that rule.
    rules: {
      "styles/no-raw-spacing": { exclude: ["src/legacy/vendor/**"] },
    },
  },
} satisfies FragmentsConfig;

Excluded findings are never silent: each one is counted in the run summary and listed with its glob and reason in the JSON report's ignored array and the SARIF run properties. A glob that matches no scanned file is reported as FUI9006, so a stale path cannot masquerade as active policy.

In-source suppressions

Put a suppression immediately before the statement it applies to. Name the exact FUI code and record a reason; use a real calendar expiry when the exception is temporary. Suppressions are narrow, auditable exceptions—not a substitute for changing the contract through govern.canonicalBridges or another documented config field.

Banner.tsx
// fragments-allow FUI2005: vendor-owned color, tracked in DS-482 expires="2026-12-31"
const Banner = () => <div style={{ color: "#39594d" }} />;
LegacyButton.tsx
// @fragments-expect-error FUI1003 reason="legacy import migration tracked in DS-611" expires="2026-12-31"
import { Button } from "@mui/material";

Run fragments check --list-suppressions to review active directives, and fragments check --check-expired to fail on expired ones. For import-path findings, see FUI1003 remediation.