From e2411e5c54c85920cda05f3c68c0d7d376fd581d Mon Sep 17 00:00:00 2001 From: Ed_ Date: Sun, 21 Jun 2026 11:59:51 -0400 Subject: [PATCH] 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 /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. --- .opencode/package-lock.json | 130 +++++++++++++++++++----------------- config.toml | 32 ++++----- manualslop_layout.ini | 12 ++-- plan.log | 0 project.toml | 44 ++++++++++++ project_history.toml | 6 +- tests/conftest.py | 34 ++++++++++ 7 files changed, 172 insertions(+), 86 deletions(-) create mode 100644 plan.log diff --git a/.opencode/package-lock.json b/.opencode/package-lock.json index c5dabd15..c6141655 100644 --- a/.opencode/package-lock.json +++ b/.opencode/package-lock.json @@ -5,13 +5,13 @@ "packages": { "": { "dependencies": { - "@opencode-ai/plugin": "1.14.18" + "@opencode-ai/plugin": "1.17.8" } }, "node_modules/@msgpackr-extract/msgpackr-extract-darwin-arm64": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/@msgpackr-extract/msgpackr-extract-darwin-arm64/-/msgpackr-extract-darwin-arm64-3.0.3.tgz", - "integrity": "sha512-QZHtlVgbAdy2zAqNA9Gu1UpIuI8Xvsd1v8ic6B2pZmeFnFcMWiPLfWXh7TVw4eGEZ/C9TH281KwhVoeQUKbyjw==", + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/@msgpackr-extract/msgpackr-extract-darwin-arm64/-/msgpackr-extract-darwin-arm64-3.0.4.tgz", + "integrity": "sha512-LCkGo6JDfaBhgST7UpPWgNgLINpcpabaHfyz5OBx75nUYxBsaEPxjnyNjWpeb/xBup/682QnBfRBy2/LvPutZQ==", "cpu": [ "arm64" ], @@ -22,9 +22,9 @@ ] }, "node_modules/@msgpackr-extract/msgpackr-extract-darwin-x64": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/@msgpackr-extract/msgpackr-extract-darwin-x64/-/msgpackr-extract-darwin-x64-3.0.3.tgz", - "integrity": "sha512-mdzd3AVzYKuUmiWOQ8GNhl64/IoFGol569zNRdkLReh6LRLHOXxU4U8eq0JwaD8iFHdVGqSy4IjFL4reoWCDFw==", + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/@msgpackr-extract/msgpackr-extract-darwin-x64/-/msgpackr-extract-darwin-x64-3.0.4.tgz", + "integrity": "sha512-zExlW9zUJKZH/tOtVMttwjKa4Xm/3KcNjnE3dPN92uCktwavMxpgCA3MoJK/DOnTWsQgo224OaST27/mPNAf+w==", "cpu": [ "x64" ], @@ -35,9 +35,9 @@ ] }, "node_modules/@msgpackr-extract/msgpackr-extract-linux-arm": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/@msgpackr-extract/msgpackr-extract-linux-arm/-/msgpackr-extract-linux-arm-3.0.3.tgz", - "integrity": "sha512-fg0uy/dG/nZEXfYilKoRe7yALaNmHoYeIoJuJ7KJ+YyU2bvY8vPv27f7UKhGRpY6euFYqEVhxCFZgAUNQBM3nw==", + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/@msgpackr-extract/msgpackr-extract-linux-arm/-/msgpackr-extract-linux-arm-3.0.4.tgz", + "integrity": "sha512-Tg3yX65f5GbtXLkrYEHE5oibZG9epyYWas7FogTTEJeDEF9JlXJzKgXaNhT3UXlTOeA+AfZpYZYZ0uPj7Cfquw==", "cpu": [ "arm" ], @@ -48,9 +48,9 @@ ] }, "node_modules/@msgpackr-extract/msgpackr-extract-linux-arm64": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/@msgpackr-extract/msgpackr-extract-linux-arm64/-/msgpackr-extract-linux-arm64-3.0.3.tgz", - "integrity": "sha512-YxQL+ax0XqBJDZiKimS2XQaf+2wDGVa1enVRGzEvLLVFeqa5kx2bWbtcSXgsxjQB7nRqqIGFIcLteF/sHeVtQg==", + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/@msgpackr-extract/msgpackr-extract-linux-arm64/-/msgpackr-extract-linux-arm64-3.0.4.tgz", + "integrity": "sha512-dgX0P/9wGPJeHFBG+ZmhgE6bmtMt7NP5CRBGyyktpopdk/mW4POnrpQsSLtKI1dwpc+pPLuXHDh6vvskyQE/sw==", "cpu": [ "arm64" ], @@ -61,9 +61,9 @@ ] }, "node_modules/@msgpackr-extract/msgpackr-extract-linux-x64": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/@msgpackr-extract/msgpackr-extract-linux-x64/-/msgpackr-extract-linux-x64-3.0.3.tgz", - "integrity": "sha512-cvwNfbP07pKUfq1uH+S6KJ7dT9K8WOE4ZiAcsrSes+UY55E/0jLYc+vq+DO7jlmqRb5zAggExKm0H7O/CBaesg==", + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/@msgpackr-extract/msgpackr-extract-linux-x64/-/msgpackr-extract-linux-x64-3.0.4.tgz", + "integrity": "sha512-8TNXMEjJc3QEy7R/x1INhgiU+XakDAFUzBhaz7+Rbrs8NH5UQeHQxxmzsSBJGyV6I1jW79undiQm8tOI+D+8FQ==", "cpu": [ "x64" ], @@ -74,9 +74,9 @@ ] }, "node_modules/@msgpackr-extract/msgpackr-extract-win32-x64": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/@msgpackr-extract/msgpackr-extract-win32-x64/-/msgpackr-extract-win32-x64-3.0.3.tgz", - "integrity": "sha512-x0fWaQtYp4E6sktbsdAqnehxDgEc/VwM7uLsRCYWaiGu0ykYdZPiS8zCWdnjHwyiumousxfBm4SO31eXqwEZhQ==", + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/@msgpackr-extract/msgpackr-extract-win32-x64/-/msgpackr-extract-win32-x64-3.0.4.tgz", + "integrity": "sha512-CmCXPQrkbwExx3j946/PtHWHbYJiCRBRDl4BlkRQcJB/YOwQxJRTpoo7aTsortjgoJ1x7opzTSxn7C+ASSLVjQ==", "cpu": [ "x64" ], @@ -87,32 +87,36 @@ ] }, "node_modules/@opencode-ai/plugin": { - "version": "1.14.18", - "resolved": "https://registry.npmjs.org/@opencode-ai/plugin/-/plugin-1.14.18.tgz", - "integrity": "sha512-oF1U7Aipz8A93WGllrwxYugopeL4ml/zd6ywoFIyuF2gbvEhOGFomAvqt1E5YjLN0wEL8nCPwFine3l7pqgNUA==", + "version": "1.17.8", + "resolved": "https://registry.npmjs.org/@opencode-ai/plugin/-/plugin-1.17.8.tgz", + "integrity": "sha512-pkmnYQz5d+xf0h6fAjgplSSJKLqgYKOXr+x6y40GRPdW+/IfndFkMGq7CDsG2SieGD84qv4zYDMyolGo06IMpw==", "license": "MIT", "dependencies": { - "@opencode-ai/sdk": "1.14.18", - "effect": "4.0.0-beta.48", + "@opencode-ai/sdk": "1.17.8", + "effect": "4.0.0-beta.74", "zod": "4.1.8" }, "peerDependencies": { - "@opentui/core": ">=0.1.100", - "@opentui/solid": ">=0.1.100" + "@opentui/core": ">=0.3.4", + "@opentui/keymap": ">=0.3.4", + "@opentui/solid": ">=0.3.4" }, "peerDependenciesMeta": { "@opentui/core": { "optional": true }, + "@opentui/keymap": { + "optional": true + }, "@opentui/solid": { "optional": true } } }, "node_modules/@opencode-ai/sdk": { - "version": "1.14.18", - "resolved": "https://registry.npmjs.org/@opencode-ai/sdk/-/sdk-1.14.18.tgz", - "integrity": "sha512-E0QiiB+9rv/TPH0a1GunKl6LnuXDRHDiJaIFHOPaBL364rQx+3ClHwHkz78/KBsjhjeLrC2CaLgK+CoxV/XUIQ==", + "version": "1.17.8", + "resolved": "https://registry.npmjs.org/@opencode-ai/sdk/-/sdk-1.17.8.tgz", + "integrity": "sha512-6MKmsj2ujZyL44jy+12dpwWYDYKPS9fUr+0wVQxaIlPYQ/eAt8T8T3QrybplJ5ZtHfZUX+esXZ02x2UYYm7oEw==", "license": "MIT", "dependencies": { "cross-spawn": "7.0.6" @@ -149,27 +153,27 @@ } }, "node_modules/effect": { - "version": "4.0.0-beta.48", - "resolved": "https://registry.npmjs.org/effect/-/effect-4.0.0-beta.48.tgz", - "integrity": "sha512-MMAM/ZabuNdNmgXiin+BAanQXK7qM8mlt7nfXDoJ/Gn9V8i89JlCq+2N0AiWmqFLXjGLA0u3FjiOjSOYQk5uMw==", + "version": "4.0.0-beta.74", + "resolved": "https://registry.npmjs.org/effect/-/effect-4.0.0-beta.74.tgz", + "integrity": "sha512-Yx+Kh12U+i2FmjwEfKs+ePFmpMd43RPD1oGqc/VraSS9bYzvF0Ff3PojwEFEVEewp8xc92Uxu28gTspU4qyvHA==", "license": "MIT", "dependencies": { "@standard-schema/spec": "^1.1.0", - "fast-check": "^4.6.0", + "fast-check": "^4.8.0", "find-my-way-ts": "^0.1.6", - "ini": "^6.0.0", + "ini": "^7.0.0", "kubernetes-types": "^1.30.0", - "msgpackr": "^1.11.9", + "msgpackr": "^2.0.1", "multipasta": "^0.2.7", "toml": "^4.1.1", - "uuid": "^13.0.0", - "yaml": "^2.8.3" + "uuid": "^14.0.0", + "yaml": "^2.9.0" } }, "node_modules/fast-check": { - "version": "4.7.0", - "resolved": "https://registry.npmjs.org/fast-check/-/fast-check-4.7.0.tgz", - "integrity": "sha512-NsZRtqvSSoCP0HbNjUD+r1JH8zqZalyp6gLY9e7OYs7NK9b6AHOs2baBFeBG7bVNsuoukh89x2Yg3rPsul8ziQ==", + "version": "4.8.0", + "resolved": "https://registry.npmjs.org/fast-check/-/fast-check-4.8.0.tgz", + "integrity": "sha512-GOJ158CUMnN6cSahsv4+ExARvIDuzzinFjkp0E9WtiBa5zcVeLozVkWaE4IzFcc+Y48Wp1EDlUZsXRyAztQcSg==", "funding": [ { "type": "individual", @@ -195,12 +199,12 @@ "license": "MIT" }, "node_modules/ini": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/ini/-/ini-6.0.0.tgz", - "integrity": "sha512-IBTdIkzZNOpqm7q3dRqJvMaldXjDHWkEDfrwGEQTs5eaQMWV+djAhR+wahyNNMAa+qpbDUhBMVt4ZKNwpPm7xQ==", + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/ini/-/ini-7.0.0.tgz", + "integrity": "sha512-ifK0CgjALofS5bkrcTy4RaQ9Vx2Knf/eLeIO+NaswQEpH1UblrtTSCIvN71qQDMq0PeQ/SSPojvEJp9vvvfr+w==", "license": "ISC", "engines": { - "node": "^20.17.0 || >=22.9.0" + "node": "^22.22.2 || ^24.15.0 || >=26.0.0" } }, "node_modules/isexe": { @@ -216,18 +220,18 @@ "license": "Apache-2.0" }, "node_modules/msgpackr": { - "version": "1.11.12", - "resolved": "https://registry.npmjs.org/msgpackr/-/msgpackr-1.11.12.tgz", - "integrity": "sha512-RBdJ1Un7yGlXWajrkxcSa93nvQ0w4zBf60c0yYv7YtBelP8H2FA7XsfBbMHtXKXUMUxH7zV3Zuozh+kUQWhHvg==", + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/msgpackr/-/msgpackr-2.0.4.tgz", + "integrity": "sha512-o1C5KRmuRt+apqMr1HuGSqWStZoRBUpEsCsl15uM9VdAF1qHLtvMOU2En747EnTyEl6c4pzPewRMFF31s1CNbA==", "license": "MIT", "optionalDependencies": { - "msgpackr-extract": "^3.0.2" + "msgpackr-extract": "^3.0.4" } }, "node_modules/msgpackr-extract": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/msgpackr-extract/-/msgpackr-extract-3.0.3.tgz", - "integrity": "sha512-P0efT1C9jIdVRefqjzOQ9Xml57zpOXnIuS+csaB4MdZbTdmGDLo8XhzBG1N7aO11gKDDkJvBLULeFTo46wwreA==", + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/msgpackr-extract/-/msgpackr-extract-3.0.4.tgz", + "integrity": "sha512-4kmO/MdyUIkLIvTPr8VHLil4AtoKIoniWPIEk5+CDy0xnWC84azhSFmuJ7PxZdsYtiP5kEeQsORAVIeMgxT+Hw==", "hasInstallScript": true, "license": "MIT", "optional": true, @@ -238,12 +242,12 @@ "download-msgpackr-prebuilds": "bin/download-prebuilds.js" }, "optionalDependencies": { - "@msgpackr-extract/msgpackr-extract-darwin-arm64": "3.0.3", - "@msgpackr-extract/msgpackr-extract-darwin-x64": "3.0.3", - "@msgpackr-extract/msgpackr-extract-linux-arm": "3.0.3", - "@msgpackr-extract/msgpackr-extract-linux-arm64": "3.0.3", - "@msgpackr-extract/msgpackr-extract-linux-x64": "3.0.3", - "@msgpackr-extract/msgpackr-extract-win32-x64": "3.0.3" + "@msgpackr-extract/msgpackr-extract-darwin-arm64": "3.0.4", + "@msgpackr-extract/msgpackr-extract-darwin-x64": "3.0.4", + "@msgpackr-extract/msgpackr-extract-linux-arm": "3.0.4", + "@msgpackr-extract/msgpackr-extract-linux-arm64": "3.0.4", + "@msgpackr-extract/msgpackr-extract-linux-x64": "3.0.4", + "@msgpackr-extract/msgpackr-extract-win32-x64": "3.0.4" } }, "node_modules/multipasta": { @@ -323,9 +327,9 @@ } }, "node_modules/uuid": { - "version": "13.0.1", - "resolved": "https://registry.npmjs.org/uuid/-/uuid-13.0.1.tgz", - "integrity": "sha512-9ezox2roIft6ExBVTVqibSd5dc5/47Sw/uY6b4SjQUT2TzQ0tltNquWA46y4xPQmdZYqvnio22SgWd41M86+jw==", + "version": "14.0.1", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-14.0.1.tgz", + "integrity": "sha512-6ZxzVpzDXDa3bJWaHilVayA+BH/1zmxCJoVgvmqJnid/gPoKHxUrS/aC/T6LGQtNHT+XHG9fXPJB4d+IrU30Ew==", "funding": [ "https://github.com/sponsors/broofa", "https://github.com/sponsors/ctavan" @@ -351,9 +355,9 @@ } }, "node_modules/yaml": { - "version": "2.8.4", - "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.8.4.tgz", - "integrity": "sha512-ml/JPOj9fOQK8RNnWojA67GbZ0ApXAUlN2UQclwv2eVgTgn7O9gg9o7paZWKMp4g0H3nTLtS9LVzhkpOFIKzog==", + "version": "2.9.0", + "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.9.0.tgz", + "integrity": "sha512-2AvhNX3mb8zd6Zy7INTtSpl1F15HW6Wnqj0srWlkKLcpYl/gMIMJiyuGq2KeI2YFxUPjdlB+3Lc10seMLtL4cA==", "license": "ISC", "bin": { "yaml": "bin.mjs" diff --git a/config.toml b/config.toml index 0713e7ca..bbbef570 100644 --- a/config.toml +++ b/config.toml @@ -17,7 +17,7 @@ paths = [ "C:/projects/gencpp/.ai/gencpp_sloppy.toml", "C:/projects/Pikuma/ps1-ai/pikuma_ps1.toml", ] -active = "C:/projects/Pikuma/ps1-ai/pikuma_ps1.toml" +active = "project.toml" [gui] separate_message_panel = false @@ -70,6 +70,21 @@ scale = 1.0 transparency = 1.0 child_transparency = 1.0 +[theme.tone_mapping.moss] +brightness = 0.7699999809265137 +contrast = 0.8700000047683716 +gamma = 1.0 + +[theme.tone_mapping.solarized_light] +brightness = 0.6899999976158142 +contrast = 0.8600000143051147 +gamma = 0.7699999809265137 + +[theme.tone_mapping.Binks] +brightness = 0.47999998927116394 +contrast = 0.8399999737739563 +gamma = 2.2100000381469727 + [theme.tone_mapping."Solarized Light"] brightness = 0.5600000023841858 contrast = 0.8600000143051147 @@ -80,21 +95,6 @@ brightness = 0.7699999809265137 contrast = 0.7200000286102295 gamma = 0.6899999976158142 -[theme.tone_mapping.moss] -brightness = 0.7699999809265137 -contrast = 0.8700000047683716 -gamma = 1.0 - -[theme.tone_mapping.Binks] -brightness = 0.47999998927116394 -contrast = 0.8399999737739563 -gamma = 2.2100000381469727 - -[theme.tone_mapping.solarized_light] -brightness = 0.6899999976158142 -contrast = 0.8600000143051147 -gamma = 0.7699999809265137 - [mma] max_workers = 4 diff --git a/manualslop_layout.ini b/manualslop_layout.ini index 4d7b8054..b9e9a798 100644 --- a/manualslop_layout.ini +++ b/manualslop_layout.ini @@ -50,8 +50,8 @@ Collapsed=0 DockId=0x00000001,4 [Window][Response] -Pos=1137,28 -Size=529,1172 +Pos=1146,28 +Size=534,1172 Collapsed=0 DockId=0x00000002,0 @@ -88,7 +88,7 @@ Collapsed=0 [Window][Diagnostics] Pos=34,28 -Size=1101,1172 +Size=1110,1172 Collapsed=0 DockId=0x00000001,2 @@ -106,7 +106,7 @@ DockId=0x0000000D,0 [Window][Discussion Hub] Pos=34,28 -Size=1101,1172 +Size=1110,1172 Collapsed=0 DockId=0x00000001,0 @@ -141,7 +141,7 @@ DockId=0x00000001,2 [Window][Log Management] Pos=34,28 -Size=1101,1172 +Size=1110,1172 Collapsed=0 DockId=0x00000001,1 @@ -923,7 +923,7 @@ Column 2 Width=70 DockNode ID=0x00000008 Pos=3125,170 Size=593,1157 Split=Y DockNode ID=0x00000009 Parent=0x00000008 SizeRef=1029,147 Selected=0x0469CA7A DockNode ID=0x0000000A Parent=0x00000008 SizeRef=1029,145 Selected=0xDF822E02 -DockSpace ID=0xAFC85805 Window=0x079D3A04 Pos=0,28 Size=1666,1172 Split=X +DockSpace ID=0xAFC85805 Window=0x079D3A04 Pos=0,28 Size=1680,1172 Split=X DockNode ID=0x00000003 Parent=0xAFC85805 SizeRef=2357,1183 Split=X DockNode ID=0x0000000B Parent=0x00000003 SizeRef=404,1186 Split=X Selected=0xF4139CA2 DockNode ID=0x00000005 Parent=0x0000000B SizeRef=820,1681 Split=Y Selected=0x3F1379AF diff --git a/plan.log b/plan.log new file mode 100644 index 00000000..e69de29b diff --git a/project.toml b/project.toml index 6679f61f..ca85ca53 100644 --- a/project.toml +++ b/project.toml @@ -1,8 +1,13 @@ +view_presets = [] + [project] name = "project" git_dir = "" system_prompt = "" execution_mode = "native" +word_wrap = true +auto_scroll_comms = true +auto_scroll_tool_calls = true [output] output_dir = "./md_gen" @@ -52,8 +57,47 @@ set_file_slice = false py_update_definition = false py_set_signature = false py_set_var_declaration = false +edit_file = true +py_remove_def = true +py_add_def = true +py_move_def = true +py_region_wrap = true +ts_c_get_skeleton = true +ts_cpp_get_skeleton = true +ts_c_get_code_outline = true +ts_cpp_get_code_outline = true +ts_c_get_definition = true +ts_cpp_get_definition = true +ts_c_get_signature = true +ts_cpp_get_signature = true +ts_c_update_definition = true +ts_cpp_update_definition = true +derive_code_path = true +bd_create = true +bd_update = true +bd_list = true +bd_ready = true [mma] epic = "" active_track_id = "" tracks = [] + +[mma.tier_models."Tier 1"] +model = "gemini-3.1-pro-preview" +provider = "gemini" + +[mma.tier_models."Tier 2"] +model = "gemini-3-flash-preview" +provider = "gemini" + +[mma.tier_models."Tier 3"] +model = "gemini-2.5-flash-lite" +provider = "gemini" + +[mma.tier_models."Tier 4"] +model = "gemini-2.5-flash-lite" +provider = "gemini" + +[conductor] +dir = "conductor" diff --git a/project_history.toml b/project_history.toml index 9e90d2e3..30203c9c 100644 --- a/project_history.toml +++ b/project_history.toml @@ -6,8 +6,12 @@ roles = [ "Context", ] active = "main" +auto_add = false [discussions.main] git_commit = "" -last_updated = "2026-06-19T01:17:10" +last_updated = "2026-06-20T13:39:31" history = [] +context_snapshot = [] +sent_markdown = "" +sent_system_prompt = "" diff --git a/tests/conftest.py b/tests/conftest.py index b638d18c..0e97796b 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -432,6 +432,40 @@ def reset_paths() -> Generator[None, None, None]: from src import paths yield +@pytest.fixture(autouse=True) +def _redirect_session_logs_to_tests_dir(monkeypatch, request) -> Generator[None, None, None]: + """ + Redirect session_logger output to tests/artifacts/ so the FR1 sandbox audit + allows the writes. Per conductor/code_styleguides/test_sandbox.md, all writes + must be under /tests/. The session_logger writes to + paths.get_logs_dir() which defaults to logs/ at project root. Tests that + create an AppController + call init_state() trigger session_logger.open_session() + at src/session_logger.py:85 which would otherwise hit TEST_SANDBOX_VIOLATION. + + 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. + pytest's monkeypatch fixture auto-restores the original after each test. + + Skips tests that explicitly test the paths module or have their own session + setup via tmp_session_dir (those tests call paths.get_logs_dir() directly or + set up the session via env var, and overriding get_logs_dir at the module + level breaks their assertions). + [C: src/session_logger.py:open_session, tests/conftest.py:_sandbox_audit_hook] + """ + test_file = str(request.node.fspath) + if any(name in test_file for name in ( + "test_paths.py", + "test_test_sandbox.py", + "test_app_controller_offloading.py", + )): + yield + return + from src import paths as paths_module + test_logs_dir = Path("tests/artifacts/_test_session_logs") / f"run_{_RUN_ID}" + test_logs_dir.mkdir(parents=True, exist_ok=True) + monkeypatch.setattr(paths_module, "get_logs_dir", lambda: test_logs_dir) + yield + @pytest.fixture(autouse=True) def reset_ai_client() -> Generator[None, None, None]: """