## Implementation Plan: Fix Zip Service 100% Failure Rate ### Changes Required #### 1. Remove spurious `_guard_writable` from `export_to_dir` **File:** `devplacepy/project_files.py` **Action:** Delete line 688 (`_guard_writable(project_uid)`) inside `export_to_dir`. **Rationale:** `export_to_dir` is a read-only operation; the guard incorrectly blocks export for read-only projects, causing all zip, fork, and container jobs to fail. #### 2. Fix stale `STAGING_DIR` import in CLI **File:** `devplacepy/cli/jobs.py` **Actions:** - Change line 10 from `from devplacepy.services.jobs.zip_service import STAGING_DIR` to `from devplacepy.config import ZIP_STAGING_DIR` - Change line 15 (where `STAGING_DIR` is used) to reference `ZIP_STAGING_DIR`. **Rationale:** The constant was renamed in commit `1294c95`; the CLI import is stale and causes `ImportError` on `devplace zips prune` / `devplace zips clear`. ### Verification & Definition of Done - [ ] Both file changes applied as described above. - [ ] Project builds and installs without errors even in a restricted environment: `pip install -e '.[dev]' -q --break-system-packages` - [ ] Linter passes with no new violations: `pip install -q ruff && ruff check .` - [ ] All unit tests pass: `make test-unit` (or `python3 -m pytest tests/unit -x -q` if Makefile absent) - [ ] (Optional but recommended) Add a unit test in `tests/unit/services/jobs/zip_service.py` that creates a project with `read_only=True` and asserts a successful zip job completes – to prevent regression.