bxctl: sanitize check shows which sanitizer rules a text breaks

Co-Authored-By: ornith-1.5-35b-a3b <agent@wntrmute.dev>
This commit is contained in:
2026-09-27 19:08:42 -07:00
co-authored by ornith-1.5-35b-a3b
parent 648469cd67
commit 54f102bbe1
7 changed files with 723 additions and 3 deletions
+11 -2
View File
@@ -33,8 +33,12 @@ usage: bxctl <command> [options]
bxctl reindex [--memory-socket PATH]
Rebuild memoryd's index from the session logs and notes.
bxctl memory log [N] | undo <id> | pending | accept <id> | reject <id> [--memory-socket PATH]
List memory edits, undo the latest edit of a file, or answer writes waiting for review.";
bxctl memory log [N] | undo <id> | pending | accept <id> | reject <id> [--memory-socket PATH]
List memory edits, undo the latest edit of a file, or answer writes waiting for review.
bxctl sanitize check [TEXT]
Show which sanitizer rules TEXT, or standard input, breaks; writes nothing. Refuse shows
the first rule only, as memory answers. Exits 1 if any rule fires, 0 if none does.";
// The options every `chat` call carries. `socket` is the loop socket; `admin_socket` is the admin
// socket the other subcommands use. Both default to the paths under `$BOXMAKER_HOME`.
@@ -100,6 +104,10 @@ pub enum Command {
socket: PathBuf,
ask: crate::memory::Ask,
},
// `None`: the text is read from standard input.
SanitizeCheck {
text: Option<String>,
},
}
pub fn parse(args: &[String], home: &Path) -> Result<Command, UsageError> {
@@ -116,6 +124,7 @@ pub fn parse(args: &[String], home: &Path) -> Result<Command, UsageError> {
"audit" => parse_audit(rest, home),
"reindex" => crate::memory::parse_reindex(rest, home),
"memory" => crate::memory::parse_memory(rest, home),
"sanitize" => crate::sanitize::parse_sanitize(rest),
// A flag before the command, or any unknown command, is not valid.
_ => Err(UsageError),
}