Skip to content

[Task] F2: verify complete mock authentication and accessible shell journeys #15

Closed

Description

@DavidVFitzGerald

Delivery phase

Phase 1 - frontend with mock services

Goal

Close F2 with repeatable evidence for simulated identity journeys and shell accessibility before selector work.

Context and authority

Milestone F2; read AGENTS.md, docs/team/product-manager.md, docs/product/LCA_diff_PRD.md, docs/engineering/roadmap.md, and docs/engineering/LCA_diff_Implementation_Specification.md §§6.1, 6.8, 9.2; roadmap F2 gate. Current planning baseline is on docs/agent-workflow, pending review/merge into main; proposed ADRs are not accepted authority. Extend frontend auth/shell Playwright and component tests and document F2 gate evidence; make only small in-scope fixes via linked findings if needed. These application paths are planned until created. Exclude all archive/reference folders.

Requirements and constraints

Exercise actual running frontend through mocked services in containers. Cover initial state, full registration/reset/verification, persistent session, revocation/logout, account switching and narrow viewport behavior. Treat mock evidence separately from future Firebase integration; no application feature additions beyond defects tracked against the relevant task.

One session-sized task/PR including verification and handoff. Run all development, installation and checks in containers; install nothing on the host. No real backend, Firebase project, cloud credentials or proprietary inputs. If the current PRD/spec must change, prepare an ADR and updates to both current documents in the same PR.

Acceptance criteria

  • AC1 - Browser coverage includes unauthenticated zero-data shell, named focus-trapped dialog, keyboard form journeys, verified access and no modal flash during restored session.
  • AC2 - Logout, refresh failure/revocation, unverified denial and delayed-response/account-switch cases clear protected content and prevent cached-account leakage.
  • AC3 - Desktop shell/tab/sidebar controls have labels/focus and narrow view has a usable desktop-required message; Chromium and Firefox journeys run where provisioned.
  • AC4 - Container PR smoke includes critical locked-shell/login/auth-guard cases, while fuller available frontend auth suite is runnable manually.
  • AC5 - Evidence records reviewed SHA, exact commands/browser versions, passing/failing/blocked cases and remaining real-auth checks; no blocker is marked PASS.

Out of scope and follow-ups

Process selector and actual comparison content are F3–F5. Real auth/security and backend validation remain B2/I1; no live credentials or licensed data.

Verification plan

Inside ./dev shell, run npm --prefix apps/frontend run test:unit, npm --prefix apps/frontend run test:e2e, format:check/lint/typecheck/build. Capture criteria evidence and validate the delivered PR CI run; report unavailable browser environments as blockers.

Engineer records branch/SHA and exact results, leaves issue open, and hands off to QA. QA verifies every criterion at that SHA and reports PASS/FAIL/BLOCKED; mock evidence is not proof of real security/integration.

Dependencies and readiness

Blocked by #13, #14. No implementation until dependencies and the M1 environment runtime gate are satisfied. This body is groomed planning material, not PM READY while blockers remain. Coordinator/PM rechecks merged dependencies and session-sized scope before starting.

Current readiness — supersedes historical planning baseline/blockers above

PM: READY for Phase 1/F2 on merged main at 93872b3f1bfb5d569f37f8ef8285bb8897764b53. Dependencies #13 and #14 are closed. Each had independent QA PASS, required hosted quality SUCCESS and an explicit maintainer merge: PR #47 (9012a65) and PR #48 (93872b3). #11/#12 were already closed, and the M1/M2/F1 prerequisites remain satisfied. The merged documents and contracts on main replace the historical planning-branch statements above. AC1–AC5 are unchanged. No ADR or product/specification decision is required. This is a verification-and-evidence task: add browser/component tests and documentation only. Do not add product features, scenario hooks or test-only product code.

