The inspection experience — independent UX proposal
- Date: 2026-08-06
- Author: OpenAI Codex (
codex exec --sandbox read-only), briefed by Claude Opus 5 (Claude Code, session 0add9fc1) at Pete's request. - Status: PROPOSAL. Nothing here is built. Read it as an argument, not a decision.
- Brief: the full interaction model (project → map → zoom/drill → assess), where DICTATED NOTES attach and whether a category is required, the multi-discipline model (PM development progress · H&S safety · ESG compliance), and a concrete Ontario Line sample data set.
One correction already applied from it: arch-1 was asked BOTH corridor-wide and at
First Parliament, which gives one check id two answers in a single walk. Fixed in
data/applicability.ts — it is now asked only at z-ol-parliament.
codex I read the field flow, map, location walk, applicability register, checklist schema, event vocabulary, NCR capture, audio engine, work-stage model, and shell navigation. The strongest design is to make the registered location the persistent working context and treat progress, safety, ESG coverage, findings, and evidence as separate append-only observations.
Ranked recommendations
- Preserve one explicit working context throughout: project → inspection → location → optional asset → discipline/check.
- Make “Inspect here” open the selected location directly. It currently only switches to the list.
- Separate coverage, verdicts, notes, and findings. A note or NCR must never imply a check was performed.
- Let dictation attach at location, check, or finding level, but require the operator to choose the attachment before committing.
- Include ESG category classification for findings; exclude it as a mandatory field for neutral location notes and discipline-specific observations.
- Add discipline-scoped assessment events instead of putting H&S and project progress into
LocationInspected. - Keep original audio and the recognizer transcript, plus any operator correction, as distinct facts.
- Present local save, upload attempt, server receipt, and console availability as separate states.
- Give the three unplotted Ontario Line locations geometry before positioning the map as the primary completion surface.
- Label all proposed demo observations as synthetic seed data, never as delivered or field-observed records.
1. The experience
A. Project selection
The shell should open with a sticky project selector showing:
- Project name and stable ID, e.g. Ontario Line /
PRJ-ontario. - Inspection type and template.
- Existing open inspection, if one exists locally.
- Local state: “Saved on this device.”
- Delivery state only when observed: “Not queued,” “Queued,” “Receipt received,” or the actual failure.
Selecting Ontario Line should establish a session context:
projectId: PRJ-ontario
siteName: Ontario Line
inspectionId: newly created or resumed
This agrees with the inheritance already started in ../MyDemos/esgm/apps/esg-field/app/index.tsx and the siteId/siteName inputs in ../MyDemos/esgm/apps/esg-field/screens/inspect/TaskFlow.tsx.
I would change one existing decision: ../MyDemos/esgm/apps/esg-field/screens/inspect/TaskFlow.tsx currently keeps the inherited site editable and allows a typed, unregistered site. For an inspection entered under sticky project context, changing the project should be a deliberate “Leave inspection and switch project” operation. Free typing can remain for investigations or an explicit “Unregistered site” workflow, but should not silently detach an Ontario Line walk from PRJ-ontario.
Creating the inspection appends InspectionCreated locally. It does not claim submission or console delivery.
B. Map home: the default walk surface
Open on:
Ontario Line
Map | List
Corridor · District · Street
10 registered locations
0 assessed · 0 not reached
The map should show all distinct states separately:
- Unvisited: neutral outline.
- In progress/draft: blue or amber draft indicator.
- Assessed, no failures: green.
- Deficiency recorded: red.
- Explicitly not reached: grey hatched or barred.
- Has unsubmitted local evidence: handset badge.
- Delivery receipt obtained: separate receipt icon, never inferred from colour.
The current LocationState in ../MyDemos/esgm/apps/esg-field/screens/inspect/SiteMapView.tsx collapses “not yet visited” and an appended LocationNotReached into "not-reached". That contradicts the semantics carefully documented in ../MyDemos/esgm/apps/esg-field/screens/inspect/LocationWalk.tsx. I recommend at least:
type LocationState =
| "unvisited"
| "in-progress"
| "assessed"
| "deficient"
| "not-reached";
“Worst state present” remains correct for the ESG badge, but the map should not merge workflow state with compliance state. If multiple disciplines are displayed, show either three small discipline badges or one worst-state badge plus a clear segmented detail sheet.
The badge number should not merely be “checks owed.” At minimum label it as 0/7, meaning checks recorded/applicable. The existing bare 7 can be mistaken for seven findings.
C. Zoom and drill
Keep the existing distinction between named zoom and drill-down:
- Corridor: all control areas and coverage.
- District: location names, bindings, discipline badges.
- Street: assets and local work features.
- Breadcrumb: Ontario Line › East Harbour brownfield ›
STK-4.
A location tap should select the location without immediately opening a form. The lower card then shows:
- Registered name and ID.
- What binds there, from
../MyDemos/esgm/apps/esg-field/data/sites.ts. - Applicable checks grouped by category.
- Progress observation and who/when supplied it.
- H&S assessment status and assessor.
- ESG coverage and worst verdict.
- Registered assets.
- Local evidence count and its delivery state.
- Primary action: “Continue assessment” or “Start assessment.”
Assets must be selectable rather than merely printed. Selecting AST-OL-STK-4 should produce:
Ontario Line › East Harbour brownfield › STK-4
The current asset breadcrumb described in the map comments is not implemented: assets are plain text, no asset is selected, and no inspection event carries an assetId.
D. Entering checks without losing map position
This is the most important immediate correction.
SiteMapView.onInspect(locationId) already provides the right identity, but ../MyDemos/esgm/apps/esg-field/screens/inspect/TaskFlow.tsx ignores it and only executes setWalkView("list"). Its own comment admits that it cannot focus the location.
Proposed state:
{
walkView: "map" | "list",
selectedLocationId: string | null,
selectedAssetId: string | null,
mapLevel: "corridor" | "district" | "street",
mapInsideId: string | null,
openCheckId: string | null
}
On “Inspect here”:
- Retain map level, map drill, and scroll offset.
- Set
selectedLocationId. - Open a full-height location sheet or the list view focused and expanded at that location.
- Show only the checks returned by
checksAt(projectId, locationId). - Back/close returns to the same map level, selected area, and viewport.
- “Next location” returns to the map with the completed location visibly updated; it must not silently choose the next register entry.
For example, East Harbour should open only:
waste-1,waste-2,waste-3,waste-4,waste-6,waste-7ero-1,ero-5spill-8
This follows ../MyDemos/esgm/apps/esg-field/data/applicability.ts, rather than presenting all checklist sections.
Draft answers should survive Map/List switching. Committed answers continue to append one LocationInspected event. A later correction appends another event, with the fold displaying the latest while retaining history.
E. Check interaction
Each applicable check row should show:
- Exact check wording.
- Category.
- Applicability reason for this location.
- Existing latest recorded response, assessor, and time.
- Satisfactory / Deficient / N/A.
- Add note.
- Dictate note.
- Add evidence.
- Raise NCR, enabled most prominently following Deficient.
- “Not answered” until an explicit verdict exists.
N/A should require a short reason because applicability says the check normally belongs at this place. It must not be a convenient skip.
A failure and an NCR are separate:
LocationInspectedrecords the check verdict and coverage.NcrRaisedrecords the actionable finding.- The UI should warn when a failed check has no NCR, but allow it if the inspector explicitly confirms “Record deficiency without raising ticket.”
- Conversely, an NCR does not automatically mark the check inspected unless the operator also confirms the verdict.
The current capture flow says a finding without an NCR has no durable home. I propose adding a durable finding/note event rather than requiring every observation to become an NCR.
F. Leaving an action
There are two kinds of state:
- Already appended: safely saved locally.
- Uncommitted draft: text, audio, photos, verdict selections not yet appended.
Leaving with no uncommitted content can simply say “Saved on this device” and exit.
Leaving with a draft should prompt:
- Save for later: append a draft-saved event referencing project, inspection, location, optional asset/check, local evidence URIs, and draft status.
- Keep working.
- Abandon draft: append
DraftAbandonedwith the draft ID and reason/confirmation. Do not delete prior events or necessarily erase evidence immediately.
“Abandon” cannot mean removing anything from the event log. If local media cleanup is later allowed, it should be governed by a separate retention event and policy.
This contradicts the top-level comment in ../MyDemos/esgm/apps/esg-field/screens/inspect/TaskFlow.tsx, which says leaving needs no decision because everything is already durable. That is true only after append; LocationWalk currently holds uncommitted drafts in React state.
2. Dictated notes
Attachment model
Support all three, but make their meanings explicit.
1. Location note
Example: “Access to the south end is blocked by the rail possession.”
Attachment:
inspectionId
locationId: z-ol-lakeshore
assetId: null
checkId: null
findingId: null
discipline: general/site-coordination
This records context. It creates neither ESG coverage nor a finding.
2. Check note
Example: “Silt fence is intact except for a two-metre tear beside the haul crossing.”
Attachment:
locationId: z-ol-portlands
categoryId: erosion
checkId: ero-6
It explains a separately selected verdict. The note alone does not establish the verdict.
3. Finding note
Example: “Two-metre tear in perimeter silt fence with sediment visible beyond the control.”
Attachment:
findingId
locationId
optional assetId
categoryId
optional checkId
This is the appropriate source for an NCR.
The capture affordance should therefore ask first:
What are you recording?
[Location note] [Check note] [Finding]
When invoked from a check, “Check note” is preselected and the check is already bound. When invoked from “Raise NCR,” “Finding” is preselected.
Category: included or excluded?
Ranked recommendation:
- Include category as a required confirmed field for a finding.
- Derive and lock category from the parent check for a check note.
- Exclude category as a mandatory part of the neutral location-note flow.
- Allow an optional discipline/topic tag on a location note, including “General/site coordination.”
Why:
- A finding must be classified for routing, reporting, and NCR ownership.
- A check already has a category through
sectionOfCheck(checkId); asking again invites contradiction. - A neutral location note may concern access, sequencing, weather, logistics, progress, or safety. Forcing it into one of the eight environmental
CATEGORIESwould fabricate an environmental classification. - Category never establishes coverage. An erosion finding at Port Lands does not mean all erosion checks there were performed.
Keep general excluded from environmental finding categories, as ../MyDemos/esgm/apps/esg-field/data/capture.ts currently does. gen-1 is project confirmation, not a useful NCR category. Add separate non-ESG disciplines/categories instead of misusing general.
This partly contradicts ../MyDemos/esgm/apps/esg-field/screens/capture/CaptureSheet.tsx, which currently requires site, environmental category, and severity for every captured ticket. That is suitable for an NCR but not for the broader note flow requested here.
Informed category selection
At selection time, each category should show more than its title:
- Category title and ID, e.g. “Erosion and Sediment Control ·
erosion.” - A one-sentence scope definition.
- Applicable checks at the current location, with exact IDs.
- Why the category applies there, from the location
bindsand governed applicability entry. - Examples of what belongs and does not belong.
- Existing coverage: “2 of 6 applicable checks answered.”
- Existing findings: “1 open finding.”
- Last assessor and timestamp, where present.
- “Suggested from transcript” only when it is a heuristic, never presented as selected.
- “Not applicable at this location” for categories absent from the applicability map, with an explicit override reason if users must be allowed to choose one.
For Port Lands, selecting Erosion should show:
Applies here because this area covers river naturalisation and water controls.
Checks: ero-1, ero-2, ero-3, ero-4, ero-6
Includes: stabilization, ESC condition, drainage, off-site sediment, perimeter controls.
Does not by itself mean any of these checks has been inspected.
The keyword suggestion in ../MyDemos/esgm/apps/esg-field/screens/capture/ReviewCapture.tsx is acceptable as a suggestion, but the operator must confirm it.
Audio and transcript record
Keep both whenever the on-device engine produces a recording.
The record should distinguish:
- Original audio URI and hash.
- Recognizer’s original transcript.
- Engine ID, on-device flag, model/version if available, language, and confidence if available.
- Operator-confirmed text.
- Whether the operator changed it.
- Capture time and duration.
- Attachment scope.
- Local retention state.
- Delivery state for audio independently of the event metadata.
Do not overwrite the recognizer transcript when the operator corrects it. Append a confirmation/correction event containing the confirmed text and the source note ID. The audio remains the source of what was spoken; confirmed text is the operator’s accepted interpretation.
Before commit, show:
- Audio playback with duration, or “No recording retained.”
- Original transcript labelled “On-device transcription.”
- Editable “Confirmed note.”
- A visible diff or at least “Edited after transcription.”
- Attachment: location, asset if any, check if any, or finding.
- Category and why it was selected.
- Verdict separately, if this is a check note.
- Photos and GPS actually captured, including “No GPS fix.”
- Storage statement: “Audio and photos are saved on this handset.”
- No delivery wording unless a receipt has actually been observed.
The current NcrEvidence retains audioUri and transcript, and CapturedEvidence retains multiple VoiceNotes. That is directionally correct. The event vocabulary only has one audio slot, while the capture sheet may make multiple recordings; silently keeping only the first URI is insufficient. Either append one note event per recording or change the new note event to carry all recording references.
3. Multi-discipline assessments
Do not make one mutable “area assessment.” Model an area as a shared subject receiving independent append-only contributions.
Proposed event shape
Add an event such as:
LocationAssessmentRecorded: {
projectId: string;
inspectionId: string | null;
locationId: string;
assetId: string | null;
discipline: "development" | "health-safety" | "esg";
frameworkId: string;
frameworkVersion: string;
assessorId: string;
assessmentId: string;
responses: readonly AssessmentResponse[];
noteIds: readonly string[];
}
In practice, I would retain the specialized existing events where they express the domain more cleanly:
- Development:
LocationStageObserved. - ESG:
LocationInspected,SiteChecksRecorded, findings and NCR events. - H&S: new
SafetyAssessmentRecordedand safety-finding events. - Cross-discipline context: new
LocationNoteRecorded.
Every event carries the assessor identity. Corrections append a new event referencing correctsEventId or supersedesAssessmentId; nothing overwrites another assessor’s contribution.
Coverage keys
Coverage must be keyed by:
project + location + discipline + framework/version + required item
Not merely by location or category.
Thus:
- A project manager confirming “structure” does not satisfy an ESG check.
- An H&S inspection does not mark the location environmentally compliant.
- An erosion NCR does not establish erosion coverage.
- Two ESG assessors can contribute separate check responses without either erasing the other’s event.
The read model may present the latest accepted response per check, but history and authorship remain accessible. If assessors disagree, show “conflicting observations,” not a silent latest-wins green state.
What each person sees
Project manager
- Stage vocabulary from
../MyDemos/esgm/apps/esg-field/data/workStages.ts. - Previous stage, source, and whether it was a synthetic seed or observed event.
- Stalled/regressed/out-of-sequence signals.
- Delivery and access blockers.
- ESG and safety summary badges, read-only unless they hold those roles.
Important existing gap: Ontario Line has no entries in STAGE_AT_LAST_SURVEY; only Eglinton is seeded. The UI must show “No prior stage observation,” not translate the fallback not-started into a real field claim.
H&S assessor
- Safety framework items applicable to the current work stage and assets.
- Hazards, controls, stop-work observations, and safety NCRs.
- Development stage for context.
- ESG summary only where relevant, e.g. hazardous storage or spill risk.
- No ability to overwrite ESG responses.
There is currently no H&S checklist or safety event vocabulary in the reviewed code. This portion is a new product model, not an existing capability.
ESG inspector
- Applicable environmental checks from
../MyDemos/esgm/apps/esg-field/data/applicability.ts. - Prior ESG responses, findings, evidence, NCR state, and separate coverage.
- Current work stage and safety constraints as context.
- No ability to revise another discipline’s observation.
Console
For each location, display three independently sourced columns:
| Discipline | Display |
|---|---|
| Development | Latest observed stage, assessor/time, movement signal |
| H&S | Coverage, worst assessment, open safety findings |
| ESG | Checks answered/applicable, worst verdict, open ESG NCRs |
A combined area colour should be reserved for an explicitly labelled “worst across disciplines” overview. Never show a single green area if one discipline is unassessed.
4. Ontario Line sample data
This should be clearly labelled “Synthetic demo scenario — not a field record.” Use a single coherent story: advancing excavation and structure works create water, sediment, dust, community, soil, heritage, and habitat pressure along the corridor.
The proposed stage values below are synthetic demo inputs, not values currently in workStages.ts.
1. Exhibition shoreline — z-ol-exhib
Registered asset:
AST-OL-DUST-2/DUST-2, Shoreline dust monitor.
Demo stage: establishment.
ESG coverage: all seven applicable checks answered.
Failure:
air-3— dust controls are not being used as required.
Dictated finding:
“Water suppression stopped during aggregate unloading. Visible dust crossed the south hoarding toward the shoreline for about three minutes.”
Category: air.
Attachment: location + AST-OL-DUST-2 + air-3.
Other applicable checks pass: air-1, ero-1, ero-3, ero-4, ero-6, waste-4.
The distinction is deliberate: dust was observed inside/at the boundary, but do not fail air-1 unless the demo explicitly says it left the project area.
2. Tunnel dewatering — z-ol-dewater
Assets:
AST-OL-DEW-3/DEW-3.AST-OL-SET-1/SET-1.
Demo stage: excavation.
Failures:
ero-3— sediment not cleared from drainage path.spill-8— evidence of a new minor leak.
Dictated finding:
“Sediment has accumulated in the discharge-side sump at DEW-3, and a fresh hydraulic sheen is visible beneath the transfer pump. Flow remains contained on the pad.”
Categories:
erosionforero-3.spillforspill-8.
Record these as two findings because they have different categories, controls, and corrective actions. Do not describe it as discharged to sewer or water unless entered.
Pass: well-1, air-2, ero-2, ero-4, waste-4.
3. Downtown receptors — z-ol-downtown
Asset:
AST-OL-NOI-5/NOI-5.
Demo stage: structure.
Failures:
light-1— light spill.air-4— noise/vibration plan control not maintained.
Dictated finding:
“The east tower light is aimed toward the Queen Street residences, and the acoustic curtain beside the loading gate is open during night deliveries.”
Categories:
lightfor the tower light.airforair-4, because that is where the current schema places noise and vibration controls.
Pass: air-1, waste-1, spill-7.
This exposes a schema naming weakness: noise lives in the air section. Do not invent a noise category until the governed schema adds one.
4. First Parliament — z-ol-parliament
Asset:
AST-OL-ARCH-1/ARCH-1.
Demo stage: excavation.
Failure:
arch-1.
Dictated finding:
“The archaeological exclusion-zone sign at the north access is lying face down, and the temporary barrier has a gap wide enough for equipment entry.”
Category: archaeological.
Pass: ero-1, ero-6, veg-4.
Do not say an artifact was found; nobody entered that fact.
5. East Harbour brownfield — z-ol-eastharbour
Asset:
AST-OL-STK-4/STK-4.
Demo stage: excavation.
Failures:
waste-1— label not legible.ero-5— mud tracking not controlled.
Dictated findings:
“The identification label on stockpile STK-4 is weather-damaged and the source area cannot be read.”
Category: waste, check waste-1.
“Mud is tracking from the south gate onto the internal paved haul route; the wheel-cleaning pass is not removing material from rear tires.”
Category: erosion, check ero-5.
Pass: waste-2, waste-3, waste-4, waste-6, waste-7, ero-1, spill-8.
Do not claim the stockpile is contaminated or violates its RSC; the observation is only an unreadable label.
6. Port Lands naturalisation — z-ol-portlands
Asset:
AST-OL-TURB-2/TURB-2.
Demo stage: reinstatement.
Failures:
ero-2.ero-6.
One finding may bind to both checks only if the event model supports multiple check IDs. With the current single itemId, record one primary check and an additional linked observation.
Dictated finding:
“The perimeter silt fence beside the river-mouth access has a two-metre tear at the haul crossing, with sediment deposited immediately outside the control.”
Category: erosion.
Pass: ero-1, ero-3, ero-4, veg-2, veg-3, veg-5, spill-2, spill-3, spill-8.
The phrase “immediately outside the control” avoids claiming sediment entered the river.
7. Don valley · TRCA — z-ol-donvalley
Asset:
AST-OL-BIRD-1/BIRD-1.
Demo stage: establishment.
Failure:
veg-2.
Dictated finding:
“The nesting-bird buffer marker at observation point BIRD-1 is missing on the trail side; the remaining markers are intact and no nest was observed during this check.”
Category: vegetation.
Pass:
veg-3,veg-4,veg-5ero-1,ero-2,ero-6light-1
This keeps coverage honest: veg-4 can be passed only because the demo explicitly says no nest was observed.
8. Lakeshore East corridor — z-ol-lakeshore
Asset:
AST-OL-SK-6/SK-6.
Demo stage: establishment.
Coverage state: explicitly not reached.
Reason:
“Rail possession boundary was closed to the inspection team; assessment deferred to the next authorized access window.”
No checks pass or fail. No category is marked compliant. The applicable checks remain unanswered:
ero-1,ero-3,ero-6,waste-4,spill-8,air-1.
This location currently has no plotted geometry, so it must remain visible in the registered-unplotted list.
9. Thorncliffe Park — z-ol-thorncliffe
Asset:
AST-OL-WASH-3/WASH-3.
Demo stage: backfill.
Failures:
ero-5.air-1.
Dictated finding:
“Wheel wash WASH-3 is operating, but trucks are carrying wet material beyond the exit and a visible dust plume followed the last outbound load along the haul route.”
Categories:
erosionforero-5.airforair-1.
Pass: air-3, air-4, light-1, waste-1.
Again, two findings are clearer than one mixed-category NCR.
10. Flemingdon Park — z-ol-flemingdon
No registered asset currently exists in ../MyDemos/esgm/apps/esg-field/data/sites.ts. The demo must show “No asset registered,” not invent one.
Demo stage: not started, but only if a project manager explicitly enters that value. Otherwise show “No stage observation.”
ESG coverage: all applicable checks answered, no failures:
veg-2,veg-4,veg-5ero-1,ero-2,ero-6
Dictated location note:
“No active construction was observed inside the registered Flemingdon Park area. Existing perimeter controls were inspected from the authorized access side.”
Category: none required because this is a location note, not a finding.
The individual passes still require explicit operator responses. The note alone does not make the six checks compliant.
Site-wide Ontario Line responses
Record separately through SiteChecksRecorded:
gen-1: pass only after the operator explicitly confirms Ontario Line.spill-1: pass if the plan is actually observed posted.veg-1: do not default. Record pass, fail, or N/A only from an explicit observation.arch-1: there is a current duplication problem: it is site-wide and also assigned to First Parliament in../MyDemos/esgm/apps/esg-field/data/applicability.ts. I recommend removing it from Ontario LinesiteWideor defining two distinct checks: corridor permit availability versus location protection condition.
That last recommendation contradicts the existing applicability decision. As written, one arch-1 question is asked once corridor-wide and again at z-ol-parliament, which makes the final folded meaning ambiguous.
Explicit contradictions and current gaps
The following proposals intentionally contradict or extend current code:
onInspect(locationId)should focus and open that location; it currently discards the ID and merely switches Map → List.- Map state should distinguish unvisited from explicitly not reached; current
LocationStatedoes not. - Sticky inspection project should not remain casually editable; the current new-task site field is editable.
- Leaving with a React-state draft must prompt;
TaskFlowcurrently assumes everything visible is already durable. - Assets should be selectable and event-bound; currently they are display-only and no event payload carries
assetId. - Notes need their own durable event home; the current NCR capture explicitly refuses to save a finding without an NCR.
- Multi-recording audio needs complete event representation; current NCR evidence has one
audioUri. - Operator-corrected text should not overwrite the original recognizer transcript; current
ReviewCaptureproduces one finaltranscript. - H&S assessment events and framework do not currently exist.
- Ontario Line development-stage seed data does not currently exist.
arch-1should not remain both site-wide and location-specific without separating its two meanings.- The three unplotted locations—
z-ol-lakeshore,z-ol-thorncliffe, andz-ol-flemingdon—cannot participate equally in spatial drill-down until geometry is registered. - The current project-level sign-off counts in
TaskFloware still based largely on nine sectionAreaInspectedevents; location-walk sign-off should instead usefoldCoverageand explicitly report location/check coverage. Otherwise the operator can complete a place-first walk while the signature screen reports misleading section totals.
73,614 I read the field flow, map, location walk, applicability register, checklist schema, event vocabulary, NCR capture, audio engine, work-stage model, and shell navigation. The strongest design is to make the registered location the persistent working context and treat progress, safety, ESG coverage, findings, and evidence as separate append-only observations.
Ranked recommendations
- Preserve one explicit working context throughout: project → inspection → location → optional asset → discipline/check.
- Make “Inspect here” open the selected location directly. It currently only switches to the list.
- Separate coverage, verdicts, notes, and findings. A note or NCR must never imply a check was performed.
- Let dictation attach at location, check, or finding level, but require the operator to choose the attachment before committing.
- Include ESG category classification for findings; exclude it as a mandatory field for neutral location notes and discipline-specific observations.
- Add discipline-scoped assessment events instead of putting H&S and project progress into
LocationInspected. - Keep original audio and the recognizer transcript, plus any operator correction, as distinct facts.
- Present local save, upload attempt, server receipt, and console availability as separate states.
- Give the three unplotted Ontario Line locations geometry before positioning the map as the primary completion surface.
- Label all proposed demo observations as synthetic seed data, never as delivered or field-observed records.
1. The experience
A. Project selection
The shell should open with a sticky project selector showing:
- Project name and stable ID, e.g. Ontario Line /
PRJ-ontario. - Inspection type and template.
- Existing open inspection, if one exists locally.
- Local state: “Saved on this device.”
- Delivery state only when observed: “Not queued,” “Queued,” “Receipt received,” or the actual failure.
Selecting Ontario Line should establish a session context:
projectId: PRJ-ontario
siteName: Ontario Line
inspectionId: newly created or resumed
This agrees with the inheritance already started in ../MyDemos/esgm/apps/esg-field/app/index.tsx and the siteId/siteName inputs in ../MyDemos/esgm/apps/esg-field/screens/inspect/TaskFlow.tsx.
I would change one existing decision: ../MyDemos/esgm/apps/esg-field/screens/inspect/TaskFlow.tsx currently keeps the inherited site editable and allows a typed, unregistered site. For an inspection entered under sticky project context, changing the project should be a deliberate “Leave inspection and switch project” operation. Free typing can remain for investigations or an explicit “Unregistered site” workflow, but should not silently detach an Ontario Line walk from PRJ-ontario.
Creating the inspection appends InspectionCreated locally. It does not claim submission or console delivery.
B. Map home: the default walk surface
Open on:
Ontario Line
Map | List
Corridor · District · Street
10 registered locations
0 assessed · 0 not reached
The map should show all distinct states separately:
- Unvisited: neutral outline.
- In progress/draft: blue or amber draft indicator.
- Assessed, no failures: green.
- Deficiency recorded: red.
- Explicitly not reached: grey hatched or barred.
- Has unsubmitted local evidence: handset badge.
- Delivery receipt obtained: separate receipt icon, never inferred from colour.
The current LocationState in ../MyDemos/esgm/apps/esg-field/screens/inspect/SiteMapView.tsx collapses “not yet visited” and an appended LocationNotReached into "not-reached". That contradicts the semantics carefully documented in ../MyDemos/esgm/apps/esg-field/screens/inspect/LocationWalk.tsx. I recommend at least:
type LocationState =
| "unvisited"
| "in-progress"
| "assessed"
| "deficient"
| "not-reached";
“Worst state present” remains correct for the ESG badge, but the map should not merge workflow state with compliance state. If multiple disciplines are displayed, show either three small discipline badges or one worst-state badge plus a clear segmented detail sheet.
The badge number should not merely be “checks owed.” At minimum label it as 0/7, meaning checks recorded/applicable. The existing bare 7 can be mistaken for seven findings.
C. Zoom and drill
Keep the existing distinction between named zoom and drill-down:
- Corridor: all control areas and coverage.
- District: location names, bindings, discipline badges.
- Street: assets and local work features.
- Breadcrumb: Ontario Line › East Harbour brownfield ›
STK-4.
A location tap should select the location without immediately opening a form. The lower card then shows:
- Registered name and ID.
- What binds there, from
../MyDemos/esgm/apps/esg-field/data/sites.ts. - Applicable checks grouped by category.
- Progress observation and who/when supplied it.
- H&S assessment status and assessor.
- ESG coverage and worst verdict.
- Registered assets.
- Local evidence count and its delivery state.
- Primary action: “Continue assessment” or “Start assessment.”
Assets must be selectable rather than merely printed. Selecting AST-OL-STK-4 should produce:
Ontario Line › East Harbour brownfield › STK-4
The current asset breadcrumb described in the map comments is not implemented: assets are plain text, no asset is selected, and no inspection event carries an assetId.
D. Entering checks without losing map position
This is the most important immediate correction.
SiteMapView.onInspect(locationId) already provides the right identity, but ../MyDemos/esgm/apps/esg-field/screens/inspect/TaskFlow.tsx ignores it and only executes setWalkView("list"). Its own comment admits that it cannot focus the location.
Proposed state:
{
walkView: "map" | "list",
selectedLocationId: string | null,
selectedAssetId: string | null,
mapLevel: "corridor" | "district" | "street",
mapInsideId: string | null,
openCheckId: string | null
}
On “Inspect here”:
- Retain map level, map drill, and scroll offset.
- Set
selectedLocationId. - Open a full-height location sheet or the list view focused and expanded at that location.
- Show only the checks returned by
checksAt(projectId, locationId). - Back/close returns to the same map level, selected area, and viewport.
- “Next location” returns to the map with the completed location visibly updated; it must not silently choose the next register entry.
For example, East Harbour should open only:
waste-1,waste-2,waste-3,waste-4,waste-6,waste-7ero-1,ero-5spill-8
This follows ../MyDemos/esgm/apps/esg-field/data/applicability.ts, rather than presenting all checklist sections.
Draft answers should survive Map/List switching. Committed answers continue to append one LocationInspected event. A later correction appends another event, with the fold displaying the latest while retaining history.
E. Check interaction
Each applicable check row should show:
- Exact check wording.
- Category.
- Applicability reason for this location.
- Existing latest recorded response, assessor, and time.
- Satisfactory / Deficient / N/A.
- Add note.
- Dictate note.
- Add evidence.
- Raise NCR, enabled most prominently following Deficient.
- “Not answered” until an explicit verdict exists.
N/A should require a short reason because applicability says the check normally belongs at this place. It must not be a convenient skip.
A failure and an NCR are separate:
LocationInspectedrecords the check verdict and coverage.NcrRaisedrecords the actionable finding.- The UI should warn when a failed check has no NCR, but allow it if the inspector explicitly confirms “Record deficiency without raising ticket.”
- Conversely, an NCR does not automatically mark the check inspected unless the operator also confirms the verdict.
The current capture flow says a finding without an NCR has no durable home. I propose adding a durable finding/note event rather than requiring every observation to become an NCR.
F. Leaving an action
There are two kinds of state:
- Already appended: safely saved locally.
- Uncommitted draft: text, audio, photos, verdict selections not yet appended.
Leaving with no uncommitted content can simply say “Saved on this device” and exit.
Leaving with a draft should prompt:
- Save for later: append a draft-saved event referencing project, inspection, location, optional asset/check, local evidence URIs, and draft status.
- Keep working.
- Abandon draft: append
DraftAbandonedwith the draft ID and reason/confirmation. Do not delete prior events or necessarily erase evidence immediately.
“Abandon” cannot mean removing anything from the event log. If local media cleanup is later allowed, it should be governed by a separate retention event and policy.
This contradicts the top-level comment in ../MyDemos/esgm/apps/esg-field/screens/inspect/TaskFlow.tsx, which says leaving needs no decision because everything is already durable. That is true only after append; LocationWalk currently holds uncommitted drafts in React state.
2. Dictated notes
Attachment model
Support all three, but make their meanings explicit.
1. Location note
Example: “Access to the south end is blocked by the rail possession.”
Attachment:
inspectionId
locationId: z-ol-lakeshore
assetId: null
checkId: null
findingId: null
discipline: general/site-coordination
This records context. It creates neither ESG coverage nor a finding.
2. Check note
Example: “Silt fence is intact except for a two-metre tear beside the haul crossing.”
Attachment:
locationId: z-ol-portlands
categoryId: erosion
checkId: ero-6
It explains a separately selected verdict. The note alone does not establish the verdict.
3. Finding note
Example: “Two-metre tear in perimeter silt fence with sediment visible beyond the control.”
Attachment:
findingId
locationId
optional assetId
categoryId
optional checkId
This is the appropriate source for an NCR.
The capture affordance should therefore ask first:
What are you recording?
[Location note] [Check note] [Finding]
When invoked from a check, “Check note” is preselected and the check is already bound. When invoked from “Raise NCR,” “Finding” is preselected.
Category: included or excluded?
Ranked recommendation:
- Include category as a required confirmed field for a finding.
- Derive and lock category from the parent check for a check note.
- Exclude category as a mandatory part of the neutral location-note flow.
- Allow an optional discipline/topic tag on a location note, including “General/site coordination.”
Why:
- A finding must be classified for routing, reporting, and NCR ownership.
- A check already has a category through
sectionOfCheck(checkId); asking again invites contradiction. - A neutral location note may concern access, sequencing, weather, logistics, progress, or safety. Forcing it into one of the eight environmental
CATEGORIESwould fabricate an environmental classification. - Category never establishes coverage. An erosion finding at Port Lands does not mean all erosion checks there were performed.
Keep general excluded from environmental finding categories, as ../MyDemos/esgm/apps/esg-field/data/capture.ts currently does. gen-1 is project confirmation, not a useful NCR category. Add separate non-ESG disciplines/categories instead of misusing general.
This partly contradicts ../MyDemos/esgm/apps/esg-field/screens/capture/CaptureSheet.tsx, which currently requires site, environmental category, and severity for every captured ticket. That is suitable for an NCR but not for the broader note flow requested here.
Informed category selection
At selection time, each category should show more than its title:
- Category title and ID, e.g. “Erosion and Sediment Control ·
erosion.” - A one-sentence scope definition.
- Applicable checks at the current location, with exact IDs.
- Why the category applies there, from the location
bindsand governed applicability entry. - Examples of what belongs and does not belong.
- Existing coverage: “2 of 6 applicable checks answered.”
- Existing findings: “1 open finding.”
- Last assessor and timestamp, where present.
- “Suggested from transcript” only when it is a heuristic, never presented as selected.
- “Not applicable at this location” for categories absent from the applicability map, with an explicit override reason if users must be allowed to choose one.
For Port Lands, selecting Erosion should show:
Applies here because this area covers river naturalisation and water controls.
Checks: ero-1, ero-2, ero-3, ero-4, ero-6
Includes: stabilization, ESC condition, drainage, off-site sediment, perimeter controls.
Does not by itself mean any of these checks has been inspected.
The keyword suggestion in ../MyDemos/esgm/apps/esg-field/screens/capture/ReviewCapture.tsx is acceptable as a suggestion, but the operator must confirm it.
Audio and transcript record
Keep both whenever the on-device engine produces a recording.
The record should distinguish:
- Original audio URI and hash.
- Recognizer’s original transcript.
- Engine ID, on-device flag, model/version if available, language, and confidence if available.
- Operator-confirmed text.
- Whether the operator changed it.
- Capture time and duration.
- Attachment scope.
- Local retention state.
- Delivery state for audio independently of the event metadata.
Do not overwrite the recognizer transcript when the operator corrects it. Append a confirmation/correction event containing the confirmed text and the source note ID. The audio remains the source of what was spoken; confirmed text is the operator’s accepted interpretation.
Before commit, show:
- Audio playback with duration, or “No recording retained.”
- Original transcript labelled “On-device transcription.”
- Editable “Confirmed note.”
- A visible diff or at least “Edited after transcription.”
- Attachment: location, asset if any, check if any, or finding.
- Category and why it was selected.
- Verdict separately, if this is a check note.
- Photos and GPS actually captured, including “No GPS fix.”
- Storage statement: “Audio and photos are saved on this handset.”
- No delivery wording unless a receipt has actually been observed.
The current NcrEvidence retains audioUri and transcript, and CapturedEvidence retains multiple VoiceNotes. That is directionally correct. The event vocabulary only has one audio slot, while the capture sheet may make multiple recordings; silently keeping only the first URI is insufficient. Either append one note event per recording or change the new note event to carry all recording references.
3. Multi-discipline assessments
Do not make one mutable “area assessment.” Model an area as a shared subject receiving independent append-only contributions.
Proposed event shape
Add an event such as:
LocationAssessmentRecorded: {
projectId: string;
inspectionId: string | null;
locationId: string;
assetId: string | null;
discipline: "development" | "health-safety" | "esg";
frameworkId: string;
frameworkVersion: string;
assessorId: string;
assessmentId: string;
responses: readonly AssessmentResponse[];
noteIds: readonly string[];
}
In practice, I would retain the specialized existing events where they express the domain more cleanly:
- Development:
LocationStageObserved. - ESG:
LocationInspected,SiteChecksRecorded, findings and NCR events. - H&S: new
SafetyAssessmentRecordedand safety-finding events. - Cross-discipline context: new
LocationNoteRecorded.
Every event carries the assessor identity. Corrections append a new event referencing correctsEventId or supersedesAssessmentId; nothing overwrites another assessor’s contribution.
Coverage keys
Coverage must be keyed by:
project + location + discipline + framework/version + required item
Not merely by location or category.
Thus:
- A project manager confirming “structure” does not satisfy an ESG check.
- An H&S inspection does not mark the location environmentally compliant.
- An erosion NCR does not establish erosion coverage.
- Two ESG assessors can contribute separate check responses without either erasing the other’s event.
The read model may present the latest accepted response per check, but history and authorship remain accessible. If assessors disagree, show “conflicting observations,” not a silent latest-wins green state.
What each person sees
Project manager
- Stage vocabulary from
../MyDemos/esgm/apps/esg-field/data/workStages.ts. - Previous stage, source, and whether it was a synthetic seed or observed event.
- Stalled/regressed/out-of-sequence signals.
- Delivery and access blockers.
- ESG and safety summary badges, read-only unless they hold those roles.
Important existing gap: Ontario Line has no entries in STAGE_AT_LAST_SURVEY; only Eglinton is seeded. The UI must show “No prior stage observation,” not translate the fallback not-started into a real field claim.
H&S assessor
- Safety framework items applicable to the current work stage and assets.
- Hazards, controls, stop-work observations, and safety NCRs.
- Development stage for context.
- ESG summary only where relevant, e.g. hazardous storage or spill risk.
- No ability to overwrite ESG responses.
There is currently no H&S checklist or safety event vocabulary in the reviewed code. This portion is a new product model, not an existing capability.
ESG inspector
- Applicable environmental checks from
../MyDemos/esgm/apps/esg-field/data/applicability.ts. - Prior ESG responses, findings, evidence, NCR state, and separate coverage.
- Current work stage and safety constraints as context.
- No ability to revise another discipline’s observation.
Console
For each location, display three independently sourced columns:
| Discipline | Display |
|---|---|
| Development | Latest observed stage, assessor/time, movement signal |
| H&S | Coverage, worst assessment, open safety findings |
| ESG | Checks answered/applicable, worst verdict, open ESG NCRs |
A combined area colour should be reserved for an explicitly labelled “worst across disciplines” overview. Never show a single green area if one discipline is unassessed.
4. Ontario Line sample data
This should be clearly labelled “Synthetic demo scenario — not a field record.” Use a single coherent story: advancing excavation and structure works create water, sediment, dust, community, soil, heritage, and habitat pressure along the corridor.
The proposed stage values below are synthetic demo inputs, not values currently in workStages.ts.
1. Exhibition shoreline — z-ol-exhib
Registered asset:
AST-OL-DUST-2/DUST-2, Shoreline dust monitor.
Demo stage: establishment.
ESG coverage: all seven applicable checks answered.
Failure:
air-3— dust controls are not being used as required.
Dictated finding:
“Water suppression stopped during aggregate unloading. Visible dust crossed the south hoarding toward the shoreline for about three minutes.”
Category: air.
Attachment: location + AST-OL-DUST-2 + air-3.
Other applicable checks pass: air-1, ero-1, ero-3, ero-4, ero-6, waste-4.
The distinction is deliberate: dust was observed inside/at the boundary, but do not fail air-1 unless the demo explicitly says it left the project area.
2. Tunnel dewatering — z-ol-dewater
Assets:
AST-OL-DEW-3/DEW-3.AST-OL-SET-1/SET-1.
Demo stage: excavation.
Failures:
ero-3— sediment not cleared from drainage path.spill-8— evidence of a new minor leak.
Dictated finding:
“Sediment has accumulated in the discharge-side sump at DEW-3, and a fresh hydraulic sheen is visible beneath the transfer pump. Flow remains contained on the pad.”
Categories:
erosionforero-3.spillforspill-8.
Record these as two findings because they have different categories, controls, and corrective actions. Do not describe it as discharged to sewer or water unless entered.
Pass: well-1, air-2, ero-2, ero-4, waste-4.
3. Downtown receptors — z-ol-downtown
Asset:
AST-OL-NOI-5/NOI-5.
Demo stage: structure.
Failures:
light-1— light spill.air-4— noise/vibration plan control not maintained.
Dictated finding:
“The east tower light is aimed toward the Queen Street residences, and the acoustic curtain beside the loading gate is open during night deliveries.”
Categories:
lightfor the tower light.airforair-4, because that is where the current schema places noise and vibration controls.
Pass: air-1, waste-1, spill-7.
This exposes a schema naming weakness: noise lives in the air section. Do not invent a noise category until the governed schema adds one.
4. First Parliament — z-ol-parliament
Asset:
AST-OL-ARCH-1/ARCH-1.
Demo stage: excavation.
Failure:
arch-1.
Dictated finding:
“The archaeological exclusion-zone sign at the north access is lying face down, and the temporary barrier has a gap wide enough for equipment entry.”
Category: archaeological.
Pass: ero-1, ero-6, veg-4.
Do not say an artifact was found; nobody entered that fact.
5. East Harbour brownfield — z-ol-eastharbour
Asset:
AST-OL-STK-4/STK-4.
Demo stage: excavation.
Failures:
waste-1— label not legible.ero-5— mud tracking not controlled.
Dictated findings:
“The identification label on stockpile STK-4 is weather-damaged and the source area cannot be read.”
Category: waste, check waste-1.
“Mud is tracking from the south gate onto the internal paved haul route; the wheel-cleaning pass is not removing material from rear tires.”
Category: erosion, check ero-5.
Pass: waste-2, waste-3, waste-4, waste-6, waste-7, ero-1, spill-8.
Do not claim the stockpile is contaminated or violates its RSC; the observation is only an unreadable label.
6. Port Lands naturalisation — z-ol-portlands
Asset:
AST-OL-TURB-2/TURB-2.
Demo stage: reinstatement.
Failures:
ero-2.ero-6.
One finding may bind to both checks only if the event model supports multiple check IDs. With the current single itemId, record one primary check and an additional linked observation.
Dictated finding:
“The perimeter silt fence beside the river-mouth access has a two-metre tear at the haul crossing, with sediment deposited immediately outside the control.”
Category: erosion.
Pass: ero-1, ero-3, ero-4, veg-2, veg-3, veg-5, spill-2, spill-3, spill-8.
The phrase “immediately outside the control” avoids claiming sediment entered the river.
7. Don valley · TRCA — z-ol-donvalley
Asset:
AST-OL-BIRD-1/BIRD-1.
Demo stage: establishment.
Failure:
veg-2.
Dictated finding:
“The nesting-bird buffer marker at observation point BIRD-1 is missing on the trail side; the remaining markers are intact and no nest was observed during this check.”
Category: vegetation.
Pass:
veg-3,veg-4,veg-5ero-1,ero-2,ero-6light-1
This keeps coverage honest: veg-4 can be passed only because the demo explicitly says no nest was observed.
8. Lakeshore East corridor — z-ol-lakeshore
Asset:
AST-OL-SK-6/SK-6.
Demo stage: establishment.
Coverage state: explicitly not reached.
Reason:
“Rail possession boundary was closed to the inspection team; assessment deferred to the next authorized access window.”
No checks pass or fail. No category is marked compliant. The applicable checks remain unanswered:
ero-1,ero-3,ero-6,waste-4,spill-8,air-1.
This location currently has no plotted geometry, so it must remain visible in the registered-unplotted list.
9. Thorncliffe Park — z-ol-thorncliffe
Asset:
AST-OL-WASH-3/WASH-3.
Demo stage: backfill.
Failures:
ero-5.air-1.
Dictated finding:
“Wheel wash WASH-3 is operating, but trucks are carrying wet material beyond the exit and a visible dust plume followed the last outbound load along the haul route.”
Categories:
erosionforero-5.airforair-1.
Pass: air-3, air-4, light-1, waste-1.
Again, two findings are clearer than one mixed-category NCR.
10. Flemingdon Park — z-ol-flemingdon
No registered asset currently exists in ../MyDemos/esgm/apps/esg-field/data/sites.ts. The demo must show “No asset registered,” not invent one.
Demo stage: not started, but only if a project manager explicitly enters that value. Otherwise show “No stage observation.”
ESG coverage: all applicable checks answered, no failures:
veg-2,veg-4,veg-5ero-1,ero-2,ero-6
Dictated location note:
“No active construction was observed inside the registered Flemingdon Park area. Existing perimeter controls were inspected from the authorized access side.”
Category: none required because this is a location note, not a finding.
The individual passes still require explicit operator responses. The note alone does not make the six checks compliant.
Site-wide Ontario Line responses
Record separately through SiteChecksRecorded:
gen-1: pass only after the operator explicitly confirms Ontario Line.spill-1: pass if the plan is actually observed posted.veg-1: do not default. Record pass, fail, or N/A only from an explicit observation.arch-1: there is a current duplication problem: it is site-wide and also assigned to First Parliament in../MyDemos/esgm/apps/esg-field/data/applicability.ts. I recommend removing it from Ontario LinesiteWideor defining two distinct checks: corridor permit availability versus location protection condition.
That last recommendation contradicts the existing applicability decision. As written, one arch-1 question is asked once corridor-wide and again at z-ol-parliament, which makes the final folded meaning ambiguous.
Explicit contradictions and current gaps
The following proposals intentionally contradict or extend current code:
onInspect(locationId)should focus and open that location; it currently discards the ID and merely switches Map → List.- Map state should distinguish unvisited from explicitly not reached; current
LocationStatedoes not. - Sticky inspection project should not remain casually editable; the current new-task site field is editable.
- Leaving with a React-state draft must prompt;
TaskFlowcurrently assumes everything visible is already durable. - Assets should be selectable and event-bound; currently they are display-only and no event payload carries
assetId. - Notes need their own durable event home; the current NCR capture explicitly refuses to save a finding without an NCR.
- Multi-recording audio needs complete event representation; current NCR evidence has one
audioUri. - Operator-corrected text should not overwrite the original recognizer transcript; current
ReviewCaptureproduces one finaltranscript. - H&S assessment events and framework do not currently exist.
- Ontario Line development-stage seed data does not currently exist.
arch-1should not remain both site-wide and location-specific without separating its two meanings.- The three unplotted locations—
z-ol-lakeshore,z-ol-thorncliffe, andz-ol-flemingdon—cannot participate equally in spatial drill-down until geometry is registered. - The current project-level sign-off counts in
TaskFloware still based largely on nine sectionAreaInspectedevents; location-walk sign-off should instead usefoldCoverageand explicitly report location/check coverage. Otherwise the operator can complete a place-first walk while the signature screen reports misleading section totals.