feat(local-dev): bind-mount ~/.molecule-ai/personas into platform container #127
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "feat/persona-bind-mount-local-dev"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Closes core#242 LOCAL surface only. The PROD surface (CP user-data fetching persona env into tenant EC2's
/etc/molecule-bootstrap/personasvia Secrets Manager) is filed as a follow-up.What changes
In-container path matches the prod tenant-EC2 path (
/etc/molecule-bootstrap/personas) soorg_import.go::loadPersonaEnvFileworks identically in both modes —feedback_local_must_mimic_productioncompliance.Stage A — verified
docker compose configresolves source to/Users/hongming/.molecule-ai/personas; 28 persona dirs visible at sourcedev-lead/envshape confirmed: GITEA_USER, GITEA_USER_EMAIL, GITEA_TOKEN_SCOPES, GITEA_SSH_KEY_PATH, MODEL_PROVIDER=claude-code, MODEL=opusTestLoadPersonaEnvFile_*tests pass; path-traversal rejections still trigger correctly)go build ./...cleanStage B — explicit skip with justification
This change is docker-compose.yml only. Tenant EC2s do not use docker-compose.yml; they use CP user-data + the
ec2.godocker-run script. So this PR has zero prod blast radius. Stage B (staging tenant probe) would be probing whether SaaS picks up the compose mount, and SaaS doesn't run compose at all.The actual prod-surface change (CP user-data fetches persona env into tenant EC2) is a separate issue; filed as a follow-up.
Why read-only mount
workspace-server only reads persona env files; never writes back. Read-only enforces the contract — a hostile plugin install path can't tamper with the persona credentials it's about to consume.
Refs
feedback_local_must_mimic_productionfeedback_unified_credentials_file(prod surface uses Secrets Manager — out of scope here)Closes core#242 LOCAL surface. The PROD surface (CP user-data fetching persona env files into tenant EC2's /etc/molecule-bootstrap/personas via Secrets Manager) is filed as a follow-up. WHAT THIS ADDS Bind-mount on the platform service in docker-compose.yml: ${MOLECULE_PERSONA_ROOT_HOST:-${HOME}/.molecule-ai/personas} → /etc/molecule-bootstrap/personas (read-only) Default source = ${HOME}/.molecule-ai/personas (the operator-host-mirrored local dir populated by today's persona rotation work). Override via MOLECULE_PERSONA_ROOT_HOST when running on a machine with a different layout (CI runners, etc.). WHY READ-ONLY workspace-server only reads persona env files; never writes back. The read-only mount enforces that contract — a hostile plugin install path can't tamper with the persona credentials it's about to consume. WHY THIS PATH MATCHES PROD /etc/molecule-bootstrap/personas is the same in-container path the prod tenant EC2 will use. Same code path (org_import.go::loadPersonaEnvFile) reads the same file regardless of mode — local-dev parity with prod per feedback_local_must_mimic_production. STAGE A VERIFICATION - docker compose config: resolves to /Users/hongming/.molecule-ai/personas correctly (28 persona dirs visible at source path) - Persona env file shape verified: dev-lead's env contains GITEA_USER, GITEA_USER_EMAIL, GITEA_TOKEN_SCOPES, GITEA_SSH_KEY_PATH, MODEL_PROVIDER=claude-code, MODEL=opus (lead tier matches Hongming's 2026-05-08 mapping) - Full handler test suite green (TestLoadPersonaEnvFile_HappyPath + 7 sibling tests pass; rejection tests still catch path traversal) - Build clean STAGE B SKIPPED (with justification per § Skip conditions) This change is config-only (docker-compose.yml volume addition). The prod tenant EC2s do NOT use docker-compose.yml — they use CP user-data + ec2.go's docker run script. So this PR has no prod blast radius. Stage B (staging tenant probe) would be checking 'is the platform using the new compose mount' on a SaaS tenant — and SaaS tenants don't run docker compose. The actual prod-surface change is the follow-up issue. PROD SURFACE — FOLLOW-UP FILED Tenant EC2 user-data needs to fetch persona env files from operator host (or AWS Secrets Manager per the established feedback_unified_credentials_file pattern) and stage them at /etc/molecule-bootstrap/personas inside the workspace-server container. Touches molecule-controlplane/internal/provisioner/ec2.go user-data. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>Local-only docker-compose change; Stage A verified (compose config + test suite + persona env file shape); Stage B skip justified (no prod compose path).