Extract secret detection into secret_redaction and regex_dfas crates - #15462
Draft
vorporeal wants to merge 1 commit into
Draft
Extract secret detection into secret_redaction and regex_dfas crates#15462vorporeal wants to merge 1 commit into
vorporeal wants to merge 1 commit into
Conversation
Move the secret regexes, the default secret patterns, and the text detection and redaction helpers out of warp_terminal and app into a new secret_redaction crate. Move the regex DFA search core out of warp_terminal's find module into a new regex_dfas crate, and keep the grid search loop in warp_terminal as GridHandler methods. Rename SecretRange to StringRange and move it into string-offset. Co-Authored-By: Warp <agent@warp.dev>
vorporeal
force-pushed
the
david/secret-redaction
branch
from
August 23, 2026 02:21
6f536d8 to
b3e47ba
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.
Description
This PR continues the crate-split work that decreases incremental compile times for the
warpcrate. It extracts the secret-detection core into two new crates that sit belowwarp_terminal:secret_redaction— owns the compiled secret regexes (SECRETS_REGEX), the typesSecretsRegex,RegexLevelMetadata, andSecretLevel, the setterset_user_and_enterprise_secret_regexes, the default patterns (regexesmodule), and the pure text helpers (find_secrets_in_text,find_secrets_in_text_with_levels,find_secrets_in_text_with_levels_using_regex,merge_sorted_ranges_with_levels). The string helpers andredact_secretsmove here fromapp, and become plainpubfunctions.regex_dfas— owns the DFA-based regex search core (RegexDFAs,FindConfig) that was inwarp_terminal's find module. This core powers all grid searching (find bar, async find, block filtering, and secret scanning). The grid-search loop stays inwarp_terminalasGridHandlermethods that take&RegexDFAs, because it depends on grid internals.The PR also renames
SecretRangetoStringRangeand moves it fromwarpui_coreintostring-offset. The type is a general "char range plus byte range" pair, and the new crates need it without a dependency onwarpui_core.What stays where:
Secret,SecretHandle,SecretMap,IsObfuscated,ObfuscateSecrets) stays inwarp_terminal.redact_inputs/redact_contextstay inwarpbecause they depend on app types.warp_terminalandappre-export the moved items from their old paths, so call sites do not change.Note: this PR is stacked on #14875 (
david/rss-shard-terminal-model).Warp conversation: https://staging.warp.dev/conversation/024e797d-1d35-4c62-8394-abf93f7ddb0e
Plan: Crate-split scoping: shrink the warp crate
Linked Issue
N/A — refactor that is part of the crate-split compile-time work; there is no user-visible change.
Testing
cargo check -p secret_redaction -p regex_dfas -p warp_terminal -p warp -p warp_tui --all-targetspasses.cargo nextest run -p secret_redaction -p regex_dfas -p string-offset -p warp_terminal -p warpui_core— 867 tests pass. The regex pattern tests moved fromwarp_terminalintosecret_redactionunchanged, and the word-boundary tests moved intoregex_dfasunchanged.cargo nextest run -p warp -E 'test(/secret_redaction|redaction/)'— 40 tests pass../script/formatand all three presubmit clippy passes are clean.Agent Mode
CHANGELOG-NONE