fix(commands): bound shared slash callbacks from gateway receipt by two-ops-standards-refresh[bot] · Pull Request #3202 · TogetherWeOwn/two-bot-next · GitHub
Skip to content

fix(commands): bound shared slash callbacks from gateway receipt - #3202

Merged
two-ops-two-bot-next[bot] merged 5 commits into
mainfrom
fix/receipt-bounded-defers
Dec 5, 2026
Merged

two-ops-two-bot-next[bot] merged 5 commits into
mainfrom
fix/receipt-bounded-defers

Conversation

@two-ops-standards-refresh

@two-ops-standards-refresh two-ops-standards-refresh Bot commented Dec 5, 2026 •

Copy link
Copy Markdown
Contributor

Linked Issues or Issue Description

  • Slash commands that use the shared defer can start a fresh callback budget after admission. The gateway receipt now governs their defer, busy reply, and router refusal through the existing Discord executor.

Verification

  • cargo fmt --all -- --check, git diff --check, and python3 scripts/check-secret-debug.py passed.
  • Boat exited before Clippy because the source directory was unavailable. GitHub Actions will run Clippy and the gateway regressions. The regressions use loopback Discord delays and a disposable store probe. Staging and live smoke follow the protected release gate.

Attestation

risk_tier: T0

Claims

  • C1: An expired gateway receipt starts zero callback attempts for shared-defer slash commands.
  • C2: An in-budget defer stays private and completes with one original-response edit.
  • C3: Rejected and stalled defers start no feature work and send no second callback.
  • C4: Busy and router refusal callbacks for commands using the shared defer honor the original receipt.

Tests

  • C1 | test=crates/bot/src/command_runtime_tests.rs::expired_gateway_receipt_starts_no_shared_slash_callback_or_store_work | failed_before=not-run | proof=Gateway dispatch with an expired receipt checks the executor and the loopback Discord and Postgres endpoints.
  • C2 | test=crates/bot/src/command_runtime_tests.rs::gateway_slash_ack_latency_uses_receipt_and_counts_only_confirmed_callbacks | failed_before=not-run | proof=A delayed Discord confirmation produces a private defer and one edit.
  • C3 | test=crates/bot/src/command_runtime_tests.rs::failed_gateway_shared_slash_defers_start_no_feature_work | failed_before=not-run | proof=HTTP rejection and a stalled response each leave the store probe untouched.
  • C4 | test=crates/bot/src/command_runtime_tests.rs::shared_defer_slash_busy_and_router_refusals_use_gateway_receipt | failed_before=not-run | proof=An expired receipt produces zero refusal or busy callback attempts and a fresh receipt produces one private busy reply.

High-risk checklist

  • D1: The shared executor still receives the token at the callback boundary. Warnings use Discord error classes.
  • D2: Command identity resolution, application fencing, and router permission checks still precede shared feature execution.
  • D3: The source diff has no migration, grant, or data repair. Feature effects remain behind confirmed deferral.
  • D4: The existing 2.5-second acknowledgement budget covers admission and transport. Only provably pre-wire blocks can retry.
  • D5: Shared handlers start only after Discord confirms the first callback. A completion uses the existing original-response edit.
  • D6: The regression cases are in the existing command runtime test target. Dependency and workflow pins are untouched.
  • D7: Rejection and timeout return before feature execution. The tests inspect attempt counts and store connections.
  • D8: The receipt uses the gateway's monotonic clock. The existing interaction parsers and wire format apply.

Notes for reviewers

  • The change uses the existing receipt-bound executor for shared slash callbacks. The post-defer feature implementations are outside the diff.
  • Created with gpt-6.2-sol in Codex.

Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.

View guided diff Turn on auto-fix

@sourcery-ai

sourcery-ai Bot commented Dec 5, 2026 •

Copy link
Copy Markdown

@coderabbitai

coderabbitai Bot commented Dec 5, 2026 •

Copy link
Copy Markdown

Important

Review skipped

Bot user detected.

To trigger a single review, invoke the @coderabbitai review command.

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Central YAML; Path: .coderabbit.yaml
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: fcdefb1d-5cdd-4e9a-89ef-b820b9665b23

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • Trigger review
  • 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

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Hey - I've found 2 issues


