DLP hot-path perf + manifest load_for_agent split #310
Reference in New Issue
Block a user
Delete Branch "dlp-perf-manifest-cleanup"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Addresses the high- and medium-priority findings from a quality eval of the egress DLP scanner and the manifest loader.
_encoded_variantsderived the full variant set (gzip + nine encodings) for every provisioned secret on every redaction and known-secret scan — once per host, path, header, and body. It is now cached per distinct secret; callers still get a fresh list so they can't corrupt the shared cached tuple._find_partial_windowsearched the text once per secret n-gram (O(len(secret) * len(text))). It now builds the secret's n-gram set once and sweeps the text a single time (O(len(text))), with no detection-coverage loss.load_for_agent. The ~100-line dual-mode method is split into_load_for_agent_eager/_load_for_agent_lazybehind a small dispatcher, with the duplicated git-user merge tail extracted into_manifest_with_merged_git_user. No behavior change.Deferred (intentionally not bundled here)
Two playbook items from the eval are better as standalone PRs:
egress_addon_core,cli/tui,supervise_server) is an architectural change that deserves its own reviewable diff.Verification