Repository navigation
feat(fleet-queue): filing-time state re-check reads the packet stamp (#12966) - #12991
Merged
Merged
Conversation
…12966) Proposal step 5 of #10626: the generators (pm-stack dispatch and console) stamp payload.issue.state_checked_at when they snapshot an issue, but nothing read the stamp — a packet filed from a stale snapshot rode the queue until the claim-time staleness check caught it. Enqueue now re-verifies a packet whose stamp is older than FILING_RECHECK_AFTER (1h): filing_verdict gates the claim-time verdict on the stamp age, and a landed verdict retires the fresh row in place with the same already_done evidence and staleness_autocomplete event the claim path writes (via enqueue_staleness_check). A fresh stamp is trusted — no lookup runs; a missing or unparsable stamp files exactly as before, and the claim-time check stays the net. retire_stale gains the via as a parameter; the claim path passes its existing value unchanged. Oracle: the staleness module tests — stamp source, the age gate (fresh trusted, old re-checked, garbage/future fail open), the filing verdict (old stamp + landed = tier 1; fresh/missing stamp = no lookup at all), and a source-order test pinning the re-check after the enqueue INSERT. Full fleet-queue suite green up to an unrelated long-running sqlite-replica proptest (520 ok, 0 failed at last read). Refs #12966 (item 1 of 2; the criterion-6 measurement is not due until ~2026-11-29 and stays open there). Does not close #12966.
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 11 minutes. View limit details
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. |
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Implements item 1 of #12966 — the filing-time state re-check (proposal step 5 of #10626).
Packet generators stamp
payload.issue.state_checked_at(pm-stack dispatchpacket.ts, consolework.ts), but nothing read the stamp: a packet filed from a stale snapshot rode the queue until the claim-time staleness check (#10626, PR #11799) caught it — if a claim ever came.staleness.rs:filing_stampreads the stamp;stamp_needs_recheckis the pure age gate (boundFILING_RECHECK_AFTER= 1h, the proposal's small bound);filing_verdictgates the existing claim-time verdict on the stamp — fresh stamp trusted with zero lookups, missing/unparsable stamp fails open exactly as before.filing_recheckis the broker-side wrapper mirroringstale_pick(same kill flags, same probe/cache).retire_stalegains aviaparameter; the claim path passes its existingclaim_staleness_checkunchanged.claim.rs(verb_enqueue): after the INSERT, a landed filing verdict retires the fresh row in place — samealready_doneresult evidence andstaleness_autocompleteevent the claim path writes, withvia: enqueue_staleness_check, so the criterion-6 measurement counts filing interceptions too. Dedupe-hit and work-identity-collision returns are untouched (nothing was filed).Evidence
cargo test -p fleet-queue --features queue-broker staleness— 15 passed / 0 failed, including 4 new tests whose oracle is this slice: stamp source; the age gate (15 min trusted, 3h re-checked, garbage/future fail open); the filing verdict (old stamp + landed before filing = tier 1; fresh stamp = probe never called; no stamp = probe never called; old stamp + still open = files live); and a source-order test pinning the re-check after the enqueue INSERT.fleet-queuesuite: 520 ok / 0 failed at last read, with one unrelated pre-existing sqlite-replica generated-sequences proptest still running long under load (not in this change's blast radius; the staleness, work-identity, and claim-path modules all completed green).cargo fmt --checkclean on all three touched files (other files' pre-existing drift untouched).Merge danger
Two-way door. Blast radius: enqueue of issue-linked packets with a >1h-old stamp gains one bounded, cached GitHub probe (the same probe/cache/backoff the claim path already uses) and a possible immediate retirement. Everything else — fresh stamps, unstamped packets, by-id claims, transfers, handoffs — is byte-for-byte the old behavior.
FLEET_STALENESS_CHECK=0disables both halves.Refs #12966 — item 2 there (the criterion-6 seven-day measurement, due ~2026-11-29) keeps the issue open.
Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.