This document defines the non-negotiable invariants and precedence rules for the platform. All specs, code, and workflows must adhere to these principles.
- Rule: The Nix devshell is the single source of truth for the development environment.
- Implication: No tool may be required that is not provided by
flake.nix. - Enforcement:
cargo xtask doctorvalidates the Nix environment.
- Rule: All functional behavior must be defined in
specs/spec_ledger.yaml(US/REQ/AC) before implementation. - Implication: No code changes without a corresponding AC or REQ update.
- Enforcement:
cargo xtask selftestvalidates AC coverage via BDD.
- Rule: Developer workflows are defined in
specs/devex_flows.yaml, not just prose. - Implication:
cargo xtaskcommands must match the spec. - Enforcement:
cargo xtask selftestenforces the DevEx contract.
- Rule: Structural documentation (Design, Plans, Requirements) must be registered in
specs/doc_index.yaml. - Implication: No "orphan" design docs; all must link to REQs/ADRs.
- Enforcement:
cargo xtask docs-checkvalidates the index and front-matter.
- Rule:
cargo xtask selftestis the authoritative gate for correctness. - Implication: If
selftestpasses, the change is valid (behaviorally). - Enforcement: CI runs
selftestas the primary blocking step.
- Rule: Dependency health and supply chain security are blocking gates.
- Implication: No release with known high-severity vulnerabilities or dirty git tree.
- Enforcement:
cargo xtask release-verifyandaudit.
When artifacts conflict, this hierarchy applies (highest priority first):
- Constitution (this file)
- Specs (
spec_ledger.yaml,devex_flows.yaml,doc_index.yaml) - ADRs (
docs/adr/*.md) - Code & Tests
- Prose Documentation (README, CONTRIBUTING)
Resolution Strategy:
- If Code conflicts with Spec → Fix Code.
- If Spec conflicts with Constitution → Fix Spec.
- If Prose conflicts with Spec → Fix Prose.
- Trigger: New component, major refactor, or platform-level change.
- Requirement: Must have
ADR+Design Doc+REQtaggedstructural.
- Trigger: New user-facing functionality.
- Requirement: Must have
US/REQ/ACin ledger +BDDscenario.
- Trigger:
flake.lockorCargo.lockchange. - Requirement: Must pass
cargo xtask audit.