## Refined Implementation Plan: Fix Zip Service 100% Failure Rate ### Context The complete three-part fix (blob‑missing resilience in both export functions, `_unlink_blob` in `delete_node`, and `_guard_writable` removal from `export_to_dir`) is already implemented and tested on branch `typosaurus/ticket-68` (HEAD `4ffddc89`). The investigation confirmed that the missing‑blob edge‑case test (`test_zip_with_missing_blob_succeeds`) already exists in `tests/unit/services/jobs/zip_service.py`, contrary to the original plan’s assumption. Therefore the revised plan focuses on merging that branch to `master` and verifying correctness. ### Steps 1. **Merge `typosaurus/ticket-68` into `master`** - `git checkout master` - `git merge typosaurus/ticket-68` - Resolve any conflicts if they arise (none expected, but verify). - Confirm `git diff master..HEAD -- devplacepy/routers/projects/project_files.py` shows exactly the three changes: • `export_to_dir` – `shutil.copyfile` wrapped in `try/except (FileNotFoundError, OSError)` with a logged warning and `continue` (lines ~715–720). • `_export_node` – same wrapper around `shutil.copyfile` (lines ~584–589). • `delete_node` – after the soft‑delete loop, a separate loop over binary nodes calling `_unlink_blob(row)` (lines ~472–474). • No call to `_guard_writable` in `export_to_dir` (line ~693). 2. **Confirm test coverage** - Verify the test method `test_zip_with_missing_blob_succeeds` exists in `tests/unit/services/jobs/zip_service.py` (lines 134–157 as found on `ticket-68`). - No new test needs to be written; the existing test covers the missing‑blob scenario. 3. **Run project verification commands** - Create a Python ≥3.12 virtual environment (as required by `pyproject.toml`). - `pip install -e '.[dev]' -q` - `make test-unit` – all tests must pass, including the new test and all existing ones. - `pip install -q ruff && ruff check .` – must exit with zero (no new lint errors). 4. **Finalise** - Ensure the working tree is clean (`git status` shows no uncommitted changes). - Optionally push the merged `master`. ### Definition of Done - [ ] `git diff master..HEAD -- devplacepy/routers/projects/project_files.py` shows exactly the three blob‑resilience changes described above – no extra modifications. - [ ] The test `test_zip_with_missing_blob_succeeds` is present in `tests/unit/services/jobs/zip_service.py` and can be identified by `grep`. - [ ] Virtual environment with Python ≥3.12 created and dependencies installed without errors. - [ ] `make test-unit` exits with exit code 0; the new test passes alongside all existing tests. - [ ] `ruff check .` exits with exit code 0 (no new lint errors on any file). - [ ] Working tree is clean (no merge conflicts, no uncommitted changes unrelated to the fix).