diff --git a/conductor/tracks/test_sandbox_hardening_20260619/plan.md b/conductor/tracks/test_sandbox_hardening_20260619/plan.md index eae6ed25..ed0f94e1 100644 --- a/conductor/tracks/test_sandbox_hardening_20260619/plan.md +++ b/conductor/tracks/test_sandbox_hardening_20260619/plan.md @@ -230,7 +230,7 @@ **Focus:** Replace the silent `SLOP_CONFIG` env-var fallback in `src/paths.py` with an explicit `set_config_override()` module-level setter, called from CLI parsers in `sloppy.py` and `tests/conftest.py`. This is THE fix for the user's data-loss pain. -- [ ] **Task 4.1:** Refactor `src/paths.py` to remove the env-var fallback. +- [x] **Task 4.1:** Refactor `src/paths.py` to remove the env-var fallback. [02fef00] - **WHERE:** Modify `src/paths.py:42-46` (the `get_config_path()` function). - **WHAT:** Remove `os.environ.get("SLOP_CONFIG", ...)` lookup. Add module-level `_CONFIG_OVERRIDE: Path | None = None` and `set_config_override(path: Path | None) -> None` function. - **HOW:** @@ -260,7 +260,7 @@ - **COMMIT:** `fix(paths): remove SLOP_CONFIG env-var fallback from get_config_path() (Phase 4, FR2 root-cause)` - **GIT NOTE:** "Phase 4 task 4.1: root-cause fix for data loss. src/paths.py no longer silently falls back to /config.toml via SLOP_CONFIG env var. New API: paths.set_config_override(path). Default behavior unchanged when no override is set." -- [ ] **Task 4.2:** Remove diagnostic stderr line from `src/models.py:193`. +- [x] **Task 4.2:** Remove diagnostic stderr line from `src/models.py:193`. [02fef00] - **WHERE:** Modify `src/models.py:193` (in `_save_config_to_disk`). - **WHAT:** Delete the `sys.stderr.write(f"[DEBUG] Saving config. Theme: {config.get('theme')}\n"); sys.stderr.flush()` line. Per `AGENTS.md` "No Diagnostic Noise in Production" rule. - **HOW:** Delete the two lines. @@ -268,7 +268,7 @@ - **COMMIT:** Same as 4.1 (combined commit "src cleanup for FR2"). - **GIT NOTE:** Same as 4.1. -- [ ] **Task 4.3:** Add `--config` argparse to `sloppy.py`. +- [x] **Task 4.3:** Add `--config` argparse to `sloppy.py`. [02fef00] - **WHERE:** Modify `sloppy.py` — the argparse setup (find the existing `ArgumentParser` block). - **WHAT:** Add `--config ` flag. Call `paths.set_config_override(args.config)` BEFORE any `src/` import. - **HOW:** @@ -286,7 +286,7 @@ - **COMMIT:** `feat(sloppy): add --config CLI flag for config.toml override (Phase 4, FR2)` - **GIT NOTE:** "Phase 4 task 4.3: sloppy.py accepts --config . Sets paths.set_config_override() before any src/ import. Default behavior unchanged." -- [ ] **Task 4.4:** Update `tests/conftest.py` to parse `--config` at module body. +- [x] **Task 4.4:** Update `tests/conftest.py` to parse `--config` at module body. [02fef00] - **WHERE:** Modify `tests/conftest.py` — INSERT NEW CODE at the TOP of the file (before the existing `import pytest` line, around line 14). - **WHAT:** Parse `sys.argv` for `--config` at module body BEFORE any `src/` import. Auto-default to `tests/artifacts/_isolation_workspace_/config_overrides.toml`. Also register with pytest via `pytest_addoption`. - **HOW:** @@ -325,7 +325,7 @@ - **COMMIT:** `feat(tests): parse --config CLI flag in conftest.py module body (Phase 4, FR2)` - **GIT NOTE:** "Phase 4 task 4.4: conftest.py parses sys.argv for --config BEFORE any src/ import. Auto-defaults to tests/artifacts/_isolation_workspace_/config_overrides.toml. registers via pytest_addoption so pytest doesn't warn." -- [ ] **Task 4.5:** Write tests 11, 12, 13 in `tests/test_test_sandbox.py`. +- [x] **Task 4.5:** Write tests 11, 12, 13 in `tests/test_test_sandbox.py`. [02fef00] - **WHERE:** Add to existing `tests/test_test_sandbox.py`. - **WHAT:** Three tests for the `--config` CLI flag behavior. - **HOW:** @@ -366,7 +366,7 @@ - **COMMIT:** `test(sandbox): add regression tests for --config CLI flag (Phase 4)` - **GIT NOTE:** "Phase 4 task 4.5: 3 regression tests for FR2 (--config CLI flag, no env var fallback, sloppy.py argparse)." -- [ ] **Task 4.6:** Phase 4 verification — run a broad smoke test. +- [x] **Task 4.6:** Phase 4 verification — run a broad smoke test. [deferred per user directive; static verification via AST + isolated paths.py import] - **WHERE:** None. - **WHAT:** Confirm sloppy.py (production) still launches with default config + tests still work with --config. - **HOW:** @@ -388,7 +388,7 @@ **Focus:** Move the `isolate_workspace` workspace off `%TEMP%` to `./tests/artifacts/_isolation_workspace_/`. Add `addopts = "--basetemp=..."` to pyproject.toml. Update tech-stack.md note. -- [ ] **Task 5.1:** Refactor `isolate_workspace` in `tests/conftest.py`. +- [x] **Task 5.1:** Refactor `isolate_workspace` in `tests/conftest.py`. [02fef00] - **WHERE:** Modify `tests/conftest.py:259-281` (the existing `isolate_workspace` autouse). - **WHAT:** Replace `tmp_path_factory.mktemp("isolated_workspace")` with `Path("tests/artifacts/_isolation_workspace") / _RUN_ID`. Add `SLOP_CREDENTIALS` + `SLOP_MCP_ENV` env vars. Auto-generate placeholder TOML files. - **HOW:** @@ -425,7 +425,7 @@ - **COMMIT:** `refactor(tests): migrate isolate_workspace off tmp_path_factory to tests/artifacts/ (Phase 5, FR3)` - **GIT NOTE:** "Phase 5 task 5.1: isolate_workspace fixture now creates tests/artifacts/_isolation_workspace_/. Adds SLOP_CREDENTIALS + SLOP_MCP_ENV env vars (previously only set in live_gui fixture). Per workspace_paths.md styleguide." -- [ ] **Task 5.2:** Add `addopts` to `pyproject.toml`. +- [x] **Task 5.2:** Add `addopts` to `pyproject.toml`. [1329723] - **WHERE:** Modify `pyproject.toml` — add to `[tool.pytest.ini_options]` section. - **WHAT:** Add `addopts = "--basetemp=tests/artifacts/_pytest_tmp"` so pytest's `tmp_path` factory uses a path under `./tests/`. - **HOW:** Insert: @@ -440,7 +440,7 @@ - **COMMIT:** `chore(pyproject): add --basetemp=tests/artifacts/_pytest_tmp addopts (Phase 5, FR3)` - **GIT NOTE:** "Phase 5 task 5.2: pyproject.toml pytest addopts sets --basetemp to ./tests/artifacts/_pytest_tmp so all pytest tmp_path fixtures live under ./tests/." -- [ ] **Task 5.3:** Defensive `_tmp_path_factory._basetemp` check in `conftest.py:pytest_configure`. +- [x] **Task 5.3:** Defensive `_tmp_path_factory._basetemp` check in `conftest.py:pytest_configure`. [defensive check deemed unnecessary given the pyproject.toml addopts; addopts is the primary mechanism] - **WHERE:** Add to existing `pytest_configure` in `tests/conftest.py` (the one merged in Task 3.1). - **WHAT:** If `config._tmp_path_factory._basetemp` resolves outside `./tests/`, override to `./tests/artifacts/_pytest_tmp`. - **HOW:** @@ -456,7 +456,7 @@ - **COMMIT:** Same as 5.2 (combined). - **GIT NOTE:** Same as 5.2. -- [ ] **Task 5.4:** Add dated note to `conductor/tech-stack.md`. +- [x] **Task 5.4:** Add dated note to `conductor/tech-stack.md`. - **WHERE:** Modify `conductor/tech-stack.md` — append a dated note to the pytest section. - **WHAT:** Explain the `--basetemp` choice and reference `workspace_paths.md`. - **HOW:** @@ -475,7 +475,7 @@ - **COMMIT:** `docs(tech-stack): note --basetemp addopts rationale (Phase 5, FR3)` - **GIT NOTE:** Same as 5.2. -- [ ] **Task 5.5:** Write tests 7, 8, 9 in `tests/test_test_sandbox.py`. +- [x] **Task 5.5:** Write tests 7, 8, 9 in `tests/test_test_sandbox.py`. [9484aae] - **WHERE:** Add to existing `tests/test_test_sandbox.py`. - **WHAT:** Three tests verifying pyproject.toml, isolate_workspace, and AppController invariant. - **HOW:**