diff --git a/review-enrichment/src/analyzers/asset-weight.ts b/review-enrichment/src/analyzers/asset-weight.ts index 4062489697..190a5fbe07 100644 --- a/review-enrichment/src/analyzers/asset-weight.ts +++ b/review-enrichment/src/analyzers/asset-weight.ts @@ -55,6 +55,7 @@ const BINARY_EXTS = new Set([ "7z", "rar", "xz", + "zst", "pdf", "psd", "ai", diff --git a/review-enrichment/test/asset-weight.test.ts b/review-enrichment/test/asset-weight.test.ts index 03192247c5..620d14d4e2 100644 --- a/review-enrichment/test/asset-weight.test.ts +++ b/review-enrichment/test/asset-weight.test.ts @@ -23,6 +23,11 @@ test("isBinaryAsset flags genuine binary extensions and ignores text/case", () = assert.equal(isBinaryAsset("photos/IMG_0001.heic"), true); assert.equal(isBinaryAsset("photos/scan.heif"), true); assert.equal(isBinaryAsset("photos/IMG_0001.HEIC"), true); + // Zstandard blobs are binary compressed assets (siblings of gz/bz2/xz) — only the last extension is matched, + // so a compound `.tar.zst` resolves to `zst`, and the match is case-insensitive. + assert.equal(isBinaryAsset("cache/model.zst"), true); + assert.equal(isBinaryAsset("dist/bundle.tar.zst"), true); + assert.equal(isBinaryAsset("cache/model.ZST"), true); // Extension match is case-insensitive. assert.equal(isBinaryAsset("assets/HERO.PNG"), true); // Text formats whose bytes are already in the diff are NOT binary assets.