ORCH-048: staging B6 reads registry via GET /projects (not local import) #45

Merged
admin merged 7 commits from feature/ORCH-048-staging-b6-check-reads-registr into main 2026-06-06 10:24:11 +03:00
Owner

Summary

  • Fixes false-FAIL in staging-check B6 «Registry: sandbox present, prod ET/ORCH absent». B6 built the registry by importing src.projects locally (host-path hack + importlib.reload), reading ORCH_PROJECTS_JSON from the launcher's process-env. On the deployer's canonical host run that var is unset → built-in default (ET+ORCH) → false FAIL even when staging isolation is healthy.
  • Adds read-only additive endpoint GET /projects (src/main.py) returning known_plane_project_ids + {plane_project_id, repo, work_item_prefix, name} of the live process; no secrets. Existing routes unchanged.
  • Rewrites B6 to fetch GET {base}/projects via the same stdlib _get helper as A/B4/B5/C; removes host-path hack + importlib.reload (launch-invariant: host / docker exec). Verdict isolated in pure _evaluate_b6(known) -> (passed, detail); contract unchanged. Endpoint degradation (non-200 / missing key / bad body / network) → deterministic FAIL, never false PASS.
  • Per ADR-001 (variant а). src/projects.py and .env* untouched; prod behaviour of existing routes unchanged.

Docs (golden source, same PR)

  • docs/architecture/README.mdGET /projects in API table + B6 mechanic in staging-gate section.
  • docs/operations/STAGING_CHECK.md — B6 description (HTTP) + isolation row + launch-invariance note.
  • CHANGELOG.md — entry.

Test plan

  • pytest tests/ -q → 476 passed.
  • tests/test_staging_check_b6.py — TC-01..TC-07.
  • tests/test_projects_endpoint.py — endpoint returns registry, only id/repo/prefix/name (no secrets).
  • Live staging run (deployer, deploy-staging): B6 == PASS; A/B4/B5/C unaffected.

Refs: ORCH-048

🤖 Generated with Claude Code

## Summary - Fixes false-FAIL in staging-check **B6** «Registry: sandbox present, prod ET/ORCH absent». B6 built the registry by importing `src.projects` locally (host-path hack + `importlib.reload`), reading `ORCH_PROJECTS_JSON` from the *launcher's* process-env. On the deployer's canonical host run that var is unset → built-in default (ET+ORCH) → false FAIL even when staging isolation is healthy. - Adds read-only additive endpoint **`GET /projects`** (`src/main.py`) returning `known_plane_project_ids` + `{plane_project_id, repo, work_item_prefix, name}` of the **live process**; no secrets. Existing routes unchanged. - Rewrites B6 to fetch `GET {base}/projects` via the same stdlib `_get` helper as A/B4/B5/C; removes host-path hack + `importlib.reload` (launch-invariant: host / `docker exec`). Verdict isolated in pure `_evaluate_b6(known) -> (passed, detail)`; contract unchanged. Endpoint degradation (non-200 / missing key / bad body / network) → deterministic FAIL, never false PASS. - Per ADR-001 (variant а). `src/projects.py` and `.env*` untouched; prod behaviour of existing routes unchanged. ## Docs (golden source, same PR) - `docs/architecture/README.md` — `GET /projects` in API table + B6 mechanic in staging-gate section. - `docs/operations/STAGING_CHECK.md` — B6 description (HTTP) + isolation row + launch-invariance note. - `CHANGELOG.md` — entry. ## Test plan - [x] `pytest tests/ -q` → 476 passed. - [x] `tests/test_staging_check_b6.py` — TC-01..TC-07. - [x] `tests/test_projects_endpoint.py` — endpoint returns registry, only id/repo/prefix/name (no secrets). - [ ] Live staging run (deployer, `deploy-staging`): B6 == PASS; A/B4/B5/C unaffected. Refs: ORCH-048 🤖 Generated with [Claude Code](https://claude.com/claude-code)
admin force-pushed feature/ORCH-048-staging-b6-check-reads-registr from 4abe746fc0 to 8b5b1f0056 2026-06-06 09:55:10 +03:00 Compare
admin added 1 commit 2026-06-06 09:56:11 +03:00
docs(ORCH-048): owner decision — pin variant (v), reject (a) HTTP-endpoint (chicken-egg)
All checks were successful
CI / test (push) Successful in 13s
CI / test (pull_request) Successful in 13s
7a6c7a0151
admin added 1 commit 2026-06-06 09:59:58 +03:00
architect(ET): auto-commit from architect run_id=151
All checks were successful
CI / test (push) Successful in 15s
CI / test (pull_request) Successful in 14s
d6744c3c05
admin added 1 commit 2026-06-06 10:03:32 +03:00
fix(staging_check): B6 reads registry from running staging instance env
All checks were successful
CI / test (push) Successful in 12s
CI / test (pull_request) Successful in 16s
28d019a1e2
B6 false-FAILed because it built the project registry from the
launcher process-env via a host-path hack (sys.path.insert +
importlib.reload), not from the running staging instance. Run from the
host, ORCH_PROJECTS_JSON is unset -> default ET+ORCH registry -> false
FAIL -> spurious deploy-staging -> development rollback.

Variant (v) per ADR-001: remove the host-path hack; canonically run the
suite INSIDE orchestrator-staging via docker exec so src.projects
resolves from /app (PYTHONPATH) with .env.staging. Verdict logic
extracted into pure _evaluate_b6(known) -> (passed, detail) +
_known_project_ids_from_registry() / _run_b6() with deterministic FAIL on
source unavailability. deployer.md and STAGING_CHECK.md updated to the
docker exec command. src/projects.py, .env* and checks A/B4/B5/C
untouched.

Refs: ORCH-048

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
admin added 1 commit 2026-06-06 10:05:49 +03:00
reviewer(ET): auto-commit from reviewer run_id=153
All checks were successful
CI / test (push) Successful in 13s
CI / test (pull_request) Successful in 14s
2424f9aaad
admin added 1 commit 2026-06-06 10:07:54 +03:00
tester(ET): auto-commit from tester run_id=154
All checks were successful
CI / test (push) Successful in 13s
CI / test (pull_request) Successful in 13s
913c185232
admin merged commit 2a36ed80b9 into main 2026-06-06 10:24:11 +03:00
Sign in to join this conversation.
No Reviewers
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: admin/orchestrator#45