Skip to content

fix(digest): fail visibly when the daily report is not confirmed - #1230

Merged
Pigbibi merged 3 commits into
mainfrom
ccr-9b5ac466-zqt5sn
Nov 26, 2026
Merged

Pigbibi merged 3 commits into
mainfrom
ccr-9b5ac466-zqt5sn

Conversation

@Pigbibi

@Pigbibi Pigbibi commented Nov 26, 2026

Copy link
Copy Markdown
Contributor

AI assistance

Claude Code wrote the change. Codex CLI reviewed it locally for two rounds: the round-1 P1, P2 and P3 findings were fixed, and the round-2 P2 doc findings were fixed.

What changed

  • execute_slot used to return HTTP 200 in four cases where no report was confirmed. Each now returns 502:
    • the Telegram send was uncertain;
    • the delivery-record write failed;
    • a retry found an earlier attempt that was never confirmed;
    • the 07:30 deadline check could not confirm the report.
  • accepted and duplicate still return 200. The reservation still blocks a second message, so nothing is resent.
  • azure_timer_digest: on a retried deadline check, the HTTP status now comes from the first recorded deadline receipt. A recorded receipt_unverified can no longer return 200.
  • Tests:
    • new retry and duplicate cases;
    • the concurrent-send test holds the first send open, so the overlapping 502/unknown path is deterministic.
  • docs/unified-daily-notification.md delivery contract updated:
    • 200 vs 502 outcomes;
    • no-op slots also return 200;
    • a 502 never permits a resend.

How verified

  • python3 -m unittest test_cloud_run_daily_digest test_azure_timer_digest: 75 tests OK.
  • python3 -m unittest discover -s python/tests: 1242 tests. The only failures are the 3 pre-existing, environment-dependent test_qsl_compat_checker cases, which also fail on main.
  • git diff --check: clean.

Why

Telegram did not deliver the unified daily report, but the Azure job still exited successfully. Schedulers therefore showed success while no report arrived. A missing report must be a visible failure.

Risk

  • Digest runtime and its docs only. No trading, account or settings contract change.
  • Callers that treated every 200 as healthy will now see 502 for unconfirmed sends. This is intended.
  • The deployed Azure package is older than this repository. Deploying this change needs Owner approval (OA-3), and this PR does not deploy anything.

Generated by Claude Code

Pigbibi and others added 3 commits November 26, 2026 07:09
An unconfirmed Telegram send, a retry finding an earlier unconfirmed
attempt, a failed delivery-record write and an unconfirmed 07:30
deadline check all returned 200, so schedulers recorded success while
no report arrived. Return 502 for each; accepted and duplicate
deliveries stay 200, and reservations still prevent resends.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011iHeYdZHqdsDyVsVxzUJLA
A retried 07:30 check now takes its HTTP status from the first recorded
deadline receipt, so a recorded receipt_unverified result cannot return
200. Make the concurrent-send test hold the first send open so the
overlapping 502 path is deterministic, and update the delivery contract
for the new 502 outcomes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011iHeYdZHqdsDyVsVxzUJLA
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 26, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-26T07:21:07.220321Z 53def5b Manual request
🔒 Security Review ✅ Completed 2026-11-26T07:22:17.779519Z 53def5b Manual request
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

Pigbibi commented Nov 26, 2026

Copy link
Copy Markdown
Contributor Author

@codex review


Generated by Claude Code

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Swish!

Reviewed commit: 53def5b610

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@chatgpt-codex-connector

Copy link
Copy Markdown

🛡️ Codex Security Review · Automatically triggered

Security review completed. No security issues were found in this pull request.

Reviewed commit: 53def5b610

View security finding report

Only the user who started this review can view the report in Codex.

ℹ️ About Codex security reviews in GitHub

This is an experimental Codex feature. Security reviews are triggered when:

  • You comment "@codex security review"
  • A regular code review gets triggered (for example, "@codex review" or when a PR is opened), and you’re opted in so security review runs alongside code review

Once complete, Codex will leave suggestions, or a comment if no findings are found.

@Pigbibi Pigbibi added the agent-approved An agent cleared this high-risk change on the current head; not an owner confirmation label Nov 26, 2026 — with Claude
@Pigbibi
Pigbibi merged commit 00bf432 into main Nov 26, 2026
19 of 20 checks passed
@Pigbibi
Pigbibi deleted the ccr-9b5ac466-zqt5sn branch November 26, 2026 09:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agent-approved An agent cleared this high-risk change on the current head; not an owner confirmation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant