DOCS · RECORD SCHEMA
Record schema
Every FACET recordA FACET record is a short, checkable description of one feature, kept as a YAML file next to the code. It states why the feature exists, the behaviour it promises as scenarios, and the tests that check it.In the glossary is a YAML file that the LintLint is FACET's check that records and code still point at each other: every record matches its schema, every anchor names an existing record, and every active record has an anchor. It runs locally and in CI on every pull request.In the glossary checks against a JSON Schema. A feature record requires five keys; every other section is optional.
The feature record
One record per feature, at docs/facets/features/<DomainA domain is the first part of a feature id: a product area such as checkout, never a team or a service.In the glossary>/<capability>/<feature>.yaml.
| Section | Required | Holds |
|---|---|---|
schema_version | yes | The schema version the record is written against. |
id | yes | domain/capability/feature: three lowercase kebab-case segments. Domains and CapabilityA capability is the middle part of a feature id: a group of related features within one domain, such as pricing within checkout.In the glossary come from taxonomy.yaml. |
lifecycle | no | planned, active, deprecated or sunset. An active record needs an @facet: AnchorAn anchor is a comment in the source code, starting with @facet:, that names the record the code belongs to. FACET reads these comments to know where each feature is implemented.In the glossary in source. |
intent | yes | A summary of what the feature is for, with optional decision records. |
contract | yes | The expected behavior as GherkinGherkin is a widely used format for describing behaviour as Given/When/Then steps. FACET writes a record's scenarios in this style.Read more here scenarios, plus business rules kept in DMN models and referenced by name. |
verification | no | Unit, integration, end-to-end and property tests, each naming the scenarios it claims to prove. |
observation | no | SLOs, alerts, dashboards and continuous checks for operators. |
knowledge | no | Five questions for help and onboarding: prerequisite knowledge, not for, discoverability, common pitfalls, success signal. |
lineage | yes | Owner and creation date, plus dependencies, related policies, AssumptionAn assumption is a record for a named belief the system depends on, with its evidence, a review date and what breaks if it turns out false.In the glossary and data entities, and tickets. |
defects | no | Fixes landed in the feature's anchored code, one entry per bugfix commit. |
variants | no | LifecycleThe lifecycle is a record's state: planned (not implemented yet), active (implemented, an anchor is required), deprecated (being phased out) or sunset (removed).In the glossary per VariantA variant is an independently deployable place where a feature can exist or not, such as a web app and an iOS app. One record then has its own lifecycle state per variant.In the glossary, for example web and iOS. |
flags | no | Feature flags that control exposure independently of lifecycle. |
Three more record types
Rules that bind several features, facts relied on but not verified here, and data that outlives a feature each have their own record.
Policy
policy/<domain>/<name>A rule that binds several features, with its own ScenarioA scenario is one behaviour a feature promises, written in a record as Given/When/Then steps. Each scenario has an id that tests and other records can refer to.Read more here and a scope.
Required:
policy.schema.jsonintent,contract,lineageAssumption
assumption/<domain>/<name>Something a feature relies on but does not verify. Past its review date it counts as stale.
Required:
assumption.schema.jsonstatement,review_by,criticality,risk_if_falseData entity
data/<domain>/<entity>Stored data with its retention, its owner and the features that read or change it.
Required:
data-entity.schema.jsonretention,ownership
WHY IT’S BUILT THIS WAY
Every rule has a reason. Written into the specification.
Answers from the FACETOriginal excerpt from the English source.[…] a named, coherent capability of the product that can be reasoned about, changed, and owned independently. […]
View on GitHub. Read the whole argument there.
Why one record per feature — not per service or per page?
Why does the code point to the record, and not the other way round?
Why exactly three levels in every id?
Why can’t a domain be a team?
Why prefer a bigger record with more scenarios?
Why is a missing answer left out instead of filled in?
Isn’t “proves:” just a claim?
facet test runs the named files and reports per file — it does not read what a test asserts — and calls a feature unmeasured when no fresh report came back, even if the runner exited 0.