chadtmiller.com/hud
A remote MCP server that shows atproto records as interactive UI inside MCP Apps hosts
place.hud.hudkit 0.5.0 Latest 5 packages
0
0
Logs mask percent-encoded secrets, and read off the async workers
Merged Approved
This pull makes telemetry::query read each parameter's name as a query is read before matching it against SECRETS. It moves the operator's log read onto spawn_blocking. It also makes flush take the database lock before the pending lines.
I found nothing that must change.
- Masking:
%63odeandacc%65ss_tokennow match, and the name is kept as written. An empty pair givesNoneand stays unmasked, which is correct.refresh+tokendecodes torefresh token, so it isn't masked, and the test says so. - Flush order: the lock order is safe.
keeptakes only the pending-lines lock and never the database lock, soflushholding the database lock while it takes the pending lines can't deadlock. Taking the database lock first does serialize batches in the order they were logged. read_logs: the.awaitis added at both callers,xrpc.rsand the tool. Theexpecton the join only fires if the blocking task panicked, and the message says so.
As the body says, no test pins the flush order. That is a fair gap for a scheduler race.
Merged as 067cb6d
The review of the telemetry pull (at://did:plc:bcgltzqazw5tb6k2g3ttenbj/space/dev.knotless.space/hud/did:plc:bcgltzqazw5tb6k2g3ttenbj/dev.knotless.pull/3n2myf3tv2put) found two things worth fixing. A secret's value could reach the kept logs when its name was percent-encoded, and an operator's read did SQLite work on an async worker, out of order with the flusher.
Claude Opus 5.5 · low
What changes
Secrets masked whatever their spelling.
telemetry::queryreads each parameter's name as a query is read (url::form_urlencoded) before matching it againstSECRETS, so%63ode=…andacc%65ss_token=…log as=_. The name stays as it was written.The operator's read off the async workers.
Hud::read_logsis async: its flush and query run inspawn_blocking.Logs::flushtakes the database lock before it takes the pending lines, so two flushes, the read's and the flusher's, write their batches in the order they were logged.writeis a free function given the connection that is held.Why
Everything outside
/oauthis logged, and withHUD_LOGS=onkept for 30 days, so a percent-encodedcodeortokenwas a secret kept on disk. The flush took its batch, then waited for the database: a flush that took an earlier batch could write after one that took a later batch, so the ids came out of order. The review's third note was dropped, not fixed: lines logged while a streamed body is polled may miss the trace. The event stream logs little of its own, and a missing trace costs only grouping.How it was checked
queries_leave_secrets_outcovers encoded names, including+and an empty pair.just checkpassed, with lines and functions at 100%. Onejust checkand onejust covbefore it exited 101 without the failing test being captured. Four morejust covruns and sixcargo test --workspaceruns all passed, so a timing-sensitive test is flaky under instrumentation; it didn't reproduce.Shortcomings
No test pins the flush order: the race needs two flushes interleaved by the scheduler. The flake above is unexplained.