Repository navigation
Description
Delivery phase
Phase 2, backend and real integration. This is milestone L2 of the local MVP (ADR 0006), the second of three implementation PRs, and it replaces I1 for the local scope. It stays one issue and one PR (ADR 0006 §6), with incremental commits and an internal checklist.
Ownership:
- frontend:
apps/frontend/andpackages/contracts/; - coordinated shared changes:
compose.app.yaml,dev,ops/local/, CI and docs.
API code changes only if a reconciliation strictly needs them.
Goal
The ./dev app-up stack serves a real-mode frontend that uses the FastAPI backend and the Firebase Auth Emulator through the existing typed services boundary.
A user does either of these:
- logs in with the demo account;
- registers and verifies a new account through the emulator.
The user then searches, bulk-selects, reorders and compares the seeded processes on Flows and Scores, with the data served from PostgreSQL.
TypeScript DTOs are generated from the FastAPI OpenAPI schema with a drift check. The provisional contracts are reconciled, and parity with the mock adapter is tested. A real-stack Playwright smoke passes.
Context and authority
Read:
AGENTS.md;docs/adr/0006-local-only-mvp.md;- ADR 0002's service-boundary rules (
docs/adr/0002-frontend-first-delivery.md); - PRD §§3, 5 and 7;
- specification §0.3, §3 (including §3.1 and §3.3:
packages/contracts/), §6.1, §6.4–6.6, §6.8, §7 (all), §8 items 1, 2 and 5, and §9.2 behaviors 13–15 and the per-PR tier ("OpenAPI contract drift (from L2)"); docs/engineering/roadmap.mdL2;docs/engineering/f2-verification.md;docs/engineering/development-environment.md(local application stack);README.md("Run the local application");docs/engineering/b2-verification.md.
Do not read the archive or reference folders.
Code to read and change:
- Frontend:
apps/frontend/src/services/contracts.tsandapps/frontend/src/services/README.md;apps/frontend/src/services/mock/;apps/frontend/src/app/composition.ts, which accepts onlymode === "mock"today;apps/frontend/src/app/service-context.ts(ApplicationRuntime.modeis"mock" | "test") andapps/frontend/src/app/queries.ts;apps/frontend/src/components/comparison/useFlowGrid.ts,useScoreGrid.tsandgeometry.ts;apps/frontend/src/main.tsx,apps/frontend/eslint.config.js,apps/frontend/vite.config.tsandapps/frontend/playwright.config.ts;apps/frontend/package.jsonandpackage-lock.json.
- API:
apps/api/src/lca_api/app.py,dtos.py,errors.py,queries.py,auth.pyandconfig.py;apps/api/openapi.json.
- Stack:
compose.app.yaml;ops/local/frontend.Dockerfileand its.dockerignore, which currently admits onlyapps/frontend/**;ops/local/local_stack.py;dev.
- CI:
.github/workflows/frontend.yml.
Planned new paths:
packages/contracts/(generated TypeScript);apps/frontend/src/services/http/andapps/frontend/src/services/firebase/(adapters; exact names are the engineer's choice undersrc/services/);- a real-stack Playwright config and specs;
- a
./dev app-e2ecommand.
Authority. B2's FastAPI contract is authoritative over the provisional frontend DTOs (ADR 0002, roadmap). None of the reconciliations below changes product or scientific meaning, so the planned path needs no ADR. An ADR, with updates to the PRD and specification in the same PR, is required if the implementation would do any of these:
- change §7 semantics, for example decimal-as-number, lexeme normalization, missing or unresolved scores becoming zero, absent becoming zero, a different 401/403 meaning, or summaries computed over a column window instead of the whole selection;
- make the API depend on server-held token state;
- weaken a §8 control.
Requirements and constraints
R1. Generated contracts
- Generate TypeScript types from the committed
apps/api/openapi.jsonintopackages/contracts/. Useopenapi-typescript: types only, no runtime client, an exact-pinned frontend devDependency. Another types-only generator is acceptable only with a recorded rationale. - Add npm scripts that run in the frontend container and in CI without the API running:
contracts:generate;contracts:check, which regenerates to a temporary path, byte-compares and exits nonzero on drift.
- Generated files carry a "generated, do not edit" header and are never hand-edited. Output must be deterministic, byte-identical across runs.
- The chain is FastAPI →
apps/api/openapi.json(existingmake backend-openapi-check, already in backend CI) →packages/contracts/(new check, added to the per-PR frontend workflow). - Make
packages/contracts/resolvable bytsc, Vite and ESLint (tsconfig include or path alias), and copy it into the frontend image. Updateops/local/frontend.Dockerfileand its.dockerignore. services/contracts.tsremains the UI-facing boundary. It derives wire types from, or maps them to, the generated types deliberately. Generated wire types do not leak into components.
R2. Contract reconciliation
Resolve each mismatch below and record the resolution in apps/frontend/src/services/README.md, replacing the "I1 will reconcile" notes. These are mismatches between contracts.ts and B2 at 41c6b14:
-
M1. Summaries (decided). There are no
flowSummariesorscoreSummariesroutes. B2 returns a whole-selectionsummary: NumericSummary {minimum, maximum, present_count, selected_count}on everyFlowRowand on every score-rowIndicator. In the indicator tree,summaryis absent or null.- The frontend
max_positive/max_negative_magnitudederive exactly from that summary:P = maximumif it is > 0, else"0";N = minimumwith its sign removed if it is < 0, else"0";- the comparisons use
services/decimal.ts, neverNumber.
- Absent =
selected_count − present_count. - Positive, negative and zero counts, and the missing versus unresolved split, are not served. Only
geometry.tsconsumes P and N. - Decision: row pages carry their summaries across the boundary. Remove the provisional
DataService.flowSummariesandscoreSummariesmethods and the unused counts. Make the mock compute the same derived summary per row page, and updateuseFlowGrid,useScoreGridandqueries.ts. - This is the "derivation" option in the roadmap. It keeps the API stateless and matches §7.1, so it needs no API change and no ADR.
- The frontend
-
M2. Error envelope. The API returns
{"error": {code, message, request_id, retryable}}:- 401 →
AUTH_REQUIRED, withWWW-Authenticate; - 403 →
EMAIL_NOT_VERIFIED; - 404 →
RELEASE_UNAVAILABLE/UNKNOWN_PROCESS; - 409 →
STALE_SNAPSHOT; - 422 →
INVALID_FILTERfor any request-validation failure, and alsoREQUEST_WINDOW_TOO_LARGE; - 429 →
TEMPORARILY_UNAVAILABLE, retryable, withRetry-After: 60; - 503 →
TEMPORARILY_UNAVAILABLE, retryable.
The adapter unwraps the envelope and uses
X-Request-ID. It maps network failure, a non-JSON body, an unknown code or a schema-invalid body to a safe typed error (TEMPORARILY_UNAVAILABLE, retryable as appropriate), with no raw payload in the message.UNSUPPORTED_OPERATIONandAUTH_FAILEDare client-only codes and do not appear in the API enum. - 401 →
-
M3. Lost unions. OpenAPI flattens these:
FlowCellbecomes{present: boolean, amount: string | null};ScoreCellbecomes{status, amount: string | null};SearchNodebecomes one object with an optionalgeography, an optionalmatching_descendant_count, andchildrendefaulting to[].
The adapter validates the invariants (
present⇔ amount;valid⇔ amount;decimalStringsyntax; the nodekindfields) and returns a typed error on violation. It never coerces. -
M4. Identity. In
GET /api/v1/me,accessisRecord<string, boolean>andemail_verifiedis an optional consttrue. Map it to{published_catalog: access.published_catalog === true}. -
M5. Indicator tree. This is a
GET /api/v1/indicators/treewithrevision_snapshotas a JSON-encoded query parameter (an array of{release_id, revision_id}). There is no body. -
M6. Transport bounds. The API bounds are:
- page
limit1–200 (default 100); - headers ≤200 IDs per batch;
- cells ≤200 processes, ≤200 rows and ≤10,000 cells;
- request 2 MB, response 4 MB;
requests_per_minutedefault 240 per client address.
The frontend windows (100 and 1,000) fit. The cell
process_idsmust be a subset of the signedcomparison_token's set, and the token embeds the full sorted selection, so it grows with the selection. Batches never cap the selection. - page
-
M7. IDs. The API validates
process_idsandindicator_idsas UUIDs and rejects duplicates with 422.row_keysmust be<uuid>|<FlowType>and belong to the token's rows. -
M8. Decimals. The API emits
str(Decimal)of PostgreSQL NUMERIC, for example1.2345E-33with an uppercase exponent, and never-0. Display and comparison must accept the API's lexemes unchanged. Parity fixtures use the lexemes the API actually emits for the seed, not mock lexemes. -
M9.
differences_only. The API implements it, while the mock returnsUNSUPPORTED_OPERATION. In L2 the UI never sendstrue, and the HTTP adapter passes the flag through unchanged. Aligning the two is L3 [Task] L3 — Differences toggles on the real API and local MVP acceptance #30. -
M10. Runtime mode. Add a
realruntime mode (see R4).
R3. Adapters
- Add an HTTP
DataServiceadapter that maps every boundary method to its/api/v1route. - Add a Firebase JS SDK
AuthServiceadapter connected to the emulator. It covers sign-in, registration, verification email, password reset, sign-out, session restore through Firebase persistence and token refresh. - Preserve:
- decimal strings and missingness;
- revision snapshots, echoed and never replaced by the latest;
- opaque cursors and comparison tokens;
- structured errors;
AbortSignalcancellation with no stale success.
- Tokens:
- ID tokens stay inside the adapters.
- A forced token refresh is retried at most once per protected request after a 401.
- After email verification,
refreshSessionreloads the user and forces a token refresh, so the API seesemail_verified. - A persistent 401/403 must lock without lock/unlock cycling (carried from F2 [Task] F2: guard protected queries through session restoration and account changes #14/[Task] F2: verify complete mock authentication and accessible shell journeys #15).
firebaseandfetchare used only undersrc/services/. The existing boundary lint must keep passing unchanged, or be tightened, but never loosened for UI code.- Firebase dependency. Add
firebaseas an exact-pinned runtime dependency withnpm install --save-exactinside the dev container. Choose the newest stable release that is at least 14 days old at implementation time and compatible with Node 24 and the pinned emulator (firebase-tools15.36.0 inapps/api/emulator/package.json). Record the version and the check in the handoff. Commitpackage-lock.json;npm cistays frozen.
R4. Configuration and composition
composition.tsstays the only adapter-selection point.VITE_SERVICE_MODEaccepts exactlymockorreal, and anything else shows the configuration error.realrequires validated build-time settings:- the API base;
- the Firebase project ID and API key: local, non-secret placeholders;
- the emulator setting.
- With the emulator, the project ID must start with
demo-, mirroring the API's rule. - Missing or invalid settings, an unreachable API or an unreachable emulator show an explicit error state. Never mock data, never a silent fallback.
- The "Local demo mode" indicator and the mock demo guidance appear only in
mockmode. npm run dev, Vitest and the existing mock Playwright suite keep mock mode. The app stack buildsreal.
R5. Browser origins and stack wiring (decided; resolves L1 QA note (b))
-
Same origin. The browser talks only to the page's origin:
- the frontend container serves the SPA;
- it reverse-proxies
/api/tohttp://api:8000; - it reverse-proxies the emulator REST paths (
/identitytoolkit.googleapis.com/,/securetoken.googleapis.com/,/emulator/) tohttp://auth:9099.
The API base is the relative
/api/v1. The Auth SDK connects to the emulator atwindow.location.origin. -
Proxy configuration. Configure the proxy through runtime environment variables in the frontend container (for example
vite previewpreview.proxy), enabled only when those variables are set. Port changes therefore need no rebuild. -
Why.
http://127.0.0.1:<port>andhttp://localhost:<port>both work with no browser CORS dependency, and the containerized Playwright run can usehttp://frontend:4173. -
CORS allowlist. Defense in depth for direct clients:
LCA_CORS_ORIGINSbecomes exactly["http://127.0.0.1:<frontend port>", "http://localhost:<frontend port>"], with no wildcard../dev app-smokeasserts that both are allowed and an untrusted origin is not. -
Docs. The README documents
127.0.0.1as the canonical URL. It also says Firebase sessions are stored per origin, so switching spellings requires a fresh login. -
Fallback. If same-origin emulator proxying proves unworkable, fall back to direct URLs from build arguments, with the two-spelling CORS allowlist. Record the reason, and AC8 must still pass.
-
Rate limit. Behind the proxy, all browser traffic shares one client address. Set a justified local
LCA_REQUESTS_PER_MINUTE(≤10,000) incompose.app.yaml, so that normal grid scrolling and the smoke never hit 429. Record the value and the reason. -
Frontend image.
compose.app.yamlbuilds the frontend withVITE_SERVICE_MODE: real. The image stays unprivileged (node), withcap_drop: [ALL],no-new-privilegesand a127.0.0.1-only port.
R6. L1 QA notes (a) and (c)
- (a) For every
app-*command,./devmust refuse anLCA_APP_PROJECTequal to the effective workspace project name. That name isCOMPOSE_PROJECT_NAMEfrom the environment or the repository.env, defaulting tolca-diff-dev, thename:incompose.yaml. The check runs before any Compose call, because otherwise--remove-orphanscould remove workspace containers. - (c) The README states that
./dev app-importneedsprivate/, or the directory named byLCA_APP_PRIVATE_DIR, to exist (create_host_path: false), and shows the failure seen otherwise.
R7. Real-stack Playwright smoke
- Add a separate Chromium-only config and specs, excluded from the mock
test:e2erun and its@smokegrep, with nowebServer. - Run it in a pinned container on the app stack network through a new
./dev app-e2e, againsthttp://frontend:4173. The container is built from the committed lock, with browsers from.devcontainer/install-browsers.shand its pinned snapshot, or from a digest-pinned Playwright image matching@playwright/test1.65.1. - Steps:
- The unauthenticated modal appears, and no
/api/v1/dataset request is observed. - Demo login.
- Search, bulk-select and select two seeded processes, then reorder the columns.
- Flows shows the seeded exact 34-digit value at full precision, a present
0, and a blank absent cell. - Scores (GWP 100) shows a valid value and
N/Afor bothmissingandunresolved_basis. - Register, verify through the emulator's
oobCodesendpoint, refresh, and unlock. - Disable, delete or revoke the account through the emulator. The next protected read locks the shell and clears the data.
- Logout clears the data.
- The unauthenticated modal appears, and no
- Hosted CI. Try a per-PR job on hosted runners using
docker compose -p <ci project> -f compose.app.yamldirectly; runners are rootful, so./devcannot run there (seeetl.yml). Add it to the per-PR tier only if it passes reliably. Otherwise keep it a documented local check, and open a linked gap issue before handoff (ADR 0006 §7).
R8. Documentation
Update:
- the README: remove the L1 limitation; real mode; URLs and both spellings; demo login; how a person obtains the emulator verification link; that emulator accounts other than demo are lost on restart; (c);
apps/frontend/src/services/README.md: the M1–M10 resolutions;docs/engineering/development-environment.md: the frontend image, proxy, CORS andapp-e2e;- the roadmap L2 delivery note.
Acceptance criteria
-
AC1. Generated contracts.
contracts:generateis reproducible: two runs give byte-identical output.contracts:checkexits 0 on a clean tree and nonzero after a deliberate change toapps/api/openapi.jsonor to a generated file. The contracts check runs in the per-PR frontend workflow, andmake backend-openapi-checkstill passes. The boundary lint passes, withfirebase/fetchimports only undersrc/services/. -
AC2. Reconciliation.
contracts.tsmaps onto the generated types. TheflowSummaries/scoreSummariesmethods are replaced by row-page summaries derived as in M1. The services README records the resolution of M1–M10. There is no §7 semantic change (otherwise an ADR is included). -
AC3. Adapter parity. One shared adapter-contract test suite runs against both the mock adapter and the HTTP adapter. The HTTP adapter uses a fetch stub whose responses are valid against the generated types and use API-emitted seed lexemes. The suite covers:
- exact decimals:
1.234567890123456789012345678901234,1.2345E-33, the high-precision score12.3456789012345678901234567890123and thee-40score; - present-zero versus absent;
- valid-zero versus
missingversusunresolved_basis; - the derived P/N for positive-only, negative-only, mixed and all-zero/absent rows;
- snapshot echo, cursor continuation and token reuse;
- the error mapping for 401, 403, 404, 409, 422 (both codes), 429, 503, network failure, a non-JSON body and an invariant violation;
AbortSignalcancellation with no stale success.
- exact decimals:
-
AC4. Real mode end to end. After
./dev app-up, a browser athttp://127.0.0.1:<port>and athttp://localhost:<port>can log in with the demo account. It can then search, bulk-select, reorder, and compare Flows and Scores with the seeded PostgreSQL data, and no mock banner is shown. QA verifies this manually. -
AC5. Registration and verification. A new account can register and verify through the emulator using the documented procedure. Before verification, the account sees the verification guidance and no dataset content. After verification and a refresh, it unlocks.
-
AC6. Session safety. All of these are checked by emulator-backed tests:
- there are zero dataset API calls before a verified identity;
- a reload restores the session without the modal flashing;
- a revoked, disabled or deleted account, and any protected 401/403, locks the shell and clears protected caches;
- a persistent 401/403 causes no lock/unlock cycling;
- a sign-out failure for an unverified session shows the F2 UX.
-
AC7. Misconfiguration. Each of these shows an explicit error state and never mock data:
- an invalid or missing
VITE_SERVICE_MODE; - missing
realsettings; - a non-
demo-project with the emulator; - a stopped
apiorauthcontainer.
This is covered by unit tests plus one stack check, for example
./dev app-logsor stoppingapi. - an invalid or missing
-
AC8. Real-stack smoke.
./dev app-e2epasses R7 steps 1–8 at the delivered SHA. Hosted CI either has a passing per-PR real-stack job, or the handoff links a gap issue with the reason. -
AC9. L1 QA notes.
- (a):
LCA_APP_PROJECT=lca-diff-dev ./dev app-upexits nonzero with a clear message and no container change. So doesCOMPOSE_PROJECT_NAME=lca-x LCA_APP_PROJECT=lca-x ./dev app-down. The default project still works. - (b): the CORS allowlist is exactly the two loopback spellings, and
./dev app-smokeasserts both allowed and an untrusted origin denied. - (c): the README states the
private//LCA_APP_PRIVATE_DIRrequirement.
- (a):
-
AC10. Mock mode intact.
npm run devruns standalone with no API, database or Firebase. Frontendformat:check,lint,typecheck,test:unitandbuildpass. The mock Playwright suite passes:@smokein Chromium and Firefox, plus the full suite once. -
AC11. Security and runtime.
firebaseand the generator are pinned exactly, and the lock is committed.- Only labelled local-only placeholders are added, with no
.envfiles. - No tokens are logged or printed.
- The API image is unchanged: lean,
65532. - All services drop all capabilities and set
no-new-privileges, and host ports bind127.0.0.1only. - L1's
./dev app-up,app-down,app-reset --yesandapp-smokebehavior is unchanged apart from R5 and R6.
Out of scope and follow-ups
- The differences toggles, the
differences_only: trueUI or mock predicate, and the final local acceptance with the opt-in BAFU import are L3 [Task] L3 — Differences toggles on the real API and local MVP acceptance #30. - Workspace persistence, reconciliation, the polish audit and the mock Phase 1 gate are post-MVP ([Task] F5 — Persist the versioned account-scoped workspace #31–[Task] F5 — Record full mock-frontend acceptance and the Phase 1 gate #34, [Task] F5 — Implement exact on-demand difference queries in mock services #29).
- A production Firebase project, hosting and deployment are post-MVP.
- Persisting emulator accounts across restarts is not required; document it as a limitation.
- Workspace tooling notes 1, 3 and 6 from the L1 QA are [Task] Harden workspace tooling: fresh-clone uv sync, Spark interpreter, guard docs and app port validation #101, which does not block L2.
- The L1 QA note about the seed report titles is not in scope.
- The real-stack CI gap, if any, gets an issue linked from here (R7).
Verification plan
Inside ./dev shell. Run npm --prefix apps/frontend run with each of:
format:check,lint,typecheck,test:unitandbuild;contracts:check(new), plus the deliberate-drift negative check;test:e2e(mock, both browsers).
Also run make backend-openapi-check. If any API file changes, also run make backend-format-check backend-lint backend-typecheck backend-test-unit backend-test-api backend-test-auth.
On the host, with a distinct LCA_APP_PROJECT and ports, for example LCA_APP_PROJECT=lca-diff-l2-app LCA_APP_FRONTEND_PORT=5260 LCA_APP_API_PORT=8260 LCA_APP_AUTH_PORT=9260:
./dev app-up;./dev app-smoke;./dev app-e2e(new);./dev app-down && ./dev app-up, after which the login and data still work;- the AC9(a) negative invocations;
- a manual browser check on both loopback spellings (AC4/AC5);
- the misconfiguration check (AC7).
Hosted CI. All workflows are green at the delivered SHA; record whether the real-stack job is in the per-PR tier.
Record the exact commands, exit codes and the pinned versions chosen. QA independently re-runs AC4, AC5 and AC8 from a clean clone at the delivered SHA.
The mock checks prove UI semantics only. The real-stack checks are the evidence for authentication and integration.
Dependencies and readiness
All dependencies are satisfied:
- L1 [Task] L1 — Single-command local stack with a seeded synthetic release #96 is closed, delivered in PR L1: single-command local stack with seeded synthetic release (Refs #96) #100 and merged at
41c6b14. - ADR 0006 was accepted in PR docs: local-only MVP scope (proposed ADR 0006) and L1–L3 plan #98 (
cf7f1d5). - B1–B4 and the F1–F5 Scores frontend are merged.
There is no open maintainer decision. M1 and R5 are decided above within the existing contracts, so no ADR is needed. #101 is independent and does not block this issue.
Activity
DavidVFitzGerald commentedon Nov 16, 2026
PM: READY
L2 is groomed against
mainat41c6b14.Phase: Phase 2 / Local MVP, milestone L2. One issue and one PR, per ADR 0006 §6.
Dependencies: all satisfied.
41c6b14. Hosted CI is green onmain.Spec references:
Evidence checked at
41c6b14apps/frontend/src/app/composition.tsthrows unlessmode === "mock".ApplicationRuntime.modeis"mock" | "test". No HTTP or Firebase adapter exists yet. The boundary lint ineslint.config.jsalready forbidsfirebaseandfetchoutsidesrc/services/.apps/frontend/package.jsonpins exact versions and has nofirebaseand no OpenAPI generator.package-lock.jsonis committed.packages/contracts/does not exist.make backend-openapi-checkexists (container-only,uv run --frozen lca-openapi --check). It runs in backend CI and passed at41c6b14.apps/api/openapi.jsonis OpenAPI 3.1 with 13 paths.vite previewwebServer on127.0.0.1:4173. CI runs@smokein both browsers inside the node image. The workspace network cannot reach the app stack, so the real smoke needs a container on the app network.ops/local/frontend.DockerfilebakesVITE_SERVICE_MODEat build time;compose.app.yamlpassesmock. Its.dockerignoreadmits onlyapps/frontend/**.http://127.0.0.1:<frontend port>. The API rate-limits at 240 requests per minute per client address../devhas no guard againstLCA_APP_PROJECTcolliding with the workspace project (lca-diff-dev).flowSummaries/scoreSummariesroutes. It returns a whole-selectionNumericSummary {minimum, maximum, present_count, selected_count}on each row instead.Decisions recorded, all within existing contracts (no ADR)
summary. The provisional summary methods and the unused counts are removed from the boundary, and the mock computes the same derived summary. Onlygeometry.tsconsumes P and N./api/and the emulator REST paths.127.0.0.1andlocalhostwork, and so does a containerized Playwright run.firebaseandopenapi-typescriptare pinned exactly: the newest stable release at least 14 days old, compatible with Node 24 andfirebase-tools15.36.0. The lock is committed../dev app-e2eon the app network. It goes into per-PR CI only if it is reliable on hosted runners; otherwise there is a linked gap issue (ADR 0006 §7).Changes made to #97
contracts:check,./dev app-e2e);LCA_APP_PROJECTcollision guard, R6 and AC9;private/requirement, R6, R8 and AC9.blockedlabel, because its dependencies are complete. Labels are nowtaskandfrontend; the milestone is unchanged, L — Local MVP.Next: hand off to the Software Engineer in an isolated worktree, with a distinct
COMPOSE_PROJECT_NAME,LCA_APP_PROJECTand ports.DavidVFitzGerald commentedon Nov 16, 2026
Coordinator: maintainer decision (2026-11-16). The emulator does not keep accounts across restarts. Non-demo accounts and stored browser sessions are lost when the stack restarts. This is accepted as a documented MVP limitation, and persisting emulator state stays out of scope. The open questions (the §7.2
revision_snapshotexample, and the untracked L1 QA notes 7 and 8) are still pending. Implementation awaits explicit maintainer go-ahead.DavidVFitzGerald commentedon Nov 16, 2026
Coordinator: IMPLEMENTING on
feat/l2-real-adapterfrom0fe3ff3. Current maintainer request authorizes L2. Existing PM READY remains valid: L1 #96 and correction #102 are closed; #101/#103 are nonblocking. Rootless./dev checkpassed before development. Engineering is implementing generated DTOs, exact row-summary reconciliation, HTTP/Firebase adapters and real-stack browser validation under the existing contracts; independent QA will review the delivered SHA. No merge or closure is authorized.DavidVFitzGerald commentedon Nov 16, 2026
Engineering: READY FOR QA
Candidate:
37874dfonfeat/l2-real-adapter; PR #105. Base0fe3ff3, core incrementfec23ae. Issue remains open; merge is not authorized.Implemented AC1–AC11 scope: reproducible generated DTOs/drift CI, whole-selection row summaries, shared mock/HTTP parity, real Firebase SDK lifecycle, strict wire/error invariants, same-origin proxy, real stack build, independent real browser config/container/command, lifecycle collision guards, CORS fixes and current docs. Differences remain off in L2; L3 #30 owns toggles.
Container evidence and exact commands:
docs/engineering/l2-verification.md. Rootless preflight/toolchain passed. Frontend format/lint/typecheck/build/contracts and backend OpenAPI check pass. Full integrated units: 460/37 files before two final malformed-envelope cases; targeted adapter suite 46/46 after those cases. Core mock browser72/72, integrated final rerun ongoing. Real-stack Chromium5/5 passes, including actual registration/OOB verification, restore, account disable, persistent401/403 locking, unverified signout failure and logout. Real API smoke9/9 includes both loopback origins. Guard regression covers every app command and dotenv/environment precedence; both required live collision commands exit2 before Compose.Runtime identities/capability/port configuration remain hardened; API source/image recipe unchanged. Dependencies pinned exactly: Firebase13.1.0 (Oct21; next stable Nov2 18:16 was under14days at Nov16 12:33), openapi-typescript7.13.0, existing TypeScript6.0.3 via recorded peer override. No tokens, host installs, licensed fixtures, .env files or deployment introduced.
Strict MyPy/Ruff pass for changed ops sources with workspace import path. An unscoped local MyPy attempt lacked Airflow stubs/toolchain; hosted backend/ETL CI installs all packages and remains required. Hosted jobs are running, including new real-stack trial.
QA owner
/root/qais independently checking the candidate in a clean clone with separate containers/ports. Next: complete AC4/AC5 both-origin directed browser/visual checks, AC7 actual outage, restart persistence, full checks and AC8 real smoke; record exact evidence and verdict here. No interactive browser-control tool is exposed, so automated/directed browser evidence must not be described as human manual testing. Any required gap blocks PASS until resolved or tracked per the issue's specific hosted-CI allowance.perf: derive exact mock extrema in one pass (Refs #97)
docs: record final L2 verification and handoff (Refs #97)
DavidVFitzGerald commentedon Nov 16, 2026
QA: PASS
Reviewed head:
6d68472f720faa074a2c87cb280e776c9d5fca4d, PR #105. Tested application source:b27cc2babe7fe67c4622546a50fda24a66c87271. The final head changes only three engineering documents; independent diff review confirms that application, tests, generated contracts, images, tooling and CI are identical to the tested source.Independent checkout:
/tmp/lca-l2-qa-37874df, initially detached at37874df, advanced cleanly to the final source and documentation head. Workspace projectlca-diff-l2-qa(5271); app projectlca-diff-l2-qa-app(5270/8270/9270). Rootless Docker, namespace UID 0 mapped to unprivileged host UID 1000, all capabilities dropped and no-new-privileges verified. Node 24.22.3/npm 11.19.1, Python 3.14.2/uv 0.9.30. All development tools ran in containers. No application code, tests or criteria were changed by QA; deliberate drift probes were restored, and the checkout is clean.120030a96c16badc9b7c12f292d597720bcc133d63fe31dcbddfc367ef7005e1). Cleancontracts:checkpasses; deliberate generated-file and OpenAPI-schema changes both fail the check.backend-openapi-checkand boundary lint pass. Generation/negative probes ran at37874df; those files are unchanged at final head and final contract check passes.http://127.0.0.1:4173andhttp://localhost:4173, using a pinned test container sharing the frontend network namespace. Demo login, search, filtered bulk selection, keyboard reorder, exact precision, zero/absence and Flows/Scores worked without mock guidance. These visual checks ran at37874df; the final source changes only mock extrema/tests, and the complete real suite was rerun atb27cc2b. This is directed browser automation with visual inspection, not a claim of human GUI testing../dev app-e2e: 5/5 passed (18.9 s), covering R7 steps 1–8. The hosted real-stack job passes on the final reviewed head and remains in the per-PR tier; no CI-gap issue is needed..envcases and precedence. API smoke checks exactly both allowed loopback spellings and an untrusted origin. The README documents the existing private-directory requirement.VITE_SERVICE_MODE=mock npm --prefix apps/frontend run devstarts standalone in the workspace-only network, renders the modal/demo banner and makes zero API/external reads. Missing mode remains an explicit configuration error.65532:65532; frontend isnode. Rendered services and runtime inspection confirm capability/privilege restrictions and loopback-only host bindings. No tokens/raw licensed inputs/new.envfiles are committed or printed by the real tests. Independent down/up preserved publication revision and activation timestamp byte-for-byte; subsequent API smoke passes 9/9. Destructive reset was not rerun: its implementation is unchanged from L1; refusal without confirmation and prior L1 evidence are retained.Commands/results (host lifecycle commands used the project/port values above):
Inside the isolated workspace, all exited 0:
The repeated-generation/drift probe ran inside the same container with original bytes restored in
finally; directed browser probes ran in the pinned e2e image. Local evidence is in/tmp/lca-l2-qa-*.logand/tmp/lca-l2-qa-images/. Destructive volume deletion was not performed. An initial workspace image-unpack interruption recovered through the guarded cached startup. An early outage probe used incorrect timing; the corrected already-stopped-service probes passed. Two engineering full-browser runs under overlapping heavy work timed out; QA's complete final suite passed without relaxing timeouts. The build's bundle-size advisory is informational.Final-head hosted checks: Frontend quality and real-stack, API/backend, ETL.
Next owner/action: coordinator hands PR #105 to the maintainer for review and explicit merge. Issue remains open; QA does not merge or close it. L3 #30 remains the next implementation milestone after L2 merges.
DavidVFitzGerald commentedon Nov 16, 2026
Coordinator: READY FOR REVIEW
Task L2 is implemented in PR #105 on
feat/l2-real-adapter, final head6d68472f720faa074a2c87cb280e776c9d5fca4d. Application source was independently tested atb27cc2b; the final commit changes three verification documents only, reviewed independently by QA.Independent QA PASS verifies AC1–AC11. Container checks pass: 464 unit tests/37 files, full Chromium/Firefox mock suite 72/72, real Firebase/API/PostgreSQL browser suite 5/5, API smoke 9/9, frozen install, format/lint/types/build, deterministic generation and negative drift, backend OpenAPI, ops Ruff/MyPy and project-collision regressions. Both loopback spellings and documented OOB verification were checked through QA-directed browser actions/screenshots; stopped API/Auth show explicit errors without fallback. Publication pointer and activation timestamp survive down/up unchanged. All five hosted jobs pass on the final head, including real-stack.
Exact commands, pinned-version rationale and evidence are in
docs/engineering/l2-verification.md; the independent QA verdict is recorded on this issue. Two engineering full-browser runs hit Firefox timeouts during overlapping heavy work; the exclusive independent final full suite passes without relaxed timeouts. Automatic approval review rejected a destructive reset test; volumes were preserved, refusal without--yeswas verified, and the unchanged L1 destructive reset branch was checked by source comparison. No new volume-deletion test is claimed.Working tree is clean. No API/scientific semantic change, host install, licensed data, deployment, merge or issue closure. L3 #30 retains differences toggles and local opt-in BAFU acceptance. Next action: maintainer review/merge of PR #105; close #97 only after approved merge. L3 remains dependent on L2 delivery.
feat: generated contracts and real HTTP/Firebase service adapters (Refs
feat: connect local real stack and verify emulator journeys (Refs #97)
perf: derive exact mock extrema in one pass (Refs #97)
docs: record final L2 verification and handoff (Refs #97)
DavidVFitzGerald commentedon Nov 16, 2026
Coordinator: closing after the maintainer merged PR #105 at cd6d8a6. Independent QA PASS is recorded at #97 (comment) and all five final-head CI jobs passed. L2 is delivered; remaining MVP acceptance and differences toggles belong to L3 #30.