Hushfang

Hushfang / Guide

Hushfang development roadmap

This proposal orders work by measurable benefit. The current release covers typed secrets, validation and reveal-time errors, and redaction at a configured Python text handler. The next decisions concern the cost per log record, the paths that bypass that handler and the cases where broader matching damages public diagnostics.

What the evidence says

The working tree matches 135 of 139 full-corpus events with the default policy. The three fragment cases and one public substring collision remain policy-dependent. Delimited mode matches 139 of 139, including the unregistered password in serialized JSON that remained visible in the 0.2.0 release. Case-by-case results

Of the 139 cases, 78 exercise wallet data and four compare a dictionary with its JSON string. The separate public suite contributes 1,630 events from four pinned sources. Hundreds of vectors can validate one transformation. A new output path provides different evidence. The current latency study measures the default formatter on a clean record and a matching record up to one million registered values. Dataset inventory · Latency study · Runtime registry precedents

1. Make large registries affordable

The 0.2.0 candidate switches between two literal-search paths. A small registry uses Python’s native string search. When the record has fewer candidate substrings than stored spellings, Hushfang probes the existing set by registered lengths. It keeps overlapping matches, token policies and type-specific paths. This removes the per-spelling scan from the measured short-line workload. Building all spellings and retaining them still costs time and memory. A batch and a stream of single registrations publish different numbers of immutable snapshots. Matcher · Before and after

Next experiment. Vary input length, the number of distinct credential lengths and reuse between records. Include traffic replay with clean lines, Unicode, repeated matches, HTTP tracebacks, PEM envelopes, rotation and concurrent readers. Measure small app configurations and realistic worker lifetimes alongside a million-value stress case. Record startup time, steady-state and peak memory, per-record p95, rotation cost and surviving public diagnostics.

Decision gate. Compare an Aho–Corasick prototype against the adaptive matcher on the same machine. Its automaton permits one traversal and overlapping matches while requiring another index to build and retain. Consider it if workloads with many different lengths or long records show enough benefit to pay for that index. Re-run all bundled cases, pinned vectors and runtime-specific controls before changing defaults. Aho–Corasick implementation and build/search API

2. Cover transformations and credential lifetime in depth

Proposed case Question Paired control and acceptance
payload-json-password How much does named-field masking add on long or deeply nested JSON records? Masking a configured JSON member is now covered. Measure allocation, latency and formatting failures on progressively larger JSON objects, including malformed inputs and nesting beyond the decoder limit.
case-normalized-token Can an opt-in policy mask a credential a client converted to lowercase or uppercase? logmask covers this in its default configuration. Pair the transformed credential with a distinct public identifier differing only in case. Measure leaked values and changes to public text independently.
fragments-public-digest Which fragments justify a match for a typed key or token? Pair a genuine fragment with a public digest sharing a prefix. Score leaks and public changes independently across exact and delimited policies.
rotation-queued-retry When may an old credential safely leave a registry? Register a replacement while an earlier retry waits in a queue. Both generations must be masked on drain. Measure retained memory. Specify drain and ownership semantics before adding retirement or TTL.
signing-error-transport Which fields survive an actual signing failure and the outbound reporter? Generate an ephemeral key, verify a real signature, then reject a wrong digest size. Retain request ID and cause, with zero key markers in the captured envelope. The existing runnable example provides the starting point.

Exercise the four cases through real handlers or in-memory transports in addition to fixture-level formatter calls. Give failures a stable ID, an exact expected public result and a list of forbidden synthetic markers. Preserve counts for drops and formatting errors, so silencing an entire event cannot improve the result. Existing signing example · Corpus contribution rules

3. Follow the event to more destinations

Priority First integration What to measure at the destination
First Stdlib QueueHandler and QueueListener with independent producer and consumer handlers Inspect the queued record and final bytes. A local prepare probe flattened the message, cleared its args and retained a custom mapping. Verify exception text, extras, sibling handlers and rotation on both sides of the queue. Python queue handler
Next A structlog processor placed before the JSON renderer Test native event dictionaries and ordinary stdlib messages bridged via ProcessorFormatter. Compare parseable output, retained numeric types, exact public fields and formatter overhead with equivalent workloads. structlog processor ordering
Then Sentry error events through a local capturing transport Exercise before_send, breadcrumbs and nested exception data, including a configuration with local-variable capture. Inspect the final envelope while retaining the exception class and public stack location. Span events require a separate test. Sentry client-side scrubbing
Then OpenTelemetry log bodies and attributes Inspect what the application exports and what a separately configured collector forwards. Keep these as two measurements. Try a Logfire string transform as a comparison on already formatted messages and a named-key policy on structured inputs. OpenTelemetry handling of sensitive data · Logfire scrubbing

Keep these integrations optional. A candidate earns a documented recipe when it passes a real destination test with synthetic data. Introduce a shared structured-redaction API once two integrations demonstrate matching field, type and failure semantics. Extend Hushbench with per-destination evidence before combining scores across different transports.