From 4658d878493b8451630117d277ea4f6aab5ccfa7 Mon Sep 17 00:00:00 2001 From: Jer Miller Date: Sat, 25 Jul 2026 15:29:56 -0600 Subject: [PATCH] fix(ci): scope the removed-time-parser guard to shipped source find_blockers walked the filesystem with rglob and skipped only a hardcoded SKIP_DIRS that omitted scratch/, whose contents are git-ignored local working space (only scratch/.gitignore is tracked). Agent session transcripts land there and quote historical pyproject.toml dependency lists verbatim, so eight scratch files reddened the canonical release gate on a developer clone while the shipped source carried zero references. The guard also reported RETAIN rather than delete-safe on that basis, so the noise produced a wrong readiness verdict, not just a red. Add scratch to SKIP_DIRS and cover the exclusion with a falsification test: a scratch transcript alone yields no blockers, and a real caller placed beside it still blocks. The test fails without the scope change. Found by the 1.0.16 release train; git grep over tracked files confirmed the only non-scratch matches are the three existing ALLOWED_PATHS. --- scripts/check_removed_time_parser_ready.py | 1 + tests/test_removed_time_parser_guard.py | 24 ++++++++++++++++++++++ 2 files changed, 25 insertions(+) diff --git a/scripts/check_removed_time_parser_ready.py b/scripts/check_removed_time_parser_ready.py index 1900f6003..1a9aeacad 100644 --- a/scripts/check_removed_time_parser_ready.py +++ b/scripts/check_removed_time_parser_ready.py @@ -24,6 +24,7 @@ SKIP_DIRS = { "dist", "htmlcov", "node_modules", + "scratch", "target", } ALLOWED_PATHS = { diff --git a/tests/test_removed_time_parser_guard.py b/tests/test_removed_time_parser_guard.py index d25f4c908..6a6b43b7a 100644 --- a/tests/test_removed_time_parser_guard.py +++ b/tests/test_removed_time_parser_guard.py @@ -19,3 +19,27 @@ def test_synthetic_production_caller_makes_removed_time_parser_retain(tmp_path): assert len(blockers) == 1 assert blockers[0].path == caller assert blockers[0].line_number == 1 + + +def test_ignored_scratch_dir_is_not_shipped_source(tmp_path): + """scratch/ is git-ignored working space; only its .gitignore is tracked. + + Agent session transcripts land there and quote historical dependency lists + verbatim, so a filesystem walk that includes scratch/ reds the release gate + on a developer clone while the shipped source is clean. The exclusion must + be narrow: a real caller sitting beside the scratch file still blocks. + """ + scratch = tmp_path / "scratch" / "codex_stream_events.jsonl" + scratch.parent.mkdir(parents=True) + scratch.write_text('{"aggregated_output": "timefhuman"}\n', encoding="utf-8") + + assert find_blockers(tmp_path) == [] + + caller = tmp_path / "solstone" / "think" / "live_caller.py" + caller.parent.mkdir(parents=True) + caller.write_text( + "from solstone.think.utils import parse_time_range\n", encoding="utf-8" + ) + + blockers = find_blockers(tmp_path) + assert [b.path for b in blockers] == [caller] -- 2.51.2