Facet
DeutschInstall

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.

facet.schema.json
SectionRequiredHolds
schema_versionyesThe schema version the record is written against.
idyesdomain/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.
lifecyclenoplanned, 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.
intentyesA summary of what the feature is for, with optional decision records.
contractyesThe 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.
verificationnoUnit, integration, end-to-end and property tests, each naming the scenarios it claims to prove.
observationnoSLOs, alerts, dashboards and continuous checks for operators.
knowledgenoFive questions for help and onboarding: prerequisite knowledge, not for, discoverability, common pitfalls, success signal.
lineageyesOwner 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.
defectsnoFixes landed in the feature's anchored code, one entry per bugfix commit.
variantsnoLifecycleThe 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.
flagsnoFeature 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: intent, contract, lineage

    policy.schema.json
  • Assumption

    assumption/<domain>/<name>

    Something a feature relies on but does not verify. Past its review date it counts as stale.

    Required: statement, review_by, criticality, risk_if_false

    assumption.schema.json
  • Data entity

    data/<domain>/<entity>

    Stored data with its retention, its owner and the features that read or change it.

    Required: retention, ownership

    data-entity.schema.json

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?
Because a feature is what people ask about. A service is implementation and gets an anchor; a page is where a user enters a flow and answers one Knowledge question. A feature passes five tests: you can name it without “and”, one person finishes it in one sitting, it has two to nine scenarios, removing it loses something a user can name, and one team could own it.

Source: 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 FACET §2.1Original excerpt from the English source.[…] a named, coherent capability of the product that can be reasoned about, changed, and owned independently. […]View on GitHub, FACET §2.1.1Original excerpt from the English source.[…] It has between two and nine observable scenarios, including at least one failure path. […]View on GitHub

Why does the code point to the record, and not the other way round?
Because features don’t live in one folder. A keyboard-shortcut system may span forty files in twelve directories. One record, forty anchors — and when code moves, the anchor moves with it. A record listing paths would be wrong after the first refactor.

Source: 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 FACET §2.3Original excerpt from the English source.[…] FACET does not require a feature-based repository layout. […]View on GitHub, FACET §3.3Original excerpt from the English source.[…] Where in the codebase the feature is implemented. […]View on GitHub

Why exactly three levels in every id?
Domain, capability, feature is the decomposition a product actually has. A fourth level means you are describing scenarios. Domains and capabilities are declared in one file, so a wrong id fails the lint while it is still cheap — ids don’t change once created.

Source: 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 FACET §2.2Original excerpt from the English source.[…] Every feature has a canonical, stable identifier of the form: […]View on GitHub, FACET §4.4Original excerpt from the English source.[…] which is the decomposition a product actually has. […]View on GitHub

Why can’t a domain be a team?
Teams reorganise; ids don’t. An id built from the org chart is wrong on a schedule. Ownership has its own field so the two can change independently.

Source: 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 FACET §2.2Original excerpt from the English source.[…] Every feature has a canonical, stable identifier of the form: […]View on GitHub

Why prefer a bigger record with more scenarios?
Because the two mistakes don’t cost the same. Splitting a record later is mechanical. Merging two retires two immutable ids and leaves a redirect behind for good. So when both readings pass, take the coarser one.

Source: 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 FACET §2.1.1Original excerpt from the English source.[…] It has between two and nine observable scenarios, including at least one failure path. […]View on GitHub

Why is a missing answer left out instead of filled in?
Because a plausible answer nobody wrote is worse than a visible gap. Generated docs are written from the record, and the agent is asked to trace every claim to it; an empty slot is omitted, and the owner sees it’s open. The same goes for numbers: unmeasured is a dash, not a zero.

Source: 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 FACET §8.5Original excerpt from the English source.[…] The Knowledge facet exists precisely to feed this pipeline. […]View on GitHub

Isn’t “proves:” just a claim?
Yes, and we say so. The lint only checks that the scenario exists. That’s why 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.

Source: 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 FACET §3.4Original excerpt from the English source.[…] The tests and property checks that prove the contract holds. […]View on GitHub · facet test

What doesn’t FACET try to own?
Strategy and rationale (they live in ADRs), UX and copy, ML behaviour that is only statistically correct, sprint planning. FACET records feature requirements and expected behavior.

Source: 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 FACET §9Original excerpt from the English source.[…] FACET is a single source of truth for a defined domain of claims about features. […]View on GitHub