Repository navigation
fix(sanitize): keep a short redacted value idempotent - #135
Conversation
Tiny Sweeper reviewReviewed head: Verdict: Ready for maintainer review · Priority: none Diagnostics and supporting detailsFull summaryPull request purpose (title): fix(sanitize): keep a short redacted value idempotent. Tiny Sweeper completed its review; deterministic results follow. Review snapshot
Completeness: Complete Features
TestsNo supported feature-to-test mapping was produced. Test execution is not inferred. FindingsNo active actionable findings. Before mergeNone. Agent review detailscritique
security
tests
commits
description
Evidence and run details
|
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars. ⚙️ Run configuration
Comment |
Summary
What was wrong.
scrub_credentialswas not idempotent for short quoted values. A quoted value of four characters or fewer is replaced whole, so{"token":"ab"}becomes{"token":"*[REDACTED]"}. A second pass then saw*[REDACTED]as a new quoted value, kept its first four characters and appended another marker:{"token":"*[RE*[REDACTED]"}. Text that is scrubbed more than once (for example a tool result that is scrubbed again when it is re-sent or logged) got progressively mangled. The existing "already redacted" guard only covered bare values, where the marker follows the kept prefix.Fix. The existing guard now also skips a value that already starts with
*[REDACTED].Related issue
None.
API or behavior changes
No public API change. A second
scrub_credentialspass leaves an already-redacted short quoted value unchanged.Validation
cargo fmt --all -- --check. I ran rustfmt (edition 2024) on the touched files only; CI runs the full check.cargo clippy --all-targets --all-features -- -D warnings. Not run locally; CI runs it.cargo build --all-targets --all-features. Not run locally; CI runs it.cargo test --all-features. I ran thesanitizemodule tests; CI runs the full suite.Tests
Added
short_quoted_value_scrubs_idempotentlytosanitize_tests.rs.left: "{\"token\":\"*[RE*[REDACTED]\"}",right: "{\"token\":\"*[REDACTED]\"}"cargo test -p tinyinference-core --lib sanitize: 35 passed, 0 failed.Documentation
No docs change. The guard's comment covers the new case.
Checklist
#[allow(...)],#[ignore], or relaxed lints.envcontents in the diff or the description