Governance
One governance model, written once and read everywhere: rules become versioned codes that surface in your editor, in CI, and in Fragments Cloud.
Overview
Governance follows one path: Rules → FUI codes → Surfaces. You author or enable rules once; each rule emits a stable diagnostic code; and every surface reads the same codes, so the editor, CI, and Cloud all agree on what a finding means.
Governance is the layer Fragments sells: an enforceable contract over the React code your team and your agents write. The component library is the open-source substrate it governs — useful on its own, but the contract is what keeps a codebase on-system as it grows.
Rules
Governance rules live in @fragments-sdk/core and run over the same usage facts extracted from your source. A rule decides whether a given fact is a violation; it does not care which surface asked.
FUI Codes
Every rule emits a versioned FUI diagnostic code. The code is the stable identifier a finding carries across surfaces, so CLI, CI, editor, and Cloud can all point to the same explanation. The Error Codes catalog is the canonical per-code reference, with an explain page for each code.
Surfaces
Because findings flow through the shared engine, the same code reaches three surfaces without per-surface wiring:
- Editor. The Fragments LSP reports violations as diagnostics as you type, with each
FUIcode linking to its explain page. - CI.
fragments check(also reachable asfragments govern scan) annotates the run and can emit SARIF for code-scanning pipelines. - Cloud. Fragments Cloud ingests the same findings and lists them in Findings, grouped and filterable by rule and code.
Topology
Findings don't float free — they roll up by topology. You map your repo into product areas (checkout, dashboard, …), each with a criticality and owners, so risk and coverage aggregate by the parts of your product that matter most — and the highest-stakes areas rise to the top.
Rule Families
- Tailwind Rules — palette policy, spacing-scale enforcement, and arbitrary values over resolved Tailwind classes.
- Composition Rules — region-scoped cardinality and co-occurrence constraints on how components are arranged inside a container.
- Error Codes — the full catalog of
FUIcodes with per-code explain pages.