mirror of
https://github.com/pocketpaw/pocketpaw.git
synced 2026-05-13 21:21:53 +00:00
#948 shipped the fleet REST router with a local workaround: it opened its own SQLite journal at ~/.pocketpaw/journal/fleet.db so the install trio would land somewhere. That works, but it splits the audit trail across two files and bakes a per-route decision into what should be an org-wide primitive. This PR adds the shared dep every ee/ route can depend on. - ee/journal_dep.py — get_journal() returns a process-scoped Journal rooted at SOUL_DATA_DIR (falling back to ~/.soul/), cached via lru_cache so request churn doesn't re-open SQLite. reset_journal_cache is the test-only escape hatch. - ee/fleet/router.py — drops _open_default_journal + the per-request close(). Install endpoint now takes journal: Journal = Depends(get_journal). The request-body `journal=false` flag still forwards None to install_fleet for the opt-out path. - tests/ee/test_journal_dep.py — three tests: instance shape, cache identity, SOUL_DATA_DIR override via monkeypatch. - tests/ee/test_fleet_router.py — swapped the _open_default_journal monkeypatch for FastAPI's dependency_overrides pattern, pointing at a tmp_path journal so tests never touch ~/.soul/. Co-authored-by: Prakash-1 <prakash-1@Mac.lan>