Skip to content

[Task] F1: define provisional service contracts and synthetic precision fixtures #6

Closed

Description

@DavidVFitzGerald

Delivery phase

Phase 1 - frontend with mock services

Goal

Define the frontend's replaceable service/auth interfaces and representative synthetic data before UI features depend on them.

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 §§1.2, 6, 7.1–7.4, 9.2. Current planning baseline is on docs/agent-workflow, pending review/merge into main; proposed ADRs are not accepted authority. Create typed boundaries in apps/frontend/src/services/ and synthetic fixtures under apps/frontend/src/services/mock/; tests alongside the boundary. These application paths are planned until created. Exclude all archive/reference folders.

Requirements and constraints

Cover all §7 frontend-facing operations and an asynchronous auth lifecycle interface. Preserve decimal strings, flow present/absent, score valid/missing/unresolved_basis, stable IDs, release/revision snapshots, row keys, windows/cursors, errors and AbortSignal. Provisional TS types will later be generated from FastAPI OpenAPI in I1; do not implement FastAPI now.

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 - Typed contracts cover identity, releases, search, resolve-selection, headers, indicator tree, flow/score rows/cells and auth observation/actions without exposing transport to components.
  • AC2 - Measurement DTOs accept decimal strings/null states and do not silently turn absent or N/A into zero.
  • AC3 - Deterministic synthetic fixtures include positive/negative, present zero, absent flow, unresolved/missing scores, same source-number-like labels in distinct compartments, differing reference amounts/units, cell warnings and multiple immutable revisions.
  • AC4 - Fixtures include nested categories and method/optional category/indicator hierarchy with source ordering and an IPCC 2021/GWP 100 default descriptor; synthetic provenance is explicit, with no proprietary rows.
  • AC5 - Contract/fixture tests prove exact-string round trips, stable IDs and valid revision linkage; planned interface semantics are documented for later OpenAPI reconciliation.

Out of scope and follow-ups

Mock execution is #7/#8; account behavior is #12; real adapter/generated OpenAPI DTOs remain I1. Do not ingest or claim to reproduce real BAFU.

Verification plan

