Files
manual_slop/scripts/tier2/artifacts/update_plan_t3_2.py
T
ed 93ccf1b182 chore(tier2): move throw-away scripts to artifacts/ subdir
Tier 2 wrote 23 working scripts to scripts/tier2/ during the
send_result_to_send_20260616 track. These were scaffolding for the
rename work, not part of the codebase.

Move them to scripts/tier2/artifacts/ so the base scripts/tier2/
directory stays clean (it should only contain the production code:
failcount.py, run_track.py, write_report.py, setup_tier2_clone.ps1,
run_tier2_sandboxed.ps1, fetch_tier2_branch.ps1).

Per user feedback 2026-06-17: throw-away scripts are kept (for
archival) but live in a dedicated subdir, not in the production
namespace.
2026-06-17 02:05:10 -04:00

47 lines
1.6 KiB
Python

"""Update plan.md for Task 3.2."""
from __future__ import annotations
import sys
from pathlib import Path
PLAN = Path("conductor/tracks/send_result_to_send_20260616/plan.md")
SHA = "5e99c20"
EDITS: list[tuple[str, str]] = [
(
"### Task 3.2: Rename in `tests/test_orchestrator_pm.py` (14 refs)\n\n- [ ] **Step 1: Verify the test file currently fails**",
f"### Task 3.2: Rename in `tests/test_orchestrator_pm.py` (14 refs) [{SHA}]\n\n- [x] **Step 1: Verify the test file currently fails**",
),
("- [ ] **Step 2: Rename the 14 references**", "- [x] **Step 2: Rename the 14 references**"),
("- [ ] **Step 3: Run the test file — confirm green**", "- [x] **Step 3: Run the test file — confirm green**"),
("- [ ] **Step 4: Commit**", "- [x] **Step 4: Commit**"),
("- [ ] **Step 5: Attach the git note**", "- [x] **Step 5: Attach the git note**"),
]
def main() -> int:
with PLAN.open("r", encoding="utf-8", newline="") as f:
content = f.read()
has_crlf = "\r\n" in content
nl = "\r\n" if has_crlf else "\n"
normalized = [(o.replace("\n", nl), n.replace("\n", nl)) for o, n in EDITS]
new_content = content
applied = 0
for old, new in normalized:
if old in new_content:
new_content = new_content.replace(old, new, 1)
applied += 1
else:
print(f"NOT FOUND: {old[:80]!r}", file=sys.stderr)
if applied != len(EDITS):
print(f"Only applied {applied}/{len(EDITS)} edits.", file=sys.stderr)
return 1
with PLAN.open("w", encoding="utf-8", newline="") as f:
f.write(new_content)
print(f"Applied {applied}/{len(EDITS)} edits. Line endings: {'CRLF' if has_crlf else 'LF'}")
return 0
if __name__ == "__main__":
raise SystemExit(main())