Existing coverage on main (do not duplicate; extend or reference)

  • apps/frontend/e2e/foundation.spec.ts: @smoke locked shell with no protected data (named aria-modal dialog, inert shell, Tab/Shift+Tab, Escape/backdrop refusal, no fetch/XHR) and @smoke narrow viewport with resize recovery.
  • apps/frontend/e2e/auth.spec.ts: @smoke keyboard sign-in (validation, invalid credentials, repeated Escape). Not smoke: registration duplicate/verification, unverified lock plus switch, and reset unknown/known.
  • apps/frontend/e2e/session.spec.ts: @smoke restore with no modal flash (init-script MutationObserver). Not smoke: unverified restore and anonymous reload, and signout/account switch preserving the workspace key.
  • Component: src/App.test.tsx (shell states, tabs/sidebars/settings with injected services, narrow view, demo marker), src/auth/AuthDialog.test.tsx (forms, pending/abort/duplicate), src/app/session.test.tsx (15 lifecycle cases: expiry/revocation/failed refresh, protected 401/403 lock, slow/failed signout, A→B, same-UID relogin, late failures, abort passthrough) and src/app/composition.test.tsx.
  • CI: .github/workflows/frontend.yml runs npm run test:e2e -- --grep @smoke on PR/push, and the full npm run test:e2e on workflow_dispatch. The Playwright config has only chromium and firefox projects.
  • Evidence: the per-issue records docs/engineering/f2-shell-verification.md, f2-auth-verification.md, f2-auth-forms-verification.md and f2-session-verification.md. No consolidated F2 gate record exists.

Gaps this issue must close

  1. G1 — browser coverage of verified-shell controls (AC3, §§6.1, 6.8). No Playwright case exercises the verified workspace controls. Add a browser journey through the composed mock adapter (sign in as [email protected]) that checks:

    • Flows is the default tab, and ArrowLeft/ArrowRight/Home/End move selection and focus with roving tabindex.
    • Activating Scores shows the indicator sidebar, and returning to Flows hides it.
    • The process and indicator collapse buttons toggle aria-expanded and the panel visibility.
    • The Settings button toggles aria-expanded and the named region.
    • Sign out is reachable and operable by keyboard.
    • Focus is visible on each control: assert :focus-visible/focused state, not just DOM order.
  2. G2 — browser evidence for expiry, revocation and failed refresh (AC2). The mock expireSession/revokeSession/refresh_failure drivers are reachable only inside services/tests by design. Do not add window globals, query parameters, env/build flags, test-only build modes or UI to drive them in the browser. No shipped auth bypass or override is allowed.

    • Add the legitimate browser-observable analogue: a session invalidated out of band before reload. From the Playwright harness, remove the adapter marker lca-diff:mock-session:v1 and also replace it with a malformed or non-synthetic value. Then reload and assert:
      • the shell resolves to the locked sign-in modal;
      • the prior account email and verified controls are absent;
      • no fetch/XHR requests are made;
      • the UID-scoped workspace key is untouched.
    • This analogue only reduces access, and it changes no product code.
    • Live expiry/revocation/failed refresh, protected 401/403 locking and delayed-response account switching are accepted as component-level evidence in src/app/session.test.tsx (injected composition). Cite the exact test names. Record the browser gap explicitly as deferred to I1 (Firebase Auth Emulator). Do not record it as PASS.
  3. G3 — smoke composition (AC4, §9.2). The PR smoke must cover locked shell, login and at least one auth-guard denial. It currently has locked shell, narrow view, keyboard login and no-flash restore, but no guard denial.

    • Tag exactly one small existing or new guard case @smoke. Prefer either "unverified sign-in stays locked with no Sign out/workspace" or "signout relocks and removes account text".
    • Keep the smoke small. Every other F2 journey stays in the full suite.
    • Document both invocations: local npm run test:e2e -- --grep @smoke and npm run test:e2e, and hosted gh workflow run frontend.yml --ref <branch> (workflow_dispatch full suite). Record the hosted full-suite run URL, or mark it NOT RUN with the reason.
  4. G4 — consolidated F2 gate record (AC5). Create docs/engineering/f2-verification.md. It must hold:

    • the reviewed SHA;
    • exact container commands;
    • tool and browser versions;
    • an AC1–AC5 × case matrix naming each spec/test file and test title, the layer (browser/component), the browsers, and PASS/FAIL/BLOCKED/NOT RUN;
    • accepted component-only evidence (G2) with its rationale;
    • remaining real-auth checks for B2/I1.

    Link the four per-issue records from it. Do not rewrite them. An optional one-line status pointer at the top of f2-shell-verification.md is allowed, because its "prepared/not merged" status is outdated.

  5. G5 — roadmap status (docs/engineering/roadmap.md).

  6. G6 — Phase 2 follow-ups must not disappear. No B2/I1 issue exists, and later phases stay at milestone level, so do not create backend issues. Add these to the roadmap B2 and/or I1 sections, and list them in the F2 record:

  7. G7 — browser versions and Safari.

    • Capture launched browser versions inside the container with: cd apps/frontend && node -e "const pw=require('@playwright/test');(async()=>{for(const t of [pw.chromium,pw.firefox]){const b=await t.launch();console.log(t.name(),b.version());await b.close();}})()" plus npx playwright --version.
    • Record Safari/WebKit as UNAVAILABLE (not provisioned in the container image or Playwright config). It is neither PASS nor an F2 blocker: §6.1 says "Safari as practicable". Note it for the Phase 1/R2 browser recheck. Do not add a WebKit project or image changes here.

