From 52fb45e1b75b2f1513dee7ef6ced142732a7e538 Mon Sep 17 00:00:00 2001 From: DreamLinx Date: Sat, 15 Aug 2026 22:18:18 +0800 Subject: [PATCH] fix(test): characterization fixture copy ignores polluted README_AI (#135 residual) Repo-root scan-all generates README_AI.md inside tests/fixtures/ char_graphbuffer/ (gitignored by #136, but still on local disk). The characterization copytree carried them into the scan; GH #38's enrichment-preserve logic kept the stale '' markers across the structural rewrite and drifted the goldens. CI was green (clean checkout has no untracked files) while local runs failed permanently. ignore_patterns in the fixture copy makes the test own its pristine-input guarantee. --- CHANGELOG.md | 7 +++++++ tests/characterization/test_graphbuffer_baseline.py | 5 ++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index adcda26..b190092 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -48,6 +48,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Fixed +- **Characterization tests immune to local fixture pollution** (GH #135 + residual). `test_graphbuffer_baseline` copies the fixture including any + on-disk `README_AI.md` left by a repo-root `scan-all` (gitignored by + #136, so only invisible locally); the structural rewrite's + enrichment-preserve logic (GH #38) then kept the stale + `` marker and drifted the goldens — CI green, + local red, forever. The fixture copy now ignores `README_AI.md`. - **CLAUDE.md outdated-hint: one version source + stderr** (GH #161). `check_outdated` compared the injected version against `importlib.metadata` (stale under editable installs — dist-info is baked diff --git a/tests/characterization/test_graphbuffer_baseline.py b/tests/characterization/test_graphbuffer_baseline.py index b9ed72d..bb9ee32 100644 --- a/tests/characterization/test_graphbuffer_baseline.py +++ b/tests/characterization/test_graphbuffer_baseline.py @@ -72,7 +72,10 @@ def _copy_fixture(tmp_path: Path) -> Path: # into the root dir's enrich prompt as "Parent: ...") is deterministic — # pytest's tmp_path basename (test-name + counter) is not stable across runs. proj = tmp_path / "wsroot" / "project" - shutil.copytree(FIXTURE, proj) + # Ignore on-disk README_AI.md pollution from repo-root scan-all (#135): + # a stale `` marker would be preserved by the + # structural rewrite (GH #38) and drift the goldens on local runs. + shutil.copytree(FIXTURE, proj, ignore=shutil.ignore_patterns("README_AI.md")) return proj