The Portal — review of what exists, and what it has to become
Status: PROPOSAL. Written 2026-08-03 by Claude Opus 5 (Claude Code) at Pete's request: review the deployed dashboard and the two presentation decks, then propose the portal.
Method, stated so the basis is clear. https://esg.cogneris.com returns
HTTP 403 — it is behind Cloudflare Access. Pete supplied the internal origin
https://esg-web.sequents.workers.dev/, which bypasses Access, and the
review below is of the live deployed build there, cross-read against the
source in app/. The decks reviewed are the two in
diagrams/SDMS/ESG/Presentations/.
The deployed build is ahead of main. Its nav carries fifteen entries
including Projects, Site maps and Submissions, none of which exist on main.
Treat main as stale when reasoning about what is live.
Companion to PERSONA-environmental-director.md (who it is for) and CONSOLE-IA-proposal.md (routes).
1. What the decks promise
The Value Proposition deck defines the product as four components, and the portal is one of them:
| # | Component | Its job, in the deck's words |
|---|---|---|
| 1 | Field App | voice, photo, GPS/chainage, evidence — captured once at the source |
| 2 | Portal | "governed triage, ownership, approvals, corrective actions and executive visibility" |
| 3 | Personal Agent | a role-aware advisor: status, deviation, cause, impact, options |
| 4 | Institutional Memory | a persistent causal record of intent, obligations, evidence, decisions, rationale, outcomes |
The single most important sentence in either deck, from the portal slide:
*"It is not a dashboard-only product. It is where field evidence becomes governed execution."* — with the verbs spelled out: review · decide · authorize · assign · escalate · verify · learn.
And the demo walkthrough's manager workflow (step 4), which is a specification in all but name:
- review evidence, obligation mapping and classification
- confirm severity, authority and accountable owner
- authorize mitigation, due date and verification evidence
- escalate when thresholds, deadlines or recurrence rules trigger
- feed the decision into operational and executive governance
Every one of those seven verbs is a write. That is the finding this whole document turns on.
2. Review of what is deployed
Fifteen nav entries live: Site map · Projects · Live Brief · My Work · Conversations · Compliance · Permits · Decision Log · Obligations · Reporting · Inspections · Site maps · Submissions · Field app · Voice.
The landing page is the site map — "Where the work is", Eglinton Crosstown, 19 km of alignment with control points and plotted incidents, then *"Everything on this site — 10 records plotted · 13 assets on the plan"*. That is a good opening move: the portfolio's state is spatial before it is tabular.
What is genuinely good, and should survive
- The Live Brief is the Personal Agent, already built.
app/lib/brief.tsimplements the deck's five questions verbatim — where are we · how far off · what moved · what it's costing · what are the options — and goes further than the deck by declaringINTENT, the target drift is measured against, andLOOP_ROLE(reality → drift → cause → consequence → response). The deck's agent slide has no equivalent of intent. The code is ahead of the deck here. - The Decision Log is the Institutional Memory chain, already modelled.
DecisionRecord(app/lib/ledger.ts:15) carriestrigger · intent · before/after · options · chosen · evidence · signedBy · outcome · repeatOf. That is the deck's intent → observation → evidence → decision → reason → outcome chain, plusrepeatOf— recurrence, which the deck asks for as an escalation trigger and nothing else in the system has. - The honesty discipline. Closure split by reason, undelivered-device caveats, "coverage is not conformity". This is a real differentiator and no redesign should trade it away.
- Real derivation logic behind NCRs (~489 lines), permits, obligations and the work queue. Swap the data source and the logic survives.
What the review found wrong
| # | Finding |
|---|---|
| 1 | The console writes on ingest, and never on governance. POST /api/inspections, POST /api/ncrs, POST /api/admin and POST /api/summarize all exist — so the plumbing to persist is there. Not one of the deck's seven governance verbs (review · decide · authorize · assign · escalate · verify · learn) has an endpoint. The portal can receive work and cannot act on it. |
| 1b | Worse: /my-work renders five governance actions as dead buttons. app/my-work/page.tsx:151 is a <button> with full styling and a hover:bg-tang-press state, no onClick, no type, no form. Its labels come from mywork.ts: "Sign to close the ticket" · "Assign an owner and a due date" · "Verify the re-inspection and sign to close" · "Correction failed — set the next action" · "Assign an owner and set the control". These are exactly the director's authorities, rendered as live-looking controls that do nothing. It also breaks the app's own first rule — "Every visible control does something. The rule the trap taught." (FIELD-INTELLIGENCE §4.6). The console holds itself to a lower standard than the handset. |
| 2 | The good parts are mock. Brief and Ledger are the two most differentiated surfaces and both are scripted literals, not derivations over a live record |
| 3 | Sixteen surfaces, no spine. Organised by function, so there is no "everything about this project" and no "everything about this incident" — the demo's whole narrative is one incident followed end to end, and the console cannot show that |
| 4 | Two of four processes have no home. Investigations and audits appear nowhere. app/api/submissions/route.ts states in its own header that they cannot arrive |
| 5 | Three of four phases have no home. Bid, cost/plan and onboard are absent from routes, data and vocabulary |
| 6 | No identity. Every actor is the string "device". Assignment, approval and accountability are all meaningless without a person |
| 7 | No persistence in effect. main's wrangler.jsonc does declare a D1 binding (DB → esg-web), but nothing on main reads it — app/lib/ncrStore.ts does not exist there, and /admin reads node:sqlite, which workerd cannot run. So the binding is declared and unused, and the console still cannot retain anything. The working branch changes this: it adds ncrStore.ts, an ESG_NCR_DB binding and /api/submissions, reading env.ESG_NCR_DB ?? env.DB. Real persistence is one merge away, not one project away |
| 8 | /dashboard leads with mock scores — rings, trend and category mix are literals with no derivation, sitting above panels that are real |
The one-line verdict: the console is an excellent demonstration of the product's thinking and a non-implementation of the portal the decks sell — and it already has the five buttons drawn. The gap between it and a portal is narrower than it looks, and it is entirely on the write side.
The single cheapest credible step: make those five buttons real. They are
already labelled with the right verbs, already positioned on the right rows,
already derived from ncrsNeedingManager(). They need identity, an approval
event and somewhere to write it — which is P1, P3, P4 below and nothing else.
3. The thesis
A portal is a place where decisions are made and recorded. A dashboard is a place where numbers are looked at. We have built the second and sold the first.
Everything below follows from closing that gap, and the ordering rule is: build the ability to act before building more places to look.
4. What the portal must cover — the 8-cell grid
Four processes × four phases. The portal is the governance surface over all of it.
| Bid | Cost · plan | Onboard | Manage | |
|---|---|---|---|---|
| NCR | history prices the bid | remediation contingency | template + owners | built |
| Inspections | cadence → labour cost | cadence × duration | template + inspector assigned | built |
| Investigations | incident history = risk premium | response capacity | escalation path + notifiers | partial — middle stage only |
| Audits | certification commitments | audit programme cost | standard + schedule | absent |
- Design rule — one closure queue, four record streams. An NCR is the single closure mechanism for a non-conformance found by any process (BR-X6), so the director's queue is one list. The records must never merge: an inspection verdict and an audit grade are different vocabularies where two of four grades must raise a ticket and two must not (BR-AU3–5).
- The register is the spine across phases. An obligation identified at bid becomes a budget line, a permit application, an inspection item, then an NCR. Four systems cannot answer "you bid this on the basis of X — did you do X?"
5. The six primitives the portal is missing
These are not features. Nothing in §6–§8 can be built until they exist, and each one unblocks several cells of the grid at once.
| # | Primitive | Why it is load-bearing |
|---|---|---|
| P1 | Identity — a person, not "device" | assignment, approval, signature and BR-CA7 self-verification disclosure all name a person or mean nothing |
| P2 | Roles and authority | who may authorise what. No role/permission/signOff concept exists anywhere |
| P3 | Approval vocabulary — approve/reject with a reason, as an appended decision event | the deck's core verb; absent from every layer. Rejection returns the item with the reason attached, not a status flag |
| P4 | A store the console can write to | seven governance verbs are seven writes. Closer than assumed — the working branch already lands a D1-backed NCR store. The open decision is whether decisions/approvals also go to D1 or to the event log via esg-command |
| P5 | Project lifecycle state | canonical Project is id · name · client · contractRef — no phase. A project springs into existence already being inspected |
| P6 | Applicability — which obligations and permits bind which project | registers exist; the binding does not. Phase 1 and phase 3 both need it |
P1–P4 are the critical path. P5 and P6 are what make phases 1–3 possible.
6. The portal, laid out
Layer 0 · Portfolio by phase
The top of the screen, because a portal showing only operating sites shows about half the director's exposure and none of the exposure still avoidable.
BIDDING in tender · decision date · environmental conditions attached
PLANNING budget signed? · permit lead times · dated constraints issued
MOBILISING readiness gate — what is outstanding, who signs
OPERATING the four process streams
Layer 1 · Six questions, in decay order
Ordered by how fast the answer decays, not by how the system is organised.
| Q | Question | What it holds |
|---|---|---|
| Q1 | Is anything about to hurt me? | overdue NCRs · permits inside 60 days · live criticals · incidents with a regulatory clock running · major audit findings with no NCR · repeat findings |
| Q2 | What needs me personally? | the decision queue — §7 |
| Q3 | Is the record defensible? | closure by reason · failed-first-fix · self-verified · coverage vs conformity · attestation method mix · investigation method stated · records with no GPS/photo |
| Q4 | Where is it concentrating? | new vs closed · by area · by category · by project · and on the plan |
| Q5 | Is the field reaching me? | undelivered tickets · inspections due vs submitted · last contact per device and inspector |
| Q6 | What is coming? | permits · scheduled inspections and audits · obligations due · the dated constraints issued at phase 2 |
- Q1 is the only part allowed to be red.
- Q3 is the differentiator: it reports on the quality of the evidence, not the performance of the crew.
- Q5 is the honesty panel. No process completes end to end today; a portal that does not say so is lying by omission.
Layer 2 · The two spines the console has never had
- The incident spine. One page per event: observation → evidence → obligation → decision → action → outcome, with the recurrence link. This is the demo's entire narrative and there is nowhere to show it.
DecisionRecordalready has the shape; it needs a live source and a URL. - The project spine.
/projects/[id]/*— everything about one project, composed from the same registers (CONSOLE-IA §4).
7. The decision queue — the portal's centre of gravity
Not a feed. A finite list that empties. Each row is a decision only this person can make, spanning all four processes:
- NCR closures awaiting signature · self-verified closures needing countersignature
- Retractions requested (
not-a-non-conformanceis the only closure that says the finding was wrong — never self-service) - Inspection sections recorded as not-reached, needing acceptance
- Investigation conclusions to accept · notifiable incidents to escalate
- Audit conformity conclusions to sign
- Reports awaiting external release
- Mobilisation readiness sign-offs · bid environmental conditions · budgets
Rules the queue is held to:
- Every row states what happens when you act, and acting makes it shorter. A count that never reaches zero is ignored inside a fortnight.
- Every decision is an appended event naming the person and the grounds — never a status flag.
- Rejection carries a reason and returns the item to its originator.
8. Phase surfaces
- Bid — obligation scope of the tender; comparable history (NCRs per inspection, days open, regulator attention, environmental delay) — the register earning its keep, and the thing a competitor without records cannot price; risk premium (receptors, windows, contaminated ground); inspector capacity against the live portfolio; prequalification evidence on demand. Output: go/no-go with environmental conditions attached.
- Cost · plan — the cost line (inspection labour, monitoring programmes, specialist subconsultants, permit fees, remediation contingency priced from history) and the dated schedule constraints, which is the part that gets missed: permit lead times gate the construction sequence, and environmental windows (in-water timing, nesting, spawning) are hard dates the programme must be built around. Output: signed budget + a list of dated constraints handed to the planner.
- Onboard — CONSOLE-IA §6's seven steps, presented as a readiness gate: boundary and control areas · obligations bound · permits in hand, not applied for · template assigned · a named inspector with a working device · baseline captured · team and roles. Output: mobilisation sign-off — this site may now be operated.
- Manage — §6 and §7.
9. Build order
Ordered so that each step makes the next one possible, and so that the first thing built is the first thing that acts.
- P1 + P3 — identity and the approval vocabulary. Smallest change that turns a dashboard into a portal. Everything else depends on it.
- P4 — merge and verify the branch's D1 store, then decide where decisions live. The NCR store is already built on the working branch; the remaining fork is D1 vs the event log for approvals, and the event log fits better because a decision is a thing whose history matters.
- The decision queue (Q2), NCR share only.
ncrsNeedingManager()already returns it. Highest value per hour, and it is what makes anyone open the portal daily rather than weekly. - The incident spine over a live
DecisionRecord. This is the demo made real, and it is the deck's whole story. - Q3, the integrity panel, against what exists — leaving the coverage tiles honestly empty until inspection records arrive.
- Q5, the honesty panel. Cheap, and it is the difference between a portal and a claim.
- P5 + P6 + phase 3 mobilisation. First real write flow; forces lifecycle state and applicability.
- Audits — structurally the walk that exists, with a different vocabulary throughout. Not a checkbox on the inspection screen.
- Investigations' two missing ends — the incident record and the stated root-cause method. The event vocabulary is already contracted in
packages/esg-events-incident/src/index.ts. - Phases 1–2. New domain; the register earns its keep here. Scope separately, do not let it block 1–9.
Also, and immediately: demote the mock rings on /dashboard. They are the
first thing a visitor sees and the least real thing on the page, sitting above
panels that are genuinely derived.
10. What must never appear
- A single compliance score with no contributors.
- "Closed" as one figure.
- A section with no finding rendered as compliant (BR-S2).
- An audit observation counted as a non-conformance, or a major with no ticket behind it (BR-AU4/5).
- Any inferred value — no interpolated coverage, no assumed location, no "probably delivered" (BR-X4, BR-X5).
- A figure restated by hand rather than derived from the register.
- AI-authored conclusions presented as record. Anything a model produced enters as classify-in, human-confirmed (FM-BOUNDARY).
11. Decisions needed
| ID | Question | Owner |
|---|---|---|
| CG-7 | Does Project gain a lifecycle state, or do phases 1–3 live in a separate pre-award aggregate? Decides whether a bid carries through to a live project without re-keying | architecture |
| CG-6 | Is post-construction monitoring a fifth phase or the tail of the fourth? Environmental obligations routinely outlive the works | director / commercial |
| PT-1 | D1 or the event log for portal writes? (P4) | architecture |
| PT-2 | Cloudflare Access currently 403s the console. Does the portal stay behind Access, or gain its own identity layer? These are not the same decision, and P1 may resolve it | operations |
| PT-3 | Is the portal one surface with role-scoped views, or separate director / manager / inspector surfaces? The decks imply one | product |
| CG-1..CG-5 | as listed in PERSONA-environmental-director.md §9 | — |