Repository navigation
perf(rules): evaluate built-in rules incrementally per model - #939
Merged
Merged
Conversation
kvlonge
enabled auto-merge (squash)
October 4, 2026 10:43
Declare an explicit scope on every built-in rule and reject findings a rule emits outside its declared scope, so a new rule must state whether its findings are model-local or cross-model. Send each model to the native engine as its own encoded payload with a digest of those exact bytes. The digest keys that model's cached findings, the whole-response memo is keyed by the model-free request plus the ordered digests, and models are decoded in parallel. Model findings no longer depend on a project-wide fingerprint or on suppression lists, cross-model rules always re-run, and cache entries for deleted model files are pruned. Hash rule identities with BLAKE2b instead of SHA-256.
Decode the split native rules request into a native handle while the memo is resolved, so the encoded model payloads are freed before built-in rules run and the decoded request is dropped as soon as evaluation finishes.
The first model's built-in rule cache key used to include a project-wide fingerprint, so any edit re-evaluated it with identical findings. Model keys are now model-local, leaving one built-in miss and one SQL-lint miss for the edited model.
kvlonge
force-pushed
the
perf/incremental-builtin-rules
branch
from
October 4, 2026 15:05
591925a to
9bb85e3
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
One-model edits re-evaluated built-in rules with whole-project overhead: re-hashing the full native request, re-encoding every model for its cache key, and decoding one large JSON request in a single pass. Warm compiles hashed 60–190 MB of JSON just to find the stored response (CHI-441, profile item O7).
Changes
Verification
make test,make check-ci.