Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Add fast-check property tests for encoded-payload-redact#137

Merged
twschiller merged 1 commit into
mainfrom
add-fast-check-encoded-payload
Jun 4, 2026
Merged

Add fast-check property tests for encoded-payload-redact#137
twschiller merged 1 commit into
mainfrom
add-fast-check-encoded-payload

Conversation

@twschiller

Copy link
Copy Markdown
Contributor

Summary

  • Property tests for encoded-payload-redact covering all three decoders (base64, hex, percent) plus a counter-property for high-entropy bytes.
  • Round-trip: any printable-ASCII string long enough to clear the encoding's length floor is masked once encoded and inserted into a text node.
  • Counter: random bytes whose printable-ASCII ratio is well under the 0.85 threshold are not masked even when their base64 form clears the length floor — i.e. hashes / binary blobs pass through.
  • Sanity: surrounding prose ("prefix ", " suffix") survives the redaction.

Why this surface

The rule's decision is the product of three knobs — an encoding regex, a length floor, and a decoded printable-ASCII ratio — and the boundaries are the interesting failure mode (a hash that happens to clear the ratio, a payload one char shy of the floor). Property tests give us coverage of those boundaries without us hand-picking every case.

Test plan

  • bun run preflight — biome, eslint, tsc (src + tests), knip, jest with coverage (1021 tests).

🤖 Generated with Claude Code

Fuzzes the three encodings the rule decodes (base64, hex, percent) with
random printable-ASCII text long enough to clear each length floor —
every such payload should be masked. Adds a counter-property for
high-entropy random bytes (hash/binary-blob shape): the base64-encoded
form should be left alone because the decoded printable-ratio falls
below the 0.85 threshold.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
@vercel

vercel Bot commented Jun 4, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
agent-browser-shield-demo-site Ready Ready Preview, Comment Jun 4, 2026 9:42pm

Request Review

@twschiller twschiller merged commit 1ac6c94 into main Jun 4, 2026
7 checks passed
@twschiller twschiller deleted the add-fast-check-encoded-payload branch June 4, 2026 21:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant