test: detect leaks into tests/fixtures/ at pytest session end
Add a project-root conftest.py that snapshots `git status --porcelain --
tests/fixtures/` at pytest_sessionstart and diffs at pytest_sessionfinish.
Any new or modified entry relative to the session baseline fails the
session with a named-path stderr message and a 3-5 line guidance block
pointing at journal_copy, the _SOLSTONE_JOURNAL_OVERRIDE env var, and
mocking. Silent on clean sessions; emits a single-line skip warning when
git is unavailable or the working tree is not a repo.
Motivated by two prior fixture-leak incidents:
- f6f382a6 (supervisor schedule tests spawning sol dream and writing
into chronicle/<date>/health/)
- 2996e072 (test_api_baselines per-test autouse clobbering the
isolated override)
Both classes of bug would have been caught at session end by this
detector before landing in a commit.
Covers both pytest entry points (`pytest tests/ --ignore=tests/integration`
from `make test` and `pytest apps/` from `make test-apps`) because pytest
walks from the rootdir (project root, anchored by pyproject.toml) and
loads the top-level conftest.py for both.
Ships with a pytester-based canary at tests/test_fixture_leak_detector.py
that spins up miniature nested pytest sessions in isolated tmp dirs
(with explicit --basetemp to avoid colliding with the repo's
--basetemp=/var/tmp/pytest-solstone) and verifies: (a) the detector
fires and names a leaked path, (b) stays silent on a clean session,
(c) emits the skip warning outside a git repo.
tests/conftest.py's set_test_journal_path default (still tests/fixtures/
journal) is deliberately unchanged — flipping that default is a separate
scope. This lode observes, it does not prevent.
Signed-off-by: Jer Miller <jeremie.miller@gmail.com>