diff --git a/tests/test_tier2_slash_command_spec.py b/tests/test_tier2_slash_command_spec.py index 81d5ba72..555984df 100644 --- a/tests/test_tier2_slash_command_spec.py +++ b/tests/test_tier2_slash_command_spec.py @@ -17,13 +17,16 @@ def test_command_file_exists() -> None: def test_command_prompt_no_appdata() -> None: - """Regression test (2026-06-18): the slash command prompt must NOT - reference AppData paths. The user directed 'NEVER USE APPDATA'. - Default locations for state and failure reports must be inside the - Tier 2 clone (scripts/tier2/state/, scripts/tier2/failures/).""" + """Regression test (2026-06-18, updated 2026-06-18 after Tier 2's + project-relative relocation): the slash command prompt must NOT + reference AppData paths and must point at the actual code defaults. + + The user directed 'NEVER USE APPDATA'. The Tier 2 failcount state + and failure reports live at tests/artifacts/tier2_state/ and + tests/artifacts/tier2_failures/ (project-relative; inside the + already-gitignored tests/artifacts/).""" content = COMMAND_PATH.read_text(encoding="utf-8") - assert "scripts/tier2/state" in content, "command prompt must point at scripts/tier2/state// for failcount state" - assert "scripts/tier2/failures" in content or True, "command prompt mentions scripts/tier2/state (state path); failures dir is implicit" + assert "tests/artifacts/tier2_state" in content, "command prompt must point at tests/artifacts/tier2_state// for failcount state (Tier 2's project-relative default)" assert "" not in content, "command prompt must NOT reference (2026-06-18 NEVER USE APPDATA)" assert "AppData\\Local\\manual_slop\\tier2" not in content, "command prompt must NOT reference the AppData tier2 dir" @@ -92,7 +95,8 @@ def test_agent_denies_destructive_git() -> None: def test_agent_denies_temp_writes() -> None: - """Regression test (2026-06-17, rewritten 2026-06-18): + """Regression test (2026-06-17, rewritten 2026-06-18, paths updated + 2026-06-18 after Tier 2's project-relative relocation): 2026-06-17: the agent wrote an audit JSON to C:\\Users\\Ed\\AppData\\Local\\Temp\\, which is outside the sandbox @@ -105,14 +109,15 @@ def test_agent_denies_temp_writes() -> None: must: - include the broader *AppData\\* bash deny rule (catches Local, LocalLow, Roaming, etc., not just Temp) - - point at scripts/tier2/state//state.json for failcount state - - point at scripts/tier2/failures/ for failure reports + - point at tests/artifacts/tier2_state//state.json for + failcount state (Tier 2's project-relative default) + - point at tests/artifacts/tier2_failures/ for failure reports - NOT reference AppData\\Local\\manual_slop\\tier2 (the old path)""" content = AGENT_PATH.read_text(encoding="utf-8") assert 'AppData\\Local\\Temp' in content, "agent prompt must include Temp deny rule in frontmatter bash (kept for self-documentation)" assert "*AppData\\\\*" in content, "agent prompt must include the broader *AppData\\* deny rule (added 2026-06-18)" - assert "scripts/tier2/state" in content, "agent prompt must point agent at scripts/tier2/state// for failcount state" - assert "scripts/tier2/failures" in content, "agent prompt must point agent at scripts/tier2/failures/ for failure reports" + assert "tests/artifacts/tier2_state" in content, "agent prompt must point agent at tests/artifacts/tier2_state// for failcount state (Tier 2's project-relative default)" + assert "tests/artifacts/tier2_failures" in content, "agent prompt must point agent at tests/artifacts/tier2_failures/ for failure reports" assert "AppData\\Local\\manual_slop\\tier2" not in content, "agent prompt must NOT reference the AppData tier2 dir (2026-06-18 NEVER USE APPDATA)"