From e9b1f44b8aa8742fa9c98efbcbe44f355f261992 Mon Sep 17 00:00:00 2001 From: Chirag Aggarwal Date: Wed, 18 Nov 2026 12:14:55 +0000 Subject: [PATCH] fix(engine): review SVG files instead of ignoring them SVG sat in the default ignore list with raster images, but it is markup: it can carry scripts, event handlers and external references, and a site may serve it from its own origin. A pull request that only added an SVG was skipped with 'No reviewable changes', so it could never be approved. --- packages/engine/src/core.test.ts | 16 ++++++++++++++++ packages/engine/src/filters.ts | 4 ++-- 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/packages/engine/src/core.test.ts b/packages/engine/src/core.test.ts index 87512c8..d7c50ed 100644 --- a/packages/engine/src/core.test.ts +++ b/packages/engine/src/core.test.ts @@ -80,6 +80,22 @@ describe('filterFiles', () => { expect(result.excluded).toEqual([{ path: 'bun.lock', reason: 'ignored by default' }]); }); + test('reviews SVG markup but ignores raster images', () => { + const assets = parseUnifiedDiff(`diff --git a/static/logo.svg b/static/logo.svg +new file mode 100644 +--- /dev/null ++++ b/static/logo.svg +@@ -0,0 +1 @@ ++ +diff --git a/static/logo.png b/static/logo.png +new file mode 100644 +Binary files /dev/null and b/static/logo.png differ +`); + const result = filterFiles(assets); + expect(result.included.map((f) => f.path)).toEqual(['static/logo.svg']); + expect(result.excluded.map((f) => f.path)).toEqual(['static/logo.png']); + }); + test('supports allowlists and exclusions', () => { expect(filterFiles(files, ['!src/**']).included).toHaveLength(0); expect(filterFiles(files, ['bun.lock']).included.map((f) => f.path)).toEqual(['bun.lock']); diff --git a/packages/engine/src/filters.ts b/packages/engine/src/filters.ts index 64c10f9..dc66095 100644 --- a/packages/engine/src/filters.ts +++ b/packages/engine/src/filters.ts @@ -54,7 +54,8 @@ export function generatedMatcher(globs: string[] = []): (path: string) => boolea /** * Files that are almost never worth an LLM's attention. Build output, vendored code, minified * bundles, and media stay ignored even with a sandbox: there is nothing to run that checks them - * which the review of their sources does not already cover. + * which the review of their sources does not already cover. SVG is not on the list: it is markup + * that can carry scripts, event handlers and external references, so it is reviewed like code. */ export const defaultIgnoreGlobs = [ ...sandboxCheckedGlobs, @@ -65,7 +66,6 @@ export const defaultIgnoreGlobs = [ '**/build/**', '**/vendor/**', '**/node_modules/**', - '**/*.svg', '**/*.png', '**/*.jpg', '**/*.gif',