Cogneris
Environmental Compliance & Inspection

Intent · Every environmental obligation current and evidenced — zero reportable exceedances at Woodbine (UTS).

Operating tolerance: issues closed in ≤ 5 days · no repeat findings · every permit condition met.

← Documentsdocs/PORTAL-INFORMATION-CONTRACT.md6,560 words

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:

GradeRendered asWhat it asserts
derivedDerived (green)Computed from the record. It cannot disagree with the record, because it is the record, folded
fixtureFixture (amber)Hand-authored for design. There is no record behind it, and none is claimed
absentNot 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).

#ActorSigns inBandPortal surface todayBrief
U1Field inspector / environmental technicianyes — deviceinspector✅ /v2/inspectorfield-inspector
U2Environmental monitor — often subcontractedyes — deviceinspector❌ no surfaceenvironmental-monitor
U3Site supervisor / superintendent / foremanyes — portal, narrowinspector✅ /v2/supervisorsite-supervisor
U4HSE leadyes — portalreviewer❌ no surfacehse-lead
U5Environmental manager — one projectyes — portalmanager✅ /v2/managerenvironmental-manager
U6Environmental director — every projectyes — portalmanager · all projects✅ /v2/directorenvironmental-director
U7Internal auditoryes — device + portalreviewer +grant❌ no surfaceinternal-auditor
U8External auditoryes — time-boxedreviewer · windowed✅ /v2/auditorexternal-auditor
U9Client representativeyes — read-onlyreviewer · released only✅ /v2/clientclient-representative
U10Platform administratoryes — platform surfacesadmin❌ no surfaceplatform-administrator
P1Site representative — countersigns a walkno—field app signature pane onlyparties
P2Crew / operator / vendorno—named on the corrective actionparties
P3Regulator — MECP, TRCAnever—consumes notifiable reports; nothing builtparties
P4Board / JV boardno — receives the packnull✅ /v2/board (rendered as a received pack, not a login)parties
N1Rita — one instance per identityn/anone, everask bar on every surfaceagent-collaboration
N2The devicen/abearer of a key, not an actorattests where and when, never whoparties

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.

RoleThe question it opens onResponsible forExplicitly 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 budgetTouching 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-offRaising 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 reachedApproving 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 ownVerifying 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 completionClosing 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.

#DisagreementThe screen saysThe authority saysAssessment
D-1Manager's closure and retraction authorityRetraction 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-2External 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 threeroles.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-3Client 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 controlroles.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):

SurfaceAnswersLands here
The RecordWhat is true, and the evidence for itauditor · inspector
The QueueWhat needs me — and I can act heredirector · manager · supervisor
The AnswerWhat we tell the board, the client, the regulatorboard · 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

  1. The person, their band, their scope and their employment relation, in the header — including a not an employee badge 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)).
  2. May sign, printed beside may not.
  3. **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 or typed, 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.
  4. A basis grade on every figure (§0.1).
  5. An honesty footer naming the source of the counts and the date anchor they measure against (app/components/v2.tsx:426).
  6. 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.
  7. The ask bar — a real GET form to /v2/brief with 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 null and 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:

  1. Exposure — overdue · material and live · permits at risk · needed a second fix, then each material item with its evidence attached.
  2. Intent versus actual — three decomposable percentages, never rolled into one score.
  3. 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.
  4. 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.

RouteProvides
/v2/libraryThe 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/docs39 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/diagrams24 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/demos11 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>.htmlThe 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 providedWhyBlocked on
Authentication, sessions, or enforcement of any kindThis 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, releaseAll seven verbs are writes; the console writes on ingest and never on governanceS1 + S2
A live store. Every register is illustrative literals7 tickets (app/lib/ncr.ts:198), 8 permits (app/lib/permits.ts:46), 6 projects, 6 decisions, 5 obligations. No module performs a network fetcha live event store reaching the console
The inspection log — coverage, attestation method, sections not reachedThe device records it; the console never asksinspection records do not reach the console
Anything about auditsThe audit process does not exist in the product at allthe largest single gap in scope
Incidents, investigations, notification clocksEvent vocabulary contracted, both ends of the process missingunbuilt
A person's name in the recordActors are the strings "device", "Site super", "M. Michaud" — a title identifies nobodyS1
Release as a stateThere is no release event, no released flag, no record of who released what to whomS2
A six-week trend lineSeven 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 valueWhere a GPS fix or photo is absent, the record says absentrule, 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 chainNo model may mark coverage, sign, submit, close a ticket, or supply a value no person or sensor produced — enforced in CI, not merely intendedrule
The S and the G of ESGThis is environmental compliance on operating sites. GRC and HSM are declared platform modules and inactiveout of scope by decision
Planning, costing, biddingEverything built and in flight is operational. The pre-operational gates are parked in PORTAL-ROLES §4.1, granted to nobodyno Project lifecycle state exists
Movement between the three surfaces. One role, one surfaceThe 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 registersEvery 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 packNo export control exists on any v2 surfaceunbuilt
A role-scoped agent. Rita is specified as one instance per identity; the ask bar is notEvery 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 registerIt 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 pagea defect, not a design boundary
Interactive charts. No selection, filtering, zoom, brushing or drill-downEvery 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 themby 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):

  1. Coverage is not asserted. A section with no finding against it is not thereby compliant.
  2. Delivery is not assumed. Undelivered tickets appear as the device's copy, never as a confirmed submission.
  3. Nothing is interpolated. Absent is rendered as absent.
  4. 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

RoleSpecifically not providedReason / blocker
BoardActivity 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 programmeThe 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
DirectorCoverage 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 worksinspection records do not reach the console; audits and incidents do not exist as processes
DirectorA portfolio scope the signed claim can expressRD-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
ManagerCoverage versus conformity — the number a manager is judged on and the one they cannot seethe device records it; inspection records do not reach the console
ManagerRetraction approval · countersigning their own verification · client releaseNot blocked — withheld by design (SoD-1, SoD-2). These are the director's
SupervisorAnything not assigned to them · closure · changing a committed due dateWithheld by design. A supervisor with a portfolio view is reading somebody else's problems instead of fixing their own
External auditorAny write at all · raw audio · raw GPS tracesRead-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 repReleased reports · their open queries · anything in draft · raising a ticketNo 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
InspectorWhat they are walking today · which sections they have attested · capture itselfNo 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 adminAny surface at all — /v2/<role> 404sWritten briefs exist in docs/roles; no view is implemented

5.4 What the library will not do

Not providedEvidence
Full-text search of documents. The docs page groups and sorts cards; there is no index and no queryapp/v2/library/docs/page.tsx:15-59
Search inside diagram content. Filtering covers title, note and filename only — not SVG textapp/components/libraryGallery.tsx:27-34
Search of decks — grouped by a hardcoded kind orderapp/v2/library/demos/page.tsx:29-36
Version history or a revision selector. One generated snapshot and a GENERATED_AT datescripts/build-library.mjs:369-379
A download control. Diagrams offer "Open the SVG", decks offer a new tab; browser-native saving is not portal functionalitylibraryGallery.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 recordinspected 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 nonebuild-library.mjs:81-113
Runtime refresh. The worker has no filesystem; all content must exist before buildbuild-library.mjs:3-18
Protection against staleness if next build is run outside the project scripts, bypassing generationinference 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 scriptbuild-library.mjs:255-270
Separation of the two subjects in this repository. RESOLVED 2026-08-03. The gallery used to publish 11 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 elsebuild-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 passbuild-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 comparisonapp/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 rendererapp/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

ModuleRowsKindAnchor
app/lib/ncr.ts7 ticketshardcoded illustrative; all status, roll-ups, closure quality, area breakdown, queues and history derived from themTODAY fixed
app/lib/permits.ts8 permitshardcoded; status/summaries derived from an explicit asOfTODAY fixed in v2; live only on the legacy /permits route
app/lib/projects.ts6 projectshardcoded—
app/lib/portfolio.ts4 pre-award fixtures (2 bidding, 1 planning, 1 mobilising) + the 6 operating projectsthe file states these are an overlay, not a derivation, because the domain has no lifecycle state—
app/lib/analytics.tsno rows of its ownentirely 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 zeroTODAY fixed
app/lib/ledger.ts6 decisionshardcoded, newest first; no event-store derivation—
app/lib/obligations.ts5 obligationsmapped from mock.ts; the module invents no dataTODAY fixed
app/lib/mock.ts1 site, 8 compliance areas, 5 obligations, 6 weekly trend rows, 5 category rows, 2 composite scoresdeclared illustrative in its first line—
app/lib/brief.ts1 intent object, 5 scripted questionsintent 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.

#ChangeLifts
S1Identity service — a person, not a device, on every writeThe "device" actor · SoD-2 · SoD-8 · the supervisor's identity gap · every named signature
S2Decision service — decisions as appended events naming the person and the grounds, never status flagsAll seven governance verbs · release · the five dead controls
RD-1Widen the session claim from project to projects: string[]The director's portfolio surface
BD-2Decide whether a released pack is frozen at signing or regenerated on demandThe board pack's referability after a meeting
—Inspection records reaching the consoleCoverage vs conformity, on three surfaces · the inspector's home screen
—The audit process, at allThe audit programme block · U7/U8's actual work
—A query aggregateThe client's only write
—Surfaces for U2, U4, U7, U10Four sign-in roles with briefs and no page
—One clock across portal and legacy consoleThe /v2 vs /permits date divergence in §0.3

8. Change control

  • This document describes /v2 as it stands on 2026-08-03 at generation stamp GENERATED_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.ts is 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.mjs pipeline, 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 /permits route does, at app/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.*