Inside ./dev shell, run the established format:check, lint, typecheck, test:unit and build scripts via npm --prefix apps/frontend run <script>. Unit cases must show exact long/small decimal strings and zero/absent/N/A remain distinct.

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 #5. 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 for Phase 1/F1 provisional service/auth contracts and deterministic synthetic fixtures. #2 and #3 are closed; scaffold #5 implementation and QA merged through PR #37 at 04779ea. Current main documents and accepted ADRs apply; historical planning-branch statements are superseded. AC1–5 are unchanged. Independently rerun rootless ./dev check: PASS, including eight preflight regressions, pinned tools and frozen lock. Container format:check/lint/typecheck/test:unit/build remain required. No product/spec deviation or new ADR is needed. Mock executors remain #7/#8, composition #9, browser tooling #10, auth execution #12, exact differences #29 and real/generated contracts I1.

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: #5. 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/F1, AC1–5 unchanged. Independent PM review verified #2/#3 complete and PR #37 merged at 04779ea for #5, and independently reran ./dev check successfully. The issue body now supersedes its historical dependency/planning blockers. Implementation scope is typed contracts, synthetic fixtures, contract tests and interface documentation under current specification §§1.2, 6, 7.1–7.4, 9.2 and accepted ADRs 0001–0003. No executor, UI, backend or scientific meaning changes. Engineering proceeds on isolated branch feat/f1-service-contracts; independent QA follows at the delivered SHA.

  4. removed
    blocked
    on Nov 14, 2026
  5. DavidVFitzGerald commented on Nov 14, 2026

    @DavidVFitzGerald
    OwnerAuthor

    Engineering: READY FOR QA

    Branch feat/f1-service-contracts, delivered SHA aaf91faa583d89b7ec6940f902e7f137aa51b54b. AC1–5 implemented: typed transport-independent data/auth boundary; exact decimal and missing-state discriminants; deeply frozen entirely invented fixtures with two immutable revisions, distinct reference identities and environmental compartments, nested process paths and optional indicator categories/defaults; documented adapter semantics and eventual OpenAPI reconciliation. No runtime adapter or UI/auth execution.

    Environment: rootless isolated Compose workspace lca-f1-contracts, ./dev check PASS (eight preflight scenarios); frozen frontend npm ci PASS, lock unchanged. Exact validation command:

    docker compose -p lca-f1-contracts 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 scripts PASS; 25 tests in two files. git diff --check PASS; clean committed worktree. Tests include exact long/tiny JSON round trips, invalid numeric syntax, compile-negative states, deep immutability, revision/process linkage, cell warning scope, indicator defaults/source ordering, and one correct reference output per process.

    Independent QA is reviewing this exact SHA. Real auth/backend/security checks are unimplemented; executors #7/#8, composition #9, browser tooling #10, auth execution #12, difference predicates #29 and real/generated I1 contracts remain separate. Leave open until QA, CI and approved merge. No historical context, host package installation, secrets or licensed data used.

  6. DavidVFitzGerald commented on Nov 14, 2026

    @DavidVFitzGerald
    OwnerAuthor

    QA: FAIL

    Independent QA reviewed aaf91faa583d89b7ec6940f902e7f137aa51b54b in the rootless lca-f1-contracts workspace. AC1/3/4/5 PASS; AC2 FAIL: decimalString(0) from an untyped caller returns numeric 0, and a string-coercible object is likewise accepted. Expected: runtime validation rejects non-string values with TypeError. Actual: RegExp.test coerces its argument, then the helper returns the original value branded as DecimalString. Compile-time negative cases do not protect untyped JSON/JS callers.

    Independent format:check, lint, typecheck, test:unit and build all PASS (25 tests, 2 files); git diff --check PASS. Fixture probes confirmed unique rectangular cells, reference amount/unit/geography, method-indicator linkage and string/null measurements. Trailing newline/CR/Unicode terminator probes correctly rejected malformed decimal strings.

    Engineering is adding a runtime typeof guard plus regression coverage under this same issue, then QA will recheck the new commit. QA made no code or test edits. Verdict applies to this SHA only; leave issue open.

  7. DavidVFitzGerald commented on Nov 14, 2026

    @DavidVFitzGerald
    OwnerAuthor

    Engineering: READY FOR QA — runtime validation fix

    Final SHA 0bce7ebf6d743e464f1466349f3ea739e459a826, branch feat/f1-service-contracts, PR #40. Adds explicit typeof string validation before regex coercion and nine regression cases for untyped numeric/null/array/object inputs. Original bug reproduced before the fix. This supersedes the initial delivered SHA.

    All five established frontend quality scripts rerun successfully in docker compose -p lca-f1-contracts exec -T workspace: format:check, lint, typecheck, test:unit (34 tests across two files), build. git diff --check PASS; working tree clean. Final independent QA pending at this SHA. Existing scope and real-integration limitations unchanged; issue stays open pending QA, CI and approved merge.

  8. DavidVFitzGerald commented on Nov 14, 2026

    @DavidVFitzGerald
    OwnerAuthor

    QA: PASS

    Independent review at final SHA 0bce7ebf6d743e464f1466349f3ea739e459a826, Phase 1/F1 synthetic contracts/fixtures, PR #40. This supersedes the initial FAIL at aaf91fa.

    Criterion Verdict Evidence
    AC1 PASS All §7 service operations plus async auth actions/observation; documented transport, snapshot, cursor/window, error and cancellation semantics.
    AC2 PASS Exact decimal strings and distinct missing states; compile-negative cases reject numeric amounts/inconsistent states. Independent untyped-input probe confirms numeric-coercion defect fixed.
    AC3 PASS Two immutable snapshots, six revision-bound processes, 42 unique flow cells, 12 score cells; signed values, zero/absence, missing/unresolved scores, distinct compartments, correct reference basis/location and scoped warnings.
    AC4 PASS Nested process paths, optional indicator categories, source order, IPCC 2021/GWP 100 default, explicit synthetic provenance.
    AC5 PASS Exact JSON round trips, stable flow IDs, revision linkage, deep immutability and documented OpenAPI reconciliation.

    Independent container commands:

    docker compose -p lca-f1-contracts 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 PASS: 34 tests across two files, build 15 modules. git diff origin/main --check PASS. Additional read-only in-container Node probes confirmed fixture integrity and rejected 13 invalid inputs, including numeric zero, coercible objects and trailing line terminators; coercion hooks never ran. Reviewed SHA and clean worktree unchanged; QA made no edits. No PRD/spec deviation requiring an ADR.

    No real authentication/API security or browser execution evidence claimed. Linked executors, composition, auth and browser follow-ups remain unchanged. Final hosted CI is being checked separately. Next action: coordinator confirms CI, then maintainer reviews/merges PR #40. Leave #6 open until approved merge; #7/#8 remain gated on it.

  9. DavidVFitzGerald commented on Nov 14, 2026

    @DavidVFitzGerald
    OwnerAuthor

    Coordinator: READY FOR REVIEW

    PR #40: #40, final branch/SHA feat/f1-service-contracts / 0bce7ebf6d743e464f1466349f3ea739e459a826.

    AC1–5 independently QA PASS; all five container quality scripts PASS (34 tests), and final hosted quality CI PASS: https://github.com/DavidVFitzGerald/LCA-diff/actions/runs/43534799498. PR description includes final evidence and limitations. No unresolved in-scope QA findings; clean committed worktree. Already-merged scaffold #5 was closed after verification.

    Next owner/action: maintainer reviews and merges PR #40. This issue remains open until approved merge. Then PM can mark #7 and #8 ready from the merged contracts; #9/#10 retain their dependency gates. No merge, deployment or publication performed.

  10. DavidVFitzGerald commented on Nov 14, 2026

    @DavidVFitzGerald
    OwnerAuthor

    Coordinator verified maintainer merge of PR #40 at fc9609b (2026-11-14). Independent QA PASS at delivered 0bce7eb and final quality CI PASS are recorded above. Closing completed F1 contracts slice; PM rechecks #7/#8 against the merged boundary.

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