Skip to content

Export Telegram message diagnostics#425

Open
hypotyposis wants to merge 1 commit into
berabuddies:masterfrom
hypotyposis:dev-4/tg-diagnostics-export-28
Open

Export Telegram message diagnostics#425
hypotyposis wants to merge 1 commit into
berabuddies:masterfrom
hypotyposis:dev-4/tg-diagnostics-export-28

Conversation

@hypotyposis

Copy link
Copy Markdown
Contributor

Summary

  • add daemon RPC telegram_diagnostics_export / task_telegram_diagnostics_export
  • join Telegram subscriber message-diagnostics.ndjson rows with workflow_history monitor runs by dedup_key
  • write a Downloads JSON report with message/receive time, subscriber receipt/filter status, and Trust AI/triage outcome

Verification

  • cargo test -p puffer-cli telegram_diagnostics_export_writes_downloadable_message_observability_report -- --nocapture
  • rustfmt --edition 2021 --check crates/puffer-cli/src/daemon_workflows/telegram_diagnostics.rs
  • rustfmt --edition 2021 --config skip_children=true --check crates/puffer-cli/src/daemon_workflows.rs
  • rustfmt --edition 2021 --check crates/puffer-cli/src/daemon.rs
  • git diff --check

Note: cargo fmt --package puffer-cli -- --check still reports pre-existing formatting drift in unrelated puffer files such as daemon_browser/wechat modules; the touched files above are rustfmt-clean.

@vercel

vercel Bot commented Jun 19, 2026

Copy link
Copy Markdown

@zooey-sys is attempting to deploy a commit to the fuzzland Team on Vercel.

A member of the Team first needs to authorize it.

@hypotyposis hypotyposis force-pushed the dev-4/tg-diagnostics-export-28 branch from f53c197 to d6efb3d Compare June 19, 2026 02:21
@hypotyposis hypotyposis force-pushed the dev-4/tg-diagnostics-export-28 branch from d6efb3d to 5348314 Compare June 19, 2026 02:24

@zooey-sys zooey-sys left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM. Verified the diagnostics export against the requested observability:

  • Join: subscriber message-diagnostics.ndjson (and rotated .1) joined with workflow_history.json by chat_id:message_id; scalar_to_string normalizes number/string keys so the two sources correlate.
  • Coverage: report exposes subscriber (received/stage/times), filter (filtered + stage + summary), and trust_ai (entered + result + usage), plus message/received timestamps — matching the requested observation points (subscriber received? filtered? entered Trust AI + result).
  • Robustness: missing workflow_history.json resolves to empty default (history.rs), so the key "no task created / no triage" case still exports; multi-account traversal; limit clamp [1, 2000]; unique_report_path avoids same-ms overwrites.
  • Privacy: sanitize_message_record recursively redacts any nested text key (-> text_redacted) in embedded trigger_info; the top-level text_prefix fallback is snippet-capped via message_snippet; a privacy_note is included. Full message text is not exported; short snippets remain only to correlate which message a row describes. The unit test covers .1 rotation and asserts the full private trigger text is absent from the export.

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