Private
Public Access
0
0

test(tier2): slash_command_spec - assert project-relative paths

Updated two test assertions to match Tier 2's project-relative
relocation (commit 923d360d):

  - test_command_prompt_no_appdata: 'scripts/tier2/state' ->
    'tests/artifacts/tier2_state' (and same for failures)
  - test_agent_denies_temp_writes: same swap

The tests now assert the slash command and agent prompts reference
the actual code defaults (tests/artifacts/tier2_state/ and
tests/artifacts/tier2_failures/) rather than the stale
scripts/tier2/ paths.

Refs: conductor/tracks/tier2_no_appdata_20260618 (post-merge followup)
This commit is contained in:
2026-06-18 18:28:37 -04:00
parent eb23a8be98
commit e1e1a6609e
+16 -11
View File
@@ -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/<track>/ 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/<track>/ for failcount state (Tier 2's project-relative default)"
assert "<app-data>" not in content, "command prompt must NOT reference <app-data> (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/<track>/state.json for failcount state
- point at scripts/tier2/failures/ for failure reports
- point at tests/artifacts/tier2_state/<track>/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/<track>/ 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/<track>/ 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)"