The portal's information contract — roles, responsibilities, and what it will and will not tell you
Status: PROPOSAL, and a description of what is on the screen today. Written 2026-08-03. Authored jointly by Claude Opus 5 (Claude Code) and Codex (codex-cli 0.144.6): Claude read the role model and the seven role surfaces, Codex audited the library, the generation pipeline and the provenance of every figure, and each reviewed the other's half. Every claim below is cited to a file and line, or is marked as unverified.
Basis. The live portal at https://esg-web.sequents.workers.dev/v2 and its
library, read against the source in app/v2, app/lib
and app/components on branch feat/rn-app-parity.
What this document is for. PORTAL-ROLES.md is the authority on who may do what — bands, scopes, grants, separation of duties. It does not say what each person is shown. This document is the other half: for every role, what information the portal will provide, and what it will not, with the reason for each exclusion and the named thing that blocks it. Where the two disagree, PORTAL-ROLES.md wins on authority and this document wins on content.
Read with: PORTAL-ROLES.md (authority) ·
docs/roles (one brief per role) ·
PORTAL-proposal.md (the surface and the named services
S1/S2) · PORTAL-boardroom-and-modules.md
(the four audiences) · BRD-field-processes.md and
FRD-field-processes.md (the rules everything traces
to).
0. The three things to know before reading a single number
0.1 Every figure carries its own grade, and there are exactly three
On the seven role surfaces, every block of register figures carries a grade.
The vocabulary is closed — three values, defined at
app/components/v2.tsx:32:
| Grade | Rendered as | What it asserts |
|---|---|---|
derived | Derived (green) | Computed from the record. It cannot disagree with the record, because it is the record, folded |
fixture | Fixture (amber) | Hand-authored for design. There is no record behind it, and none is claimed |
absent | Not captured (red) | The record does not carry this yet, and the portal says so instead of estimating |
The grading is not universal, and the exception matters. /v2/brief renders
rings, meters, stats, bars and tables with no BasisTag at all — the chart
primitives in app/components/v2charts.tsx take
no basis property. So the strongest form of the rule — *no number without its
provenance* — holds on the role surfaces and not on the brief.
A block the record cannot fill renders as an AbsentPanel
(app/components/v2.tsx:61) — a dashed hole that prints *what it
would contain* and what it is blocked on. An honest hole beats a plausible
number is the rule, and it is enforced by the component taking blockedOn as
a required prop rather than an optional one.
0.2 The portal does not authenticate anybody
There is no identity service, no session, and no permission check anywhere in
this console. Choosing a person at /v2 changes what is rendered and nothing
else — the launcher says so in its own footer
(app/v2/page.tsx:178), and the role model file opens
by calling itself a presentation binding, not an access-control one
(app/lib/roles.ts:4).
Consequence, stated plainly: anyone who can reach the origin can be anyone. The authorities printed on each role card are a specification that an identity service (S1) and a decision service (S2) must eventually satisfy. They are written down first because "who may sign this" has had no representation anywhere in the system, and every governance feature is unreachable until it does.
0.3 The portal has one clock, and it is not a clock
Every date in the portal is measured against TODAY = "2026-07-18" — a
prerender anchor, not a clock (app/lib/ncr.ts:105,
app/lib/obligations.ts:13,
app/lib/permits.ts:41). Overdue, ageing, and permit expiry
all stay fixed at that date. Nothing reads the wall clock during render: the
pure helpers take an explicit asOf (app/lib/ncr.ts:143)
because the build environment forbids Date.now.
One caveat, and it is about the old console, not the portal.
permits.ts supports a live date, and the legacy /permits route advances
asOf to the viewer's real date after mount
(app/permits/page.tsx:133). No v2 surface does
this — all four callers pass the frozen anchor explicitly
(app/v2/views/board.tsx:53,
app/v2/views/director.tsx:136,
app/v2/views/client.tsx:35,
app/v2/brief/page.tsx:143). So the portal is
internally consistent, and a reader comparing /v2/board against /permits is
comparing two different presents. That divergence is a real defect for the
release build to resolve, not a documentation nicety.
1. The actors — all sixteen, and which of them the portal actually renders
Sixteen actors appear across the decks, the BRD, the console data and the field
app (PORTAL-ROLES §2). Ten of them sign in. The portal
currently renders seven surfaces
(app/lib/roles.ts:109).
| # | Actor | Signs in | Band | Portal surface today | Brief |
|---|---|---|---|---|---|
| U1 | Field inspector / environmental technician | yes — device | inspector | ✅ /v2/inspector | field-inspector |
| U2 | Environmental monitor — often subcontracted | yes — device | inspector | ❌ no surface | environmental-monitor |
| U3 | Site supervisor / superintendent / foreman | yes — portal, narrow | inspector | ✅ /v2/supervisor | site-supervisor |
| U4 | HSE lead | yes — portal | reviewer | ❌ no surface | hse-lead |
| U5 | Environmental manager — one project | yes — portal | manager | ✅ /v2/manager | environmental-manager |
| U6 | Environmental director — every project | yes — portal | manager · all projects | ✅ /v2/director | environmental-director |
| U7 | Internal auditor | yes — device + portal | reviewer +grant | ❌ no surface | internal-auditor |
| U8 | External auditor | yes — time-boxed | reviewer · windowed | ✅ /v2/auditor | external-auditor |
| U9 | Client representative | yes — read-only | reviewer · released only | ✅ /v2/client | client-representative |
| U10 | Platform administrator | yes — platform surfaces | admin | ❌ no surface | platform-administrator |
| P1 | Site representative — countersigns a walk | no | — | field app signature pane only | parties |
| P2 | Crew / operator / vendor | no | — | named on the corrective action | parties |
| P3 | Regulator — MECP, TRCA | never | — | consumes notifiable reports; nothing built | parties |
| P4 | Board / JV board | no — receives the pack | null | ✅ /v2/board (rendered as a received pack, not a login) | parties |
| N1 | Rita — one instance per identity | n/a | none, ever | ask bar on every surface | agent-collaboration |
| N2 | The device | n/a | bearer of a key, not an actor | attests where and when, never who | parties |
Four sign-in roles have a written brief and no portal surface — U2
environmental monitor, U4 HSE lead, U7 internal auditor, U10 platform
administrator. /v2/hse-lead is a 404, not an empty page —
roleById() returns undefined and the route calls notFound()
([app/v2/[role]/page.tsx:57-58](../app/v2/%5Brole%5D/page.tsx#L57)); static
params are generated from the same seven-entry ROLES array
(app/v2/%5Brole%5D/page.tsx:24). All four briefs exist; none of the
four routes does. This is a stated gap, not a
defect to be discovered later.
The board is rendered but is not a user. /v2/board shows the pack the
director releases, which is why the role carries band: null and
isParty: true (app/lib/roles.ts:129). The distinction
is load-bearing: the four audiences are cuts of one record, and the role
model decides who may release each cut, never who may author a separate one.
The moment the board gets an authoring surface, the board's version and the
client's version can disagree — which is the failure this product exists to
prevent.
2. Responsibilities — the one question, and the boundary
Each surface opens on the single question that person is actually being asked, and prints may sign beside may not on every page ([app/v2/[role]/page.tsx:151-178](../app/v2/%5Brole%5D/page.tsx#L151)). The boundary is printed because a portal where authority is implicit is a portal where nobody knows whose signature the thing is waiting for.
| Role | The question it opens on | Responsible for | Explicitly not theirs |
|---|---|---|---|
| Board (P4) | Are we exposed — and does our system of control actually work? | Risk acceptance above the director's limit · policy and standard changes · programme-level remediation budget | Touching any operational record; closing, retracting or reassigning anything |
| Director (U6) | Where is my exposure, across every project and every phase? | Closing a verified NCR · approving a retraction · countersigning a self-verified closure · reassigning owner or date · accepting an investigation conclusion · signing an audit conformity conclusion · external release · escalating a notifiable incident · mobilisation sign-off | Raising a field finding · recording the corrective work they then verify · editing a sealed walk (corrections are new events) |
| Manager (U5) | Is my site defensible, and what is waiting on me to verify? | Assigning an owner and a due date · recording corrective work verified effective · accepting a section recorded as not reached | Approving a retraction (disputed — see §2.1) · countersigning their own verification · releasing a report to the client |
| Supervisor (U3) | What is assigned to me, and what is due? | Recording corrective work done with the date it was done · attaching evidence to a ticket they own | Verifying their own work undisclosed · closing a ticket · changing a due date they committed to |
| External auditor (U8) | Show me the evidence — does the record support the claim? | On the portal: nothing — read-only. In the role model: conducts the audit, grades findings, raises NCRs and signs a conformity conclusion (contradiction — see §2.1) | Writing anything at all · seeing personal data beyond the record (raw audio, raw GPS traces — decision CG-1) |
| Client rep (U9) | Are you meeting the contract — and can you show me? | Raising a query against a released record — which is a write (contradiction — see §2.1) | Seeing anything not yet released · raising a ticket (only the delivery team raises an NCR against itself) · writing anything |
| Inspector (U1) | What am I walking today, and did what I sent arrive? | Attesting a section (whole-section or item-by-item) · raising an NCR · signing an inspection at completion | Closing a ticket they raised · verifying a correction |
Source: app/lib/roles.ts:109. The separation-of-
duties rules these enforce are SoD-1 … SoD-10 in
PORTAL-ROLES §5.
2.1 Three places where the screen and the authority document disagree
The table above records what the portal prints, which is the maySign /
mayNot pair from app/lib/roles.ts. That is not always what
PORTAL-ROLES.md grants, and in two cases roles.ts
contradicts itself. Found during joint review on 2026-08-03; all three are
open and none should be resolved by editing this document.
| # | Disagreement | The screen says | The authority says | Assessment |
|---|---|---|---|---|
| D-1 | Manager's closure and retraction authority | Retraction is "the director's", and closing a verified NCR appears only on the director (app/lib/roles.ts:179, app/lib/roles.ts:144) | U5 holds all seven verbs within the project, including approve retraction (SoD-1) and NCR closure as corrected (PORTAL-ROLES §6.5, §4.1) | A real divergence. SoD-1 only bars the raiser from retracting — it does not reserve retraction to the director. The portal is stricter than the model, and the model is the authority |
| D-2 | External auditor: read-only, or an author? | maySign: [] and "Write anything at all" under may-not (app/lib/roles.ts:224) | The same object grants grade-findings, raise-ncr, sign-conformity (app/lib/roles.ts:233); PORTAL-ROLES §6.7-6.8 requires all three | roles.ts contradicts itself. An auditor who raises an NCR and signs a conformity conclusion is not read-only. Today the contradiction is invisible because audits do not exist |
| D-3 | Client representative: may they raise a query? | "Write anything at all" under may-not (app/lib/roles.ts:252) | The same object grants raise-query (app/lib/roles.ts:244); PORTAL-ROLES §6.9 grants it explicitly. /v2/client renders a Raise a query control | roles.ts contradicts itself. Raising a query is a write. The correct statement is "writes nothing to the compliance record" — a query is a write to a different aggregate |
Why this matters more than a wording fix. roles.ts is the shape S1 and S2
must eventually satisfy. A grant list and a printed prohibition that disagree
will be read by two different implementers and produce two different systems —
which is the exact failure the single-enum rule in
PORTAL-ROLES §3.1 exists to prevent.
3. The three surfaces, and the agent that is not one
The portal collapses fifteen console menu entries into three surfaces
(app/v2/page.tsx:133):
| Surface | Answers | Lands here |
|---|---|---|
| The Record | What is true, and the evidence for it | auditor · inspector |
| The Queue | What needs me — and I can act here | director · manager · supervisor |
| The Answer | What we tell the board, the client, the regulator | board · client |
The launcher's stated intent is that every register which used to be a menu
entry becomes a lens inside The Record, reached from the thing you were
already looking at (app/v2/page.tsx:137).
No such lens routes exist yet — the intent is written down, not built.
The surface bar is an indicator, not navigation. Each role lands on exactly
one surface and cannot move to another: the three items render as <span>
elements, and the only link in the bar is Switch role
(app/components/v2.tsx:366). The Record, The
Queue and The Answer are therefore a statement of what this page is for, not a
tab set. Whether they should become navigable — and what a director would see on
The Record that /v2/auditor does not already show — is undecided.
The agent is deliberately not a fourth surface. It is an ask bar at the top
of every role page, above the role header and above the analytics
([app/v2/[role]/page.tsx:74](../app/v2/%5Brole%5D/page.tsx#L74)) — an advisor you
have to remember to visit is one nobody visits. Submitting it, or picking one of
the five questions, lands on /v2/brief, where the chosen question gets the
whole screen: the narration is the agent's, the figures beside it are derived
live from the register, and where script and register disagree the register
wins and the panel says so (app/v2/brief/page.tsx:8).
The whole page including answer routing is server-rendered — no JavaScript is
involved in producing an answer.
4. What the portal WILL provide
4.1 On every surface, for every role
- The person, their band, their scope and their employment relation, in the header — including a
not an employeebadge for external parties, because BR-AU2 requires the record to show an external auditor is not staff ([app/v2/[role]/page.tsx:99](../app/v2/%5Brole%5D/page.tsx#L99)). - May sign, printed beside may not.
- **Provenance on demand for every ticket *row*** — wherever a surface renders a ticket, never for an aggregate, a score or a chart — a native
<details>disclosure headed "How do you know that's true?", rendering raiser, capture date, photo count, GPS fix or its absence, spoken-note duration ortyped, not spoken, origin, delivery state, the transcript where one exists, and the chain — appended, never edited (app/components/v2.tsx:126). No JavaScript, no backend call. - A basis grade on every figure (§0.1).
- An honesty footer naming the source of the counts and the date anchor they measure against (
app/components/v2.tsx:426). - Inert governance controls that name what they wait on. A governance action renders as a dashed, visibly-disabled control reading
needs S1 identity + S2 decisions(app/components/v2.tsx:93). This is deliberately not a greyed copy of the real button: grey reads as "temporarily unavailable", and this is not temporary, it is unbuilt. - The ask bar — a real GET form to
/v2/briefwith five numbered scripted questions, plus the declared intent and tolerance the answers are measured against (app/components/v2.tsx:453).
4.2 Role by role
Director — /v2/director (app/v2/views/director.tsx)
- A defensibility score with its contributing rings, each carrying a number, a word and a sentence, and each decomposable. There are six components — closure, on-time, delivered, evidence, second-party, and coverage, which is
nulland renders as—rather than a number (app/lib/analytics.ts:63). The headline is the mean of the five known ones and excludes the sixth rather than scoring it zero. - A spotlight — the one thing today, ranked by consequence not recency: overdue → a fix that did not hold → nobody independent checked it → waiting on your signature.
- Net flow per day (raised vs closed) with the verdict stated in words and a caveat about how thin the window is, plus the same data as a table.
- Where it concentrates by area; how long things sit as an age profile; the oldest live ticket named.
- The rest of the exposure — permits expiring or expired, tickets held on an undelivered device, items awaiting the director's signature, projects in a phase the model cannot represent.
- The decision queue — each row a decision only they can make, with the grounds it turns on and what happens if they act.
Manager — /v2/manager — one project only, and the page says why: *a
manager who can see the whole portfolio spends their day reading other people's
problems.* Unowned · in correction · awaiting the director · overdue; the
waiting-on-you queue with the director's verbs excluded; concentration by area;
and a disclosure panel naming every ticket verified by whoever fixed it
(permitted under BR-CA7, surfaced rather than hidden).
Supervisor — /v2/supervisor — deliberately the smallest surface in the
portal. Assigned to me · late · closed; each row carrying severity, area, due
date, and the requested action or an honest *"No remedy was prescribed by the
raiser — a real case, not a missing field."* It also states the identity gap
where it bites: you are shown as Ray Duval, the record says "Site super".
External auditor — /v2/auditor — leads with what the record does not
claim (four statements, §5.2), then the whole register, every ticket with its
full trail, ordered by recency, each expandable to its evidence. Tickets in
scope · closed as corrected · no second party · evidence gaps split into
no-GPS and no-photo.
Client representative — /v2/client — states that nothing has been
released, because release is not a state this system has; then the shape a
released monthly pack would take, graded fixture, so it can be argued with
before it is built; and a Raise a query control that names the missing query
aggregate.
Inspector — /v2/inspector — delivery first, in words: *"N of your M
tickets have not reached the office… saved on this device is not the same as
received by the office."* Raised by you · delivered · still on the device, then
every ticket they raised with what happened to it after they sent it. Capture is
not offered here and the page says why — it belongs on the handset, outdoors, in
gloves.
Board — /v2/board — four blocks, rendered in sequence on one page:
- Exposure — overdue · material and live · permits at risk · needed a second fix, then each material item with its evidence attached.
- Intent versus actual — three decomposable percentages, never rolled into one score.
- Does the control system work? — how the closed pile actually closed, reported apart and never summed: corrected and verified · retracted · superseded · verified by whoever fixed it.
- Decisions taken, and the ask — signed decisions from the ledger, with recurrence flagged, and three explicit asks.
4.3 The library — /v2/library
One place for everything written about the product, in the product, because documentation that lives in a folder stops being read.
| Route | Provides |
|---|---|
/v2/library | The overview: the industry problem · four processes with one closure mechanism · the platform's four parts · the requirements table (8 BR/FR families with build state) · the roles table (11 rows, 16 actors) · what is real in three columns |
/v2/library/docs | 39 documents, grouped and sorted, each with title, summary and word count |
/v2/library/docs/<slug> | The full document rendered as HTML at build time; doc-to-doc links rewritten to library routes |
/v2/library/diagrams | 24 hand-authored SVG diagrams, browsable with a lightbox and client-side filtering over title, note and filename. All 24 are ESG — see §5.4 for the eleven that used to be here and no longer are |
/v2/library/demos | 11 decks and mocks, old and new, each labelled by kind and era, openable in place or in a new tab |
/v2/library/view/<page> | The deck viewer — a sandboxed iframe over the copied static HTML |
/library/pages/<file>.html | The raw deck itself, served as a static asset (e.g. the 9.1 MB value-proposition deck) |
The colour law is the diagrams' law: green built and exercised, amber exists
but does not meet its business rule, red absent. Nothing is coloured by
intent, so the page cannot flatter the build
(app/v2/library/page.tsx:8).
One subject only. The library is the ESG product. Foreman — the agentic development platform that builds it — is a different product in a different repository, and nothing of it belongs in this gallery. Eleven of its diagrams were published here until 2026-08-03; if any reappear, the generator is copying a directory it should not.
How it is produced. scripts/build-library.mjs recursively discovers every
.md under docs/, converts it with a purpose-built Markdown renderer, copies
every SVG under diagrams/SDMS/ and the eleven declared HTML sources into
public/library/, and emits app/lib/library.generated.ts. It runs before
dev, build, cf:build and cf:deploy, and standalone as pnpm library
(package.json:7-14). Current generation stamp: GENERATED_AT = "2026-08-03".
5. What the portal WILL NOT provide
Each exclusion states the reason and the named blocker. An exclusion with no blocker named is a decision; an exclusion with one is a dependency.
5.1 Universal — no role gets these
| Not provided | Why | Blocked on |
|---|---|---|
| Authentication, sessions, or enforcement of any kind | This is a presentation role model; it enforces nothing (app/lib/roles.ts:4) | S1 identity service |
| Any governance write — assign, verify, close, retract, countersign, escalate, release | All seven verbs are writes; the console writes on ingest and never on governance | S1 + S2 |
| A live store. Every register is illustrative literals | 7 tickets (app/lib/ncr.ts:198), 8 permits (app/lib/permits.ts:46), 6 projects, 6 decisions, 5 obligations. No module performs a network fetch | a live event store reaching the console |
| The inspection log — coverage, attestation method, sections not reached | The device records it; the console never asks | inspection records do not reach the console |
| Anything about audits | The audit process does not exist in the product at all | the largest single gap in scope |
| Incidents, investigations, notification clocks | Event vocabulary contracted, both ends of the process missing | unbuilt |
| A person's name in the record | Actors are the strings "device", "Site super", "M. Michaud" — a title identifies nobody | S1 |
| Release as a state | There is no release event, no released flag, no record of who released what to whom | S2 |
| A six-week trend line | Seven tickets across ten days. A line would draw a shape the data does not contain — the old /dashboard draws one from hardcoded literals; this portal refuses (app/v2/views/director.tsx:15) | the dataset, not the code |
| Any interpolated or substituted value | Where a GPS fix or photo is absent, the record says absent | rule, not a gap |
| Coverage as a score | "a zero here would be a lie, not a low score" (app/lib/analytics.ts:109) | rule + inspection records |
| Anything a model produced, in the proof chain | No model may mark coverage, sign, submit, close a ticket, or supply a value no person or sensor produced — enforced in CI, not merely intended | rule |
| The S and the G of ESG | This is environmental compliance on operating sites. GRC and HSM are declared platform modules and inactive | out of scope by decision |
| Planning, costing, bidding | Everything built and in flight is operational. The pre-operational gates are parked in PORTAL-ROLES §4.1, granted to nobody | no Project lifecycle state exists |
| Movement between the three surfaces. One role, one surface | The bar indicates; it does not navigate (app/components/v2.tsx:366) | undecided, not blocked |
| Any filter, sort, date range or free-text search over the registers | Every surface is composed for its reader rather than filtered by them — the launcher's own claim is that the portal "does not show everyone everything and let them filter" (app/v2/page.tsx:111) | by design |
| Export, print or download of any register or pack | No export control exists on any v2 surface | unbuilt |
| A role-scoped agent. Rita is specified as one instance per identity; the ask bar is not | Every role posts to the same /v2/brief, which hardcodes roleId="director" and serves the same programme-wide answers — including to the external auditor and the client representative (app/v2/brief/page.tsx:81) | S1 — scope cannot be inherited from an identity that does not exist |
| A graded brief. The brief's narration is not derived from the seven-ticket register | It carries ungraded hardcoded figures — "Six of eight environmental areas are clean", 88%, 4.2, `3 repeat findings* (app/lib/brief.ts:87, app/lib/brief.ts:160) — while the page footer says every figure beside it is derived live. The footer overstates the page | a defect, not a design boundary |
| Interactive charts. No selection, filtering, zoom, brushing or drill-down | Every chart is a static server-rendered SVG with native title hover only (app/components/v2charts.tsx:21). "Decomposable" means the contributors are printed, not you can click into them | by design, at this data volume |
5.2 What the record does not claim — printed to the auditor, true for everyone
Four statements, rendered at the top of /v2/auditor
(app/v2/views/auditor.tsx:43):
- Coverage is not asserted. A section with no finding against it is not thereby compliant.
- Delivery is not assumed. Undelivered tickets appear as the device's copy, never as a confirmed submission.
- Nothing is interpolated. Absent is rendered as absent.
- No audit findings exist. Any conformity conclusion must come from elsewhere.
An auditor who discovers a limitation themselves treats everything else as suspect; one told about it up front treats the rest as credible.
5.3 Per role
| Role | Specifically not provided | Reason / blocker |
|---|---|---|
| Board | Activity counts ("we did 240 inspections") · screenshots of the field app · a single composite score with no decomposition · anything green not earned by an attestation · live drill-down · coverage vs conformity · the audit programme | The first four are deliberate editorial exclusions (app/v2/views/board.tsx:310); the last two are AbsentPanels blocked on inspection records and the missing audit process. Whether a released pack is frozen at signing or regenerated on demand is open decision BD-2 |
| Director | Coverage over time · attestation-method mix · audit findings by grade · incidents against their regulatory clock — the four that would tell you whether the system of control works | inspection records do not reach the console; audits and incidents do not exist as processes |
| Director | A portfolio scope the signed claim can express | RD-1 — the claim carries project, singular (workers/esg-query/src/authz.ts:23). Widening it to projects: string[] is the single change that makes this surface expressible, and it is cheapest now while the pilot is one project |
| Manager | Coverage versus conformity — the number a manager is judged on and the one they cannot see | the device records it; inspection records do not reach the console |
| Manager | Retraction approval · countersigning their own verification · client release | Not blocked — withheld by design (SoD-1, SoD-2). These are the director's |
| Supervisor | Anything not assigned to them · closure · changing a committed due date | Withheld by design. A supervisor with a portfolio view is reading somebody else's problems instead of fixing their own |
| External auditor | Any write at all · raw audio · raw GPS traces | Read-only is a property of the role, not the build. Raw media is excluded by decision CG-1: a recording is a person's voice and a fix sequence is their movements through a shift |
| Client rep | Released reports · their open queries · anything in draft · raising a ticket | No release decision exists (S2); reports are generated on the device and not held by the console; no query aggregate exists in any layer. Showing them the live register instead would hand an external party draft findings nobody has decided to stand behind |
| Inspector | What they are walking today · which sections they have attested · capture itself | No programme or schedule model exists and inspection records do not reach the console. Capture is excluded by design — a second, worse capture flow in a desktop browser is how field tools get filled in at the truck at the end of the day, from memory |
| Monitor, HSE lead, internal auditor, platform admin | Any surface at all — /v2/<role> 404s | Written briefs exist in docs/roles; no view is implemented |
5.4 What the library will not do
| Not provided | Evidence |
|---|---|
| Full-text search of documents. The docs page groups and sorts cards; there is no index and no query | app/v2/library/docs/page.tsx:15-59 |
| Search inside diagram content. Filtering covers title, note and filename only — not SVG text | app/components/libraryGallery.tsx:27-34 |
| Search of decks — grouped by a hardcoded kind order | app/v2/library/demos/page.tsx:29-36 |
Version history or a revision selector. One generated snapshot and a GENERATED_AT date | scripts/build-library.mjs:369-379 |
| A download control. Diagrams offer "Open the SVG", decks offer a new tab; browser-native saving is not portal functionality | libraryGallery.tsx:99-108 |
| Any access control. No library route inspects a role. NOT VERIFIED repo-wide — Cloudflare Access is a perimeter, not an identity, and puts no name in any record | inspected routes carry none |
| Links into repository source. Source citations render as inline code deliberately, because the site cannot open a repo file and a dead link is worse than none | build-library.mjs:81-113 |
| Runtime refresh. The worker has no filesystem; all content must exist before build | build-library.mjs:3-18 |
Protection against staleness if next build is run outside the project scripts, bypassing generation | inference from package.json:7-14; not independently guarded |
| Discovery of decks. The 11 HTML sources are hand-maintained in the generator, not found on disk — a new deck is invisible until someone edits the script | build-library.mjs:255-270 |
Foreman-SDLC diagrams — authority hierarchy, CPT internals, pipeline — beside the NCR lifecycle, because the generator copies everything under diagrams/SDMS/. Foreman is the agentic development platform that BUILDS this product; it is not part of it. The eleven diagrams and the stray diagrams/README.md were moved to MyProjects/Foreman/diagrams/, their metadata removed from scripts/library-diagrams.json, and the gallery is now 24 ESG diagrams and nothing else | build-library.mjs:285-292; verified against the regenerated DIAGRAMS inventory |
| Guaranteed accuracy of diagram descriptions. Metadata is hand-maintained and can go semantically stale even when file-presence checks pass | build-library.mjs:277,388-398 |
| Document navigation beyond a shallow contents list. A single H2-level table of contents, and only when a document has more than two H2s — no deep outline, no in-page search, no source view, no revision comparison | app/v2/library/docs/[slug]/page.tsx:39,56 |
Sanitisation of document HTML. Generated markup is injected with dangerouslySetInnerHTML; the trust boundary is the repository, not the renderer | app/v2/library/docs/[slug]/page.tsx:42-55 |
Unknown slugs and unknown deck names 404 via notFound() rather than
rendering an empty shell (docs/[slug]/page.tsx:35-41,
view/[page]/page.tsx:36-42).
5.5 What Rita will not do — in any instance
Rita may draft, summarise, rank and propose. She may never mark coverage,
sign, submit, close a ticket, assign an owner, or supply a value no person or
sensor produced (FR-UX-9, BR-U4, FR-SEC-5, enforced by
scripts/guard-no-llm-in-proof-chain.mjs). She holds no grant, ever
(SoD-7).
In the portal today the ask bar is a real GET form to /v2/brief with five
numbered scripted questions. Everything runs locally: no cloud call, no API
key. Scripted answers are deterministic.
Off-script questions are not answered. composeLocal() exists in
app/lib/brief.ts:404 and the route never calls it: the
page resolves matchScripted() and, on no match, prints *"…did not match a
briefed question"* and shows the nearest scripted answer instead
(app/v2/brief/page.tsx:67). Its own reason is
the right one — *"rather than compose an answer that reads as authoritative and
is not"* — so the ask bar takes free text and will only ever return one of five
answers. Agent-to-agent
collaboration and sponsored disclosure are specified, not built — an
agent-to-agent answer may contain only what the requesting principal could have
read themselves, and silence is refusal
(roles/agent-collaboration.md).
6. Provenance of every figure the portal renders
| Module | Rows | Kind | Anchor |
|---|---|---|---|
app/lib/ncr.ts | 7 tickets | hardcoded illustrative; all status, roll-ups, closure quality, area breakdown, queues and history derived from them | TODAY fixed |
app/lib/permits.ts | 8 permits | hardcoded; status/summaries derived from an explicit asOf | TODAY fixed in v2; live only on the legacy /permits route |
app/lib/projects.ts | 6 projects | hardcoded | — |
app/lib/portfolio.ts | 4 pre-award fixtures (2 bidding, 1 planning, 1 mobilising) + the 6 operating projects | the file states these are an overlay, not a derivation, because the domain has no lifecycle state | — |
app/lib/analytics.ts | no rows of its own | entirely derived from the 7 tickets; 6 score components — 5 numeric, coverage null; defensibility is the mean of the known ones and excludes the missing one rather than scoring it zero | TODAY fixed |
app/lib/ledger.ts | 6 decisions | hardcoded, newest first; no event-store derivation | — |
app/lib/obligations.ts | 5 obligations | mapped from mock.ts; the module invents no data | TODAY fixed |
app/lib/mock.ts | 1 site, 8 compliance areas, 5 obligations, 6 weekly trend rows, 5 category rows, 2 composite scores | declared illustrative in its first line | — |
app/lib/brief.ts | 1 intent object, 5 scripted questions | intent hardcoded; NCR figures derived once from ncrSummary() | — |
No v2 data module performs a live network fetch. The registers derive
correctly from illustrative data rather than a live store — which is exactly
what the library's own "exists, but not to its rule" column says
(app/v2/library/page.tsx:317).
7. What must change for each exclusion to lift
In dependency order. Nothing below is scheduled here — see WORKLIST.md.
| # | Change | Lifts |
|---|---|---|
| S1 | Identity service — a person, not a device, on every write | The "device" actor · SoD-2 · SoD-8 · the supervisor's identity gap · every named signature |
| S2 | Decision service — decisions as appended events naming the person and the grounds, never status flags | All seven governance verbs · release · the five dead controls |
| RD-1 | Widen the session claim from project to projects: string[] | The director's portfolio surface |
| BD-2 | Decide whether a released pack is frozen at signing or regenerated on demand | The board pack's referability after a meeting |
| — | Inspection records reaching the console | Coverage vs conformity, on three surfaces · the inspector's home screen |
| — | The audit process, at all | The audit programme block · U7/U8's actual work |
| — | A query aggregate | The client's only write |
| — | Surfaces for U2, U4, U7, U10 | Four sign-in roles with briefs and no page |
| — | One clock across portal and legacy console | The /v2 vs /permits date divergence in §0.3 |
8. Change control
- This document describes
/v2as it stands on 2026-08-03 at generation stampGENERATED_AT = "2026-08-03". - If a surface starts showing something this document says it will not, one of the two is wrong and it is not automatically this document. The rule the portal is built on is that an unearned number is worse than an absent one.
- PORTAL-ROLES.md remains the authority on authority.
app/lib/roles.tsis a presentation binding onto it and must not diverge — but currently does, in the three places recorded in §2.1. That is a defect against this rule, not a licence to relax it, and it is recorded here so it is fixed in the code rather than absorbed into the prose. - The bands used here are the four that already ship on the read plane (
workers/esg-query/src/authz.ts:50), not a second enum invented for the portal. A richer portal enum guarantees the read and write planes disagree about who someone is, and the disagreement surfaces as a person who can approve a thing they cannot see.
9. How this document was produced, and what the review changed
Two agents, one session, 2026-08-03.
- Codex (codex-cli 0.144.6) audited the library, the
build-library.mjspipeline, and the provenance of every data module — §4.3, §5.4 and §6 are substantially its findings. - Claude Opus 5 (Claude Code) read the role model and the seven role surfaces and wrote §0–§3, §5.1–§5.3 and §7.
- Codex then reviewed the draft adversarially, instructed to falsify it and report only defects. It returned 18, of which 13 were valid and are fixed above — including the §0.1 overclaim, the ungraded brief narration, the ask bar not being role-scoped, and the three authority divergences now in §2.1, which neither agent had noticed while writing.
- Two of its findings were themselves wrong and were rejected after checking: it reported that no component advances the permit
asOf(the legacy/permitsroute does, atapp/permits/page.tsx:124), and it read the manager's bar on "countersigning their own verification" as a divergence when SoD-2 makes it correct. Agent output was verified, not adopted. - One correction was found by Claude against its own draft: the original §0.3 claimed two live clocks in the portal. There is one, and it is frozen.
Facts marked NOT VERIFIED were confirmed by neither agent and must not be relied on.
*Authored 2026-08-03 by Claude Opus 5 (Claude Code) and Codex (codex-cli 0.144.6). Where this document and the code disagree, the code is the fact and this document is the bug — except in §2.1, where the code is the bug.*