Skip to content

wta: redact WT event bodies from logs - #544

Open
Gordon Lam (yeelam-gordon) wants to merge 1 commit into
mainfrom
dev/yeelam/reliability/wt-event-log-redaction
Open

wta: redact WT event bodies from logs#544
Gordon Lam (yeelam-gordon) wants to merge 1 commit into
mainfrom
dev/yeelam/reliability/wt-event-log-redaction

Conversation

@yeelam-gordon

Copy link
Copy Markdown
Contributor

Summary

  • keep WT event method diagnostics at debug level
  • stop persisting full event envelopes even when trace logging is enabled
  • add a trace-level sentinel test proving event body content is excluded

Release builds default to info, so debug diagnostics remain disabled unless WTA_LOG or RUST_LOG explicitly enables them.

Validation

  • cargo test --manifest-path tools/wta/Cargo.toml (1349 passed)

Copilot AI lite review requested due to automatic review settings August 6, 2026 02:00

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the WTA helper’s WT event logging to avoid persisting full WT event envelopes (which may contain terminal output, prompts, or hook payloads) while still retaining lightweight method-level diagnostics for debugging.

Changes:

  • Centralized WT event “received” logging into a helper that logs only the event method at debug level.
  • Removed trace-level logging of full WT event JSON envelopes (including prior special-case redaction logic).
  • Added a trace-level sentinel unit test to ensure WT event body content does not appear in logs even when trace logging is enabled.

Comment on lines +29 to +32
// Event bodies may contain terminal output, prompts, or hook payloads.
// Keep diagnostics to protocol metadata even when trace logging is enabled.
tracing::debug!(method, "wt_event_rx: received event");
method
Keep method-only debug diagnostics while preventing terminal and hook payloads from being persisted even when trace logging is enabled.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: dd185e71-68e2-4772-83fe-525e877c54f4
@yeelam-gordon
Gordon Lam (yeelam-gordon) force-pushed the dev/yeelam/reliability/wt-event-log-redaction branch from cb6fffa to 81bea31 Compare August 6, 2026 02:13
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.

2 participants