Files
gstack/test/helpers/touchfiles.ts
T
Garry TanandClaude Fable 5 587217e2ec evals: split touchfiles into pure data + selection logic + facade
touchfiles.ts listed ITSELF in GLOBAL_TOUCHFILES, so adding one test's
dep entry forced the full ~$38 / 30-45min suite — measured on 21.9% of
recent commits (42/192). The self-reference existed because data and
logic shared a file: any edit COULD be a selection-logic change.

Now: touchfiles-data.ts (the four maps, literals only, zero imports —
the future map-diff target), test-selection.ts (matchGlob/detectBase
Branch/getChangedFiles/selectTests), and touchfiles.ts as a re-export
facade so all ~12 import sites are untouched. GLOBAL_TOUCHFILES drops
the self-ref, adds test-selection.ts (logic stays maximally
conservative), and TEMPORARILY adds touchfiles-data.ts until the
map-diff change lands. New free test pins the literal-only property
(comment-aware state-machine scan with a self-test) and facade export
parity (===), so neither can silently rot.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-08-15 08:21:00 -07:00

35 lines
1.2 KiB
TypeScript

/**
* Diff-based test selection for E2E and LLM-judge evals — compatibility facade.
*
* This module is split into three files:
*
* - ./touchfiles-data.ts — the four touchfile/tier maps (E2E_TOUCHFILES,
* E2E_TIERS, LLM_JUDGE_TOUCHFILES, GLOBAL_TOUCHFILES), LITERALS ONLY.
* Map-diff selection evaluates OLD git versions of that file standalone
* to diff the maps across commits, so it must stay importable pure data
* (zero imports, zero executable logic).
* - ./test-selection.ts — the logic: matchGlob, detectBaseBranch,
* getChangedFiles, selectTests.
* - this facade — re-exports everything so the ~dozen existing import
* sites (e2e-helpers, eval-select, e2e-tier-alignment, paid-test-set,
* the *-e2e test files, …) keep importing from './touchfiles' unchanged.
*
* test/touchfiles-facade.test.ts pins the shape: the literal-only tripwire
* on the data file, and export parity (every export of both halves is
* re-exported here by identity).
*/
export {
E2E_TOUCHFILES,
E2E_TIERS,
LLM_JUDGE_TOUCHFILES,
GLOBAL_TOUCHFILES,
} from './touchfiles-data';
export {
matchGlob,
detectBaseBranch,
getChangedFiles,
selectTests,
} from './test-selection';