Skip to content

[Task] L1 — Single-command local stack with a seeded synthetic release #96

Closed

Description

@DavidVFitzGerald

Delivery phase

Local MVP (ADR 0006), milestone L1, the first of three implementation PRs. By the explicit ADR 0006 exception, this is one issue and one PR, which may span several sessions with incremental commits. Ownership is backend/ops plus shared root tooling (compose.yaml or a new app overlay, dev, Makefile, README). The frontend only receives a container definition; apps/frontend/src is unchanged.

Goal

One documented host command, ./dev app-up (wrapped by make up), starts the whole local application. It runs PostgreSQL, migrations, a published synthetic release, the Firebase Auth Emulator with a verified demo user, the FastAPI service and the frontend. Data persists across restarts.

Context and authority

Read AGENTS.md, the PRD, the specification (§0.3, §3.1 "Single-command application run", §4, §5.8, §7, §8 as revised by ADR 0006, and §9.2), docs/adr/0006-local-only-mvp.md, docs/engineering/roadmap.md (L1), docs/engineering/b3-ingestion.md, docs/engineering/b4-publication.md and docs/engineering/development-environment.md. Do not read the archive or reference folders.

Existing pieces, checked at 401dc06:

  • compose.yaml (project lca-diff-dev) has the profiles backend (postgres, volume postgres-data, no host port), api and auth. api and auth have no healthchecks yet.
  • compose.etl.yaml and compose.publication.yaml (postgres-target, volume publication-data).
  • apps/api/Dockerfile: lean image that asserts pyspark and airflow are absent. Its CMD does not migrate.
  • apps/api/emulator/: runs with no --import, so emulator state is lost on restart.
  • db/bootstrap.sql: roles lca_migrator, lca_import, lca_publisher and lca_api (read-only).
  • Alembic db/migrations/versions/0001–0003.
  • lca-import promote|publish|rollback (data_pipeline/src/lca_etl/cli.py, publication.py). Promotion reads only a ready B3 artifact manifest.json plus a Target JSON (environment: local, absolute file:// archive_uri, LCA_TARGET_IMPORT_DATABASE_URL / LCA_TARGET_PUBLISH_DATABASE_URL).
  • API settings (LCA_ prefix) already support explicit LCA_CORS_ORIGINS, emulator host validation and /api/v1/health and /api/v1/ready.
  • The frontend supports only VITE_SERVICE_MODE=mock (apps/frontend/src/app/composition.ts). There is no frontend Dockerfile.
  • data_pipeline/tests/fixtures.py is a test-only generator. It has 7 processes (1 excluded as multi-output), a single Synthetic/Nested/Leaf category and a random uuid4 release version per call. It is a starting point, not a sufficient seed.

Requirements and constraints

  • Commands. Add ./dev app-up, ./dev app-down (keeps volumes) and ./dev app-reset (removes only this stack's named volumes; refuses without an explicit --yes). Add make up / make down host wrappers in the existing dev-* style. Keep the rootless preflight (check-docker.sh), cap_drop: [ALL] and no-new-privileges on every service. Bind every host port to 127.0.0.1. Keep the existing ./dev up workspace, api-up, etl-*, publication-* and mock-only frontend flows unchanged.

  • Isolation from development and test databases. The app stack uses its own Compose project name (or equivalent distinct names) and its own named volumes for the database and the promoted-archive store. The integration and publication suites run DROP SCHEMA … CASCADE against postgres/postgres-target, so they must never be able to reach the app database. The stack must be startable while the ./dev up workspace is running. Choose and document non-conflicting default host ports, or fail fast with a clear message. The workspace already publishes FRONTEND_PORT (5173), and api-up uses 8000 and 9099.

  • Startup ordering. Use healthchecks and one-shot tasks: postgres healthy → migrations as lca_migrator → idempotent seed → API ready (/api/v1/ready) → frontend. The auth emulator gets a healthcheck, and the demo account is created after it is healthy. The API must never run migrations on startup. Do not start Airflow in this stack.

  • Synthetic seed. Commit a synthetic BAFU-shaped release under a runtime path outside tests/. Make it deterministic, with a fixed release version and no uuid4 per start. Load it through B4 promote and then publish/activate as lca_import/lca_publisher, with all B4 gates. A dedicated loader is acceptable only if it calls the same publication functions and constraints. Do not insert directly into the release, revision or publication tables, and do not bypass immutability or role limits. Preferably commit a pre-built ready artifact, with a documented regeneration command from committed synthetic sources, so that startup does not need Spark. The archive file:// URI must live on the stack's persisted volume.

  • Seed variety. The published revision contains at least:

    • 20 published processes;
    • 2 top-level categories, with at least one category_path of depth ≥ 3;
    • ≥ 2 distinct reference units and ≥ 2 distinct reference amounts;
    • one flow row that is positive in one process, negative in another, exactly 0 in another and absent in another;
    • at least one valid score and one N/A (missing) score, for the default indicator IPCC 2021 GWP 100;
    • at least one high-precision decimal amount (≥ 30 significant digits or an exponent ≤ -30).

    No licensed or provider data.

  • Idempotence. The seed is idempotent on restart. Use fixed operation UUIDs, so that B4 reused: true applies. If the release is already published at the seed revision, it is a no-op. It never creates a second revision and never changes the publication pointer silently. Any unexpected state, such as a different active revision, fails loudly and does not republish.

  • Demo account. Seed one verified email/password demo account in the Auth Emulator on every start, for project demo-lca. Document its credentials as local-only. They must not appear in any production configuration, and the API's existing production refusal of emulator settings stays in force.

  • API configuration. The API runs as lca_api with LCA_ENVIRONMENT=local, explicit emulator verification and an explicit LCA_CORS_ORIGINS list containing only the local frontend origin.

  • Frontend container. Add a frontend container: a pinned image, npm ci from the committed lockfile, and the Vite dev server or a static build. It must be reachable at the documented localhost URL. In L1 it runs with explicit VITE_SERVICE_MODE=mock, shows the existing "Local demo mode" banner and does not yet show seeded data. L2 [Task] L2 — Connect the frontend to the real API and Auth Emulator #97 switches the stack to the real adapter. Do not change apps/frontend/src.

  • Opt-in BAFU path. Document how to import the private BAFU inputs with the existing B3 commands into a separate import database and then lca-import promote/publish into this stack's database, with the same publish semantics. Name the target JSON shape, environment variables and network/overlay used. This is documentation only; executing it is L3 verification.

  • Documentation. Update the README quick start, docs/engineering/development-environment.md and the roadmap L1 status.

Acceptance criteria

  • AC1: From a clean clone with rootless Docker, and with no .env, private files or prior volumes, ./dev app-up alone brings every long-running service to healthy and every one-shot task to exit code 0. The documented frontend, API /api/v1/health and /api/v1/ready URLs respond from the host loopback.
  • AC2: A committed, container-run smoke check runs against the live stack. Its exact command is documented, and it prints no token values. With an emulator ID token for the demo user, GET /api/v1/releases returns the seeded published release and active revision. With no token the request returns 401 AUTH_REQUIRED. For an unverified emulator user it returns 403 EMAIL_NOT_VERIFIED. A preflight from a non-allowlisted origin gets no CORS allow header.
  • AC3: ./dev app-down followed by ./dev app-up preserves the database and archive: the same release and revision IDs, one revision, the same pointer and no new publication operation. The demo login still works. ./dev app-reset without --yes refuses and leaves the volumes. ./dev app-reset --yes followed by ./dev app-up recreates a clean seeded state.
  • AC4: The seed goes through B4 promotion and publication (evidence: one promote and one publish row in publication_operation, recording the restricted session roles). Targeted automated tests prove:
    • (a) seed idempotence, including a rerun against an already-seeded database;
    • (b) the variety minimums above, asserted from the published data;
    • (c) exact decimal-string round-trip of seeded flow amounts and scores, including the high-precision value, through the API cell endpoints;
    • (d) present zero vs absent vs N/A stay distinct in API responses.
  • AC5: With the workspace up, make backend-test-integration (and ./dev publication-run make backend-test-publication if run) leaves the app stack's release and revision IDs unchanged. ./dev app-up succeeds while ./dev up is running.
  • AC6: No new secrets are committed beyond clearly labelled local-only credentials. The API image still excludes pyspark and airflow. Rendered Compose config and docker port show only 127.0.0.1 host bindings, and Postgres has no host port. All services keep cap_drop: [ALL] and no-new-privileges.
  • AC7: The README documents app-up/down/reset, demo login credentials (marked local-only), ports and URLs, the L1 mock-frontend limitation, troubleshooting (port conflicts, rebuilds, reset) and the opt-in BAFU path. development-environment.md and the roadmap are updated.

Out of scope and follow-ups

Verification plan

On the Docker host (lifecycle only): ./dev config, ./dev app-up, ./dev app-down, ./dev app-up, ./dev app-reset, then ./dev app-reset --yes, then ./dev app-up. Also run ./dev up alongside to check AC5.

Inside ./dev shell: make backend-format-check backend-lint backend-typecheck backend-test-unit backend-test-integration backend-openapi-check, plus the new targeted seed tests and the AC2 smoke check, which runs in a container and not with host tooling. If ETL or publication code changes, also run ./dev publication-run make backend-test-publication.

Record exact commands, exit codes, rendered port bindings and IDs before and after restart. Never record token values. The applicable hosted CI (Backend, ETL and Frontend workflows) must pass. QA re-runs AC1–AC3 and AC5 from a clean clone at the delivered SHA, using a distinct project name and ports.

Dependencies and readiness

Satisfied:

L1 has no other blocking dependency. L2 #97 depends on this issue. PM grooming: see the issue comment.

Activity

  1. added
    task
    on Nov 16, 2026
  2. DavidVFitzGerald commented on Nov 16, 2026

    @DavidVFitzGerald
    OwnerAuthor

    PM: READY

    Lifecycle: groomed/ready. Next role is Software Engineer (one issue and one PR under the ADR 0006 exception).

    Phase: Local MVP (ADR 0006), milestone L1.

    Dependency status (satisfied):

    Spec references: §0.3 item 1, §3.1 "Single-command application run", §5.8, §7.1/§7.4, §8 (local MVP note, items 1–3/5/10), §9.2 (fixture rules and per-PR tier), §12 L1 and the definition of done.

    Checks against the repository at 401dc06

    • ./dev has no app-* commands and Makefile has no up/down. Host make exists, but the documented primary command stays ./dev app-up.
    • compose.yaml is project lca-diff-dev. postgres (volume postgres-data) has no host port. api and auth have no healthchecks. The workspace publishes 127.0.0.1:${FRONTEND_PORT:-5173}, and api-up uses 8000 and 9099. These collide with an app frontend on 5173 unless the app stack uses separate ports.
    • Risk found: apps/api/tests/conftest.py, packages/python/lca_shared/tests/test_schema.py and data_pipeline/tests/test_publication.py run DROP SCHEMA … CASCADE on postgres/postgres-target. An app stack that shares that project or volume would be wiped by the issue's own verification commands. I added an isolation requirement and AC5 for this.
    • The API is ready for this: it requires the lca_api role, has an explicit LCA_CORS_ORIGINS (wildcard refused), validates the emulator host and demo- project, provides /api/v1/health and /api/v1/ready, and its CMD does not migrate. The lean image asserts that pyspark and airflow are absent.
    • The emulator starts with no import/export, so the demo account must be recreated on each start. The existing requirement already says so. The B2 tests show the REST sign-up/verify pattern.
    • B4 promote reads only a ready B3 artifact plus a Target JSON with an absolute file:// archive. It and publish are idempotent with the same operation UUID (reused: true). The archive must therefore persist with the database. I added this to the requirements, and to AC3 and the reset behaviour.
    • lca-etl depends on airflow 3.4.0 and pyspark 4.3.0. Any seed that uses lca-import runs from the ETL image, never the API image.
    • Gap: data_pipeline/tests/fixtures.py is a test-only generator. It has 7 processes (1 multi-output excluded), one category path and a random release version per call. It cannot meet the variety minimums or determinism as it stands, so a committed runtime seed source is required.
    • The frontend accepts only VITE_SERVICE_MODE=mock, and there is no frontend Dockerfile. L1 therefore ships a mock-mode frontend container. The real adapter is L2. This is consistent with ADR 0006 item 6. §3.1's "real-adapter mode" is reached at the end of L2, not L1.

    Changes made to the issue body

    1. Dependencies: marked ADR 0006 as accepted and satisfied, with the PR docs: local-only MVP scope (proposed ADR 0006) and L1–L3 plan #98 and docs: record ADR 0006 acceptance (L0 follow-up) #99 SHAs, [Task] L0 — Record the local-only MVP scope (ADR 0006) #95 closed and B1–B4 merged.
    2. Context: replaced the generic "existing pieces" list with a verified inventory, including its gaps (missing healthchecks, the limits of the test fixture, frontend mock-only mode).
    3. Requirements:
      • added isolation from the destructive test databases (own project name and volumes) and port coexistence with ./dev up;
      • made a persisted archive volume part of the stack;
      • added an auth healthcheck and "no Airflow in this stack";
      • added a deterministic committed seed outside tests/ that goes through B4 promote and publish, preferably as a pre-built artifact so startup needs no Spark;
      • added objective variety minimums;
      • made idempotence fail loudly on unexpected state;
      • added explicit LCA_ENVIRONMENT=local and LCA_CORS_ORIGINS;
      • required the L1 frontend to run in explicit mock mode with no apps/frontend/src changes;
      • made the opt-in path name the target JSON, environment variables and network.
    4. Acceptance criteria:
      • AC1 now means a clean clone with no .env or private files, and one-shot tasks must exit 0.
      • AC2 is now a committed, container-run smoke check with exact statuses and codes (401 AUTH_REQUIRED, 403 EMAIL_NOT_VERIFIED) and a CORS negative check.
      • AC3 now covers the archive and publication_operation counts, and app-reset refusing without --yes.
      • AC4 now requires B4 operation evidence and tests for idempotence, variety, high-precision decimal round-trip and zero/absent/N/A distinctness.
      • New AC5 covers isolation from the test suites.
      • AC6 (formerly AC5) now adds a check of the rendered port bindings and security options.
      • AC7 (formerly AC6) now covers the roadmap and the L1 mock-frontend limitation.
    5. Verification plan: listed the exact host lifecycle sequence and the ./dev shell targets (adding backend-format-check and backend-openapi-check), the conditional publication suite and QA rerunning from a clean clone with distinct project and ports.

    Scope is unchanged relative to ADR 0006 and the specification. No new product decisions were introduced.

    Decisions recorded and left to engineering (no ADR needed)

    • Exact project name, port defaults and seed packaging. A pre-built artifact is recommended; running B3 run-local once on the first start is acceptable if it is documented and idempotent.

    Open points flagged for the maintainer (not blocking)

    • The first ./dev app-up builds the ETL image (Airflow + PySpark) for the seed task, which makes the first start slow. Later starts are a no-op seed.
    • In L1 the UI still shows mock data. The seeded data is visible in the browser only after L2.
  3. DavidVFitzGerald commented on Nov 16, 2026

    @DavidVFitzGerald
    OwnerAuthor

    Coordinator: state → implementing. Software Engineer assigned on branch feat/l1-local-stack (isolated worktree, base 401dc06). One issue and one PR for L1, per ADR 0006. QA will follow at the delivered SHA.

  4. DavidVFitzGerald commented on Nov 16, 2026

    @DavidVFitzGerald
    OwnerAuthor

    Engineering: READY FOR QA

    Lifecycle: implementing → QA. Next role: QA Engineer, at the delivered SHA.

    Summary

    • compose.app.yaml. It runs under its own project, ${LCA_APP_PROJECT:-lca-diff-app}, which is always passed as --project-name and never comes from COMPOSE_PROJECT_NAME. It has its own volumes, app-db and app-archive. Its database service is db.

    • Services and startup order.

      1. db becomes healthy.
      2. One-shot migrate runs as lca_migrator.
      3. One-shot seed runs: B4 promote and publish with fixed operation UUIDs.
      4. auth becomes healthy and one-shot auth-seed creates the verified demo account.
      5. api starts as lca_api (local, emulator, CORS limited to the local origin) and waits for /api/v1/ready.
      6. frontend starts: an explicit VITE_SERVICE_MODE=mock build served by vite preview.

      Airflow and Spark are not started.

    • Commands. ./dev app-up|app-down|app-reset [--yes]|app-status|app-logs|app-smoke|app-import, and make up/make down. ./dev config also validates the app file.

    • Ports. Defaults are 127.0.0.1:5180 (frontend), 8010 (API) and 9110 (auth). app-up fails fast on a port that is already in use.

    • Seed (data_pipeline/seed/). Invented sources, plus a pre-built ready B3 artifact produced by the Spark pipeline. The loader is lca_etl/seed.py. A fixed release synthetic-local-2026.1 gives deterministic IDs: release e0639837-ac2a-56e4-9746-967bc5ad433f, revision dc63c04e-8927-5825-8544-ffbfe2de8e8e.

    • Tools image (ops/local/tools.Dockerfile). The ETL runtime for the stack: the lca-etl package from the frozen lock, without the JVM. The API image is unchanged.

    • Smoke and demo account. ops/local/local_stack.py provides demo-user and smoke, standard library only, and prints no tokens.

    • Docs. README, development-environment.md (app-stack section and L1 record), roadmap and .env.example.

    Acceptance criteria

    AC Status Evidence
    AC1 Met A fresh git clone of the branch at 59dce85, with no .env, no private/ and no volumes, under project lca-diff-l1-clean with ports 5241/8241/9241. ./dev app-up exited 0. db, auth, api and frontend were healthy; migrate, seed and auth-seed showed Exited (0). From the host, curl on 127.0.0.1 got frontend 200, /api/v1/health 200 and /api/v1/ready 200. The same held in the worktree run (first build 2m26s).
    AC2 Met ./dev app-smoke runs in the tools container on the stack network and passed 8/8: health and ready 200; no token gives 401 AUTH_REQUIRED; the demo emulator token returns the seeded release and active revision; the exact 1.234567890123456789012345678901234 comes back through flow cells; an unverified user gets 403 EMAIL_NOT_VERIFIED; a preflight from http://untrusted.example.invalid gets no access-control-allow-origin; the local origin is allowed. No token values are printed.
    AC3 Met After app-down and app-up: the same release, revision and pointer activated_at; one revision; the same 2 operations; 55 archive files with the same digest. The seed reported promote_reused/publish_reused true, and the demo login worked again (smoke passed). app-reset alone exited 1 and kept both volumes. app-reset --yes removed only <project>_app-db and <project>_app-archive, and the next app-up reseeded cleanly with the same IDs.
    AC4 Met publication_operation has two rows: promote with lca_import/lca_import and publish with lca_publisher/lca_publisher. make backend-test-seed (6 tests) covers these points:
    (a) The first load seeds; a CLI rerun against the seeded DB is a no-op with reused true; an injected foreign revision raises SEED_UNEXPECTED_REVISION without a new operation. There is also a unit test of the state guard.
    (b) Checked through the API: ≥20 processes (24), ≥2 top-level categories (3), a path of depth ≥3, ≥2 units (5) and ≥2 reference amounts, and a flow row with positive, negative, zero and absent cells. GWP 100 has valid, missing and unresolved_basis scores.
    (c) Exact strings come back for the 34-digit flow, 1.2345E-33, the score 12.3456789012345678901234567890123 and the e-40 score.
    (d) A present 0 (flow and score), an absent present:false, amount:null, and N/A scores with amount:null stay distinct.
    Further tests check that the sources regenerate byte for byte and that the artifact is bound to the committed sources.
    AC5 Met With app project lca-diff-l1-app running, the workspace lca-diff-l1 ran make backend-test-integration (5 passed), backend-test-api (4), backend-test-auth (1), ./dev publication-run make backend-test-publication (3) and backend-test-seed (6). The app state dump was identical before and after. ./dev app-up exited 0 while both the lca-diff-l1 and lca-diff-dev workspaces were running.
    AC6 Met Only clearly labelled local-only credentials were added; there are no .env files and no apps/frontend/src or uv.lock changes. The API image has no pyspark, airflow or lca_etl (build assertion plus a runtime find_spec check) and runs as user 65532:65532. In the rendered config every service has cap_drop [ALL] and no-new-privileges:true. Port bindings are only 127.0.0.1: docker port shows api 8000→127.0.0.1:8240, auth 9099→127.0.0.1:9240 and frontend 4173→127.0.0.1:5240; db has none.
    AC7 Met The README documents up/down/reset, the smoke, demo login (marked local-only), ports and URLs, the L1 mock-frontend limitation, troubleshooting (ports, rebuilds, reset, failed one-shots), the seed and its regeneration, and the opt-in BAFU path (target JSON, LCA_TARGET_* variables, ./dev app-import on the stack network with the archive volume and a read-only /private). development-environment.md and the roadmap are updated.

    Exact commands (host lifecycle; tooling only in containers)

    export LCA_APP_PROJECT=lca-diff-l1-app LCA_APP_FRONTEND_PORT=5240 LCA_APP_API_PORT=8240 LCA_APP_AUTH_PORT=9240
    ./dev config                                   # 0
    ./dev app-up                                   # 0
    ./dev app-smoke                                # 0, 8/8 ok
    ./dev app-down && ./dev app-up                 # 0, state identical, reused=true
    ./dev app-reset                                # 1, refused
    ./dev app-reset --yes && ./dev app-up          # 0, clean reseed
    LCA_APP_FRONTEND_PORT=5173 ./dev app-up        # 1, port conflict named
    # workspace: COMPOSE_PROJECT_NAME=lca-diff-l1 FRONTEND_PORT=5230 API_PORT=8230 AUTH_PORT=9230 ./dev api-up and ./dev publication-up
    # inside the workspace container (docker compose -p lca-diff-l1 exec -T workspace ...):
    make backend-format-check backend-lint backend-typecheck backend-test-unit             # all 0
    make backend-test-integration backend-test-api backend-test-auth backend-openapi-check  # all 0
    ./dev publication-run make backend-test-publication    # 3 passed
    ./dev publication-run make backend-test-seed           # 6 passed
    # clean clone at 59dce85 (project lca-diff-l1-clean, ports 5241/8241/9241):
    ./dev app-up; ./dev app-smoke; make down; make up      # all 0

    The container commands set UV_PROJECT_ENVIRONMENT=/var/tmp/lca-venv, because the worktree is on a size-limited tmpfs. Locked packages are the same. The non-interactive docker compose exec -T workspace was used in place of the interactive ./dev shell.

    Blockers

    None.

    Limitations and follow-ups

    • The stack frontend is mock mode in L1, by design. It does not show the seeded data. That is L2 [Task] L2 — Connect the frontend to the real API and Auth Emulator #97, which also covers the real adapter, generated DTOs and the real-stack Playwright smoke.
    • No hosted CI job for the app stack itself. ./dev requires a rootless daemon, and GitHub runners are rootful. Per ADR 0006 item 7 it remains a local check until L2/L3 adds a CI smoke.
    • The opt-in BAFU path is documented and wired (./dev app-import) but not executed. Running it is L3 [Task] L3 — Differences toggles on the real API and local MVP acceptance #30.
    • Cleanup. I removed my own projects (lca-diff-l1, lca-diff-l1-app, lca-diff-l1-clean), their volumes, images and the clone. Other projects' containers were untouched.

    For QA

    Re-run AC1–AC3 and AC5 from a clean clone at 59dce85. Use a distinct LCA_APP_PROJECT and ports, for example LCA_APP_PROJECT=lca-diff-l1-qa LCA_APP_FRONTEND_PORT=5250 LCA_APP_API_PORT=8250 LCA_APP_AUTH_PORT=9250, and a distinct COMPOSE_PROJECT_NAME/ports for the workspace. The ETL overlay needs an existing LCA_PRIVATE_INPUT_DIR; an empty directory works.

  5. DavidVFitzGerald commented on Nov 16, 2026

    @DavidVFitzGerald
    OwnerAuthor

    Coordinator: state → QA. Independent QA assigned at the delivered SHA 59dce8503885817849ac3de8da2b9372236a1fc1 (PR #100). Hosted CI is 4/4 passing at that SHA.

  6. DavidVFitzGerald commented on Nov 16, 2026

    @DavidVFitzGerald
    OwnerAuthor

    QA: PASS

    Reviewed SHA: 59dce8503885817849ac3de8da2b9372236a1fc1 (PR #100).

    Environment:

    • Fresh GitHub clone under /var/tmp, with no .env, no private/ and no volumes.
    • Rootless Docker.
    • App project lca-diff-l1-qa (ports 5250/8250/9250) and workspace lca-diff-l1-qaws (ports 5251/8251/9251).
    • Real backend (PostgreSQL, B4, FastAPI, Auth Emulator). The frontend is an explicit mock build, as L1 intends.

    Criteria:

    • AC1 PASS: ./dev app-up exits 0. db, auth, api and frontend are healthy. The migrate, seed and auth-seed one-shots exit 0. Frontend, health and ready all return 200 on loopback.
    • AC2 PASS:
      • ./dev app-smoke passed 8/8, twice.
      • Independent probes: 401 AUTH_REQUIRED without a token or with a garbage token. 200 with the seeded release and revision for the demo token. 403 EMAIL_NOT_VERIFIED for an unverified user.
      • CORS: an untrusted origin gets no allow header; http://127.0.0.1:5250 is allowed.
      • No tokens appear in logs.
    • AC3 PASS:
      • State is byte-identical across down and up: 1 revision, the same pointer timestamp, the 2 operations reused, and 55 archive files with the same digest.
      • app-reset and app-reset --no exit 1 and keep the volumes.
      • app-reset --yes removes only the app volumes. The next app-up reseeds with the same IDs and an identical archive digest.
      • make down and make up both exit 0.
    • AC4 PASS:
      • Operation rows: promote by lca_import and publish by lca_publisher.
      • backend-test-seed: 6 passed.
      • Seed inspection: deterministic IDs, no direct table writes, 24 processes in depth-3 categories, high-precision decimals, positive, negative, zero and absent values, and valid, missing and unresolved scores.
      • Live injection of a foreign revision: app-up exits 1 with SEED_UNEXPECTED_REVISION. The api and frontend are not started, and the state is unchanged.
    • AC5 PASS:
      • With the app stack running, all of these exited 0: uv lock --check, format-check, lint, typecheck (46 files), unit (15), integration (5), API (4), auth (1) and OpenAPI check.
      • Publication (3), seed (6) and ETL (5) tests passed.
      • The app state was identical afterwards.
      • The workspace cannot resolve db. The app uses a separate network and volumes, and every DROP SCHEMA guard allowlist excludes db.
    • AC6 PASS:
      • All 9 services drop all capabilities and set no-new-privileges. Host bindings are 127.0.0.1 only, and db has no host port.
      • Neither Airflow nor Spark starts.
      • The API image lacks pyspark, airflow and lca_etl, and runs as uid 65532.
      • Credentials are local-only and labelled. There are no apps/ changes and no uv.lock change.
      • The frontend mode is explicit, and the code has no fallback.
      • The rootless preflight is preserved for the app-* commands.
    • AC7 PASS: the README quick start matches the observed behavior, and the port-conflict and invalid-input errors behave as documented.

    Diff review:

    • Arguments to ./dev are validated and quoted, with no injection path.
    • The seed and import tools run as namespace UID 0 on the guarded rootless daemon, which is consistent with ADR 0003 and spec §3.1. All long-running services stay unprivileged.
    • There is no L2 scope creep and no PRD/spec deviation, so no ADR is needed.

    Hosted CI: 4/4 passing at the SHA.

    Non-blocking notes (follow-up candidates):

    1. The workspace backend targets on a fresh clone need uv sync --frozen --all-packages first, and this is undocumented. Overriding UV_PROJECT_ENVIRONMENT breaks the Spark tests, because PYSPARK_PYTHON is pinned.
    2. ./dev should refuse an LCA_APP_PROJECT equal to the workspace COMPOSE_PROJECT_NAME. Otherwise --remove-orphans could remove the workspace containers. Data would stay safe.
    3. The test-guard wording in development-environment.md omits the localhost/127.0.0.1 allowance.
    4. The CORS allowlist is exactly 127.0.0.1:<port>, so localhost:<port> will fail once L2 makes real calls.
    5. ./dev app-import fails closed if private/ is missing; the README could state that it must exist.
    6. An invalid LCA_APP_*_PORT blocks every ./dev command, and the port range is unchecked.
    7. The committed seed reports are titled "Private import report", although the data is invented.
    8. QA did not do a --no-cache rebuild.

    QA authored no changes and cleaned up all lca-diff-l1-qa* resources. The evidence logs are in /var/tmp/l1qa-*.

    Coordinator handoff

  7. DavidVFitzGerald commented on Nov 16, 2026

    @DavidVFitzGerald
    OwnerAuthor

    Closed by the coordinator. L1 was delivered through PR #100, which the maintainer merged at 41c6b14 on 2026-11-16. It passed independent QA (PASS at 59dce85) with hosted CI 4/4 green. QA's non-blocking notes 2, 4 and 5 (project-name collision guard, the localhost CORS origin, and the missing-private/ doc) are being handed to L2 #97 grooming. Notes 1, 3 and 6 are tooling follow-ups.

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

    task

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions