The portal's users, roles and role requirements
Status: PROPOSAL. Written 2026-08-03 by Claude Opus 5 (Claude Code) at Pete's request: *outline all of the users, roles and the requirements for those roles* for the portal.
Basis. The live deployed console at https://esg-web.sequents.workers.dev/
(esg.cogneris.com returns HTTP 403 behind Cloudflare Access), read against the
source in app, apps/esg-field,
packages and workers. Every claim about what
exists today is cited to a file and line.
Scope, corrected by Pete on 2026-08-03 and binding on this document. Everything built, and everything currently in flight, is OPERATIONAL — environmental review, inspection, NCR, incident and investigation, audit. There is no planning, no costing and no bidding activity, and no role in this document holds authority over any of them. Where PERSONA §2 describes four project phases, only the fourth — managing — is in scope here. Phases 1–3 (bid · cost·plan · onboard) are recorded in §4.1 as parked, so that when they arrive the authorities are already named and nobody re-derives them; nothing in §6 grants them today.
Domain scope — the E, not the S or the G. Asked directly on 2026-08-03 and
answered honestly: everything here is environmental compliance on operating
construction sites. Nothing in this document, and nothing in the product,
covers the social or governance/disclosure sides of ESG. The console's own
module switcher says as much — ESG · Environmental is active, while
GRC · Governance, Risk & Compliance and HSM · Health & Safety Management
are declared and inactive
(app/components/ConsoleShell.tsx:131) —
and a word-boundary search of the repository for GHG, carbon, GRI, SASB, ISSB,
TCFD, CSRD, Indigenous engagement, social value, human rights, modern slavery or
local content returns nothing outside vendored third-party headers. If S and
G come into scope they bring roles that do not exist here — a disclosure /
sustainability lead, a community and stakeholder liaison, a social-value or
local-content officer, an external assurance provider (which is not an
auditor), and a supply-chain owner — and a different record model: periodic
aggregate reporting over a defined boundary, rather than append-only site
events. Do not stretch these ten roles to cover it.
This is the specification half of WORKLIST item R2 — *"approval vocabulary +
role and access model"*, currently [!] blocked: not started — and of
primitive P2 in PORTAL-proposal §5. It does not build
anything. It says who the users are, what a role is, what each role may and may
not do, and what the record must say about them.
Read with PERSONA-environmental-director.md (the portfolio reader), PORTAL-proposal.md (the surface), PORTAL-boardroom-and-modules.md (the four audiences the record is cut for — board · client · regulator · management, which are consumers, not roles: one derivation, four renderers), BRD-field-processes.md §4 (stakeholders and the business rules every authority below traces to) and FRD-field-processes.md §6 (FR-X-8, FR-SEC).
0. What is actually true today, before any of this is proposed
Stated first so nothing below reads as nearer than it is.
| # | Fact | Evidence |
|---|---|---|
| 0.1 | A closed role enum already exists in shipped code — inspector · reviewer · manager · admin, with an explicit per-surface allow-list in three bands (field-and-oversight / oversight / audit) | workers/esg-query/src/authz.ts:50, workers/esg-query/src/authz.ts:325, workers/esg-query/src/authz.ts:346 |
| 0.2 | It governs reads only. FR-X-8 — "role-based access governs who may assign, verify and close" — is marked ⚠️ against exactly this file | FRD §6 |
| 0.3 | The field app has no identity at all. inspectorId is the literal string "device" everywhere it is written, and the code says so in a comment | apps/esg-field/screens/inspect/TaskFlow.tsx:262, apps/esg-field/screens/inspect/TaskFlow.tsx:636 |
| 0.4 | The console's ingest endpoint defaults the author to "device" too | app/api/ncrs/route.ts:90 |
| 0.5 | Where actors are named, two incompatible vocabularies are in use. NCR assignment holds a job title — assignee: "Site super", "HSE lead", "Env monitor" — while the ledger holds a person — signedBy: "D. Osei · Environmental Manager". A title is not attributable: two people can both be "Site super" and the record cannot say which one owed the work | app/lib/ncr.ts:89, app/lib/ncr.ts:211, app/lib/ledger.ts:55 |
| 0.6 | The console's own operator is a title, not a user — OPERATOR = { name: "Environmental Manager", greetingName: "Marie" }, a literal | app/lib/mywork.ts:62 |
| 0.7 | The only access boundary in the console is loopback, with a documented interim residual risk, pending "real authn/authz and org identity" | app/lib/admin-access.ts:42 |
| 0.8 | The signature model already has two roles — Inspector and Site Representative — and they are the only role concept that reaches a signed artefact today | apps/esg-field/screens/SignoffSheet.tsx:45 |
| 0.9 | Cloudflare Access is a perimeter, not an identity. It decides who may reach the origin. It puts no name in any record, and nothing downstream reads it | operational |
The consequence, plainly: every governance authority described in the decks is currently a button that anyone who can reach the origin may press, recorded against nobody. Roles are not a hardening pass on this system. They are the precondition for the record being worth keeping.
1. Five things that are routinely conflated, and are not the same
The whole model below depends on keeping these apart.
| Term | Definition | Example |
|---|---|---|
| User | A human with credentials who signs in and acts | Marie, environmental manager on ONxpress |
| Party | A named actor on a record who may never sign in | The regulator (MECP); the crew that performed a correction |
| Role (band) | The coarse authority class carried in the signed session claim | manager |
| Scope | Which rows the role may see and act on — tenant · project(s) · sites | allowedSites: ["woodbine", "exhibition"] |
| Grant | A single named capability — one governance verb on one object class | ncr.close.retract |
Two further distinctions that the current code violates:
- An identity in the record is not a login. A crew member who did the work, a site representative who countersigned on a phone, an external auditor — all must be nameable on a record without ever holding an account. Requiring a login to be named is how systems end up recording
"device". - A role is not a job title. "HSE lead" is an organisational fact that changes without any system event.
manageris an authority the system grants and revokes. Storing the first where the second belongs is defect 0.5.
2. The users and parties
Thirteen actors appear across the decks, the BRD, the console data and the field app. Not all of them are users.
| # | Actor | Relationship | Signs in? | Where they work | Appears today as |
|---|---|---|---|---|---|
| U1 | Field inspector / environmental technician | employee | yes — device | esg-field app | "device" (apps/esg-field/screens/inspect/TaskFlow.tsx:262); Inspector signer |
| U2 | Environmental monitor — specialist, frequently subcontracted | employee or subcontractor | yes — device | esg-field app | assignee: "Env monitor", permit holder |
| U3 | Site supervisor / superintendent / foreman | employee (delivery, not environment) | yes — portal, narrow | portal: assigned work only | assignee: "Site super", "Earthworks super", "Night super" |
| U4 | HSE lead | employee | yes — portal | portal: assigned work, own project | owner: "HSE lead" |
| U5 | Environmental manager — one project, in delivery | employee | yes — portal | portal: project workspace | OPERATOR literal; signedBy: "D. Osei · Environmental Manager" |
| U6 | Environmental director — every project, operationally | employee | yes — portal | portal: portfolio lens + decision queue | PERSONA doc; nothing in code |
| U7 | Internal auditor | employee, independent of the audited site | yes — device + portal | esg-field (walk) + portal (report) | absent — audits are unbuilt (BRD §5.3) |
| U8 | External auditor | not an employee (BR-AU2) | yes — time-boxed, read + audit capture | portal, scoped and dated | absent |
| U9 | Client representative | not an employee | yes — read-only, released records only | portal, released reports only | client: "Metrolinx", "Aecon", "Meridian Retail Trust", "STC" |
| U10 | Platform administrator / operator | employee (ours) | yes — platform surfaces | /admin, provisioning | loopback-gated (app/lib/admin-access.ts:42) |
| P1 | Site representative — countersigns a walk on the inspector's device | may be anyone on site | no | signature pane only | Site Representative signer (apps/esg-field/screens/SignoffSheet.tsx:46) |
| P2 | Crew / operator / vendor — performs corrective work | subcontractor or employee | no | named on the action | by: "Earthworks crew", "Vendor" |
| P3 | Regulator — MECP, TRCA | external authority | never | consumes notifiable reports | authority: "MECP · Spills", issuer: "MECP · EASR" |
| P4 | Board / JV board | internal governance | no — receives the pack | quarterly board pack (PORTAL-boardroom-and-modules.md) | absent |
And one non-human actor, which is the most important row in the table because it is the one most likely to be given authority by accident:
| # | Actor | Authority |
|---|---|---|
| N1 | Rita — one per identity, not one for the system (see §3.4) | None. Ever, in any of her instances. She may draft, summarise, rank and propose. She may not mark coverage, sign, submit, close a ticket, assign an owner, or supply a value no person or sensor produced (FR-UX-9, BR-U4, BR-P2/FR-SEC-5, enforced by scripts/guard-no-llm-in-proof-chain.mjs) |
| N2 | The device | A device is a bearer of a key, not an actor. It attests where and when a record was captured. It never attests who — that is U1's credential, bound at sign-in |
3. The role model
3.1 The rule: one enum, three axes
Keep the four bands that already ship. inspector · reviewer · manager ·
admin (workers/esg-query/src/authz.ts:50) is a closed enum
enforced on the read plane with an explicit per-surface allow-list. A second,
richer enum invented for the portal guarantees the read plane and the write
plane will disagree about who someone is — and the disagreement will surface as
a person who can approve a thing they cannot see.
Everything the thirteen actors need is expressible as band × scope × grants, without a fifth band:
- Band — the coarse class, carried in the signed session claim. Decides which surfaces exist for you.
- Scope —
tenant·project·allowedSites, already the signed vocabulary (workers/esg-query/src/authz.ts:59). Decides which rows. An empty axis reads nothing — never "all". - Grants — named capabilities. Decide which verbs. This is the new part; nothing in the repo has it.
Plus party attributes on every identity, which are record facts rather than
permissions: organisation, employmentRelation (employee · subcontractor ·
external), and for external parties an engagementWindow. BR-AU2 requires the
record to show that an external auditor is not an employee; that cannot be
derived from a band.
3.2 The director problem, which blocks the persona document
The signed claim is project — singular. The pilot is deliberately one
project, many sites (FR-OVS-1, FR-SEC-10), and
workers/esg-query/src/authz.ts:23 is explicit that a minter
using a plural form reads nothing.
The environmental director (U6) cannot be expressed in the current claim vocabulary at all. Their defining property is that they hold every project, including ones not yet won. This is not a UI gap; it is a claim-shape gap, and it is the single change that unblocks PERSONA §2.
Three ways out, with a recommendation:
| Option | Consequence |
|---|---|
A. Widen the claim to projects: string[] (recommended) | One coordinated change to a signed vocabulary shared by esg-query / esg-memory / esg-compliance. Do it once, now, while the pilot is one project and ["p1"] is a trivially compatible migration. Doing it later means re-minting every session in flight |
| B. One session per project, switched in the UI | The director's whole job — "where is my exposure across the portfolio" — becomes impossible to answer on one screen. Rejects the persona |
| C. A separate portfolio claim type | A second vocabulary to keep in step with the first. This is the drift 3.1 exists to prevent |
Recommendation: A, and take it now. Deferring it is the expensive option.
3.3 Actor → band · scope · grants
| Actor | Band | Scope | Distinguishing grants | Party attributes |
|---|---|---|---|---|
| U1 inspector | inspector | one project, assigned sites | capture, raise, sign own walk | employee |
| U2 env monitor | inspector | one project, assigned sites | capture, raise, record correction | employee or subcontractor — must be stated |
| U3 site super | inspector | one project, own sites | assigned NCRs only: record correction, request extension | employee |
| U4 HSE lead | reviewer | one project | own + assigned; may assign within own site | employee |
| U5 env manager | manager | one project, all its sites | the seven governance verbs on that project | employee |
| U6 director | manager | all projects (needs 3.2 A) | + escalation, recurrence across projects, and external release | employee |
| U7 internal auditor | reviewer + audit capture grant | the audited project | conduct audit, grade findings, raise NCRs, sign conformity conclusion | employee, independent of the audited site |
| U8 external auditor | reviewer, time-boxed | the audited project, evidence only | as U7, minus anything on other projects | not an employee (BR-AU2), engagement window mandatory |
| U9 client rep | reviewer, released-only | one project | read released reports; raise a query, never a ticket | not an employee |
| U10 admin | admin | tenant | provisioning, key rotation, quarantine, export trail | employee |
Two consequences worth stating out loud, because both look wrong at first glance and are deliberate:
adminis not the top of a ladder. It is a different ladder — platform operations. It carries no compliance signature (SoD-5). The most privileged compliance role ismanager.- U3 is
inspector-banded on purpose. A superintendent outranks an inspector organisationally and has less environmental authority. Bands are authority over the record, not seniority. This is exactly why 1's "a role is not a job title" is load-bearing.
3.4 Rita is per-person, and that is a role requirement
Every role has their own Rita. She is not one system agent that everyone queries; she is the individual's agent, and there are as many of her as there are users. That single fact generates four requirements that nothing else in this document would produce:
| ID | Requirement | Why |
|---|---|---|
| A1 | Rita inherits her principal's scope exactly — the same tenant · project(s) · allowedSites claim, never a service identity, never a superset | An agent that can see more than the person it answers to is a scope leak wearing a friendly face. It is also the easiest one to ship by accident, because a service token is the convenient way to build her |
| A2 | Rita holds none of her principal's grants | Scope and authority are different axes (§1). She inherits the first and none of the second. The manager's Rita may draft a closure rationale; only the manager closes |
| A3 | Her memory is per-identity | Conversations are the institutional-memory side of the product (app/lib/conversations.ts). One person's exchanges must never surface in another's recall, and a shared memory across roles would leak an unreleased finding to a client rep's agent in one sentence |
| A4 | Her answers are attributed to her principal when accepted | An accepted draft is the human's record. Rita is never the author of anything in the compliance chain (FR-ROLE-15) |
Two properties of the shipped implementation are worth protecting rather than
redesigning. The field app's Rita calls no network and holds no model key —
answers are either briefed (matchScripted) or on-device
(composeLocal), and each carries a provenance chip saying which
(apps/esg-field/screens/Rita.tsx). And
when she has no basis, she says so rather than composing a plausible answer
— which on a spill or a permit is the difference between a tool and a hazard.
Per-user scoping must not be the change that quietly introduces a shared
server-side model with a service token.
She also researches, collaborates and works unbidden. Each instance may
interrogate the institutional memory, ask a colleague's agent for information,
and act on its own initiative — and where an answer would exceed the asker's
scope, it asks its own human sponsor to approve the disclosure. The
governing rule is one sentence: *an agent-to-agent answer may contain only what
the requesting principal could have read themselves; anything more is a
disclosure, and a disclosure is the sponsor's decision, never the agent's.* The
protocol, the approval loop, the autonomy boundary and the per-role risks are in
roles/agent-collaboration.md (F-AGT-1..23).
What differs per role is only the job she does — the inspector's Rita drafts
a finding from speech, the director's answers the five questions across the
portfolio. Each role file in docs/roles states hers. None of them gives
her authority.
4. The authority matrix
The seven verbs are the decks' own — *review · decide · authorize · assign · escalate · verify · learn* — and all seven are writes (PORTAL-proposal §1).
| Verb | On what | inspector | reviewer | manager | admin |
|---|---|---|---|---|---|
| review | any record in scope | own + assigned | ✅ | ✅ | ✅ platform only |
| decide | accept / reject with a reason | ❌ | propose | ✅ | ❌ |
| authorize | mitigation, due date, verification evidence | ❌ | ❌ | ✅ | ❌ |
| assign | owner + due date on an NCR (BR-CA4) | ❌ | within own site | ✅ | ❌ |
| escalate | raise to notifiable / to the director | ✅ raise | ✅ | ✅ + notify | ❌ |
| verify | corrective work effective / not effective | ✅ disclosed (BR-CA7) | ✅ | ✅ | ❌ |
| learn | link recurrence (repeatOf), amend the control | ❌ | propose | ✅ | ❌ |
4.1 The sign-offs — operational only
Every sign-off below sits inside the operating site. There is no bid gate, no budget gate and no mobilisation gate in this model, because there is no bidding, costing or onboarding activity to gate.
| Sign-off | On what | Who | Blocked by |
|---|---|---|---|
| Inspection report signed and issued in the pinned ONxpress format (BR-S5) | one walk | U5 (countersigned in the field by U1 + P1) | nothing — the two-party signature already exists |
| Acceptance of a not-reached section (BR-S4) | one walk | U5 | approval vocabulary (P3) |
NCR closure as corrected, on recorded and verified work (BR-CA5) | one ticket | U5 | P3 |
| Countersignature of a self-verified closure (BR-CA7, SoD-2) | one ticket | U5 | P3 + person identity |
Retraction as not-a-non-conformance (BR-CA6, SoD-1) | one ticket | U5, never the raiser | P3 |
| Acceptance of an investigation conclusion and its stated method (BR-I7) | one case | U5 → U6 where notifiable | investigations' two missing ends |
| Notifiable-incident escalation, against a deadline someone owns (BR-I4) | one incident | U6 | no notification clock exists |
| Audit conformity conclusion (BR-AU6) | one audit | U7 / U8 | audits absent from the product |
| External release of a report to client, regulator or board | any released record | U6 only | no release concept exists |
Parked, not granted — the pre-operational gates. Recorded here only so they
are not re-derived from scratch later. No role holds them, no surface renders
them, and they are out of scope until bidding, costing or onboarding become
real activities: bid go/no-go with environmental conditions attached · signed
budget and dated schedule constraints · mobilisation readiness sign-off. All
three are the director's, all three need Project lifecycle state
(packages/esg-projects/src/index.ts:70,
P5) and obligation applicability (P6), and none of that exists
(PORTAL-proposal §8, PERSONA §2).
5. Separation of duties
Each rule states the constraint, the reason, and what the record must therefore carry. These are the rules that make roles worth having; without them a role model is just a menu filter.
| ID | Rule | Why | Record consequence |
|---|---|---|---|
| SoD-1 | The raiser of a finding may not close it as not-a-non-conformance | That closure asserts the finding was wrong. Self-service retraction erases inconvenient findings with no trace | Retraction is a manager decision naming the retractor and the grounds (PORTAL-proposal §7) |
| SoD-2 | Where one person both performed and verified a correction, the system discloses it — and does not prohibit it (BR-CA7) | A lone technician is a real operating condition. Prohibiting it produces false records, not better ones | Requires person identity on both the action and the verification. Impossible while both are titles (0.5) |
| SoD-3 | An auditor raises tickets and never closes them (BR-AU4, BR-X6) | The NCR process is the single closure mechanism. An auditor closing their own finding audits nothing | The audit report cites NCR ids; closure lives on the ticket |
| SoD-4 | No role may promote an observation or OFI into an NCR, or record a major/minor without one (BR-AU3–5) | Two of four grades must raise a ticket and two must not. This is a vocabulary rule, not a permission | The grade is on the finding; the ticket link is derived, never chosen |
| SoD-5 | admin may never sign, close, verify or approve anything in the compliance record | Otherwise the person who can rotate keys can also close every ticket, and no audit trail means anything | Admin actions land in the platform trail, not the decision ledger |
| SoD-6 | An external party (U8, U9) is never granted an internal band, and never sees an unreleased record | Release is a decision (§4). Access to a draft is release without a decision | Every external identity carries employmentRelation and an engagementWindow |
| SoD-7 | No model or agent holds any grant (N1) | FR-UX-9 / FR-SEC-5, already enforced in CI | Draft, original media, human edit and accepted record stay separately recoverable (BR-U4) |
| SoD-8 | An assignment names a person, never a title | "Assigned to Site super" is unattributable and unenforceable — BR-CA4 requires it to be reportable as overdue against someone | Titles become a display derived from the person's role, not the stored value |
| SoD-9 | Delegation ("I am away — Marie holds my queue") is an appended, expiring event, never a settings toggle | An expired delegation must not silently persist, and an approval made under delegation must show it | The decision event names the delegate and the delegator |
| SoD-10 | Every decision is an appended event naming the person and the grounds — never a status flag (BR-X2) | A flag cannot answer "who decided this, when, and why" | Rejection carries a reason and returns the item to its originator |
6. Requirements, role by role
Format per role: purpose · surfaces · may · must not · the record must state · what breaks today.
One file per role, with the feature list, lives in docs/roles —
field inspector · environmental monitor ·
site supervisor · HSE lead ·
environmental manager · environmental director ·
internal auditor · external auditor ·
client representative · platform administrator.
Those files answer what the portal is for and what must be built per role
(F-<ROLE>-n features); this section states the authority. Where they
appear to disagree, this section wins.
6.1 Field inspector (U1) — band inspector
- Purpose. Capture what happened at the source, once, and know it arrived.
- Surfaces. esg-field app only. On the read plane:
inspection-summary · open-issues · evidence-records · incidents · corrective-actions(workers/esg-query/src/authz.ts:346). - May. Conduct an inspection walk; attest a section whole or item-by-item (BR-S3); record a section as not reached, with a reason (BR-S4); raise an NCR standalone or from a walk (BR-CA3); report an incident (BR-I2); capture photo/voice/text as one action (BR-U2); sign their own walk and collect the site representative's countersignature; record corrective work they performed.
- Must not. See trend, score, coverage or register surfaces — the
OVERSIGHTband explicitly excludes the field inspector, and that is correct: a score is a judgement about the site, and showing it during capture invites the record to be shaped to it. Assign an owner. Authorize a due date. Close a ticket. Release anything externally. - The record must state. The person (not the device); which sites they were scoped to; whether attestation was whole-section or item-by-item (BR-S3); where GPS/transcription was unavailable, that it was unavailable (BR-X4).
- Breaks today. 0.3 — the inspector is the string
"device", so every requirement in this section is currently unattributable.
6.2 Environmental monitor (U2) — band inspector
As 6.1, plus:
- May. Record corrective work and verify it, subject to SoD-2 disclosure.
- The record must state.
employmentRelation— monitors are routinely subcontracted, and a subcontractor verifying their own correction is a materially different fact from an employee doing so.
6.3 Site supervisor / superintendent (U3) — band inspector, narrow scope
- Purpose. Owns assigned corrective work and records what was done.
- Surfaces. Portal, assigned items only — a queue, not a console.
- May. Record corrective action against an NCR assigned to them, with the date the work was done, which may precede the date it was recorded (BR-CA8); attach evidence; request an extension with a reason; report an incident.
- Must not. Assign work to themselves or others; verify their own correction silently (SoD-2 permits it, disclosed); close any ticket; see other sites' registers.
- The record must state. Who performed the work (which may be a party, P2 — a crew or vendor — named on the action without an account).
- Breaks today.
assignee: "Site super"is a title (0.5), so the queue cannot be filtered to a person, and BR-CA4's "reportable as overdue against an owner" has no owner.
6.4 HSE lead (U4) — band reviewer
- Purpose. First-line review within a project; the manager's delegate for routine assignment.
- May. Everything in
OVERSIGHTreads for their project; assign an owner and due date within their own site; propose a decision to the manager; verify corrective work they did not perform. - Must not. Authorize mitigation on other sites; retract a finding (SoD-1); release externally; countersign a self-verified closure — that is the manager's, precisely because it is the case the disclosure exists for.
6.5 Environmental manager (U5) — band manager, one project
- Purpose. "Verifies closures, reviews reports, answers to the client" (BRD §4).
- Surfaces. The project workspace
/projects/[id]/*(CONSOLE-IA §4) and the decision queue filtered to their project. - May. All seven verbs (§4) within the project: confirm severity, authority and accountable owner; authorize mitigation, due date and required verification evidence; countersign self-verified closures; approve retraction (SoD-1); accept a not-reached section; accept an investigation conclusion; link recurrence; sign the inspection report.
- Must not. Release to a client or regulator without the director's sign-off; approve their own delegation; escalate a notifiable incident on their own authority where the clock is the director's (§4.1).
- The record must state. For every one of the above: person, timestamp, grounds, and the state before and after — the shape
DecisionRecord(app/lib/ledger.ts:15) already has. - Breaks today.
app/my-work/page.tsx:151— five of these authorities are rendered as fully-styled buttons with noonClick. The labels are right, the positions are right, the writes do not exist. This is the cheapest place in the system for roles to become real.
6.6 Environmental director (U6) — band manager, all projects
- Purpose. "Where is my exposure, and what have we committed to" — across every operating project (PERSONA §1). The persona's pre-award remit is real and is not in scope here (see the scope note at the top and §4.1's parked gates).
- Surfaces. The portfolio lens; the six questions in decay order; the decision queue unfiltered; the incident spine (PORTAL-proposal §6–7).
- May. Everything U5 may, on every project; plus the two authorities that are the director's alone (§4.1) — notifiable-incident escalation against an owned deadline (BR-I4), and external release to a client, regulator or board.
- Must not. Substitute for the project manager's verification — a director closing tickets is a signal the queue is broken, not a feature. Alter a record; only append (BR-X2).
- The record must state. Which sign-off, on what evidence, and what conditions were attached — a closure accepted with a condition and one accepted without are different commitments. For a release: what was released, to whom, and when.
- Breaks today. One structural blocker, and it is not a backlog item: the signed claim cannot express multi-project scope (§3.2), so the portfolio reader cannot be minted at all. (
Projectalso has no lifecycle state —packages/esg-projects/src/index.ts:70— but that only bites the parked gates, not the operational ones.)
6.7 Internal auditor (U7) — band reviewer + audit-capture grant
- Purpose. Conduct a scheduled audit against a standard or scope, not a checklist (BR-AU1).
- May. Conduct the walkabout; grade findings major · minor · observation · OFI (BR-AU3); raise NCRs for majors and minors (BR-AU4); write the audit report — scope, standard, auditor, findings by grade, conformity conclusion (BR-AU6); sign that conclusion.
- Must not. Close any NCR (SoD-3); audit a site where they hold delivery responsibility — independence is a scope rule, enforced at assignment; record an observation or OFI as a non-conformance (SoD-4).
- The record must state. Internal vs external, and the auditor's identity and organisation (BR-AU2); coverage separately from conformity (BR-AU7, BR-S2).
- Breaks today. Audits are absent from the product entirely (BRD §5.3) — this role has nothing to sign in to.
6.8 External auditor (U8) — band reviewer, time-boxed
As 6.7, plus the constraints that come from not being an employee:
- May. Only within a declared
engagementWindow, and only on the audited project's evidence. - Must not. Reach any other project; retain access after the window closes; see the decision queue or any unreleased draft (SoD-6).
- The record must state.
employmentRelation: externaland the organisation, on the audit record itself — BR-AU2 is explicit that "an external auditor is not an employee and the record must reflect that."
6.9 Client representative (U9) — band reviewer, released-only
- Purpose. Consume reports as evidence of conformity; the ONxpress-format inspection report is a contractual deliverable (BR-S5).
- May. Read records released to them and their own project's released register; raise a query against a released record.
- Must not. See drafts, the decision queue, or any record before release; raise or close an NCR — a client query becomes a ticket only when an internal role raises one (SoD-6, BR-X6).
- The record must state. What was released, to whom, by whom, and when — release is a decision with an author, not a visibility setting.
6.10 Platform administrator (U10) — band admin
- Purpose. Keep the platform running and provably tamper-evident.
- May. Provision users, bands, scopes and grants; rotate keys; bind and revoke devices; reach the
AUDITsurfaces —quarantine · chain-integrity · location-history(workers/esg-query/src/authz.ts:362); operate export and retention. - Must not. Sign, verify, close, assign, approve or release anything in the compliance record (SoD-5); grant themselves a compliance band without a second admin's approval; read record content where a scope claim would not admit them.
- The record must state. Every provisioning act, in a platform trail separate from the decision ledger, including the grantor.
- Breaks today.
/adminis reachable on loopback with no identity at all (app/lib/admin-access.ts:42) — self-described as interim, pending exactly this document's implementation.
6.11 The parties, which are requirements too
| Party | Requirement |
|---|---|
| P1 site representative | Nameable and signable on the inspector's device, without an account — a two-party signature is already implemented (apps/esg-field/screens/SignoffSheet.tsx:45) and must survive identity landing |
| P2 crew / operator / vendor | Nameable on a corrective action as the performer, distinct from the U3 who recorded it. SoD-2's disclosure depends on being able to say these were different people |
| P4 board | Never a user. Receives a released pack under the same release decision as any external party (FR-ROLE-14). The four audiences in PORTAL-boardroom-and-modules §2 are cuts of one record, not four permission sets — the role model decides who may release each cut, never who may author a separate one |
| P3 regulator | Never a user. A recipient of a released notifiable report, with the notification deadline and the person accountable for closing it recorded (BR-I4) |
| N1 agent | No grant, ever (SoD-7) |
7. Cross-cutting role requirements
New family FR-ROLE, traceable to FR-SEC-4, FR-X-8 and the BR rules named.
| ID | Requirement | Pri | Status |
|---|---|---|---|
| FR-ROLE-1 | Every actor on every record is a person or a named party, never a device, a title, or an empty default | MUST | ❌ "device" (0.3, 0.4) |
| FR-ROLE-2 | The role enum stays the closed set inspector · reviewer · manager · admin; the portal introduces no second enum | MUST | ✅ exists, reads only |
| FR-ROLE-3 | Authority = band × scope × grants. Scope axes are tenant · project(s) · allowedSites, trusted only from signed claims; an empty axis means nothing, never "all" | MUST | ⚠️ read plane only |
| FR-ROLE-4 | The session claim expresses multi-project scope, or the director role cannot exist | MUST | ❌ §3.2 |
| FR-ROLE-5 | Every identity carries organisation and employmentRelation; external identities also carry an engagementWindow and expire automatically | MUST | ❌ (BR-AU2) |
| FR-ROLE-6 | Role is enforced on the write plane before any governance verb, in the same order as reads (authenticate → role → scope) | MUST | ❌ FR-X-8 ⚠️ |
| FR-ROLE-7 | Every governance act is an appended event naming the person and the grounds; no status flag, no in-place edit | MUST | ❌ (BR-X2, SoD-10) |
| FR-ROLE-8 | Rejection carries a reason and returns the item to its originator | MUST | ❌ |
| FR-ROLE-9 | Where performer and verifier are the same person, the record discloses it and does not block it | MUST | ❌ (BR-CA7, SoD-2) |
| FR-ROLE-10 | Retraction as not-a-non-conformance requires a role above the raiser | MUST | ❌ (SoD-1) |
| FR-ROLE-11 | admin holds no compliance authority; admin acts land in a separate platform trail | MUST | ❌ (SoD-5) |
| FR-ROLE-12 | Delegation is an appended, expiring event that both the delegate's actions and the audit trail display | SHOULD | ❌ (SoD-9) |
| FR-ROLE-13 | Auditor independence is enforced at assignment: a person may not audit a site where they hold delivery responsibility | MUST | ❌ |
| FR-ROLE-14 | External release is a decision with an author, a recipient and a timestamp — never a visibility setting | MUST | ❌ (SoD-6) |
| FR-ROLE-15 | No model or agent holds any grant; generated content is a draft a person accepts, and the draft, the original and the accepted record stay separately recoverable | MUST | ✅ enforced in CI (FR-UX-9, FR-SEC-5) |
| FR-ROLE-19 | Every user has their own agent instance, which reads with the principal's scope claim and never a service identity (A1) | MUST | ❌ |
| FR-ROLE-20 | Agent memory and conversation history are per-identity; no recall crosses users, and no agent surfaces a record its principal could not open (A3) | MUST | ❌ |
| FR-ROLE-21 | An agent-to-agent answer contains only what the requesting principal could have read themselves; transitive requests are evaluated against the original requester, never the last hop | MUST | ❌ |
| FR-ROLE-22 | Any answer beyond that is a disclosure the responding agent's human sponsor approves, as a release decision naming the sponsor. Silence is refusal — no timeout grants a disclosure, and no agent approves its own | MUST | ❌ |
| FR-ROLE-23 | An agent acts as "agent of X", never as X, and never exercises a governance verb (sign · close · assign · authorize · verify · retract · escalate · release) | MUST | ❌ |
| FR-ROLE-24 | Information received from another agent is hearsay — labelled, sourced, and never a record, a reported figure or the basis of a closure | MUST | ❌ |
| FR-ROLE-25 | Autonomous agent work is visible to its sponsor, stoppable by them, and dies with their access | MUST | ❌ |
| FR-ROLE-16 | Signing in on a device binds a person to that device for the session; the device attests where and when, the credential attests who | MUST | ❌ |
| FR-ROLE-17 | Revocation is immediate and retroactive in effect on access, and never retroactive on the record — a revoked user's past signatures stand | MUST | ❌ |
| FR-ROLE-18 | A user with no scope sees an empty portal, not an error — and the portal says why | SHOULD | ❌ |
8. Identity lifecycle
The part that is invisible until it is missing.
- Invite — an admin creates an identity with
organisationandemploymentRelation; no band, no scope. It can reach nothing. - Grant — a manager (not an admin) assigns the band and the scope; the grant is an event naming the grantor. An admin granting a compliance band requires a second admin (SoD-5).
- Bind — the user signs in on a device; the session binds person to device (FR-ROLE-16). Field capture from that point names the person.
- Operate — every act appends an event.
- Delegate — optional, expiring, visible (SoD-9).
- Revoke — leavers, ended engagements and expired windows lose access immediately. Their records do not change (FR-ROLE-17). This is the rule that stops "we removed the auditor" from meaning "the audit lost its author".
- External expiry — U8 and U9 windows close automatically; renewal is a new decision, not an extension of an old one.
9. What must never appear
Extending PORTAL-proposal §10, specifically for roles:
- A record whose author is a device, a title, or blank.
- A "super-admin" who can do everything — the union of platform and compliance authority is the failure mode this whole model exists to prevent.
- A permission toggle where a decision belongs — release, delegation and retraction are decisions with authors, not settings.
- A role assumed from a job title, or a title stored where a person belongs.
- An external party seeing an unreleased draft.
- A generated summary, ranking or classification carrying anyone's authority.
- A revoked user's signature disappearing from a signed record.
- Silent self-verification — either disclose it or the record is a claim nobody can defend.
10. Open decisions
| ID | Question | Owner | Blocks |
|---|---|---|---|
| RD-1 | Widen the signed claim to projects: string[] now, while the pilot is one project? (§3.2 — recommendation: yes) | architecture | U6 entirely |
| RD-2 | Does the portal issue its own session-JWT, or does Cloudflare Access remain the front door with a session service behind it? Restates PT-2, and the answer decides whether U8/U9 can exist at all — external parties cannot be put behind our Access tenant | operations | U8, U9 |
| RD-3 | Where do grants live — in the signed claim (fast, coarse, re-mint to change) or looked up per request (fine, revocable instantly, a dependency on every write)? | architecture | FR-ROLE-6 |
| RD-4 | Is a subcontracted environmental monitor (U2) inspector-banded on our tenant, or a scoped external identity? Answering "external" makes BR-AU2-style disclosure automatic; answering "inspector" makes day-to-day operation simpler | director / commercial | U2 |
| RD-5 | Does the client representative (U9) get a login at all, or only released PDFs? A login is a support and access-review commitment for a party that may not want one | product / commercial | U9 |
| RD-6 | Who may grant a band — managers for their own project, or admins only? SoD-5 pushes toward the former; operational reality often pushes toward the latter | operations | §8 step 2 |
| RD-7 | Does auditor independence (FR-ROLE-13) get enforced by the system, or asserted by the audit programme? Enforcing it requires knowing who holds delivery responsibility, which nothing currently records | director | U7 |
| RD-8 | PT-3 answered here: the portal is one surface with role-scoped views, not separate director / manager / inspector portals. The decks imply one, the read plane already models one with per-surface allow-lists, and three surfaces would triple the places a permission can be wrong. Confirm | product | the whole IA |
11. The order this becomes real
Aligned to PORTAL-proposal §9, which puts identity and the approval vocabulary at step 1 for exactly these reasons.
- A person, on the device and in the console. Replace
"device"(apps/esg-field/screens/inspect/TaskFlow.tsx:262,app/api/ncrs/route.ts:90) with a signed-in identity. Nothing else in this document is testable until this lands. - RD-1 — widen the claim to multi-project while the migration is trivial.
- Person, not title, on assignment (SoD-8). Titles become display.
- Write-plane role enforcement (FR-ROLE-6), reusing the read plane's order so the two cannot disagree.
- Make the five dead buttons real (
app/my-work/page.tsx:151) — the manager's authorities, already labelled with the right verbs. This is the smallest change that turns the dashboard into a portal, and it exercises FR-ROLE-6, -7, -8 and -9 in one pass. - Self-verification disclosure (FR-ROLE-9) — cheap once 1 and 3 exist, and it is the honesty differentiator that makes the record defensible.
- External identities (U8, U9) behind RD-2 and RD-5.
- Notifiable-incident escalation and external release (§4.1) — the two director-only operational authorities. Both need a recipient and a clock, neither of which exists.
Not in this order at all: the parked pre-operational gates (§4.1). They wait on activities that are not happening, not on anything in this document.
*Written 2026-08-03 by Claude Opus 5 (Claude Code) on branch
feat/rn-app-parity. Traceability: BR-CA3..CA8, BR-S2/S3/S4/S5, BR-AU1..AU7,
BR-I2/I4, BR-X2/X4/X5/X6, BR-U4/U6, BO-9 · FR-SEC-4, FR-SEC-5, FR-X-8,
FR-UX-9 · PORTAL-proposal P1/P2/P3/P5, PT-2, PT-3 · PERSONA §2, §9.*