Skip to content

fix(notifications): single daily-digest PAPER preview with opt-in send - #506

Closed
Pigbibi wants to merge 2 commits into
mainfrom
fix/paper-notification-preview-single-digest
Closed

Pigbibi wants to merge 2 commits into
mainfrom
fix/paper-notification-preview-single-digest

Conversation

@Pigbibi

@Pigbibi Pigbibi commented Nov 1, 2026 •

Copy link
Copy Markdown
Contributor

AI assistance

Originally authored with Codex (OpenAI); the original model was not recorded. PR governance metadata updated with Codex (GPT-6).

What changed

The PAPER Notification Preview workflow previously sent one Telegram message per status (~6 per run). This PR makes the preview render one consolidated message in the unified QuantSentinel daily-digest format, reusing the pinned QRS digest renderer snapshot in tests/fixtures/qrs_notification_716 (no new format invented).

  • scripts/send_paper_notification_preview.py now builds a single DailyDigestInput with one synthetic run entry (firstrade / tqqq_growth_income, status ok, zero orders/fills) and renders it via the snapshot's render_daily_digest. The preview-profile-enabled guard is preserved.
  • The snapshot was missing display_names.json (the renderer reads it at runtime). This PR vendors the authentic file from QRS commit 160933e (byte-identical to the copy pinned in other platform repos) and records it in provenance.json.
  • The workflow stays workflow_dispatch-only and gains a boolean input send (default false). When false, the run only prints the rendered preview to the job log and sends nothing; GCP auth steps are skipped in that case. When true, the single message is delivered through the existing Telegram sender.
  • The RUNTIME_TARGET_ENABLED fail-closed guard is preserved.

How verified

  • uv run --no-sync python -m pytest -q tests/test_paper_notification_preview.py → 12 passed.
  • uv run --no-sync ruff check scripts/send_paper_notification_preview.py tests/test_paper_notification_preview.py → all checks passed.
  • Manual run with send disabled prints exactly one digest message and exits 0 (verified locally, zh and en).
  • Prior independent review reran the full suite with NO_GCE_CHECK=true: main 1712 passed; this PR head 1715 passed; no failures on either revision. The originally reported 13 failures were not reproduced.

Tests now assert: single-message digest format in zh/en, exactly-one send call, no broker/execution imports, fail-closed without a Telegram target, print-only behavior when send is false, and workflow static constraints (no push/PR/schedule triggers, send input default false, GCP auth gated on inputs.send, pinned setup-uv).

Why

Consolidate the PAPER preview into one daily digest and require an explicit opt-in to send it.

Risk

High: this PR changes .github/workflows/paper-notification-preview.yml. The preview remains manual, with send defaulting to false. Trading and order-execution behavior is unchanged. Owner approval remains for the path-based risk gate. This governance update changes PR metadata only; it does not deploy or send notifications.

Replace the six-message PAPER notification preview pack with one
consolidated message rendered by the pinned QRS daily-digest snapshot.
Vendor the missing display_names.json into the snapshot with a
provenance entry. The workflow_dispatch input `send` defaults to false
and only prints the preview to the job log; GCP auth steps now run only
when sending.
@Pigbibi Pigbibi added the risk:low Documentation, tests or ordinary checks; automated path classification remains authoritative. label Nov 1, 2026
@coderabbitai

coderabbitai Bot commented Nov 1, 2026 •

Copy link
Copy Markdown

Important

  • Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: f9b9064c-73ec-4c54-8907-61eacab711d0
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@Pigbibi Pigbibi added the owner-approved Owner approval for high-risk PRs. AI agents must never apply this label. label Nov 1, 2026
@Pigbibi
Pigbibi marked this pull request as ready for review November 1, 2026 19:45
@Pigbibi

Pigbibi commented Nov 1, 2026

Copy link
Copy Markdown
Contributor Author

Superseded by #510 (merged). Branch kept.

@Pigbibi Pigbibi closed this Nov 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

owner-approved Owner approval for high-risk PRs. AI agents must never apply this label. risk:low Documentation, tests or ordinary checks; automated path classification remains authoritative.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant