Build local-edition api image from the public tree

Task 10177 · Done · Coder · created · updated

Supersedes draft 10167 (same defect; that draft sits outside the epic and never dispatches). Reproduction (Task 10133, fresh Ubuntu 24.04 VM, staging repo jaah-ai/jaah-local-staging v1.2.4426): the tag's release build failed, so `install.sh` stops at "could not find a release" (AC-4). `git clone` + `docker compose --profile node up -d` falls back to building and fails at `COPY packages/evidence` (AC-5). README build-from-source verbatim fails on 8 monorepo-only COPY paths incl. `infra/jaah/requirements.txt` (AC-6). This is the epic's core ask ("one line install and/or build from repo and/or docker compose") and it does not work today. Cause: `tools/local_edition/manifest.toml` ships only `apps/api/app/{__init__,edition}.py` and `migrations/_edition.py`; `infra/local-edition/Dockerfile.api` COPYs `apps/api/requirements.txt`, `infra/jaah/requirements.txt`, `packages/governance`, `packages/evidence`, `portfolio/fleet/*.md`, `docs/policies/context-architecture.md`, `tools/{manifest_check,github_settings}.py`. Including `apps/api/**` makes `check_tree.py` report 1136 findings (444 non-test imports of `app.vnodes`, `app.nodelinks`, `app.cloud_node_launch`, `app.billing.*`, `app.support_kb.*`, `app.project_memory.*`, `app.node_group_reconcile`; plus domain literals and instance terms). Fix: - Decouple excluded cloud-only modules from shipped api modules (lazy/registered imports behind `edition.IS_LOCAL`, or move call sites into `apps/api/app/routers_cloud.py`), then include `apps/api/**` minus excludes/tests in the manifest. - Make `Dockerfile.api` build from the public tree (no `infra/jaah/requirements.txt`; ship or replace doctrine/`packages/*` inputs). - Make `.github/workflows/local-edition-check.yml` build the api image inside the built tree so the gap cannot reopen. Out of scope: node bundle (separate follow-up), jaahd decoupling (separate follow-up), any cloud behaviour change (PRD §7); do not change the cloud route table. Done means: - `build_tree.py` then `check_tree.py` report 0 findings with the api included (cite output). - `docker build -f Dockerfile.api .` succeeds inside the built tree; `local-edition-check.yml` does this and is green. - A staging publish's `Release images` run goes green and creates a GitHub Release (cite run URL). - `./dc check quick` green; `apps/api/tests/test_routers_cloud.py` green.

Outcome

Public tree now ships the api minus PRD cloud-only modules (~80 modules decoupled behind edition guards); Dockerfile.api builds and boots from the tree, CI smoke-tests it. Tree check 0 findings, api suite 27567 passed, CI green; PR #6965 queued. Staging release oracle pending post-merge publish. Memory: none applied.

Pull request

Artifacts

Activity

  • Ready
  • Runner started
  • Runner ended (done)