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

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>
This commit is contained in:
2026-06-06 07:03:31 +00:00
parent d6744c3c05
commit 28d019a1e2
4 changed files with 230 additions and 26 deletions

View File

@@ -21,10 +21,20 @@ On stage `deploy-staging` your job is to run the staging test suite and write a
### Steps:
1. Run the staging test suite against the live staging environment:
1. Run the staging test suite against the live staging environment.
**CANONICAL: run INSIDE the `orchestrator-staging` container via `docker exec`**
(ORCH-048, ADR-001) — NOT from the host:
```bash
python3 scripts/staging_check.py --base-url http://localhost:8501 --mode stub
docker exec orchestrator-staging \
python3 /repos/orchestrator/scripts/staging_check.py \
--base-url http://localhost:8501 --mode stub
```
Why: the B6 registry-isolation check reads the registry from the running
instance's own process-env (`.env.staging`). Running from the host leaves
`ORCH_PROJECTS_JSON` unset → B6 falls back to the default (ET+ORCH) registry
→ false FAIL → spurious rollback. The script path is `/repos/orchestrator/scripts/…`
(bind-mount); `scripts/` is NOT copied into the image, so `/app/scripts` does
not exist. Details: `docs/operations/STAGING_CHECK.md`.
2. Check the exit code:
- Exit code **0** = all tests PASS → `staging_status: SUCCESS`