Skip to content

fix: protect Docker build context and verify isolated local persistence - #90

Merged
Air000000 merged 1 commit into
mainfrom
codex/docker-build-context-safety
Oct 20, 2026
Merged

Air000000 merged 1 commit into
mainfrom
codex/docker-build-context-safety

Conversation

@Air000000

Copy link
Copy Markdown
Owner

Changes

  • Exclude Docker/development runtime databases, uploaded files, Chroma directories and .env variants from image build context; keep public .env.example. Primary checkout actually contains the three Docker data directories, which were not previously excluded by .dockerignore.
  • Add one fixed live-container check, guarded to require network-none isolation, disposable DB/storage paths and dummy loopback-only provider config; refuse Python -O so assertions cannot be bypassed. No mock-provider stack or new dependency.
  • Record scoped real-container evidence and update README without claiming complete deployment/quality acceptance.

Actual Docker verification (not TestClient)

Docker Engine 29.6.2; original Dockerfile, Python 3.11.15, original Alembic/Uvicorn entrypoint. Built dedicated local image, no image push, no real .env, no primary data mounts, no host ports. Three fresh owned volumes, two fictional uploaded documents, one directly inserted Chroma vector canary.

Five successful phases: seed/default-off; same-container restart; container removal/recreation with preserved volumes and temporary Hybrid empty-scope enabled; restore disabled configuration; final guarded-image recheck. Across phases: migration 20260705_0001 head and SQLite integrity, JWT/role/tenant checks, unchanged document metadata/source checksums, vector canary and initial audit IDs persisted. Audit counts 2/4/6/8/10. Ticket/Agent action tables stayed empty.

Disabled Hybrid returned sanitized 503; enabled empty scope returned empty search/no_context without provider calls. This is configuration rollback and component persistence, NOT functional Dense answer fallback or non-empty RAG quality.

Image inspection confirmed runtime data/.env paths absent and public template retained; pip check passed. Final image ID and source hashes recorded. One premature local verify during asynchronous restart exited without result; it was not counted as PASS, and verification ran after restart completion, without reseeding.

Verification / cleanup

  • Full guarded Windows offline suite: 659 passed in 72.99s. Ruff, source hashes/report checks and git diff --check passed.
  • Added static exclusion contract and tests that unsafe environment / optimized Python fail before HTTP.
  • Runtime network none and dummy endpoints ensured zero paid provider calls; no tickets or deployment outside the container.
  • Label-verified owned test container and three synthetic-only volumes removed; dedicated image retained for reproduction. No global prune or user data/container edits.

Still pending

Original Compose with safe fake-env override and host-loopback access; non-empty running-server RAG/indexing; functional Dense answers; independent semantic-quality acceptance. API/business logic, Dockerfile/Compose, .env, frozen prompts and historical provider records unchanged; v5.3.1 remains offline and default Hybrid switches unchanged.

@Air000000
Air000000 merged commit 38df33f into main Oct 20, 2026
1 check passed
@Air000000
Air000000 deleted the codex/docker-build-context-safety branch October 20, 2026 04:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant