29a12bb102
- Add expand_container_path() helper that resolves ~/ and $HOME/ prefixes
- Add get_manifest_home_dir() to compute /home/{user.name} or /root from manifest
- Set ENV HOME=... and ENV USER=... in generated Dockerfile for runtime compatibility
- Pass home_dir through instance creation and startup pipeline
- Expand mount targets in apply_resolved_profile() for regular profile mounts
- Expand mapping targets in _resolve_git_mount_mappings() for git mounts
- Expand working_directory and volume targets in _modify_compose_file()
- Update _prepare_manifest_instance to return home_dir alongside image tag
- Fetch tool_type early in start_instance to determine home_dir before profile application
Quality gates: pytest 188 passed, frontend typecheck clean
Addresses: home-path-expansion
1.9 KiB
1.9 KiB
Proposal: ~ / $HOME Expansion in Mount Paths
Context
Users want to write mount target paths like ~/workspace or $HOME/workspace instead of absolute paths like /home/user/workspace or /root/workspace. Docker Compose does not expand these — they must be resolved before writing the compose file.
Goal
Resolve ~ and $HOME in container target paths to the correct home directory for the target container.
Direction
Manifest-aware home directory (Option B)
- Extract
user.namefrom the tool manifest to compute/home/{name} - For root-based manifests (no user block), use
/root - For legacy tool types (non-manifest), default to
/root - Apply expansion at compose generation time for both regular mounts and git mount targets
- Also set
HOMEenv var in the Dockerfile for runtime compatibility
Acceptance Criteria
~in a mount target path is expanded to the container's home directory$HOMEin a mount target path is expanded to the container's home directory- For manifest-based tools with
user.name, home is/home/{user.name} - For manifest-based tools without user block, home is
/root - For legacy tool types, home is
/root - Git mount
mapping.target_pathalso supports~and$HOME HOMEenv var is set in generated Dockerfile- No frontend changes needed (users type
~, backend resolves it)
Out of Scope
~expansion in host-side source paths~expansion in mount file relative paths~usersyntax (e.g.,~alice)
Risks
| Risk | Mitigation |
|---|---|
| Wrong home for custom containers | Document that manifest should declare user.name |
$HOME env var not set in container |
Set it in Dockerfile via ENV HOME=... |
Related Artifacts
- Exploration:
openspec/explorations/home-path-expansion.md - Spec:
openspec/specs/home-path-expansion.md - Design:
openspec/designs/home-path-expansion.md - Tasks:
openspec/tasks/home-path-expansion.md