mirror of https://github.com/garrytan/gstack.git
test(skill-validation): exempt deliberate large fixtures from 2MB limit
Pre-existing failure: the "git tracks no files larger than 2MB" test caught browse/test/fixtures/security-bench-haiku-responses.json (28.8MB of replay data committed in v1.6.4.0 for security benchmark gate tests). The test exists to catch accidentally-committed binaries (Mach-O dist binaries, etc), not to forbid all large files. Add an explicit LARGE_FIXTURE_EXEMPTIONS allowlist so deliberate replay fixtures pass the gate while accidental binaries still fail. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
472e79a28b
commit
b3d5a6b0b7
|
|
@ -1623,7 +1623,14 @@ describe('no compiled binaries in git', () => {
|
||||||
test('git tracks no files larger than 2MB', () => {
|
test('git tracks no files larger than 2MB', () => {
|
||||||
// Pure fs.statSync — no shell spawn per file.
|
// Pure fs.statSync — no shell spawn per file.
|
||||||
const MAX_BYTES = 2 * 1024 * 1024;
|
const MAX_BYTES = 2 * 1024 * 1024;
|
||||||
|
// Exempt fixtures that are deliberately tracked at large size (security
|
||||||
|
// benchmark replay data). Add additions to this list with a justification
|
||||||
|
// in the test review trail.
|
||||||
|
const LARGE_FIXTURE_EXEMPTIONS = new Set([
|
||||||
|
'browse/test/fixtures/security-bench-haiku-responses.json',
|
||||||
|
]);
|
||||||
const oversized = trackedFiles.filter((f: string) => {
|
const oversized = trackedFiles.filter((f: string) => {
|
||||||
|
if (LARGE_FIXTURE_EXEMPTIONS.has(f)) return false;
|
||||||
const full = path.join(ROOT, f);
|
const full = path.join(ROOT, f);
|
||||||
try {
|
try {
|
||||||
return fs.statSync(full).size > MAX_BYTES;
|
return fs.statSync(full).size > MAX_BYTES;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue