Repository navigation
Description
Re-scoped 2026-11-16 under ADR 0006 (#95). This issue was F5-04 (mock-only toggles). It now covers the MVP differences toggles against the real API plus local MVP acceptance, and it is the third and final local-MVP PR. The exhaustive mock predicate work stays in #29 (post-MVP). The former Phase 1 gate #34 is post-MVP.
Delivery phase
Local MVP (ADR 0006), milestone L3 — final implementation PR.
Goal
Each comparison tab has an independent "Show differences only" toggle backed by the API's exact differences_only reads. The local MVP is then accepted end to end from one command.
Context and authority
Read AGENTS.md, the PRD, the specification (§§6.7, 7.1–7.3, 9.2 behaviors 15–16, 9.3, 12 definition of done, as revised by ADR 0006), docs/adr/0006-local-only-mvp.md, docs/engineering/roadmap.md (L3), and the B2 differences_only implementation in apps/api/src/lca_api/queries.py. Do not read archive/reference folders.
Requirements and constraints
- Toggles on Flows and Scores start off, stay independent across tab switches, and are disabled and reset to off with fewer than two processes. They are not persisted (browser workspace persistence is post-MVP, [Task] F5 — Persist the versioned account-scoped workspace #31).
- Turning a toggle on requests only that tab's eligible rows via
differences_only=true. Turning it off restores full rows without a difference query. Cache keys use the canonical (order-independent) process set, revision snapshot, indicators where relevant, tab and flag. Reordering alone reuses results. - Use exact semantics from the API. Absent ≠ present zero,
-0equals0, N/A is never zero, and there is no float or tolerance comparison. Add a minimal exact-string mock implementation only so that deterministic unit tests and mock mode do not error. The full mock instrumentation stays in [Task] F5 — Implement exact on-demand difference queries in mock services #29. - Loading/error/cancellation keeps controls responsive and offers retry without applying a superseded snapshot's eligibility.
- Local MVP acceptance: run the spec §9.3 UAT journeys (except browser restoration) on the L1/L2 stack. Extend the real-integration Playwright smoke with a differences step. Execute the documented opt-in BAFU path once using the representative private manifest (
data_pipeline/examples/bafu-private-representative.json) and confirm the imported release is visible. Keep reports private and record only non-sensitive evidence. Record results indocs/engineering/local-mvp-verification.md.
Acceptance criteria
- AC1 — Both toggles start off, are independent across tabs, and are disabled and reset with fewer than two processes.
- AC2 — On sends only that tab's
differences_onlyrequest; off restores full rows without one; unchanged inputs and reorders reuse cached results; membership, indicator or revision changes invalidate them. - AC3 — On seeded data, Flows hides only rows equal in every selected process, and absent vs present-zero counts as a difference. Scores hides equal valid values and uniformly N/A rows, and valid vs N/A counts as a difference.
- AC4 — Error/cancel paths offer retry and never mix snapshots.
- AC5 — From a clean clone,
./dev app-upalone yields a working app. A verified user can log in, search, bulk-select, compare Flows and Scores, toggle differences, reorder and remove columns. Data persists across./dev app-down/app-up. - AC6 — The opt-in BAFU representative import is visible in the local app, or a concrete blocker is filed. Verification records list exact commands, results and remaining post-MVP gaps.
Out of scope and follow-ups
Workspace persistence #31, stale-ID reconciliation #32, async/accessibility audit #33, full mock acceptance #34 and exhaustive mock predicates #29 are post-MVP. Deployment and full-corpus validation are also post-MVP.
Verification plan
Inside ./dev shell: frontend format:check, lint, typecheck, test:unit, build. Real-integration Playwright smoke against ./dev app-up (Chromium; Firefox as practicable). Manual UAT checklist. Record exact commands/results and SHA. QA re-runs AC5 from a clean clone.
Dependencies and readiness
Blocking predecessor: L2 #97 (which requires L1 #96). ADR 0006 must be merged (#95).
Activity
DavidVFitzGerald commentedon Nov 13, 2026
PM: BLOCKED
Groomed using docs/team/product-manager.md for F5, 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: #29. 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.
[-][Task] F5 — Wire independent difference toggles and canonical query caching[/-][+][Task] L3 — Differences toggles on the real API and local MVP acceptance[/+]DavidVFitzGerald commentedon Nov 16, 2026
Re-scoped by the coordinator on 2026-11-16 per the maintainer's local-only MVP decision (ADR 0006, #95). Former F5-04 mock-only toggle scope is replaced by the L3 body: toggles against the real API's
differences_onlyreads plus local MVP acceptance. The blocking predecessor changed from #29 (now post-MVP) to L2 #97. GitHub's edit history keeps the previous body.DavidVFitzGerald commentedon Nov 16, 2026
PM: READY
Rechecked on 2026-11-16 (coordinator acting under docs/team/product-manager.md). Dependencies are satisfied: L2 #97 closed via PR #105 (
cd6d8a6), L1 #96 merged (PR #100), ADR 0006 accepted (PR #98). Scope, ACs and the container verification plan are unchanged. Branch:feat/l3-differencesfrommain@baff738.Grooming note for QA: the committed synthetic seed has no flow row with equal amounts across two processes, and its loader refuses to add or replace revisions (
check_state). On seeded data, AC3's Flows half is therefore observable as "nothing equal, nothing hidden; absent vs present-zero kept". The hide case is evidenced by the B2 PostgreSQL API tests, the mock predicate tests and the opt-in representative BAFU import (AC6). Extending the seed would force./dev app-reset --yeson existing volumes, so it is out of scope here.DavidVFitzGerald commentedon Nov 16, 2026
Engineering: READY FOR QA
Branch
feat/l3-differences@f57d5e6dd33617ee371b54826e6f346626448cfe, PR #109. Evidence:docs/engineering/local-mvp-verification.md.differences_onlyread per tab, cached off/on, reorder reuse, membership invalidation (Vitest + real)app-up/app-smoke9/9/app-e2e7/7 Chromium + Firefox, publication pointer byte-identical across down/up. QA to repeat from a clean cloneChecks inside the workspace: format, lint, typecheck, contracts and build pass; Vitest 472/37; mock Playwright 72/72 at both the toggle and fix commits. The real suite needs a seed-only stack; it fails on environment assumptions after the opt-in import.
DavidVFitzGerald commentedon Nov 16, 2026
QA: PASS
QA Engineer role (
docs/team/qa-engineer.md), independent verification of L3 #30 and the bundled defect fix #107.f57d5e6dd33617ee371b54826e6f346626448cfe(feat/l3-differences, PR feat: L3 differences toggles and local MVP acceptance #109). The QA clone was not modified. A temporary revert of one file, used to confirm that the regression test fails, was restored afterwards (git statusclean)./tmp/lca-l3-qa(private/anddata/absent), rootless Docker via./dev. These QA-only projects were created and touched nothing else: workspacelca-diff-l3-qa(FRONTEND_PORT 5291) and app stacklca-diff-l3-qa-app(ports 5270/8270/9270). AC6 was read-only against the existinglca-diff-l3-app(5280/8280/9280). On that stack only./dev app-e2e node -e ...ran: no import, reset or down.Commands and results
COMPOSE_PROJECT_NAME=lca-diff-l3-qa FRONTEND_PORT=5291 ./dev up && ./dev checkdocker compose -p lca-diff-l3-qa exec -T workspace bash -lc 'cd apps/frontend && npm ci && npm run format:check && npm run lint && npm run typecheck && npm run contracts:check && npm run build && npm run test:unit'... npm run test:e2e(mock, Chromium + Firefox)LCA_APP_PROJECT=lca-diff-l3-qa-app LCA_APP_FRONTEND_PORT=5270 LCA_APP_API_PORT=8270 LCA_APP_AUTH_PORT=9270 ./dev app-up./dev app-smoke./dev app-e2e(Chromium)./dev app-e2e node_modules/.bin/playwright test --config playwright.real.config.ts --browser firefox./dev app-down→ named volumesapp-db/app-archivekept →./dev app-up→psql ... "select * from release_publication"before vs after, compared withcmp./dev app-smokepassed againgh pr checks 109(headf57d5e6)quality,real-stack,api-quality,backend-quality,etl-quality: all passDirected edge cases (QA stack,
./dev app-e2e node -e "<script>", Chromium)All of these were observed as expected:
differences_onlyrow request is sent on either tab.aria-busy, and tab switches still worked. Turning the switch off aborted the in-flight request (1 aborted), restored the identical full row count and sent no new flows row request.unavailable,positive). The uniform-missing case is covered by the committed journey (0 rows plus an explicit "No differences" message).Per-criterion verdicts — #30
differences.tsresets during render, so no commit shows a stale on state.differences_only: trueread when on, and none when off. Toggling off and on reuses the cache with zero new row reads (committed test and QA). Keys use the sorted process set, snapshot, sorted indicators, tab and flag (useFlowGrid/useScoreGrid). Reorder and membership/indicator invalidation are covered by Vitest (flows-composition.test.tsx).apps/api/tests/test_api.py,differences_only→total_count == 2) and the mock predicate tests (comparison.test.ts:-0=0, absent ≠ zero, N/A states). The mock predicate matchesflow_base's HAVING (count < n OR min != max) andscore_rows' status/value logic, with no floats or tolerance../dev app-upalone, then demo login, search, bulk select, Flows/Scores, toggles, reorder (keyboard) and header × removal, in both the real suites and the directed checks. Registration and verification of a new user are in the real suite. Data persisted acrossapp-down/app-up(byte-identical publication pointer).lca-diff-l3-app, read-only, only booleans recorded: 2 release roots are listed, includingBAFU:2026 v1 2026 v1, next to the synthetic one. With its processes selected (≥2), Flows cells load without an alert. The switch is enabled and starts off. On sends a difference read; nothing was hidden for this selection, and no error occurred. Off restores the full row count without a new read. Scores shows GWP 100 as the first row with cells, without an error alert, both off and on. There were 0 comparison responses ≥400. Mixed releases (BAFU processes plus one synthetic): Scores requests both releases' GWP 100, shows 2 rows, and returns no alert and no 4xx. This is consistent with native, non-merged indicators (§6.5).local-mvp-verification.mdlists commands, results and post-MVP gaps.#107 (Scores INVALID_FILTER with two releases)
scopedIndicatorIdsfilters chosen indicators to the selected processes' releases (unknown IDs are kept for [Task] F5 — Reconcile restored IDs and publication changes atomically #32). On the two-release stack, 0 comparison 4xx and Scores loads.ScoresPanelshows "Select an indicator" with the "None of the chosen indicators belongs to the database version…" text when the scoped set is empty (App-level test inflows-composition.test.tsx).scores-grid.test.tsxfails without the fix: QA revertedScoresGrid.tsxto064c518^, saw 1 failed / 3 passed, then restored it. The real two-release check passed (AC6 above).score_rows: requested IDs ≠ snapshot indicators → 422), so scoping on the client is the right fix, with no contract change. [Task] Distinguish releases in the indicator tree when several releases are published #108 is an appropriate follow-up. The duplicate unlabeled method roots are a display/clarity issue under §6.2/§10.1, not a correctness defect, and should not block the MVP.Governance
No PRD, specification or ADR changes. The toggles implement §6.7 as revised by ADR 0006 (in-memory, not persisted), so no ADR is needed. The roadmap and services README updates are consistent. The diff contains no references to the excluded historical folders, and QA did not use them.
Unrun checks / notes
Next action
Maintainer review and merge decision on PR #109 (owner: maintainer). Coordinator closes #30 and #107 after merge. #108 is to be groomed afterwards.
feat: per-tab differences toggles over exact differences_only reads (…
test: real-stack differences journey on the seeded release (Refs #30)
test: real-stack UAT for filtered category selection, warnings, indic…
fix: scope Scores indicators to the selected processes' releases (Refs …
docs: record L3 local MVP verification and handoff (Refs #30)
DavidVFitzGerald commentedon Nov 16, 2026
Closed by the coordinator after QA PASS (see #30 QA verdict), passing hosted CI and the maintainer's merge of PR #109.
docs: record L3 delivery and local MVP completion in the roadmap (Refs …