Business Requirements Document — ESG Field Processes
Scope: the four field processes that must be captured end to end, and the standard of usability they must be captured to. Status: draft for review. Date: 2026-07-29. Revision B — §2 corrected against observed evidence; §3 and §5.6 add usability as a business requirement. Companions:
- FRD-field-processes.md — the functional specification derived from this document.
- GAP-ANALYSIS-console-vs-build.md — the deployed console compared with the repository. Revision B of §2 is drawn from it, and corrects Revision A in both directions.
- UX-simplicity-design-and-plan.md — the simplicity standard behind §5.6.
1. Purpose
Four distinct business processes have been identified as the ones the ESG product must capture properly:
| # | Process | Nature | Unit of work |
|---|---|---|---|
| 1 | NCR | A ticket | One non-conformance, owned and closed out |
| 2 | Site inspection | A walk | The whole site, section by section |
| 3 | Internal / external audit | A walk | Full site walkabout, section by section |
| 4 | Incident reporting → investigation → report | A case | One event, investigated, reported |
This document states what the business needs from each, and what the current build does and does not do about it. It is deliberately organised by process, not by screen or by data structure.
1.1 A note on tri-state
Prior design work treated the tri-state control — satisfactory / deficient / N-A per checklist item — as the organising abstraction of field capture. It is not. Tri-state is a presentation and print-fidelity control belonging to one form (the ONxpress weekly environmental inspection), pinned by the golden PDF fixture in reference/Test_Aecon_Report_Structure.md and declared in packages/esg-inspection-template/src/index.ts.
It remains a requirement of the inspection report output. It is not the model for the four processes above, and it does not describe an NCR, an audit finding, or an incident at all. Requirements in this document are therefore expressed in terms of work objects and their lifecycles; tri-state appears only where the ONxpress form output is concerned (BR-S5).
2. Current state (as-is)
Assessed against the repository on 2026-07-29. Three independent layers exist, and they do not meet.
2.1 Platform event vocabularies — substantially built
| Process | Package | Lifecycle already contracted |
|---|---|---|
| NCR / corrective | packages/esg-events-corrective/src/index.ts | raised → assigned → remediation → verify → closed, plus derived overdue, an origin split, and a severity ladder with a material threshold |
| Site inspection | packages/esg-events-inspection/src/index.ts, packages/esg-inspection-template/src/index.ts | CheckResponded, PhotoCaptured, IssuePhotoAttached, InspectionSigned, InspectionReviewed; 9 sections / 34 items |
| Incident | packages/esg-events-incident/src/index.ts | reported → investigating → contained → closed / verified; typed classification, notification deadline, obligation linkage, corrective spawn |
| Report | packages/esg-events-report/src/index.ts | draft → in-review → final → submitted → superseded; kinds include incident-notification |
| Audit | none | — nothing exists — |
2.2 The console at esg.cogneris.com — a demo shell that cannot persist
The site could not be observed. Every path probed on 2026-07-29 returns HTTP 302 to cogneris.cloudflareaccess.com — /, /app, /demoapp, /inspections, /api/inspections, /favicon.ico and static assets alike. There is no Access-exempt route on the hostname and no cached credential on the assessing workstation. Revision A of this section reported 403 and asserted that app "is that deployment"; both were imprecise. The identification is now stated as what it is — a strong inference, from wrangler.jsonc (one deployable worker, esg-web) and from apps/esg-field/app/index.tsx:4 citing esg.cogneris.com/app, a route that exists on main and not on the current branch. The live site is main. Closing this properly is DP-5.
Navigation exposes twelve entries (app/components/ConsoleShell.tsx), not eleven, and two of them are the same route (/app, listed as both "Field app" and "Field App"). Of thirteen routes, two read or write data — and both are the two that cannot run on the deployment target:
| Fact | Consequence for the business |
|---|---|
Nine surfaces (Live Brief, My Work, Conversations, Compliance, Permits, Decision Log, Obligations, Reporting, Voice) are hardcoded literals in app/lib/*.ts | The console demonstrates capability it does not have. Their derivation logic is real and reusable — see §2.7 |
app/lib/db.ts persists via node:sqlite to a local file (./.data/esg.db), and wrangler.jsonc declares zero bindings — no D1, no KV, no R2 | The three flat tables Revision A described exist on a developer's laptop only. The deployed console has no server-side store at all. Work would have nowhere to land even if a device could send it |
/admin — the only surface that inspects what capture wrote — is gated to localhost by middleware.ts and returns 404 to any other caller | Nobody in the office can audit captured records, by design |
None of the four processes has a working console surface, including inspection. There is no NCR ticket, no audit, no incident and no investigation anywhere in the console.
2.3 The React Native field app — capture without completion
apps/esg-field holds a durable append-only event log (apps/esg-field/lib/store), inspection capture, on-device report generation, and an NCR submission client. Its gaps:
- The NCR ticket lifecycle is built, and now reachable — BO-2 is met on the device. Revision A reported that "nothing assigns, corrects, verifies or closes". That was wrong when written and is now doubly so.
apps/esg-field/lib/ncr/ticket.tsimplements the whole ladder (raise, assign, record corrective action, verify, close, reopen, overdue) as a fold over the append-only log, and as of2bf7e93the inbox → raise → detail flow is routed into the shell (apps/esg-field/app/index.tsx:84). A lone operator can now run a non-conformance from raise to verified closure on a handset. What they cannot do is let anyone else see it (§2.5). - No audit, no incident, no investigation — not modelled, not captured, no screens. Worse: the app offers a "New investigation" button that creates an investigation as a template-less inspection, which is the wrong shape for the process (§5.4).
- Voice capture is present but unproven. The app ships a 99 MB on-device Whisper model (three int8 tiers exist; tiny is installed), byte-verified and correctly wired. No one has completed a real transcription on a device. Voice is the input the field workflow leans on hardest — dictating a finding is the alternative to typing in gloves — so an unproven engine is an unproven process, not an unproven feature.
- Nothing reaches a server.
workers/esg-syncis unreachable from a handset (it demands an HMAC gateway assertion a device cannot mint), and the console route is behind Cloudflare Access. This is documented in the client itself atapps/esg-field/lib/ncr/api.ts:14. - The field app declares no dependency on the
@esg/*packages, so the contracted vocabularies in §2.1 govern nothing that runs on a device.
2.4 The delivery boundary is severed twice, both outside the app
BO-6 fails at the first hop, and it is important for planning that neither cause is in application code:
- Cloudflare Access blocks at the edge, before any app code runs.
middleware.tsmatches only/adminand/api/admin, and no middleware can exempt a route from Access — Access adjudicates before the worker is invoked. A device cannot be let in by changing the app. - Even a successful POST would land nowhere.
wrangler.jsoncdeclares zero bindings andapp/lib/db.tswrites a localnode:sqlitefile (§2.2).
Both are operations/configuration decisions (DP-1, and now DP-5). No amount of field-app work moves them.
2.5 The server estate is not deployed
Eleven of the twelve workers under workers declare no route and no custom domain; only esg-sync and esg-memory are addressable at all. The CQRS write plane, the projection runner and the query front door are scaffolded and unpublished. Resolving Access alone would therefore still not produce a reachable ingest — there is no deployed ingest to reach.
2.6 Usability is a business gap, not a polish item
Two findings belong here rather than in a design document, because each changes whether a record is defensible or whether the tool gets used at all:
- The field tool's design authority is a web page.
apps/esg-field/app/index.tsx:4andapps/esg-field/ui/theme.ts:1state that the handset app is a port ofesg.cogneris.com/appand its design tokens are "ported from the web design system" — and the page being ported simulates a phone, complete with a fake bezel. Geometry, type and interaction for a gloved, one-handed, outdoor tool were decided in a desktop browser. - The inspection walk opens pre-answered.
apps/esg-field/screens/InspectTab.tsx:4: the inspection "opens pre-filled from the baseline (so progress reads full)". This manufactures the precise claim BR-S2 exists to forbid — sections reported inspected-and-compliant that nobody attested. It is the only defect in this document that actively fabricates evidence, and it does so in the name of simplicity.
2.7 Summary of the gap
| Process | Vocabulary | Device capture | Console | Delivery | Verdict |
|---|---|---|---|---|---|
| 1. NCR ticket | ✅ | ✅ full ticket lifecycle, routed (2bf7e93) | ❌ | ❌ | Closes out on the device; invisible to the office |
| 2. Site inspection | ✅ | ⚠️ captured and reported, but coverage is fabricated (§2.6) | ❌ no working surface | ❌ | Captured, never delivered, and not yet defensible |
| 3. Audit | ❌ | ❌ | ❌ | ❌ | Absent entirely |
| 4. Incident → investigation → report | ⚠️ partial | ❌ (and offered in the wrong shape) | ❌ | ❌ | Contracted, never built |
The single most consequential finding is unchanged: no process in scope completes end to end. Work captured on a device stays on that device — and now stays there in greater volume, because the device does more.
3. Business objectives
| ID | Objective | Measure of success |
|---|---|---|
| BO-1 | Each of the four processes is capturable start to finish, offline, on a phone | An operator completes each process with no connectivity and loses nothing |
| BO-2 | A non-conformance is owned and closed out, not merely observed | Every NCR has an owner, a due date, and a verified closure or a stated reason it was not corrected |
| BO-3 | An audit is a first-class process, not an inspection with a different label | Internal and external audits produce audit reports citing graded findings |
| BO-4 | An incident produces an investigation, and an investigation produces a report | Root cause and corrective actions are traceable to the incident that triggered them |
| BO-5 | Records are defensible under challenge | Every claim in a report traces to a captured event with author, time, and evidence binding |
| BO-6 | Captured work reaches the office | A submitted record is visible in the console without manual intervention |
| BO-7 | The tool is faster than the paper form it replaces, and needs no training | A field worker who has never seen the app completes a finding — capture, confirm, save — unassisted, median under 30 seconds. 90% of first-time users complete the full journey unassisted |
| BO-8 | The operator always knows whether the office has the record | No user, at any point, mistakes saved on this device for received by the office. Delivery state is stated in words, never implied by an animation |
| BO-9 | Speed is never bought with a claim nobody made | No screen, default or shortcut causes the record to assert coverage, a verdict, a location or a conclusion that no person supplied |
BO-7 is a business objective because adoption is a business risk: a compliance tool that is slower than the clipboard is filled in at the truck at the end of the day, from memory, which defeats BO-5 entirely. BO-9 is the constraint on BO-7 — and where they conflict, BO-9 wins (BR-U6).
4. Stakeholders
| Role | Interest |
|---|---|
| Field inspector / environmental tech | Captures inspections and raises NCRs on site, often without signal |
| Site supervisor / foreman | Owns assigned NCRs, records corrective work |
| Environmental manager | Verifies closures, reviews reports, answers to the client |
| Internal auditor | Conducts scheduled internal audits against a standard |
| External auditor / client representative | Conducts audits; consumes reports as evidence of conformity |
| Regulator | Ultimate consumer of notifiable-incident reports |
| Project owner (ONxpress CJV) | Requires inspection reports in the pinned ONxpress format |
5. The processes
5.1 Process 1 — NCR (ticket)
A single non-conformance, raised and driven to closure. It is a ticket, not a row inside a walk. Every stage after "raised" happens after the walk that found it has finished, and an NCR may equally be raised standalone with no walk in progress.
Lifecycle: raised → assigned → corrective action recorded → verified → closed. Reopening is possible.
| ID | Business rule |
|---|---|
| BR-CA2 | An NCR is a record in its own right with its own identity and lifecycle, independent of any inspection or audit that raised it |
| BR-CA3 | An NCR may be raised standalone, or from a finding during an inspection or audit; when raised from a walk, that walk is recorded as its origin |
| BR-CA4 | An NCR must carry an owner and a due date once assigned, and must be reportable as overdue against them |
| BR-CA5 | An NCR must not be closable as corrected unless corrective work has been recorded and verified |
| BR-CA6 | An NCR raised in error must be closable as not a non-conformance — retracting the finding without asserting a correction that never happened |
| BR-CA7 | Where the same person performs and verifies the corrective work, the record must disclose it rather than prohibit it — a lone technician is a real operating condition |
| BR-CA8 | Correction dates are the dates work was done, which may precede the date it was recorded |
5.2 Process 2 — Site inspection (section-by-section walk)
The inspector traverses the whole site, working through each section of a governing checklist. Output is the ONxpress-format inspection report.
| ID | Business rule |
|---|---|
| BR-S1 | An inspection walks a defined template of sections; the section sequence is the unit of progress |
| BR-S2 | Coverage and conformity are separate facts. That a section was reached and inspected is a claim about the inspector; that it was compliant is a claim about the site. A section with no finding recorded against it must never be reported as inspected-and-compliant unless coverage was actually attested |
| BR-S3 | An inspector must be able to attest a whole section at once, and the record must state which was done — whole-section attestation or item-by-item — because that is what a challenge to the record turns on |
| BR-S4 | A section the inspector could not reach must be recordable as not reached, with a reason |
| BR-S5 | The inspection report must reproduce the pinned ONxpress structure, including the tri-state control per item, photo watermarking (timestamp, GPS, address), and multi-party signature |
| BR-S6 | Findings raised during the walk become NCRs under BR-CA3; the inspection does not own their closure |
| BR-S7 | An inspection must be completable offline in full, including its report |
5.3 Process 3 — Internal and external audit (full site walkabout)
Structurally a walk like an inspection, and a different business process. The audit is currently absent from the product and is the largest gap in scope.
| ID | Business rule |
|---|---|
| BR-AU1 | An audit is conducted against a standard or scope (clauses, programme elements), which may not be the same thing as an inspection checklist |
| BR-AU2 | An audit records whether it is internal or external, and the auditor's identity and organisation — an external auditor is not an employee and the record must reflect that |
| BR-AU3 | Audit findings are graded: major non-conformance, minor non-conformance, observation, opportunity for improvement. This grading is not the same vocabulary as an inspection item verdict |
| BR-AU4 | A major or minor non-conformance must raise an NCR under BR-CA3; the audit report cites those tickets, and closing them is the NCR process, not the audit |
| BR-AU5 | An observation or opportunity for improvement must not create an NCR — recording an improvement idea as a non-conformance misstates the audit |
| BR-AU6 | An audit produces an audit report distinct from an inspection report: scope, standard, auditor, findings by grade, and conformity conclusion |
| BR-AU7 | Audit coverage is subject to BR-S2 exactly as inspection coverage is |
5.4 Process 4 — Incident reporting → investigation → report
Three chained stages, each a distinct record.
| ID | Business rule |
|---|---|
| BR-I2 | An incident is reportable by anyone on site, immediately, with minimal ceremony — the first record must be fast to create |
| BR-I3 | When an incident occurred is not when it was reported. Both must be captured and never conflated |
| BR-I4 | A notifiable incident carries a notification deadline that a person is accountable for closing |
| BR-I5 | Immediate actions taken (make safe, contain, evacuate) are part of the incident record, distinct from later corrective action |
| BR-I6 | An investigation is opened from an incident and is a case in its own right: evidence, witness statements, a timeline, and a root-cause determination |
| BR-I7 | An investigation must state the method used to reach root cause, and must not present a conclusion as though evidence compelled it when it did not |
| BR-I8 | An investigation concludes in a report; recommended corrective actions raise NCRs under BR-CA3 |
| BR-I9 | An investigation report may be superseded by a later revision; the earlier version is retained, never overwritten |
5.5 Cross-cutting business rules
| ID | Business rule |
|---|---|
| BR-X1 | All four processes must be fully operable offline; connectivity is not a precondition for any capture |
| BR-X2 | Records are append-only. A correction is a new record; nothing is edited or deleted after the fact |
| BR-X3 | Evidence (photo, audio, signature) is bound at capture to time, author, and location where available |
| BR-X4 | Where location, transcription, or any other input is unavailable, the record says so. The system never substitutes an invented value |
| BR-X5 | The system must never report a submission as delivered unless delivery was observed |
| BR-X6 | An NCR is the single closure mechanism for a non-conformance found by any process — inspection, audit, or investigation |
5.6 Usability business rules
The product sentence, adopted from the revised end-to-end set: capture what happened, confirm the record, send it, and know it arrived. These rules are business requirements because each one, if broken, produces either an unusable tool or an indefensible record.
| ID | Business rule |
|---|---|
| BR-U1 | On every screen the user can answer five questions without help: what am I doing, what did the system capture, what must I confirm, what happens next, did it arrive |
| BR-U2 | Camera, voice and typing are three inputs to one capture action. None of them is a separate destination the user must find |
| BR-U3 | Delivery is reported in distinct, plainly-worded states — signed and saved · queued · sending · received · not received — never as a single checkmark and never as a spinner over work already safely stored (extends BR-X5) |
| BR-U4 | Machine-generated content — transcript, summary, extracted fields — is labelled as a draft and is a person's to accept or edit. It may not mark coverage, sign, submit, close a ticket, or invent a fact. The original media, the original transcript, the human edit and the accepted record remain separately recoverable (extends BR-P2, BR-X4) |
| BR-U5 | The interface uses the words the business uses — inspection, finding, NCR, incident, audit, submit, received, report — and not invented product vocabulary |
| BR-U6 | Where a usability shortcut and an honest record conflict, the honest record wins. No default may pre-answer a question the record then attributes to a person. A deliberate increase in interaction is the correct trade for a defensible claim (governs BO-7 by BO-9) |
| BR-U7 | The tool is operable one-handed, in gloves, in daylight, by a user who has not been trained on it |
| BR-U8 | A demonstration must be visibly labelled as such. Seeded data may never imply that capture, delivery or reporting works where it does not |
BR-U6 is the load-bearing one, and it is what §2.6's pre-fill defect violates.
6. Assumptions
| ID | Assumption | Risk if wrong |
|---|---|---|
| AS-1 | The ONxpress weekly environmental inspection is the governing template for process 2 at present; other templates follow the same section/item structure | Template model needs generalising earlier |
| AS-2 | Audit findings grade to the four-way major/minor/observation/OFI ladder (ISO-style) | BR-AU3 vocabulary must be restated |
| AS-3 | The device may hold the full NCR lifecycle including verification and closure | If closure is office-only, the NCR aggregate shrinks and BR-CA7 disappears |
| AS-4 | One person may hold several roles on a small site | Segregation-of-duty rules would tighten BR-CA7 |
| AS-5 | Cloudflare Access can be configured to admit a device service token, or an exempt ingest route can be provided | BO-6 is unachievable and every process ends on the device |
7. Dependencies
| ID | Dependency | Owner |
|---|---|---|
| DP-1 | Cloudflare Access accommodation for device ingest (see §2.3, AS-5) | Operations |
| DP-2 | Confirmation of the audit standard/clause set for BR-AU1 | Environmental manager / client |
| DP-3 | Regulatory notification deadlines per incident type for BR-I4 | Compliance |
| DP-4 | Identity and role assignment for assignment and verification | Operations |
| DP-5 | Cloudflare Access credential for the office and for CI — without it the deployed console cannot be reviewed, and §2.2's identification of it stays an inference (see §2.2, §2.4) | Operations |
| DP-6 | A published, addressable ingest worker — eleven of twelve declare no route (§2.5) | Operations / Platform |
| DP-7 | A field user, a handset, gloves and a bright afternoon, for the BR-U7 usability and legibility test | Environmental manager |
8. Out of scope
- Contractor-facing or client-facing portals.
- Any web or responsive-web field client. Field clients are React Native, iOS and Android.
- Automated root-cause inference. BR-I7 requires a stated human method.
- Changes to the pinned ONxpress report format.
9. Open decisions for the business
| ID | Decision | Why it matters |
|---|---|---|
| OD-1 | Is an NCR the same object as a corrective action, or does an NCR contain corrective actions? | packages/esg-events-corrective/src/index.ts already models the lifecycle. If they are the same, no new aggregate is needed; if an NCR can carry several corrective actions, it is a distinct parent record. Recommendation: distinct parent, because BR-CA6 (retracting a finding) is a statement about the finding, not about a remedy |
| OD-2 | Do internal and external audits differ beyond auditor identity and scope? | Determines whether BR-AU2 is one process with a flag or two processes |
| OD-3 | Must an investigation exist for every incident, or only above a severity threshold? | Drives whether investigation is automatic or elective |
| OD-4 | Who may verify an NCR closure? | BR-CA7 discloses self-verification; a business rule prohibiting it would change the requirement |
| OD-5 | Is the console or the device the system of record for NCR closure? | Affects conflict handling when both touch one ticket. Now urgent: as of 2bf7e93 the device closes tickets and the console cannot see them, so the device is the system of record by default rather than by decision |
| OD-6 | Is the deployed console a demo or a product? | §2.2 has no correct remedy until this is settled — either bind a real store, or stop the surfaces claiming one (BR-U8) |
| OD-7 | Confirm BR-U6: the honest inspection walk costs ~9 deliberate attestations where the pre-filled walk costs none. Accept the added interaction? | This is a deliberate reduction in apparent speed to buy a defensible record. It needs an explicit business yes, not a design assumption |
| OD-8 | Is transcription on-device by default with cloud as an enhancement, or the reverse? | A construction site is where connectivity fails and dictation is the alternative to typing in gloves. The app already ships both paths; the default is undecided. Recommendation: on-device default, so BR-X1 holds for voice as it does for everything else |
| OD-9 | Do the five shipped tabs — Today, My Brief, Speak, Capture, My Work — have five distinct jobs? | Three of them can read as "what needs me". If they do, BR-U1 fails and the answer is content, not navigation |
10. Traceability
Business rules map to functional requirements in FRD-field-processes.md §9. The usability rules added in §5.6 map to the FR-UX family in FRD §6.5; BR-U6 — the honest record beats the shortcut — is carried by FR-UX-4 and is the requirement §2.6's pre-fill defect violates.
Existing rule identifiers found in the codebase (BR-A1, BR-CA1, BR-I1, BR-P2, BR-P3, BR-P4) are referenced by the platform packages but have no document behind them in this repository. New identifiers above extend those families rather than renumbering them; reconciling the originals requires the source document, which was not available.
BR-P2 is the exception worth noting: it is not only documented elsewhere but enforced in CI by scripts/guard-no-llm-in-proof-chain.mjs via .github/workflows/security-guards.yml, which is what makes BR-U4 (machine output is always a draft) a constraint the build already checks rather than a policy the team must remember.
Revision B changes. §2.2 corrected (302 not 403; no store on the deployment target; twelve nav entries, nine hardcoded). §2.3 corrected — the NCR lifecycle is built and routed; Revision A's "no lifecycle anywhere" is withdrawn. §2.4–2.6 added (the twice-severed boundary, the undeployed server estate, usability as a business gap). §2.7 matrix updated. BO-7/8/9, §5.6 BR-U1…BR-U8, DP-5/6/7 and OD-6…OD-9 added.