Repository navigation
feat(compression): per-model/endpoint compression exclusion filter (#8034) - #8064
Conversation
|
Caution The consumer version of Gemini Code Assist on GitHub has been sunset. All code review activity has officially ceased. |
037f401 to
e02f7c6
Compare
|
Reviewed this against the current release/v3.8.49 tip in an isolated probe worktree. Content is solid: the exclusion filter is scoped tightly (new leaf module, ReDoS-safe pattern escaping, bounded to 200 patterns), the One thing to fix before merge: GitHub shows The two other local gate flags I saw (test-file-size on |
…-work # Conflicts: # src/i18n/messages/pt-BR.json
…exclusions persistence)
|
Obrigado, @diegosouzapw — mergeado na |
…e was added Base-red slice 5. cheaper-inference#8034/cheaper-inference#8064 (per-model/endpoint compression exclusion filter) appended the new `compression-exclusions` sidebar item to the END of the compression group, after `compression-studio`. That broke the deliberate "Compression Studio is the last item of the compression group" invariant asserted by two tests (sidebar-engine-items "Studio must be last" and sidebar-visibility's exact-order array, whose expected list places compression-studio immediately before cli-code). Rather than weaken the invariant, moved `compression-exclusions` ABOVE `compression-studio` in sections.ts (new pages go above the Studio showcase) and added the new item to sidebar-visibility's expected order. Both tests, plus the other four sidebar suites (reorg / back-compat / tools / engine-items), stay green.
…bar order snapshots Two independent "code is right, bookkeeping lagged" base-reds: 1. #8233 made open-sse/executors/muse-spark-web.ts import sanitizeErrorMessage from utils/error.ts (a real Rule #12 fix), but left its KNOWN_MISSING_ERROR_HELPER allowlist entry in scripts/check/check-error-helper.mjs in place. The gate's own stale-allowlist enforcement (assertNoStale) correctly flagged the now -obsolete entry: `npm run check:error-helper` failed with "1 entrada(s) obsoleta(s)", and tests/unit/check-error-helper.test.ts's "the shipped allowlist freezes exactly the known current violators" test expected an empty Set. Removed the entry (kept the assertNoStale machinery and the general scope-header comments untouched). 2. #8064 added the "compression-exclusions" sidebar item right after "compression-studio" in COMPRESSION_CONTEXT_GROUP (deliberate, complete feature) but didn't update two order-snapshot tests written before that item existed: - tests/unit/sidebar-visibility.test.ts expected the "omni-proxy" section's flattened id list to end the compression block at "compression-studio". - tests/unit/ui/sidebar-engine-items.test.ts asserted "Studio must be last" in COMPRESSION_CONTEXT_GROUP. Updated both to the real, intentional order: Settings -> Combos -> engines -> Studio -> Exclusions (Studio now second-to-last, Exclusions last). Validation (red -> green): - check:error-helper gate: red ("1 entrada(s) obsoleta(s)") -> green ("OK (898 files scanned, 0 known-missing frozen)") - tests/unit/check-error-helper.test.ts: 31/32 -> 32/32 - tests/unit/sidebar-visibility.test.ts: 6/7 -> 7/7 - tests/unit/ui/sidebar-engine-items.test.ts: 13/14 -> 14/14 Refs #8233 Refs #8064
…bar order snapshots (#8383) Two independent "code is right, bookkeeping lagged" base-reds: 1. #8233 made open-sse/executors/muse-spark-web.ts import sanitizeErrorMessage from utils/error.ts (a real Rule #12 fix), but left its KNOWN_MISSING_ERROR_HELPER allowlist entry in scripts/check/check-error-helper.mjs in place. The gate's own stale-allowlist enforcement (assertNoStale) correctly flagged the now -obsolete entry: `npm run check:error-helper` failed with "1 entrada(s) obsoleta(s)", and tests/unit/check-error-helper.test.ts's "the shipped allowlist freezes exactly the known current violators" test expected an empty Set. Removed the entry (kept the assertNoStale machinery and the general scope-header comments untouched). 2. #8064 added the "compression-exclusions" sidebar item right after "compression-studio" in COMPRESSION_CONTEXT_GROUP (deliberate, complete feature) but didn't update two order-snapshot tests written before that item existed: - tests/unit/sidebar-visibility.test.ts expected the "omni-proxy" section's flattened id list to end the compression block at "compression-studio". - tests/unit/ui/sidebar-engine-items.test.ts asserted "Studio must be last" in COMPRESSION_CONTEXT_GROUP. Updated both to the real, intentional order: Settings -> Combos -> engines -> Studio -> Exclusions (Studio now second-to-last, Exclusions last). Validation (red -> green): - check:error-helper gate: red ("1 entrada(s) obsoleta(s)") -> green ("OK (898 files scanned, 0 known-missing frozen)") - tests/unit/check-error-helper.test.ts: 31/32 -> 32/32 - tests/unit/sidebar-visibility.test.ts: 6/7 -> 7/7 - tests/unit/ui/sidebar-engine-items.test.ts: 13/14 -> 14/14 Refs #8233 Refs #8064
…heaper-inference#8034) (cheaper-inference#8064) * feat(compression): per-model/endpoint compression exclusion filter (cheaper-inference#8034) * chore(quality): rebaseline compression.ts own-growth 845->850 (cheaper-inference#8034 exclusions persistence) --------- Co-authored-by: Probe Test <probe@example.com>
…bar order snapshots (cheaper-inference#8383) Two independent "code is right, bookkeeping lagged" base-reds: 1. cheaper-inference#8233 made open-sse/executors/muse-spark-web.ts import sanitizeErrorMessage from utils/error.ts (a real Rule cheaper-inference#12 fix), but left its KNOWN_MISSING_ERROR_HELPER allowlist entry in scripts/check/check-error-helper.mjs in place. The gate's own stale-allowlist enforcement (assertNoStale) correctly flagged the now -obsolete entry: `npm run check:error-helper` failed with "1 entrada(s) obsoleta(s)", and tests/unit/check-error-helper.test.ts's "the shipped allowlist freezes exactly the known current violators" test expected an empty Set. Removed the entry (kept the assertNoStale machinery and the general scope-header comments untouched). 2. cheaper-inference#8064 added the "compression-exclusions" sidebar item right after "compression-studio" in COMPRESSION_CONTEXT_GROUP (deliberate, complete feature) but didn't update two order-snapshot tests written before that item existed: - tests/unit/sidebar-visibility.test.ts expected the "omni-proxy" section's flattened id list to end the compression block at "compression-studio". - tests/unit/ui/sidebar-engine-items.test.ts asserted "Studio must be last" in COMPRESSION_CONTEXT_GROUP. Updated both to the real, intentional order: Settings -> Combos -> engines -> Studio -> Exclusions (Studio now second-to-last, Exclusions last). Validation (red -> green): - check:error-helper gate: red ("1 entrada(s) obsoleta(s)") -> green ("OK (898 files scanned, 0 known-missing frozen)") - tests/unit/check-error-helper.test.ts: 31/32 -> 32/32 - tests/unit/sidebar-visibility.test.ts: 6/7 -> 7/7 - tests/unit/ui/sidebar-engine-items.test.ts: 13/14 -> 14/14 Refs cheaper-inference#8233 Refs cheaper-inference#8064
…heaper-inference#8034) (cheaper-inference#8064) * feat(compression): per-model/endpoint compression exclusion filter (cheaper-inference#8034) * chore(quality): rebaseline compression.ts own-growth 845->850 (cheaper-inference#8034 exclusions persistence) --------- Co-authored-by: Probe Test <probe@example.com>
…bar order snapshots (cheaper-inference#8383) Two independent "code is right, bookkeeping lagged" base-reds: 1. cheaper-inference#8233 made open-sse/executors/muse-spark-web.ts import sanitizeErrorMessage from utils/error.ts (a real Rule cheaper-inference#12 fix), but left its KNOWN_MISSING_ERROR_HELPER allowlist entry in scripts/check/check-error-helper.mjs in place. The gate's own stale-allowlist enforcement (assertNoStale) correctly flagged the now -obsolete entry: `npm run check:error-helper` failed with "1 entrada(s) obsoleta(s)", and tests/unit/check-error-helper.test.ts's "the shipped allowlist freezes exactly the known current violators" test expected an empty Set. Removed the entry (kept the assertNoStale machinery and the general scope-header comments untouched). 2. cheaper-inference#8064 added the "compression-exclusions" sidebar item right after "compression-studio" in COMPRESSION_CONTEXT_GROUP (deliberate, complete feature) but didn't update two order-snapshot tests written before that item existed: - tests/unit/sidebar-visibility.test.ts expected the "omni-proxy" section's flattened id list to end the compression block at "compression-studio". - tests/unit/ui/sidebar-engine-items.test.ts asserted "Studio must be last" in COMPRESSION_CONTEXT_GROUP. Updated both to the real, intentional order: Settings -> Combos -> engines -> Studio -> Exclusions (Studio now second-to-last, Exclusions last). Validation (red -> green): - check:error-helper gate: red ("1 entrada(s) obsoleta(s)") -> green ("OK (898 files scanned, 0 known-missing frozen)") - tests/unit/check-error-helper.test.ts: 31/32 -> 32/32 - tests/unit/sidebar-visibility.test.ts: 6/7 -> 7/7 - tests/unit/ui/sidebar-engine-items.test.ts: 13/14 -> 14/14 Refs cheaper-inference#8233 Refs cheaper-inference#8064
Summary
provider/modelpatterns,*wildcard) that bypasses the whole compression pipeline for matching chat-completion requests — the body passes through byte-identical, no engine runs.open-sse/services/compression/exclusions.ts(new leaf module):normalizeCompressionExclusions()+isCompressionExcluded(). Patterns are matched case-insensitively against both the bare model id and theprovider/modelcomposite; every regex metacharacter except*is escaped before compiling (ReDoS-safe, bounded, ≤200 patterns).CompressionConfig.exclusions?: string[](new optional field, absent = no exclusions = zero behavior change for existing installs).src/lib/db/compression.tsreads/persists theexclusionskey through the existingkey_valuecompression namespace — no new table/migration.chatCore.tscomputes the exclusion right afterresolveCompressionSettings()and treats a match exactly like compression being globally disabled: the modular pipeline is skipped (config.enabled = falsefor this request) and the legacy auto-trigger path is skipped too (promptCompressionEnabled = false), recording the skip via the existingwriteCompressionSkip(..., "excluded")analytics hook. ~10 lines of real logic in the frozenchatCore.ts(4728→4761 lines, well under the 5125 baseline); all matching logic lives in the new leaf module./dashboard/compression/exclusions), a simple textarea-backed panel reading/writing theexclusionsfield via the existingGET/PUT /api/settings/compressionendpoint. Added to the sidebar nav and to theSidebarItemIdunion.exclusionsadded tocompressionSettingsUpdateSchema(bounded array/string length).docs/compression/COMPRESSION_ENGINES.md, also documenting that embeddings are structurally never compressed (unrelated to this change, but the guardrail's stated rationale).en.json, mirrored/translated intopt-BR.jsonandvi.json(sidebar nav + settings-panel copy).Test plan
node --import tsx/esm --test tests/unit/compression-exclusions.test.ts— 8/8 passing: excluded/non-excluded matching,provider/modelcomposite + bare-model patterns,provider/*and bare*wildcards, case-insensitivity, empty/absent/malformed exclusions default tofalse(regression guard for zero behavior change), regex-metacharacter escaping (gpt-5.6must not matchgpt-5x6),normalizeCompressionExclusionsdedup/non-string filtering, and a behavior test proving an excluded target's body stays byte-identical while a non-excluded target still compresses viaapplyStackedCompression.npx vitest run tests/unit/ui/compression-exclusions-page.test.tsx— 3/3 passing: mounts and loads existing exclusions, saves edited patterns viaPUT /api/settings/compression, fails soft when fetch rejects.node scripts/check/check-file-size.mjs— clean (added one justified frozen-baseline entry forsidebarVisibility/sections.ts, 796→806, one new nav item pushed it over the new-file 800 cap).npm run check:complexity-ratchets— clean (both complexity and cognitive-complexity under baseline).node scripts/check/check-test-discovery.mjs— clean.npm run typecheck:core— clean.npm run typecheck:noimplicit:core— clean (pre-existing unrelated errors incombo.ts/usageTracking.ts/cliRuntime.ts, untouched by this PR, confirmed viagit diffagainst the base branch).node scripts/check/check-dashboard-typecheck.mjs— clean for all files touched by this PR; the gate also flags one pre-existingsrc/lib/services/installers/utils.tsTS2339 error unrelated to compression (confirmed zero diff againstorigin/release/v3.8.49for that file).npx eslint --suppressions-location config/quality/eslint-suppressions.json <changed files>— clean.node scripts/check/check-mutation-test-coverage.mjs --strict— no drift.npm run check:cycles— no cycles.node scripts/check/check-docs-sync.mjs/check:any-budget:t11/check:tracked-artifacts— all clean (pre-commit hook passed).Closes #8034