On this page

← RCF

Concept

Requirements as the source of truth

Requirements define what the product must do and why. In RCF, code and tests are checked against those requirements.

Last updated

Requirements govern every downstream artefact in RCF. Code can be regenerated from a good specification, but code alone cannot recover the original specification and its intent.

Many projects treat code, tests or developers’ memories as the source of truth. Requirements are updated after implementation and consulted infrequently.

Without agreed requirements, disagreements about behaviour depend on influence or memory. Existing implementation becomes its own justification. Teams must reconstruct an audit trail from code when asked to show that a control is in place.

What it costs when requirements are decorative

Requirements that do not govern the work undermine three capabilities: resolving disagreements, controlling scope and verifying completion.

First, an agreed requirement lets engineers check whether the requirement needs correction or the implementation fails to meet it. Without that reference, disagreements depend on recollections of earlier conversations.

Second, recorded scope makes additions identifiable. If scope exists only in a developer’s memory, a reviewer cannot reliably distinguish required work from scope creep.

Third, completion must mean that every requirement is met and every acceptance criterion passes. A running demo and an outdated requirements document make it easy to overstate progress.

Why code can’t be the source of truth

Code describes how the software works. It does not record why a function was requested. Those reasons need a durable record that survives edits, refactors, deletion and replacement.

An agent generates a plausible interpretation of its prompt. If the prompt omits intent, the agent fills the gaps with assumptions. The resulting code does not establish that those assumptions were approved.

Why tests can’t be the source of truth either

Tests state expected behaviour, and passing tests provide evidence that it occurs. That makes tests useful evidence, but does not make them the product specification.

A test case describes a specific behaviour. A requirement describes a business goal. The relationship must be explicit and traceable. Tests can all pass while the product is wrong if they describe what was built rather than what was requested.

What “source of truth” actually means

In RCF, the source of truth is the PRD’s requirements list. Concretely, that means three things.

The RCF document chain A Y-shaped diagram of the RCF document chain. Two upstream arms converge at the build chain. The intent arm runs down the left: PRD (product requirements document), REQ (requirement), US (user story), AC (acceptance criterion). The architecture arm runs down the right: TAD (technical architecture document), TAC (technical architecture component), ADR (architectural decision record). Both arms converge at the FBS (functional build specification), shown in signal-filled treatment as the load-bearing join. The build sequence sits above the FBS, the directed acyclic graph that orchestrates which FBS runs next. Below the FBS the test lane runs through the proof artefacts: TS (test suite, one per user story) and TC (test case, one per AC). The acceptance criterion is a fork: a second lane leaves it for CN (code node), the eleventh and newest RCF document kind. CN is the source code that implements the AC; it sits alongside the chain, anchored to the AC, level with the test case, not appended after it. Each card carries its document type acronym and its ID-prefix format. PRD. Product requirements document. The top of the intent arm. One per product. States what the product is, who it is for, what it does, and what it deliberately does not. PRD PRD-01 REQ. Requirement. An atomic, testable statement of what the product must do. Listed inside the PRD; each REQ breaks down into one or more user stories. REQ REQ-01 US. User story. The human shape of a requirement. As a role, I want an action, so that an outcome. Carries one or more acceptance criteria. US US-01 AC. Acceptance criterion. A Given/When/Then sentence: the contract for done. The fork in the chain: one test case in the story's test suite verifies the AC, one to one, and the code that implements the AC anchors to it too, which several code nodes may do. AC AC-01-01 TAD. Technical architecture document. The top of the architecture arm. Sibling to the PRD; describes the services, data stores, integrations, and cross-cutting decisions the product needs to live in. TAD TAD-01 TAC. Technical architecture component. A named moving part of the architecture: a service, a data store, a queue, an integration, a shared module. TACs carry their own IDs and are referenced from FBSs by ID, the way ACs are. TAC TAC-01 ADR. Architectural decision record. Captures one consequential choice: context, decision, alternatives, consequences. References the TAD and the components it constrains. FBSs reference ADRs as build context. ADR ADR-01 Build sequence. The directed acyclic graph of FBSs. Each node is one functional build specification; each edge is a dependency. The build sequence orchestrates which FBS runs next. Build sequence FBS. Functional build specification. The convergence point. Pulls the in-scope ACs from the intent arm and the in-scope TAD components and ADRs from the architecture arm, plus the surrounding context the worker needs, and turns the two arms into one buildable slice. FBS FBS-01 TS. Test suite. One per user story; hangs off its US and lists the ACs it verifies. The test cases inside it are what actually prove each criterion. TS TS-01-01 TC. Test case. One scenario inside a test suite: a happy path, a named edge case, a failure mode. TC TC-01-01 CN. Code node. The eleventh and newest RCF document kind, added to bridge the chain to source code. It forks off the acceptance criterion through implementsAcIds; its identity is the file path, optionally a symbol, not a parent slot. rcf validate walks the link, so a rename or move that breaks it surfaces as a stale edge. The link to an AC may be empty, which is a legitimate state for utility or glue code. CN CN-01 The RCF document chain (Y-shape, narrow layout) A narrow-viewport rendering of the RCF document chain Y-shape. Intent arm down the left (PRD, REQ, US, AC); architecture arm down the right (TAD, TAC, ADR); both converge at the FBS in the centre. The build sequence pill sits above the FBS. Below the FBS the diagram forks: the test lane runs TS then TC on the right, and a code lane forks off the acceptance criterion to CN (code node), the eleventh RCF document kind and the source code that implements the AC, sitting alongside the chain rather than after the test case. PRD. Product requirements document. The top of the intent arm. PRD PRD-01 REQ. Requirement. Atomic, testable statement inside the PRD. REQ REQ-01 US. User story. The human shape of a requirement. US US-01 AC. Acceptance criterion. The contract for done, and the fork: the test suite and the code that implements it both anchor here. AC AC-01-01 TAD. Technical architecture document. Top of the architecture arm. TAD TAD-01 TAC. Technical architecture component. A named moving part of the architecture, referenced from FBSs by ID. TAC TAC-01 ADR. Architectural decision record. Captures one consequential choice. ADR ADR-01 Build sequence. The DAG of FBSs; picks which FBS runs next. Build sequence FBS. Functional build specification. The convergence point. Pulls in-scope ACs, components, and ADRs into a single buildable slice. FBS FBS-01 TS. Test suite. One per user story; contains the test cases that verify its ACs. TS TS-01-01 TC. Test case. One scenario inside a test suite. TC TC-01-01 CN. Code node. The eleventh RCF document kind; the source code that implements the AC, forked off it through implementsAcIds and walked by rcf validate, so a rename or move that breaks the link surfaces as a stale edge. CN CN-01
Intent & architecture → FBS → tests  ·  AC → CN

When behaviour is disputed, check the requirement. If it does not answer the question, update and commit it before changing the code.

Every user story links to a requirement. Every acceptance criterion belongs to a story. Each test suite implements one criterion, and a Code Node links the implementation to its criteria. Work without a requirement must either be justified by adding a requirement or removed from scope.

Work is complete when every acceptance criterion passes and traces back to its requirement. A running demo or a passing CI run alone does not establish completion.

The cost of doing this properly

Writing a useful PRD takes time before coding starts. This initial requirements work can resemble waterfall.

The PRD remains editable. Requirements can be added, retired and restated as the product develops, with every change recorded in a commit. Someone must own the statement of what the product is. Without that ownership, unwritten requirements emerge later as bugs, missed deadlines and rework.

The chain retains decisions, makes changes to intended behaviour visible and connects failures to the requirements they affect. Checking whether the product still meets its requirements becomes a query rather than a reconstruction from memory.

Where this idea cashes out