# Track state for test_batching_post_refactor_polish_20260607
# Updated by Tier 2 Tech Lead as tasks complete

[meta]
track_id = "test_batching_post_refactor_polish_20260607"
name = "Test Batching - Post-Refactor Polish"
status = "active"
current_phase = 0
last_updated = "2026-06-08"

[blocked_by]
# This track cannot begin Phase 1 until the refactor is SHIPPED.
# Verify by checking conductor/tracks.md (status [x]) OR the refactor's
# state.toml (current_phase = 4 AND last phase checkpoint_sha recorded).
test_batching_refactor_20260606 = "not yet shipped"

[phases]
phase_1 = { status = "pending", checkpoint_sha = "", name = "Shared _extract_failed_files library" }
phase_2 = { status = "pending", checkpoint_sha = "", name = "live_gui window foregrounding" }
phase_3 = { status = "pending", checkpoint_sha = "", name = "focus_test_panel helper + per-test wiring" }
phase_4 = { status = "pending", checkpoint_sha = "", name = "tests/artifacts/ scratch cleanup" }
phase_5 = { status = "pending", checkpoint_sha = "", name = "Track finalization (regression run + tracks.md)" }

[tasks]
# Phase 1: Shared _extract_failed_files library
t1_1 = { status = "pending", commit_sha = "", description = "Red: 11 unit tests in tests/test_test_failure_parser.py" }
t1_2 = { status = "pending", commit_sha = "", description = "Green: implement scripts/test_failure_parser.py (no re import)" }
t1_3 = { status = "pending", commit_sha = "", description = "Wire shared parser into post-refactor run_tests_batched.py:_run_batch + SUMMARY" }
t1_4 = { status = "pending", commit_sha = "", description = "User verification: end-to-end run with deliberate failure shows per-file listing" }
# Phase 2: live_gui window foregrounding
t2_1 = { status = "pending", commit_sha = "", description = "Red: 3 unit tests in tests/test_live_gui_foregrounding.py" }
t2_2 = { status = "pending", commit_sha = "", description = "Green: implement _foreground_subprocess_window in tests/conftest.py" }
t2_3 = { status = "pending", commit_sha = "", description = "Wire _foreground_subprocess_window into the live_gui fixture" }
t2_4 = { status = "pending", commit_sha = "", description = "User verification: live_gui test still passes; window helper is no-op-safe" }
# Phase 3: focus_test_panel helper + per-test wiring
t3_1 = { status = "pending", commit_sha = "", description = "Add focus_test_panel helper to tests/conftest.py" }
t3_2 = { status = "pending", commit_sha = "", description = "Wire focus_test_panel into 3 starter sim tests (command_palette, workflow, undo_redo)" }
t3_3 = { status = "pending", commit_sha = "", description = "User verification: 3 sim tests pass with focus_test_panel calls" }
# Phase 4: tests/artifacts/ scratch cleanup
t4_1 = { status = "pending", commit_sha = "", description = "Verify each candidate scratch file is unreferenced (rg across tests/scripts/src/docs)" }
t4_2 = { status = "pending", commit_sha = "", description = "Delete ~45 scratch files; preserve the 8 in-use entries from FR-20" }
t4_3 = { status = "pending", commit_sha = "", description = "User verification: directory listing shows only preserved entries" }
# Phase 5: Track finalization
t5_1 = { status = "pending", commit_sha = "", description = "Full suite regression run via new orchestrator (or legacy if refactor not yet switched)" }
t5_2 = { status = "pending", commit_sha = "", description = "Update conductor/tracks.md with the completed entry" }
t5_3 = { status = "pending", commit_sha = "", description = "Archive to conductor/tracks/archive/ (optional; ask user)" }

[verification]
# Filled as phases complete. The metadata.json's verification_criteria is the source of truth.
shared_parser_module_exists = false
shared_parser_unit_tests_pass = false
shared_parser_no_re_import = false
orchestrator_per_file_failure_list = false
foreground_helper_exists = false
foreground_unit_tests_pass = false
foreground_wired_into_fixture = false
focus_test_panel_exists = false
focus_test_panel_wired_into_3plus_sims = false
scratch_files_deleted = false
preserved_files_preserved = false
full_suite_no_regressions = false
per_file_accuracy_in_batch5_timeout = false

[blocker_verification]
# Before starting Phase 1, verify:
# 1. conductor/tracks.md shows test_batching_refactor_20260606 status [x]
# 2. conductor/tracks/test_batching_refactor_20260606/state.toml shows current_phase = 4
#    AND phase_4.checkpoint_sha is non-empty
# If either check fails, STOP and report to the user. Do not proceed.
refactor_track_shipped = false
refactor_state_phase_4_checkpoint_present = false
refactor_state_phase_4_checkpoint_sha = ""

[files_audit]
# Cross-reference of files this track touches
scripts_test_failure_parser_py = { action = "create", notes = "shared FAILED-line parser; no re import" }
tests_test_test_failure_parser_py = { action = "create", notes = "11 unit tests" }
tests_test_live_gui_foregrounding_py = { action = "create", notes = "3 unit tests" }
scripts_run_tests_batched_py = { action = "modify", notes = "wire shared parser into _run_batch + SUMMARY; add --timeout arg" }
tests_conftest_py = { action = "modify", notes = "add _foreground_subprocess_window + focus_test_panel helpers" }
tests_test_command_palette_sim_py = { action = "modify", notes = "one-line focus_test_panel call in setup" }
tests_test_workflow_sim_py = { action = "modify", notes = "one-line focus_test_panel call in setup" }
tests_test_undo_redo_sim_py = { action = "modify", notes = "one-line focus_test_panel call in setup" }
tests_artifacts_scratch_files = { action = "delete", notes = "~45 files; verify no references first" }
