From 78dddf9b7c53c6e04a4d023ecf800a92597c2f4e Mon Sep 17 00:00:00 2001 From: Ed_ Date: Thu, 18 Jun 2026 14:27:48 -0400 Subject: [PATCH] fix(tier2): chdir to repo_path before state/report calls The failcount _state_dir() and write_report _failures_dir() now default to Path.cwd()-relative paths (scripts/tier2/state// and scripts/tier2/failures/ respectively, per the previous 2 commits). run_track.py is the CLI entry point; it now does os.chdir(repo_path) before invoking load_state/save_state/write_failure_report so the relative paths resolve to /scripts/tier2/. The Tier 2 agent's CWD is the clone root already, so this is a no-op when run by the agent; it ensures the CLI works regardless of where the user invokes it from. Refs: conductor/tracks/tier2_no_appdata_20260618 --- scripts/tier2/run_track.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/scripts/tier2/run_track.py b/scripts/tier2/run_track.py index 6b37e58b..05ba9127 100644 --- a/scripts/tier2/run_track.py +++ b/scripts/tier2/run_track.py @@ -7,6 +7,7 @@ itself is a thin wrapper that calls this CLI. from __future__ import annotations import argparse +import os import subprocess import sys from datetime import datetime, timezone @@ -74,6 +75,7 @@ def run_init(args: argparse.Namespace) -> int: print(f"[tier2] ERROR: git switch -c failed: {err}", file=sys.stderr) return 1 + os.chdir(repo_path) state = load_state(args.track_name) if args.resume else FailcountState() save_state(args.track_name, state) started_at = datetime.now(timezone.utc) @@ -95,6 +97,7 @@ def run_report(args: argparse.Namespace) -> int: repo_path = Path(args.repo_path) branch_name = _git_current_branch(repo_path) or f"tier2/{args.track_name}" started_at = datetime.now(timezone.utc) + os.chdir(repo_path) state = load_state(args.track_name) path = write_failure_report( track_name=args.track_name,