From 4e5e0975446847fcb26240848720d69a5f348718 Mon Sep 17 00:00:00 2001 From: sim Date: Tue, 8 Sep 2026 16:09:37 -0400 Subject: [PATCH] fix(#4460): strip realpath -m from Tier 1 in the test (Windows CI) CI's test (windows-latest, shard 1/3) failed: --files=src/alpha.js widened to all 5 files instead of staying at 1. Root-caused (not assumed): this is the SAME pre-existing Tier-1 `realpath -m` portability gap already documented as out-of-scope for this fix (confirmed on macOS during manual verification) -- also real on Windows CI. `-m` only changes behavior for a path that doesn't (yet) exist; on a platform where it errors or behaves differently, every --files entry gets misclassified as "outside the repository", REVIEW_FILES stays empty, and the test ends up exercising the OUTER `if [ ${#REVIEW_FILES[@]} -eq 0 ]` full-diff fallback instead of ever reaching the elif this fix's own gate lives on. Fixed in the TEST only (code-review.md's Tier 1 is untouched -- this gap is real, pre-existing, and out of #4460's scope per cr-2). Strip `-m` from the extracted Tier 1 fence before running it: every path in these fixtures already exists, so `-m` is a behavioral no-op here, and this makes the test exercise Tier 3's gate (the actual subject of this fix) on every platform gsd-test runs on. Manually re-verified both cases locally before re-pushing. Co-Authored-By: Claude Sonnet 5 --- ...ode-review-tier3-files-override-scoping.test.cjs | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/tests/code-review-tier3-files-override-scoping.test.cjs b/tests/code-review-tier3-files-override-scoping.test.cjs index b65cbd9b1..1a861cd52 100644 --- a/tests/code-review-tier3-files-override-scoping.test.cjs +++ b/tests/code-review-tier3-files-override-scoping.test.cjs @@ -102,7 +102,18 @@ function buildFixture(tmpDir) { */ function runTiers(tmpDir, { filesOverride, seedReviewFiles = [] }) { const content = fs.readFileSync(WORKFLOW_PATH, 'utf-8'); - const tier1 = extractFirstBashBlockAfter(content, '**Tier 1 — --files override', '**Tier 2 —'); + // #4460 CI finding: Tier 1's `realpath -m` is a pre-existing, out-of-scope + // portability gap (BSD/macOS realpath has no -m; confirmed CI-reproducible + // on Windows too, where it likewise makes every --files entry look "outside + // the repository" and REVIEW_FILES stays empty, tripping the OUTER `if + // [ ${#REVIEW_FILES[@]} -eq 0 ]` fallback instead of exercising the gated + // elif this test targets). Not this fix's concern (see #4460's review + // notes) and every path in these fixtures already exists, so `-m` (which + // only changes behavior for a MISSING path) is a no-op here — stripped so + // this test exercises Tier 3's gate on every platform gsd-test runs on, + // not Tier 1's realpath compatibility. + const tier1 = extractFirstBashBlockAfter(content, '**Tier 1 — --files override', '**Tier 2 —') + .replace(/\brealpath -m\b/, 'realpath'); const tier3 = extractFirstBashBlockAfter(content, '**Tier 3 — Git diff fallback', '**Post-processing'); const filesArrayInit = filesOverride