Implement source copy functionality for Python models in cogpack
This completes the basic Python model support by enabling SourceCopyBlock
to properly copy application source code to the runtime image.
Key changes:
- Enable SourceCopyBlock in Python stack (pkg/cogpack/stacks/python/stack.go)
- Fix Dependencies method signature to return []*Dependency (pkg/cogpack/stacks/commonblocks/source_copy.go)
- Resolve nested venv issue by removing existing /venv before copy to prevent BuildKit from creating /venv/venv structure (pkg/cogpack/stacks/python/uv.go)
- Add conditional venv setup with --allow-existing flag for base image compatibility
- Clean up export config conflicts between blocks
Technical details:
- BuildKit Copy operation copies directories INTO existing directories rather than replacing them
- Solution: Use rm -rf /venv before copying /venv from build stage to runtime
- Maintains compatibility with both base images with existing venv and bare base images
- Python models now build and run successfully end-to-end
Updated documentation:
- Document completed source copy functionality in CLAUDE.project.md
- Add design decision for directory removal pattern
- Clear current task and update project status
Fixes: Python models failing to run due to missing source code in runtime image
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>