From 923d360d21cd4000308ac5fbad22eeca1ebd5639 Mon Sep 17 00:00:00 2001 From: Ed_ Date: Thu, 18 Jun 2026 14:11:26 -0400 Subject: [PATCH] chore(scripts): relocate Tier 2 state paths to project-relative Honor the user's NEVER USE APPDATA directive. The Tier 2 state and failure report directories now default to project-relative gitignored locations under tests/artifacts/ instead of C:\\Users\\Ed\\AppData\\. - failcount.py: _state_dir() now defaults to tests/artifacts/tier2_state// (gitignored) - write_report.py: _failures_dir() now defaults to tests/artifacts/tier2_failures/ (gitignored) The TIER2_STATE_DIR and TIER2_FAILURES_DIR env vars still override the defaults when set (preserves the existing escape hatch). --- scripts/tier2/failcount.py | 10 +++++----- scripts/tier2/write_report.py | 9 +++++---- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/scripts/tier2/failcount.py b/scripts/tier2/failcount.py index 563e0246..992c49f5 100644 --- a/scripts/tier2/failcount.py +++ b/scripts/tier2/failcount.py @@ -114,11 +114,11 @@ def from_dict(d: dict[str, Any]) -> FailcountState: def _state_dir(track_name: str) -> Path: - base = os.environ.get( - "TIER2_STATE_DIR", - r"C:\Users\Ed\AppData\Local\manual_slop\tier2", - ) - return Path(base) / track_name + env_base = os.environ.get("TIER2_STATE_DIR") + if env_base: + return Path(env_base) / track_name + project_root = Path(__file__).resolve().parents[2] + return project_root / "tests" / "artifacts" / "tier2_state" / track_name def load_state(track_name: str) -> FailcountState: diff --git a/scripts/tier2/write_report.py b/scripts/tier2/write_report.py index f6d41d16..83addcdb 100644 --- a/scripts/tier2/write_report.py +++ b/scripts/tier2/write_report.py @@ -16,10 +16,11 @@ from scripts.tier2.failcount import FailcountState def _failures_dir() -> Path: - return Path(os.environ.get( - "TIER2_FAILURES_DIR", - r"C:\Users\Ed\AppData\Local\manual_slop\tier2_failures", - )) + env_base = os.environ.get("TIER2_FAILURES_DIR") + if env_base: + return Path(env_base) + project_root = Path(__file__).resolve().parents[2] + return project_root / "tests" / "artifacts" / "tier2_failures" def compute_report_path(track_name: str, now: datetime) -> Path: