Private
Public Access
0
0
Files
manual_slop/.opencode
ed e2411e5c54 fix(test_sandbox): redirect session logs to tests/artifacts via autouse fixture
Per FR1 of test_sandbox_hardening_20260619 spec, all writes must be under
<project_root>/tests/. Tests that create an AppController + call init_state()
trigger session_logger.open_session() at src/session_logger.py:85 which
writes to paths.get_logs_dir() - by default logs/ at project root, outside
tests/. This was triggered by tests/test_context_composition_decoupled.py
and surfaced in the latest batched test run.

Add a function-scoped autouse fixture in tests/conftest.py that monkeypatches
src.paths.get_logs_dir to return a per-run tests/-allowed path. Per-run
subdirectory prevents log_registry.toml collisions across test runs.

Skips test_paths.py, test_test_sandbox.py, and test_app_controller_offloading.py
which directly assert on paths.get_logs_dir() behavior or set up their own
session via tmp_session_dir (overriding get_logs_dir at the module level
breaks those tests' assertions). No production code is modified.
2026-06-21 11:59:51 -04:00
..