fix(backend): add local harness storage

Merged
SH
2mo ago
+334-26

What changed and why

Give the owned local dev harness a filesystem-backed implementation of the backend's GCS surface, wire every bucket binding into the child environment, and serve uploaded artifacts from the real FastAPI app. This closes #11703 without allowing the adapter outside a demo Firebase project plus Firestore emulator.

Product invariants affected

none

How it was verified

  • PYTHONPATH=backend backend/.venv/bin/pytest -q backend/tests/unit/test_local_storage.py — 5 passed.
  • backend/.venv/bin/pytest -q scripts/dev-harness/tests/test_env_stage.py — 5 passed.
  • Imported the production main:app under a real harness child environment, called upload_profile_audio, and fetched the returned /_local/storage/... URL through TestClient; the route returned HTTP 200 with the exact uploaded local-audio bytes.
  • bash test.sh — selected all 890 backend test files. The sandboxed run reached only four infrastructure failures (two missing-Helm render tests and two loopback-socket tests); after installing Helm, BACKEND_UNIT_TEST_FILE_LIST=/tmp/omi-backend-unit-failures.txt bash test.sh outside the socket sandbox reran those exact files and passed 10 + 2 + 15 + 22 tests.
  • make preflight outside the process/socket sandbox — dev-harness tests passed 94 with 6 skipped; all remaining selected repository contracts are run again with this PR body.

The complete make dev-up stack could not be launched on this machine because Java, redis-server, and a running Docker daemon are absent. The actual production upload helper and mounted FastAPI route were exercised directly instead.

Tests

backend/tests/unit/test_local_storage.py is the regression suite for the missing credential-free storage boundary, including round-trip bytes, production helper URL behavior, listing/copy/streaming, path containment, and the no-cloud-client production URL path. scripts/dev-harness/tests/test_env_stage.py pins the bucket and storage bindings in the actual child environment.

Failure class (fixes)

Failure-Class: none