Files

  • Change/add:
    • apps/frontend/e2e/*.spec.ts (new shell-controls and invalidated-restore journeys; @smoke tag change), with new spec files allowed;
    • optional focused additions to src/App.test.tsx/src/app/session.test.tsx, only if a G1/G2 assertion is missing at component level;
    • docs/engineering/f2-verification.md (new);
    • docs/engineering/roadmap.md (F2 row/paragraph and B2/I1 follow-ups).
  • Do not change product source, src/services/** behavior, playwright.config.ts browser projects, .github/workflows/frontend.yml or .devcontainer/**, unless a real defect is found. If a defect is found, stop, and the coordinator opens a linked Bug for it rather than fixing it silently here.

Verification (container only; nothing installed on the host)

COMPOSE_PROJECT_NAME=lca-diff-f2-gate FRONTEND_PORT=<free port> ./dev up
COMPOSE_PROJECT_NAME=lca-diff-f2-gate FRONTEND_PORT=<free port> ./dev check
docker compose -p lca-diff-f2-gate exec -T workspace bash -lc 'npm --prefix apps/frontend ci --no-audit --no-fund'
docker compose -p lca-diff-f2-gate exec -T workspace bash -lc 'cd apps/frontend && npm run format:check && npm run lint && npm run typecheck && npm run test:unit && npm run build'
docker compose -p lca-diff-f2-gate exec -T workspace bash -lc 'cd apps/frontend && npm run test:e2e -- --grep @smoke'
docker compose -p lca-diff-f2-gate exec -T workspace bash -lc 'cd apps/frontend && npm run test:e2e'

Expected evidence:

  • Chromium and Firefox pass both the smoke subset and the full suite, with counts recorded.
  • Every browser case still asserts no fetch/XHR/API/external requests and no console errors.
  • The lockfile is unchanged.
  • Hosted PR quality passes at the delivered SHA. Record the hosted full-suite dispatch run, or mark it NOT RUN.
  • The engineer hands off the branch/SHA, PR (Refs #15, no closing keyword) and limitations to independent QA. QA verifies at that SHA.
  • Mock evidence does not prove real Firebase authentication, token lifecycle, authorization or data security.

Activity

  1. added
    task
    frontend
    blocked
    on Nov 13, 2026
  2. DavidVFitzGerald commented on Nov 13, 2026

    @DavidVFitzGerald
    OwnerAuthor

    PM: BLOCKED

    Groomed using docs/team/product-manager.md for F2, 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: #13, #14. 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.

  3. DavidVFitzGerald commented on Nov 14, 2026

    @DavidVFitzGerald
    OwnerAuthor

    PM: READY — Phase 1/F2, AC1–5 unchanged. #13/#14 now closed with independent QA PASS, required hosted quality SUCCESS and maintainer merges of PR #47 (9012a65) and PR #48 (93872b3); #11/#12 and M1/M2/F1 prerequisites satisfied. Verification/evidence task on main 93872b3 per specification §§6.1, 6.8, 9.2: add browser verified-shell keyboard controls (G1), out-of-band invalidated-restore browser analogue with component-level expiry/revocation/refresh-failure/delayed-switch evidence accepted from session.test.tsx and the browser gap deferred to I1 — no shipped driver/bypass (G2), one auth-guard @smoke case plus documented smoke/full/workflow_dispatch invocations (G3), consolidated docs/engineering/f2-verification.md (G4), roadmap F2 status (G5), Phase 2 follow-ups from #13/#14 QA in roadmap B2/I1 without new backend issues (G6), browser version capture and Safari recorded UNAVAILABLE not PASS (G7). No product code, ADR or spec change; defects go to linked Bugs. Exact scope, files and container commands appended to the body. Handoff to Software Engineer, then independent QA at delivered SHA.

  4. DavidVFitzGerald commented on Nov 14, 2026

    @DavidVFitzGerald
    OwnerAuthor

    Engineering: READY FOR QA

    Branch test/f2-gate-evidence, delivered SHA 0143fba, PR #49 (no closing keyword). The base is main at 93872b3. The change is tests and docs only, with no product code changes and no shipped test hooks.

    Gaps addressed

    • G1: added a browser journey that drives the verified shell from the keyboard in e2e/f2-gate.spec.ts. It covers tab switching, the sidebar, Settings and sign-out, and checks a visible 3px focus ring on each control.
    • G2: added three browser cases for a session changed in storage before reload (removed, malformed, non-demo account). Each expects the locked modal, the workspace key preserved and the session marker cleared. The live expiry, revocation, refresh-failure and 401/403 cases are accepted as component-level evidence, cited by test name in the record. Browser-level coverage is deferred to I1.
    • G3: the unverified-denial case is now @smoke. Smoke, full and hosted-dispatch invocations are documented.
    • G4: consolidated record in docs/engineering/f2-verification.md.
    • G5: roadmap F2 status updated. F2 is not marked complete.
    • G6: the [Task] F2: connect mock login, registration, verification and password-reset flows #13 and [Task] F2: guard protected queries through session restoration and account changes #14 QA follow-ups are recorded in the roadmap B2/I1 sections and in the record.
    • G7: versions recorded. Safari/WebKit is recorded as UNAVAILABLE.

    Criteria: AC1–AC5 are each mapped to specific tests in the record, with the layer (browser or component) and the browsers for each.

    Commands (rootless container project lca-diff-f2-gate):

    • ./dev check PASS
    • Frozen npm ci: 230 packages, lockfile unchanged
    • format:check, lint, typecheck and build PASS
    • test:unit 168/168
    • test:e2e -- --grep @smoke: 10 passed
    • full test:e2e: 26 passed

    Versions: Node v24.22.3, npm 11.19.1, Playwright 1.65.1, Chromium 159.0.8154.6, Firefox 159.0.

    Hosted CI

    Limitations: this is mock evidence only. Safari is unavailable. Browser-level coverage of live session invalidation is deferred to I1.

    Next: independent QA at 0143fba.

  5. DavidVFitzGerald commented on Nov 14, 2026

    @DavidVFitzGerald
    OwnerAuthor

    QA: PASS

    Reviewed SHA: 0143fbab170465fbfb0da91d455dcc7c0175372f (PR #49, branch test/f2-gate-evidence), base main 93872b3. Mode: mock services only (VITE_SERVICE_MODE=mock). This does not prove real Firebase identity, token lifecycle, authorization or data security.
    Environment: isolated detached worktree /tmp/claude-1000/qa-15, rootless Compose project lca-diff-qa-15, FRONTEND_PORT=5185. Torn down afterwards. Nothing was installed on the host and no files were modified.

    Commands and results (all inside the container except the ./dev lifecycle)

    Command Result
    COMPOSE_PROJECT_NAME=lca-diff-qa-15 FRONTEND_PORT=5185 ./dev up / ./dev check PASS: rootless identity, capabilities, 8 preflight regressions, frozen uv lock
    npm --prefix apps/frontend ci --no-audit --no-fund PASS, 230 packages; git status --porcelain clean afterwards (lockfile unchanged)
    npm run format:check, lint, typecheck, build PASS
    npm run test:unit PASS, 168 tests in 9 files
    npm run test:e2e -- --grep @smoke PASS, 10 tests (5 cases × Chromium/Firefox)
    npm run test:e2e PASS, 26 tests (13 × 2)
    npx playwright test e2e/f2-gate.spec.ts --repeat-each=3 PASS, 24/24 (4 cases × 3 × 2 browsers); no flakes
    npx playwright --version; npx vitest --version; documented node -e launch script Playwright 1.65.1, Vitest 5.1.0, Node v24.22.3, npm 11.19.1, chromium 159.0.8154.6, firefox 159.0. All match the record.

    Hosted CI

    • gh pr checks 49: quality pass. Run 43602273788 is pull_request at 0143fba, SUCCESS, log shows "10 passed" smoke and 168 unit tests.
    • gh run view 43602279979: workflow_dispatch at 0143fba, quality SUCCESS, log shows "26 passed" for the full browser suite and 168 unit tests.

    Acceptance criteria

    • AC1: PASS. All cited titles exist in foundation.spec.ts, auth.spec.ts and session.spec.ts, and pass in both browsers. The cited component titles exist in App.test.tsx/session.test.tsx, and AuthDialog.test.tsx has the cited 13 cases.
    • AC2: PASS (mixed layers, as accepted by PM G2). Browser: unverified denial (now @smoke), signout/account switch, the f2-gate keyboard signout, and three invalidated-before-reload cases. Component: session.test.tsx cases "%s clears rendered data, aborts pending reads and empties the cache" (logout/expiry/revocation/failed refresh/verification loss), "a protected %s response locks the session…", "locks before a slow signout…", the A→B switch, same-UID relogin and late-failure cases. All exist and assert what the record says. Browser-level live-invalidation evidence is recorded as deferred to I1, not PASS.
    • AC3: PASS (Safari UNAVAILABLE). The f2-gate keyboard journey asserts Flows as the default tab, Arrow/Home/End roving with aria-selected/tabindex=-1, the Scores-only indicator sidebar, both collapse buttons' aria-expanded and heading visibility with Enter/Space, the Settings aria-expanded/named region, and keyboard signout. It also asserts focus plus a computed outline: 3px solid on each control. That ring comes from the :focus-visible rule in shell.css, so the assertion actually checks visible focus. The narrow-view smoke passes in both browsers.
    • AC4: PASS. The smoke set covers the locked shell, narrow view, keyboard login, no-flash restore and the unverified auth-guard denial. The full suite runs locally and through workflow_dispatch (both verified above). The record documents the invocations.
    • AC5: PASS. docs/engineering/f2-verification.md records the commands, versions, counts, AC×case matrix with layers, accepted component-only evidence with its rationale, Safari UNAVAILABLE, and the B2/I1 real-auth checks. The delivered SHA and hosted run URLs are recorded in the engineering handoff and here (see concern 1). No blocked, deferred or unavailable item is marked PASS.

    PM gaps

    • G1 PASS: see AC3.
    • G2 PASS: removed, malformed and non-synthetic markers each give the locked, focused modal with an inert shell, no Sign out, no @example. text and an "Auth: unauthenticated" status. The seeded workspace key is preserved, the session marker is cleared, and no fetch/XHR, external, /api/ or console errors occur. No shipped hook, global or flag was added.
    • G3 PASS: exactly one tag change (auth.spec.ts:135).
    • G4 PASS: consolidated record created; the four per-issue records are linked and unchanged apart from the allowed status pointer in f2-shell-verification.md.
    • G5 PASS: the roadmap F2 row and paragraph are updated, and F2 is explicitly not marked complete.
    • G6 PASS: follow-up (a) is in B2; (b) and (c) are in I1. All three are listed in the record.
    • G7 PASS: versions are captured, and Safari/WebKit is UNAVAILABLE, neither PASS nor a blocker.

    Scope and authority

    git diff --stat 93872b3..0143fba shows 5 files changed: e2e/auth.spec.ts (+1/-1), e2e/f2-gate.spec.ts (new), f2-shell-verification.md, f2-verification.md (new) and roadmap.md. There are no changes under apps/frontend/src, .github, .devcontainer, playwright.config.ts, package*.json, docs/product, the specification or docs/adr. No PRD/spec deviation, and no ADR is required. No historical or archived folders were used.

    Non-blocking concerns

    1. The record itself names only the base 93872b3 and says the hosted runs are "NOT RUN until then"; the delivered SHA and run URLs live in the issue. A commit cannot contain its own SHA, so this is acceptable, but the coordinator may want a pointer to this comment after merge.
    2. In session.test.tsx, the expiry/revocation/failed-refresh component cases all emit the same AUTH_FAILED error state. The scenario-specific behaviour is covered at the adapter level in src/services/mock/auth.test.ts (refresh_failure, expireSession/revokeSession).
    3. No product code writes lca-diff:workspace:v1:* yet (workspace persistence starts in F3+). The browser "workspace key preserved" assertions therefore seed the key themselves and prove only that it is not deleted.

    Defects: none. Next: coordinator/maintainer review and merge of PR #49. After merge, the coordinator marks F2 complete in the roadmap.

  6. DavidVFitzGerald commented on Nov 14, 2026

    @DavidVFitzGerald
    OwnerAuthor

    Coordinator: closing. Independent QA PASS at 0143fba (identical content merged), hosted PR quality and full-suite dispatch SUCCESS, maintainer merge of PR #49 as 1f82774. All F2 tasks #11–#15 are closed; the roadmap F2 row will be marked complete in the next roadmap-touching PR. Delivered SHA and hosted runs: see the engineering and QA comments above.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    blockedfrontendtask

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions