Repository navigation
Description
Delivery phase
Phase 1 - frontend with mock services. Milestone F4; task key F4-02.
Goal
Show complete readable process identity and basis information consistently in both comparison tabs.
Context and authority
Read AGENTS.md, docs/product/LCA_diff_PRD.md, docs/engineering/LCA_diff_Implementation_Specification.md, docs/engineering/roadmap.md, and docs/team/product-manager.md. Do not read archive/reference folders. Current governance/spec documents are prepared on branch docs/agent-workflow; acceptance/merge authority follows docs/adr/README.md, not proposed ADR status. Any contract deviation needs an ADR and both current document updates in the same PR.
Specification §§6.3–6.5, 6.8. Planned files: apps/frontend/src/components/comparison/, shared comparison state/hooks and service-header tests (planned).
Requirements and constraints
Use the canonical selection/order from F3 and bulk header services; do not duplicate selection ownership. Build the reusable metadata header now and consume it in Scores under F5. Choose separate documented width bounds per tab within the specification's recommended range, retaining minimum widths and horizontal scroll.
All work runs in containers with synthetic mock data and no API/Firebase/cloud dependency. Keep HTTP/auth/fixtures behind typed services and mock adapters; components consume contracts rather than fixtures. Follow Software Engineer and QA role handoffs, commit focused increments referencing this issue, and leave it open for QA/review.
Acceptance criteria
- AC1 — Headers visibly show Process Name, Location, Reference Flow Name, Reference Amount and Reference Unit, with full process/release identity available on hover/focus or accessible name.
- AC2 — Long text ellipsizes and full values are keyboard-discoverable; small selection keeps normal maximum width, large selection reaches a readable minimum and scrolls.
- AC3 — A non-blocking warning appears if any selected reference amount OR unit differs; equal exact values such as
1and1.0do not cause a false quantity warning. - AC4 — The warning states that no normalization was applied, never changes amounts and does not require confirmation or prevent comparison.
- AC5 — Selection/order updates fetch bounded bulk headers and preserve exact amount strings and safe missing-geography displays.
Out of scope and follow-ups
Sticky virtualization belongs to #23, drag/reorder/removal to #25, and mounting the header in Scores to #28. No interactive normalization.
Verification plan
Run on the Docker host: ./dev shell, then inside /workspaces/lca-diff: npm --prefix apps/frontend run format:check, npm --prefix apps/frontend run lint, npm --prefix apps/frontend run typecheck, npm --prefix apps/frontend run test:unit, and npm --prefix apps/frontend run build. These scripts are established by F1, not claimed available today. Browser scenarios use npm --prefix apps/frontend run test:e2e -- --project=chromium (F1 establishes the pinned Playwright tool/browser setup). No host package installs.
Component tests cover 0/1/many processes, long Unicode names, same/different amount and unit, exact decimal equivalence, width limits and hover/focus identity. Add a browser header/warning scenario.
Record exact commands/results and delivered SHA in the engineering handoff. QA independently checks every criterion at that SHA and reports PASS/FAIL/BLOCKED; unavailable required checks are not passing.
Dependencies and readiness
Blocking predecessors: #20. Also requires verified M1 container runtime and merged bootstrap/M2 configuration; later milestones are planned, not implementation-ready while predecessors remain open. PM must recheck dependencies and actual interfaces before marking READY.
Activity
DavidVFitzGerald commentedon Nov 13, 2026
PM: BLOCKED
Groomed using docs/team/product-manager.md for F4, Phase 1 — frontend with mock services. Documentation review: PASS for scope, required sections, specification coverage and acyclic dependency links; this is not application QA or implementation readiness.
Blocking predecessor issues: #20. The M1 runtime gate (#2) and merged bootstrap/M2 configuration (#3) also remain required. PM must recheck merged dependencies and current interfaces before changing this to READY.
Engineer implements one issue, commits regularly and hands the delivered SHA plus exact container checks to independent QA; do not close before QA, review and approved merge. No backend/Firebase/cloud credentials or host installations are required for Phase 1.
DavidVFitzGerald commentedon Nov 14, 2026
PM: READY (recheck)
The blocking predecessor #20 is closed (PR #63 merged). M1 and the bootstrap/M2 configuration are merged. The actual interfaces were rechecked:
app/selection.tsDataService.headersand theProcessHeaderDTO (exact decimalreference_amount)services/decimal.tsfor exact comparisonRemoving the
blockedlabel.DavidVFitzGerald commentedon Nov 14, 2026
Engineering: READY FOR QA
feat/f4-process-headers4c8fde9Refs #21; no closing keyword)Criteria
AC1, implemented. Headers show Process Name, Location, Reference Flow Name, Reference Amount and Reference Unit. Each header's accessible description and its hover/focus overlay give the full identity: release, revision and process ID.
AC2, implemented. Values ellipsize, and the name clamps to 2 lines. Full values are reachable by keyboard: one roving tab stop, with arrows, Home and End. Widths are
clamp(available / count, min, max):components/comparison/model.ts)Many columns stay at the minimum width and scroll horizontally. They are windowed, so 300 selected columns mount about 13.
AC3, implemented. The warning appears if any amount differs exactly or any unit differs as an exact string.
1,1.0and1e0(across releases) raise no warning.AC4, implemented. The text says "No normalization has been applied", with a "Why?" tooltip. There is no dialog or confirmation, values are not rescaled, and the warning never blocks comparison.
AC5, implemented. One headers query per revision:
SERVICE_WINDOW(100).—, read as "not specified".STALE_SNAPSHOT; missing or extra IDs asUNKNOWN_PROCESS.Commands (
./dev up, then in the workspace container at/workspaces/lca-diff)npm --prefix apps/frontend run format:check— passnpm --prefix apps/frontend run lint— passnpm --prefix apps/frontend run typecheck— passnpm --prefix apps/frontend run test:unit— 23 files, 275 tests pass, stable over 3 consecutive runsnpm --prefix apps/frontend run build— passnpm --prefix apps/frontend run test:e2e -- --project=chromium— 19/19 passnpm --prefix apps/frontend run test:e2e -- --project=firefox e2e/process-headers.spec.ts— passThe stderr lines in the process-tree and process-search unit tests are pre-existing: the count is identical on the base commit.
Notes for QA
services/decimal; a boundary test pins this.mountaccepts an optionalui.bulk-selection.test.tsxheader-failure stub now fails only multi-ID (bulk) reads, because the Flows header now also reads the single pre-selected process.[email protected], then expandtransport systems › road › operations › infrastructure.Limitations and follow-ups
services/mock/comparison-headers.test.tsx).Next: independent QA at
4c8fde9.DavidVFitzGerald commentedon Nov 14, 2026
QA: FAIL
4c8fde92081b6d54add04941ef104a356bc18e86(feat/f4-process-headers, PR F4: shared process headers and comparability warnings (#21) #65; base16e9802)workspacecontainer (lca-diff-dev-workspace-1) at/workspaces/lca-diff. Nothing was installed on the host.apps/frontend/src/services/README.md. No archive or reference folders were used.Criteria
ProcessHeaders.tsxHeaderCellanddetails(). The accessible description includes release, revision and process ID. The overlay appears on focus and hover. Unit test and E2E cover this in Chromium and Firefox.clamp(floor(avail/count))is used. The scroller hasoverflow-x: auto. With 300 columns, under 20 are mounted. There is one roving tab stop.1/1.01,1.0,1e0,+1.000,10,0.1E2,.1e+2;-0equals0;1vs1.0…01warns). Units compare as exact strings. But a known difference disappears when a later header read fails (D1).2.0000000000000000000000001and1.0are shown unchanged.STALE_SNAPSHOT, and missing or duplicate IDs giveUNKNOWN_PROCESS; none of these are cached (QA probes P5 and P6). Blank geography shows—with the accessible text "not specified".Defects
D1: Medium (blocks AC3). A failed header read hides known comparability differences and reverts loaded headers to "Loading…".
apps/frontend/src/components/comparison/useSelectionHeaders.ts:58(result.data ?? [])apps/frontend/src/app/queries.ts:303(placeholderDataapplies only while the query is pending)apps/frontend/src/components/comparison/ComparisonHeader.tsx:48errorwith no data, because placeholder data is not used in the error state.retry: falseis the global default (ApplicationProviders.tsx:34), so any single transient failure reaches this state.comparison-headers.test.tsxfixtures):r1:p0(Alpha, kg) andr1:p3(Gamma, MJ).headersreturnfailure("TEMPORARILY_UNAVAILABLE"), then selectr1:p2."".aria-busy="true", and Alpha shows "Reference Loading…" next to the error alert.headersandloadedfrom the per-process cache in addition toresult.data, including in the error state.Observations (non-blocking, suggested follow-ups)
O1: Bulk-seeded header cache skips #21's validation.
useBulkSelection.ts:155passesheadersForresults (queries.ts:205) torememberHeaders. That path, from [Task] F3: implement filter-scoped bulk selection and tri-state parent checkboxes #19, does not check the response snapshot, the per-item revision or the ID set.rememberHeaderskeys each header by the release, revision and ID the response itself reports.selectionHeadersthen serves those headers with no request, which bypasses its ownSTALE_SNAPSHOT/UNKNOWN_PROCESSchecks.headersFor, or validate beforerememberHeaders. Fix it with D1 or track it for I1 adapter parity.O2: Malformed amounts throw during render.
compareDecimalthrowsTypeErroron a malformed amount, andcomparability()calls it during render. DTOs are typed asDecimalStringand the mock validates them, but a real adapter should reject malformed amounts at the boundary (I1).O3: Large-selection evidence is component-level only. Windowing and minimum width for hundreds of columns are proven only in jsdom. Real-browser evidence of horizontal scrolling at minimum width is deferred to #23, as documented.
Checked with no issue found:
account-aquery keys remain. The per-processheaderkeys include the UID.services/decimal.tsimports onlytype DecimalStringfrom contracts, so it is transport-free. The boundary test pins both the decimal allowance and the continued rejection ofservices/mock/runtime.useSelectionHeadersandComparisonHeaderreaduseSelection().entriesand own no order. Components import onlyservices/contracts(type) andservices/decimal.1/1.0.bulk-selection.test.tsxstub change is justified, because the Flows header now reads the single pick.Commands and results
All commands ran via
docker compose --project-directory . -f compose.yaml exec -T workspace bash -lc 'cd /workspaces/lca-diff && …'.npm --prefix apps/frontend run format:checknpm --prefix apps/frontend run lintnpm --prefix apps/frontend run typechecknpm --prefix apps/frontend run test:unit, run 1npm --prefix apps/frontend run test:unit, run 2npm --prefix apps/frontend run buildnpm --prefix apps/frontend run test:e2e -- --project=chromiumnpm --prefix apps/frontend run test:e2e -- --project=firefox e2e/process-headers.spec.tsnpx vitest run src/services/mock/zz-qa-headers.test.tsx(temporary file, deleted afterwards)The working tree was clean after the probe was removed (
git status --shortprinted nothing). Implementation and tests are unchanged.Not run: real API, Firebase or authorization checks, which are out of scope for Phase 1.
Next action
FAIL returns to Engineering to fix D1 with a regression test and, optionally, O1. QA will then recheck the new SHA: AC1, AC3, AC5 and the full required checks.
fix: keep validated headers after a failed read and validate bulk rea…
DavidVFitzGerald commentedon Nov 14, 2026
Engineering: READY FOR QA (after QA FAIL)
Delivered SHA:
c559c63onfeat/f4-process-headers(PR #65). It contains one fix commit on top of4c8fde9.Fixes
D1, fixed. Placeholder data applies only while a query is pending, so a failed read left no headers at all.
useSelectionHeadersnow falls back to the validated per-process cache (queries.cachedHeaders) for any revision whose query has no data.services/mock/comparison-headers.test.tsx. It loads kg/MJ headers first, then makes the next read fail and retries.O1, fixed.
headersFornow applies the same sharedinvalidHeaderscheck asselectionHeaders: it must answer the requested revision (STALE_SNAPSHOTotherwise) with exactly the requested IDs, once each (UNKNOWN_PROCESSotherwise).rememberHeadersonly ever receives validated headers.O2, documented, not fixed. The README now states that the real adapter must validate decimal amounts at its boundary (I1).
O3: unchanged, deferred to #23.
Mutation check
Commands
Run in the workspace container at
/workspaces/lca-diff:npm --prefix apps/frontend run format:check— passnpm --prefix apps/frontend run lint— passnpm --prefix apps/frontend run typecheck— passnpm --prefix apps/frontend run build— passnpm --prefix apps/frontend run test:unit— 23 files, 280 tests pass (run twice)npm --prefix apps/frontend run test:e2e -- --project=chromium— 19/19 passnpm --prefix apps/frontend run test:e2e -- --project=firefox e2e/process-headers.spec.ts— 1/1 passNext: QA recheck at
c559c63.DavidVFitzGerald commentedon Nov 14, 2026
QA: FAIL
c559c638b46f099a0022d2cb00ab51b512178111(feat/f4-process-headers, PR F4: shared process headers and comparability warnings (#21) #65). The fix diff is4c8fde9..c559c63; the whole PR is16e9802..c559c63.workspacecontainer (lca-diff-dev-workspace-1) at/workspaces/lca-diff. Nothing was installed on the host.docs/team/qa-engineer.md, issue [Task] F4 — Build shared process headers and comparability warnings #21 and its comments, spec §§6.3–6.5, 6.8 and 7.1–7.3, andapps/frontend/src/services/README.md. No archive or reference folders were used.Summary
gcTimeof 5 minutes, even while their columns are on screen.Criteria
1/1.0Status of earlier findings
zz-qa-recheck.test.tsx, run undersrc/services/mock/and deleted afterwards.r1:p2process.aria-busy="false"with their values shown. Only the unread column is busy (1 of 3).["r1:p2"].["r2:p0"].account-b, noaccount-aquery keys remain, the warning is empty and noMJvalue is shown.kgorMJvalue is shown.headersForapplies the sharedinvalidHeaderscheck: the requested revision (STALE_SNAPSHOT) and the exact ID set, each once (UNKNOWN_PROCESS).End to end through the App's bulk branch action (probe
zz-qa-bulk.test.tsx), four tampered multi-ID responses were tried:Each one leaves "Selected processes (0)" and 0 per-process cache entries, and shows "Selection unchanged: could not update processes in rail. Response does not match…".
A valid bulk read seeds the cache, and the comparison header then issues no extra request.
DecimalString, and only the real adapter can receive malformed amounts. I1 should carry a test that a malformedreference_amountbecomes a structured error at the boundary rather than a render-timeTypeError.Defects
D2: Medium (blocks AC3). D1 comes back once the per-process header cache expires, after 5 minutes.
apps/frontend/src/app/queries.ts:160:rememberHeaders→client.setQueryData(headerKey(header), header). Theseheaderqueries never have observers.apps/frontend/src/app/ApplicationProviders.tsx:31-37: there is nogcTimeoverride, so TanStack Query 5.107.1 uses the default of 300000 ms.refetchOnWindowFocus: falsemeans nothing repopulates the cache.apps/frontend/src/components/comparison/useSelectionHeaders.ts:62-63: the fallbackqueries.cachedHeaders(...), and theplaceholderDatainqueries.ts:336, both read only those expiring entries.setquery stays observed and keeps its data.comparison-headers.test.tsx):vi.useFakeTimers({ shouldAdvanceTime: true }), then renderComparisonHeaderthroughmount({ ui }).r1:p0(Alpha, kg) andr1:p3(Gamma, MJ), and wait until they are loaded. The warning reads "…different reference units."headerentries: 2, with observer counts[0, 0]andgcTime[300000, 300000].vi.advanceTimersByTime(301000). Per-processheaderentries: 0.headersreturnfailure("TEMPORARILY_UNAVAILABLE", true), then selectr1:p2."", and 3 of 3 columns arearia-busy="true".["r1:p0","r1:p2","r1:p3"]; every ID was refetched.client.setQueryDefaults([...header prefix], { gcTime: Infinity }). They are already UID-scoped and cleared on signout or account change; recheck this.gcTimebefore the failed read.Other checks
/tmp/qa-mut; tracked files were not touched, and the copy was deleted afterwards.4c8fde9version ofuseSelectionHeaders.tsfails only "keeps loaded headers and known differences when a later read fails (QA D1)" (1 failed, 11 passed).invalidHeaderscall fromheadersForfails exactly the three "rejects … before anything can be cached" tests (3 failed, 9 passed).queries.ts(shared validator,cachedHeaders, deduplication of IDs inheadersFor),useSelectionHeaders.ts, the README and tests. There is no scope creep.flushSync was called from inside a lifecycle methodstderr in the bulk and tree tests predates this fix.Commands and results
All commands ran via
docker compose --project-directory . -f compose.yaml exec -T workspace bash -lc 'cd /workspaces/lca-diff && …'.npm --prefix apps/frontend run format:checknpm --prefix apps/frontend run lint--max-warnings 0)npm --prefix apps/frontend run typechecknpm --prefix apps/frontend run buildnpm --prefix apps/frontend run test:unit, run 1npm --prefix apps/frontend run test:unit, run 2npm --prefix apps/frontend run test:e2e -- --project=chromiumnpm --prefix apps/frontend run test:e2e -- --project=firefox e2e/process-headers.spec.tsnpx vitest run src/services/mock/zz-qa-recheck.test.tsx(temporary file, deleted afterwards)npx vitest run src/services/mock/zz-qa-bulk.test.tsx(temporary file, deleted afterwards)comparison-headers.test.tsxin/tmp/qa-mutThe working tree was clean afterwards (
git status --shortprinted nothing). Implementation and tests are unchanged.Not run: real API, Firebase or authorization checks, which are out of scope for Phase 1.
Next action
FAIL returns to Engineering to fix D2 with a regression test that crosses
gcTime. QA will then recheck the new SHA: AC3, AC5 and the full required checks. O2 should be carried as an explicit I1 test obligation.DavidVFitzGerald commentedon Nov 14, 2026
Engineering: READY FOR QA (after QA FAIL at
c559c63)Delivered SHA:
8da80b3onfeat/f4-process-headers(PR #65).D2 — fixed
gcTime. A later failed read then lost the loaded columns and the known comparability warning again.rememberHeadersregisters query defaults for the UID-scopedheaderkey prefix, withgcTime: InfinityandstaleTime: Infinity.client.clear(), which still removes them.services/mock/comparison-headers.test.tsx.["r1:p2"].Commands
All run in the workspace container.
npm --prefix apps/frontend run format:checknpm --prefix apps/frontend run lintnpm --prefix apps/frontend run typechecknpm --prefix apps/frontend run buildnpm --prefix apps/frontend run test:unit(run twice)npm --prefix apps/frontend run test:e2e -- --project=chromiume2e/process-headers.spec.tsNext: QA recheck at
8da80b3. Focus on AC3 and AC5, plus the full required checks.fix: keep per-process headers for the session so the failure fallback…
DavidVFitzGerald commentedon Nov 14, 2026
QA: PASS
8da80b31283928cde4879e7711987d618fcfbd34(feat/f4-process-headers, PR F4: shared process headers and comparability warnings (#21) #65). The fix diff isc559c63..8da80b3, which touchesqueries.ts, the services README andcomparison-headers.test.tsx. The whole PR is16e9802..8da80b3.workspacecontainer (projectlca-diff-dev) at/workspaces/lca-diff. Nothing was installed on the host.docs/team/qa-engineer.md, issue [Task] F4 — Build shared process headers and comparability warnings #21 and its comments, spec §§6.3–6.5, 6.8 and 7.1–7.3, andapps/frontend/src/services/README.md. No archive or reference folders were used.Summary
gcTime: Infinity), so the D1 failure fallback survives any length of idle time.headerprefix, and signout or account change still removes every entry.Criteria
1/1.0["r1:p2"], or["r2:p0"]for a new revision. The O1 bulk probe passes 5/5.Status of earlier findings
zz-qa-d2.test.tsx, run undersrc/services/mock/and deleted afterwards. The setup matches R6b: fake timers, then load Alpha (kg) and Gamma (MJ).gcTime[Infinity, Infinity].r1:p2, with the same result after each wait:aria-busy="false"[["r1:p2"]]["r1:p2"].Safety of the fix
Scope of the defaults (S1).
setQueryDefaultsuses the prefix["lca-services", 1, namespace, uid, "header"]. TanStack'spartialMatchKeycompares each element exactly, so theheadersselection-set queries do not match.headerentries havegcTimeInfinity, while theheadersandreleasesqueries keep 300000.headersqueries were collected and theheaderentries remained.{}).Cross-UID safety (S2). After 24 h of idle time:
account-bleaves 0account-akeys and shows noMJvalueheaderentriesBoth paths go through
client.clear()inservice-context.ts:65/:100, which removes queries regardless ofgcTime.rememberHeadersdoes nothing whileuid === null.clear(), at one tiny entry per account and namespace. They hold no data. This is not a defect.Staleness across revisions (S3). Keys include
release_idandrevision_id. The cached keys were[r1, r1-rev, r1:p0]and[r1, r1-rev, r1:p3], so a new r2 selection does not reuse r1 data and fetches onlyr2:p0.staleTime: Infinityhas no practical effect, because these entries are never observed or refetched; they are only read withgetQueryData.Growth (S4). 300 headers make 300 entries, about 77 KB of JSON (around 258 B each). They stay after the selection is cleared.
Mutation check. In a container-local copy (
/tmp/qa-mut, deleted afterwards; tracked files untouched), I removed thesetQueryDefaultscall. The new test "keeps them after the default cache lifetime has passed (QA D2)" then fails (1 failed, 13 passed).Scope and ADR
queries.ts, the README, and 2 tests. There is no scope creep.Commands and results
All commands ran via
docker compose --project-directory . -f compose.yaml exec -T workspace bash -lc 'cd /workspaces/lca-diff && …'.npm --prefix apps/frontend run format:checknpm --prefix apps/frontend run lintnpm --prefix apps/frontend run typechecknpm --prefix apps/frontend run buildnpm --prefix apps/frontend run test:unit, run 1npm --prefix apps/frontend run test:unit, run 2npm --prefix apps/frontend run test:e2e -- --project=chromiumnpm --prefix apps/frontend run test:e2e -- --project=firefox e2e/process-headers.spec.tsnpx vitest run src/services/mock/zz-qa-d2.test.tsx(temporary file, deleted afterwards)npx vitest run src/services/mock/zz-qa-bulk.test.tsx(temporary file, deleted afterwards)comparison-headers.test.tsxin/tmp/qa-mut, withoutsetQueryDefaultsgit status --shortwas empty afterwards, and HEAD is unchanged at8da80b3. Implementation and tests are unchanged.Not run: real API, Firebase or authorization checks, which are out of scope for Phase 1.
Follow-ups (non-blocking)
reference_amountfrom the real adapter becomes a structured boundary error.Next action
PASS goes to the coordinator/maintainer for PR #65 review and merge. QA does not close the issue or merge.
feat: add shared process headers and comparability warning (Refs #21)
test: cover process headers, comparability and widths; document #21 (…
fix: keep validated headers after a failed read and validate bulk rea…
fix: keep per-process headers for the session so the failure fallback…
DavidVFitzGerald commentedon Nov 14, 2026
Coordinator: closed
Closing this issue now that QA has passed, the required checks pass and the maintainer has merged the PR.
8da80b3(report).qualitycheck passed on PR F4: shared process headers and comparability warnings (#21) #65.mainon 2026-11-14 (head1d8c8ab).Carried forward: