Skip to content

[Task] F1: compose mock services with TanStack Query and an enforced UI boundary #9

Closed

Description

@DavidVFitzGerald

Delivery phase

Phase 1 - frontend with mock services

Goal

Give every later component a single replaceable service/auth entry point and query client.

Context and authority

Milestone F1; 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 §§3, 6.8, 7.3–7.4, 12. Current planning baseline is on docs/agent-workflow, pending review/merge into main; proposed ADRs are not accepted authority. Create the service composition/query integration under apps/frontend/src/app/; expose service/query hooks without fixture imports in UI; add boundary configuration/tests. These application paths are planned until created. Exclude all archive/reference folders.

Requirements and constraints

Select explicit mock mode from validated configuration at one composition boundary; no silent production fallback. Components/hooks may access injected services but must not perform direct HTTP/Firebase calls or import mock fixtures. Carry cancellation and revision identity through query keys. Auth interfaces initially support resolving/unauthenticated scenarios; complete account behavior is F2.

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 - The app has one typed service provider and one TanStack Query composition boundary; mock mode runs without backend/Firebase/cloud configuration.
  • AC2 - Invalid/unsupported configuration fails visibly with a safe non-sensitive error; a future real-mode failure cannot silently select mocks.
  • AC3 - A lint/import-boundary check or equivalent meaningful static check prevents UI imports from mock fixtures and direct transport/auth-SDK access.
  • AC4 - Query cancellation reaches the adapter; cache keys include semantic inputs and revisions and do not reuse data across distinct account/release contexts.
  • AC5 - Component/service integration tests inject a substitute adapter without modifying UI code; technical mock-mode status is explicit.

Out of scope and follow-ups

Actual shell/auth UX is #11–#14; full difference-specific cache behavior is F5. Real auth/HTTP adapters and generated types remain I1.

Verification plan

Inside ./dev shell, run all established format:check/lint/typecheck/test:unit/build scripts. Demonstrate an import-boundary violation is detected, an abort reaches a pending mock request, and invalid mode does not fall back.

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 #7, #8. 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 blockers above

PM: READY, AC1–5 unchanged. PR #41 and #42 merged; #7 and #8 closed after independent QA and final hosted quality CI PASS. #42 merge is 31842a5. Current merged docs/contracts apply; historical planning-branch blockers are superseded. Rootless ./dev check PASS. Scope typed service/query composition, minimal resolving-to-unauthenticated auth boundary, explicit config and static import enforcement. Default demo must not request protected dataset content before verified auth; verified injected adapters may exercise query paths in tests. Full auth behavior remains #12/F2. No new ADR/product decision needed. #10 awaits #9 merge.

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 F1, 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: #7, #8. 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. removed
    blocked
    on Nov 14, 2026
  4. DavidVFitzGerald commented on Nov 14, 2026

    @DavidVFitzGerald
    OwnerAuthor

    PM: READY

    Rechecked merged #7/#8 and quality/independent-QA evidence. AC1–5 unchanged; readiness addendum supersedes historical blockers. Implement isolated feat/f1-service-composition then independent QA at delivered SHA. No protected dataset requests in resolving/unauthenticated demo; actual account behavior remains F2. Container-only validation, no silent adapter fallback. #10 remains merge gated.

  5. DavidVFitzGerald commented on Nov 14, 2026

    @DavidVFitzGerald
    OwnerAuthor

    Engineering: READY FOR QA

    Branch feat/f1-service-composition, SHA f0f1a36d8aba8c5040e2bf555cab2589367f0a7e. AC1–5 implemented: injected service/query providers, explicit mock-only configuration, minimal resolving/unauthenticated auth, guarded datasets, account cache cancellation/clear and response-epoch guard, typed error handling, scoped query keys, static UI boundary checks, adapter injection and explicit demo marker. TanStack Query pinned 5.107.1; README gives VITE_SERVICE_MODE=mock commands.

    Rootless ./dev check and frozen npm ci PASS (227 packages). Exact validation:

    docker compose -p lca-f1-composition exec -T workspace bash -lc '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 && npm --prefix apps/frontend run build'

    All five PASS; 104 tests/six files, including 15 composition and 10 negative lint-boundary cases. Pending mock query abort, default no-data auth path, injected verified adapter, typed failures, account/logout cleanup, stale direct response rejection, and config errors tested. Whitespace PASS; clean committed worktree.

    Independent QA pending. Full auth lifecycle/product UI remains #12/F2; browser smoke #10; real auth/API/security evidence remains future integration. Leave issue open pending QA, CI and approved merge.

  6. DavidVFitzGerald commented on Nov 14, 2026

    @DavidVFitzGerald
    OwnerAuthor

    QA: PASS

    Independent QA at f0f1a36d8aba8c5040e2bf555cab2589367f0a7e, Phase 1 mock mode, PR #43.

    Criterion Verdict/evidence
    AC1 PASS — One injectable Services provider and stable TanStack Query client; default auth resolves unauthenticated and no protected dataset calls occur.
    AC2 PASS — Seven invalid/unsupported modes fail safely and visibly without fallback or leaking mode contents.
    AC3 PASS — Independent static probes reject 11 prohibited import/re-export/HTTP/auth/global/dynamic cases; two allowed cases pass. Concrete adapters confined to composition.
    AC4 PASS — UID/adapter/release/revision/filter keys isolate caches; captured inputs stay immutable. Account changes clear caches; query abort reaches adapter without cached success; late auth-epoch results are rejected and imperative unauthenticated query calls blocked.
    AC5 PASS — Substitute-adapter component tests work without modifying components; explicit local-demo marker rendered.

    Independent command:

    docker compose -p lca-f1-composition exec -T workspace bash -lc 'set -e; 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; npm --prefix apps/frontend run build'

    All five PASS: 104 tests/six files (15 composition, 10 boundary); build 71 modules. Whitespace checks PASS; reviewed SHA/worktree unchanged, QA made no edits. Additional read-only probes confirmed async placeholder auth, direct data guards, same-UID auth-epoch rejection, semantic key isolation, cleanup and cancellation. No blocking regression or ADR-required deviation found.

    Mock-only evidence: full account UX/lifecycle #12/F2, browser smoke #10 and real backend/security remain separate. Coordinator confirms final hosted CI, then maintainer reviews/merges PR #43; leave #9 open until approved merge.

  7. DavidVFitzGerald commented on Nov 14, 2026

    @DavidVFitzGerald
    OwnerAuthor

    Coordinator: READY FOR REVIEW

    PR #43, branch feat/f1-service-composition, SHA f0f1a36. Independent QA PASS AC1–5; all five container quality scripts PASS (104 tests), frozen install PASS, final hosted quality CI PASS: https://github.com/DavidVFitzGerald/LCA-diff/actions/runs/43588351365. Clean committed worktree; no unresolved in-scope blockers. Next: maintainer reviews/merges PR #43, then coordinator closes #9 and PM rechecks #10 browser smoke/completion gate. No merge, deployment or publication performed.

  8. DavidVFitzGerald commented on Nov 14, 2026

    @DavidVFitzGerald
    OwnerAuthor

    Coordinator verified maintainer merge of PR #43 at 7704e8e. Final independent QA PASS AC1–5 and hosted quality CI PASS at f0f1a36 are recorded above. Closing completed service composition slice; #10 is next for PM recheck.

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

    frontendtask

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions