Functional Requirements — the whole ESG project lifecycle
Status: draft for review. Date: 2026-08-04. Revision A.
Written by Claude Opus 5 (Claude Code). The functional half of
BRD-lifecycle-all-phases.md.
This document does not replace FRD-field-processes.md.
That document specifies the four field processes and remains authoritative for
them. This one specifies the phases around them and the state model for every
aggregate in the system.
New, additive identifier families: FR-LC, FR-ST, FR-REG, FR-BID,
FR-CST, FR-MOB, FR-CLO. Nothing existing is renumbered.
Status column. ✅ built · 🟡 partial · ❌ absent. Almost everything here is
❌, and that is the honest position — §2 of the BRD sets out the evidence.
1. Domain model additions
1.1 New aggregates
| Aggregate | Identity | Owns | Notes |
|---|
| Bid | bidId | environmental scope, risk premium, conditions, outcome | Retained won or lost (BR-LC-5) |
| EnvironmentalBudget | budgetId | cost lines, basis, signature | One signed budget per project version |
| Constraint | constraintId | kind, dates, authority, state | Issued to the planner; outlives issue |
| MobilisationGate | projectId | the readiness items and their states | One per project; reportable while incomplete |
| ObligationInstance | obligationInstanceId | library ref, project ref, origin, state | The register spine (BR-REG-1) |
| HandoverRegister | projectId | carried-forward obligations, owners, cadences | Created at closeout |
1.2 The project aggregate
| ID | Requirement | Priority | Status |
|---|
| FR-LC-1 | Project MUST carry an explicit lifecycleState from the closed set in §3.1 | MUST | ❌ canonical Project is id · name · client · contractRef |
| FR-LC-2 | Project.phase as free prose MUST NOT be used for control flow; it is a label | MUST | ❌ app/lib/projects.ts uses prose |
| FR-LC-3 | Where phases 1–3 live in a separate pre-award aggregate (CG-7), a won bid MUST resolve to a project without re-keying any environmental scope | MUST | ❌ |
| FR-LC-4 | Every record MUST carry the lifecycleState in force when it was created | MUST | ❌ |
1.3 Structural rules
| ID | Requirement | Priority |
|---|
| FR-LC-5 | A phase transition is an event, never a field update. Rationale: the sequence of phases and who moved them is itself evidence | MUST |
| FR-LC-6 | A phase may be re-entered; re-entry creates a new phase episode and never mutates the prior one | MUST |
| FR-LC-7 | Terminal states (lost, closed) remain fully readable and are never deleted | MUST |
2. The register spine (FR-REG)
| ID | Requirement | Priority | Status |
|---|
| FR-REG-1 | An ObligationInstance MUST bind a library obligation to exactly one project | MUST | ❌ no applicability model |
| FR-REG-2 | It MUST carry origin ∈ bid-commitment · permit-condition · statutory · client-instruction · internally-raised | MUST | ❌ |
| FR-REG-3 | Origin MUST NOT be inferred. Where unknown, the value is unknown and reportable as a data gap | MUST | ❌ |
| FR-REG-4 | The system MUST report bid commitments not carried into the live project | MUST | ❌ — the BO-11 report |
| FR-REG-5 | A library obligation MUST be reusable across bids; instances reference it rather than copying its text | MUST | ❌ |
| FR-REG-6 | A variation MUST append with its authority; original text remains readable | MUST | ❌ |
| FR-REG-7 | The register MUST answer, for any live obligation, which phase it originated in | MUST | ❌ |
| FR-REG-8 | Obligation and permit registers MUST support per-project scoping without duplicating rows | MUST | 🟡 registers exist; scoping does not |
3. THE STATE MODEL
The core of this document. Every aggregate, its states, its legal transitions
and the guard on each. A transition with no guard listed is unconditional.
3.1 Project
prospect ──▶ bidding ──▶ bid-submitted ──┬──▶ lost (terminal, retained)
└──▶ won ──▶ planning ──▶ mobilising
──▶ operating ──▶ closing ──▶ closed
| From → To | Guard |
|---|
prospect → bidding | a bid record exists |
bidding → bid-submitted | environmental scope complete AND director go/no-go recorded (BR-BID-6) |
bid-submitted → won / lost | outcome recorded with a date |
won → planning | unconditional |
planning → mobilising | environmental budget signed (BR-CST-3) AND constraints issued (BR-CST-7) |
mobilising → operating | mobilisation gate signed or waived-in-part (BR-MOB-10) |
operating → closing | practical completion recorded |
closing → closed | every obligation discharged, transferred or carried forward (BR-CLO-1) |
any → operating (exception) | recorded exception naming who accepted the risk (BR-LC-7) |
| ID | Requirement | Priority |
|---|
| FR-ST-1 | The system MUST refuse planning → mobilising where no signed budget exists, and state that as the reason | MUST |
| FR-ST-2 | The system MUST refuse mobilising → operating where the gate is refused | MUST |
| FR-ST-3 | The system MUST permit → operating without a signed gate ONLY via a recorded exception naming a person | MUST |
| FR-ST-4 | The system MUST refuse closing → closed while any obligation is active or overdue | MUST |
3.2 Bid
drafting → scoped → conditioned → submitted → won | lost | withdrawn
| From → To | Guard |
|---|
drafting → scoped | environmental scope drawn from the library (BR-BID-2) |
scoped → conditioned | risk premium stated (BR-BID-3) AND capacity checked (BR-BID-4) |
conditioned → submitted | director go/no-go with conditions (BR-BID-6) |
submitted → won/lost/withdrawn | outcome recorded |
3.3 EnvironmentalBudget
draft → proposed → signed → superseded
| From → To | Guard |
|---|
proposed → signed | signer holds the authority (PORTAL-ROLES) |
signed → superseded | a later budget is signed; the superseded one remains readable |
3.4 Constraint
identified → issued → active → met | breached | waived
| From → To | Guard |
|---|
identified → issued | issued to the planner as a dated item (BR-CST-7) |
issued → active | its window opens |
active → met | evidence recorded |
active → breached | window closed with no evidence — recorded, never silent (BR-CST-9) |
active → waived | authority recorded |
3.5 MobilisationGate
open → items-outstanding → signed | waived-in-part | refused
Items: boundary · control areas · asset register · applicability · permits ·
template & cadence · named inspector & device · baseline · team & roles
(BR-MOB-1..9). Each item is outstanding | satisfied | waived.
| ID | Requirement | Priority |
|---|
| FR-MOB-1 | The gate MUST be readable while incomplete, itemised (BR-MOB-11) | MUST |
| FR-MOB-2 | A waived item MUST name who accepted it and why | MUST |
| FR-MOB-3 | signed MUST require every item satisfied or waived | MUST |
3.6 ObligationInstance
identified → applicable → active → met | overdue → discharged | transferred | carried-forward
| From → To | Guard |
|---|
identified → applicable | bound to a project (FR-REG-1) |
applicable → active | project is operating, or the obligation binds earlier by its own terms |
active → overdue | derived for display from its due date — not a stored state (BR-ST-5) |
active → met | evidence recorded |
any → discharged / transferred / carried-forward | an explicit closeout decision, never expiry (BR-CLO-1, BR-ST-4) |
3.7 Permit
required → applied → issued → active → expiring → expired | renewed | surrendered
expiring is derived from the configured window (60 days today), not stored.
| ID | Requirement | Priority | Status |
|---|
| FR-ST-5 | Permit status MUST be derived from dates, not stored, so it cannot go stale | MUST | ✅ app/lib/permits.ts |
| FR-ST-6 | required and applied MUST exist so a site can report operating against an unissued permit (BR-MOB-5) | MUST | ❌ register starts at active |
3.8 Field aggregates
Specified in the field FRD; restated here so §3 is the complete state model.
| Aggregate | States | Key guard |
|---|
| NCR | open → assigned → actioned → verified → closed, reopenable | MUST refuse closed/corrected unless the latest corrective action is verified effective (FR-NCR-10) |
| Inspection | scheduled → in-progress → signed → delivered | delivered MUST require observed delivery (BR-X5) |
| Audit | scheduled → in-progress → findings-graded → concluded | major/minor MUST have raised an NCR; observation/OFI MUST NOT (BR-AU4/5) |
| Incident | reported → investigating → contained → closed → verified | occurrence time and report time are separate facts (BR-I2/I3) |
| Investigation | opened → evidence-gathered → cause-determined → actions-raised → concluded | conclusion MUST state the method used (BR-I7) |
3.9 Universal state rules
| ID | Requirement | Priority |
|---|
| FR-ST-7 | Every aggregate MUST be in exactly one state from a closed set; no null, unknown or inferred state | MUST |
| FR-ST-8 | Every transition MUST be an appended event with actor, timestamp and grounds | MUST |
| FR-ST-9 | A forbidden transition MUST be refused with a machine-readable reason code and a human sentence | MUST |
| FR-ST-10 | Terminal states MUST be reachable only by decision, never by elapsed time | MUST |
| FR-ST-11 | Derived states (overdue, expiring) MUST be labelled as derived and MUST show the facts they derive from | MUST |
| FR-ST-12 | The system MUST expose the legal transitions from any current state, so a UI never offers an action that will be refused | SHOULD |
4. Phase 1 — Bidding (FR-BID)
| ID | Requirement | Priority | Status |
|---|
| FR-BID-1 | Create a bid against a prospect, capturing client, contract reference and decision date | MUST | ❌ |
| FR-BID-2 | Assemble environmental scope by selecting from the obligation library | MUST | ❌ |
| FR-BID-3 | Record risk premium factors: receptors, watercourses, species-at-risk, contaminated ground, residential receptors, heritage | MUST | ❌ |
| FR-BID-4 | Compute committed inspector capacity across live projects and compare with this bid's demand | MUST | ❌ |
| FR-BID-5 | Produce a comparable-history pack: NCRs per inspection, median days to close, repeat-finding rate, regulator interactions, environmental delay — for projects matched on kind and scale | MUST | ❌ |
| FR-BID-6 | Where no comparable exists, state that explicitly rather than presenting an estimate as measured | MUST | ❌ |
| FR-BID-7 | Record a go/no-go decision with attached conditions, naming the director | MUST | ❌ |
| FR-BID-8 | Carry conditions forward on win, as obligation instances with origin = bid-commitment | MUST | ❌ |
| FR-BID-9 | Produce a prequalification pack from the register on demand | SHOULD | ❌ |
| FR-BID-10 | Retain lost bids with outcome and reason | MUST | ❌ |
| FR-BID-11 | Restrict bid visibility to a commercial audience | MUST | ❌ |
5. Phase 2 — Costing and planning (FR-CST)
| ID | Requirement | Priority | Status |
|---|
| FR-CST-1 | Compose a budget from lines: inspection labour, monitoring programmes, equipment, subconsultants, permit fees, remediation contingency | MUST | ❌ |
| FR-CST-2 | Derive inspection labour from cadence × duration × sites × rate | MUST | ❌ |
| FR-CST-3 | Price remediation contingency from measured history where available, recording the basis either way | MUST | ❌ |
| FR-CST-4 | Sign the budget; record signer and date; supersede rather than edit | MUST | ❌ |
| FR-CST-5 | Report consumed against signed, per project and portfolio | SHOULD | ❌ |
| FR-CST-6 | Capture permit lead times as dated constraints on the construction sequence | MUST | ❌ |
| FR-CST-7 | Capture environmental windows (in-water, nesting, spawning, SAR) as dated constraints with authority | MUST | ❌ |
| FR-CST-8 | Issue constraints to the planner as a dated list; record the issue as an event | MUST | ❌ |
| FR-CST-9 | Identify baseline monitoring that must precede commencement | MUST | ❌ |
| FR-CST-10 | Record a breached or waived constraint with the authority that permitted it | MUST | ❌ |
| FR-CST-11 | Surface forthcoming constraints on the operating dashboard (Q6) | MUST | 🟡 panel exists, honestly empty |
6. Phase 3 — Onboarding (FR-MOB)
| ID | Requirement | Priority | Status |
|---|
| FR-MOB-4 | Create a project: identity, client, contract, kind | MUST | ❌ no create path at all |
| FR-MOB-5 | Capture a boundary — paste GeoJSON or import from OSM by bounding box are the recommended first two | MUST | ❌ alignments are hand-authored TS literals |
| FR-MOB-6 | Define control areas, each with a category | MUST | ❌ |
| FR-MOB-7 | Register assets, or record that there are none | MUST | ❌ |
| FR-MOB-8 | Establish applicability: bind obligations and permits to the project | MUST | ❌ |
| FR-MOB-9 | Reconcile bid commitments against bound obligations and report the difference (FR-REG-4) | MUST | ❌ |
| FR-MOB-10 | Record permits as required / applied / issued, with dates | MUST | 🟡 register has no pre-issue states |
| FR-MOB-11 | Assign inspection template and cadence | MUST | ❌ one hardcoded template |
| FR-MOB-12 | Assign a named inspector and a device | MUST | ❌ actors are strings |
| FR-MOB-13 | Capture baseline, or record its absence with a reason | MUST | ❌ |
| FR-MOB-14 | Assign team and roles including sign-off authority | MUST | ❌ no role model implemented |
| FR-MOB-15 | Present the gate itemised, with outstanding items visible | MUST | ❌ |
| FR-MOB-16 | Record the mobilisation sign-off, naming the director | MUST | ❌ |
7. Phase 5 — Closeout (FR-CLO)
| ID | Requirement | Priority | Status |
|---|
| FR-CLO-1 | At practical completion, list every obligation with a required decision: discharge, transfer or carry forward | MUST | ❌ |
| FR-CLO-2 | Produce a handover register of carried-forward obligations with owners and cadences | MUST | ❌ |
| FR-CLO-3 | Retain monitoring cadence and reporting route for surviving obligations | MUST | ❌ |
| FR-CLO-4 | Record the retention period per project; refuse disposal before it elapses | MUST | ❌ |
| FR-CLO-5 | Produce a closeout report reconciling phase-1 promise against phase-4 record (BO-11) | MUST | ❌ |
| FR-CLO-6 | A closed project is read-only for capture and fully readable for challenge | MUST | ❌ |
8. Cross-cutting
| ID | Requirement | Priority | Status |
|---|
| FR-LC-8 | Every phase gate MUST be an approval carrying approver and grounds — the same decision primitive as every other approval | MUST | ❌ no approval vocabulary in any layer |
| FR-LC-9 | Phase-scoped visibility MUST follow the role model; bid data is not operating data | MUST | ❌ |
| FR-LC-10 | The portfolio view MUST show projects in every phase, not only operating | MUST | 🟡 /v2/director shows a phase strip whose pre-award columns are labelled fixtures |
| FR-LC-11 | No figure derived from a phase that does not exist may be presented as measured | MUST | ✅ BasisTag grades derived / fixture / not-captured |
| FR-LC-12 | Where the record cannot answer, the surface MUST say so rather than render zero | MUST | ✅ AbsentPanel |
9. Interfaces
| ID | Requirement | Priority | Status |
|---|
| FR-IF-10 | Constraints MUST be exportable to the scheduling tool that owns the programme | SHOULD | ❌ |
| FR-IF-11 | The budget MUST be exportable to the commercial system of record | SHOULD | ❌ |
| FR-IF-12 | The handover register MUST be exportable to whoever owns the asset after closeout | SHOULD | ❌ |
| FR-IF-13 | The obligation library SHOULD be importable from a regulatory source rather than hand-typed | COULD | ❌ |
10. Gap register
Ordered by what blocks the most.
| # | Gap | Blocks | Note |
|---|
| 1 | Project has no lifecycle state | every phase requirement | CG-7. Decide widened aggregate vs pre-award aggregate |
| 2 | No approval vocabulary | every phase gate | Same primitive the field processes need |
| 3 | No identity | every signature | Actors are strings |
| 4 | No applicability model | FR-REG-1..8, FR-MOB-8/9 | Registers bind to nothing |
| 5 | No write store in the console | all of §4–§7 | Partly resolved on the working branch |
| 6 | project singular in the signed claim | any portfolio-phase view | RD-1 |
| 7 | No obligation library | FR-BID-2, FR-REG-5 | Registers are per-instance today |
| 8 | No comparable-history query | FR-BID-5 | The data exists; the query does not |
| 9 | The TSD is cited by code and absent | traceability | DP-14 |
10.1 Recommended sequence
- Decide CG-7, then add lifecycle state — nothing else in this document is buildable first
- Approval vocabulary + identity — shared with the field processes, so it pays twice
- Applicability, which makes the registers mean something per project
- Phase 3 mobilisation — the first phase to build, because it is the first write and it forces 1–3
- Phase 2 constraints before phase 2 costing — the constraints are the part that cannot be recovered with money
- Phase 1 once history is queryable
- Phase 5 last; it is the least urgent and the best understood
11. Verification
| Requirement | How it is proven |
|---|
| FR-ST-7..11 | A state-machine conformance test per aggregate: every legal transition succeeds, every illegal one is refused with a reason code, and no aggregate reaches a state off the closed set |
| FR-ST-3, FR-ST-4 | Seeded fixtures attempting the forbidden transition; the test asserts refusal, not absence of crash |
| FR-REG-4 | A fixture where a bid commitment is dropped at mobilisation; the reconciliation report must name it |
| FR-BID-5 | A fixture with no comparable project; the pack must say so rather than emit an estimate |
| FR-CST-10 | A window that closes with no evidence must produce breached, not silence |
| FR-MOB-3 | A gate with one outstanding item must refuse signed |
| FR-LC-11/12 | A surface fed a phase with no data must render "not captured" and must not render 0 |
| FR-CLO-4 | Disposal attempted inside the retention period must be refused |
The verification bar is the same as the golden gate's: a test that asserts a
targeted violation per seeded mutation, not a test that passes because nothing
happened.