Sourcery is free for open source - if you like our reviews please consider sharing them ✨

Comment thread crates/bot/src/command_runtime.rs Resolved
Comment thread crates/bot/src/command_runtime_tests.rs Resolved
@two-ops-standards-refresh

Copy link
Copy Markdown
Contributor Author

Note

🤖 GPT-6.2 Sol responding on behalf of togetherweown

Independent T0 security review by Claude Opus 5.5 returned APPROVE for c90009501cdfb242f7020fda10ea74b25ccde9ea. The reviewer traced the identity and permission fences, callback ownership, token handling, receipt cutoff, and the feature execution guard. This was a static review.

Discord can accept a defer before its response times out locally. The handler stops on that uncertain result, so feature work requires a confirmed callback. The game-price busy reply uses the receipt budget whenever the confirmed registry assigns the command to the shared handler. The legacy sticky reply failed label is shared by several reply paths and predates this patch.

@two-ops-standards-refresh

Copy link
Copy Markdown
Contributor Author

Note

🤖 GPT-6.2 Sol responding on behalf of togetherweown

Independent T0 general and security reviewers using Claude Opus 5.5 both returned APPROVE for c90009501cdfb242f7020fda10ea74b25ccde9ea after a static review. Their approvals cover the production patch at 82812a5befc59a9367d9c88b42a2484d2416579e. The only file changed between the two heads is the command runtime test file, which now also checks the in-budget router refusal. Revision diff

The general review noted gaps in expiry coverage for game-price, unavailable replies, and full-lane admission. Existing tests exercise a private game-price defer and edit, the unwired replies, and the full-lane path. User-slot and full-lane refusals call the same busy callback. The discussion about the voice-owned kick callback is resolved in its review thread. The custom-command owner and the legacy reply log label predate this change. Game-price test · Unwired test · Full-lane test · Voice discussion

@github-actions github-actions Bot added the size/M Pull request size: M (advisory, counted lines) label Dec 5, 2026
@github-actions

github-actions Bot commented Dec 5, 2026 •

Copy link
Copy Markdown
Contributor

Pull request size gate: large but passing (warning)

This pull request changes 400 counted lines across 4 files (raw diff 400 lines including 0 in lockfiles, generated files and fixtures, which are not counted) - over the 200-line review target but under the 400-line / 20-file gate, so this check passes. The target is 100-200 lines and 10 files or fewer; smaller pull requests get faster, more careful review.

@two-ops-two-bot-next

Copy link
Copy Markdown
Contributor

Note

🤖 GPT-6.2 Sol responding on behalf of togetherweown

The prior-revision database job stopped before running tests. Attempt 3 checked out candidate 6019818c2b74ce830e000af9ad7f325eee76335c with base parent 5a8c23fd95fbc3eec6472a84149c0abe2daebd42, while the PR event supplied 8c59a5db73df1bf6c83feba3e348179e203ff2ef. Failed job

Empty commit a565c7bd29a7f5ced03f4ef85fadc3ad949512cd refreshes the PR event. I verified that its tree is identical to 82812a5befc59a9367d9c88b42a2484d2416579e and that the branch and PR refs point to the new head. The existing dual T0 approvals still cover the same production patch. Review evidence

@two-ops-two-bot-next

Copy link
Copy Markdown
Contributor

Note

🤖 GPT-6.2 Sol responding on behalf of togetherweown

Independent T0 general review by Claude Opus 5.5 returned APPROVE for e73371fb5b210d3cf4062203cc2b07e48d5d9c47 against 1cfeedd26773522ff68d675cda00097a0e3a70b1. The reviewer checked the fixed receipt deadline, private replies, the early return after failed defers, and the /mod-preflight application fence carried through the merge. There were no blocking findings. This was a static review. Compilation and test evidence remain pending in hosted CI.

@two-ops-two-bot-next

Copy link
Copy Markdown
Contributor

@two-ops-two-bot-next
two-ops-two-bot-next Bot merged commit 072fe51 into main Dec 5, 2026
56 of 119 checks passed
@two-ops-two-bot-next
two-ops-two-bot-next Bot deleted the fix/receipt-bounded-defers branch December 5, 2026 09:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/M Pull request size: M (advisory, counted lines)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant