Skip to content

fix: defer fetch acknowledgement until packet disposition - #3208

Merged
chubes4 merged 2 commits into
mainfrom
fix/3206-explicit-packet-disposition
Aug 15, 2026
Merged

fix: defer fetch acknowledgement until packet disposition#3208
chubes4 merged 2 commits into
mainfrom
fix/3206-explicit-packet-disposition

Conversation

@chubes4

@chubes4 chubes4 commented Aug 15, 2026

Copy link
Copy Markdown
Member

Summary

  • replace fetch-time acknowledgement with explicit per-packet disposition identities carried safely through AI, handler, continuation, terminal, retry, and fanout paths
  • complete only successful or explicitly rejected claims while releasing deferred, failed, zero-output, and unexplained omissions for retry
  • add transactional claim reconciliation with deterministic row locking, whole-transaction deadlock retry, recovery-generation fencing, parked-claim renewal, and post-commit cache invalidation
  • add durable handler execution reservations and crash-idempotent external runtime-tool completion without exposing ownership tokens
  • make fanout claim transfer/adoption recoverable across scheduling crashes while guaranteeing one validated claim per child
  • add focused executable contracts for the exact production 52 input -> 27 output -> 25 retry lifecycle and associated failure/concurrency paths

Production Reproduction

Phoenix venue flow 858 extracted 52 fresh source packets. AI emitted 27 packets, upsert received 27, and the job completed with no errors. An immediate rerun returned no items because all 52 identifiers had been acknowledged before downstream disposition.

Verification

  • 229 executable smoke assertions passed across packet routing, reconciliation, runtime tools, fanout, cache ordering, claim isolation, fetch dispositions, and AI failure propagation
  • exact 52 -> non-contiguous 27 -> terminal 27 processed + 25 immediately reacquirable passes
  • runtime-tool composed lifecycle: 49 assertions
  • reconciliation transaction lifecycle: 18 assertions
  • PHP syntax checks passed for every changed PHP file
  • PHPCS passed for the complete changed surface
  • git diff --check passed
  • repeated independent code reviews reached a final no-findings approval

Test Infrastructure

A real two-connection MySQL lock-order test is included in ItemClaimLifecycleTest. Local execution is blocked because /tmp/wordpress-tests-lib/wp-tests-config.php is not configured; tracked separately in #3207. Deterministic production-class transaction tests cover rollback, deadlock retry, cache ordering, recovery takeover, and exact claim outcomes locally.

Compatibility And Safety

  • single-packet consumers retain server-side disposition inference
  • multi-packet tools require exact validated packet identity
  • ownership tokens remain engine-side and are recursively removed from model/client projections
  • no event- or vendor-specific behavior was added to the generic substrate
  • ambiguous side-effect outcomes block automatic replay rather than risking duplicate execution

Fixes #3206

AI assistance: Used for production diagnosis, iterative implementation, adversarial concurrency review, fault-injection test design, and final verification. Multiple unsafe intermediate candidates were rejected before this version reached a clean independent review.

@chubes4
chubes4 merged commit aadb085 into main Aug 15, 2026
14 of 18 checks passed
@chubes4
chubes4 deleted the fix/3206-explicit-packet-disposition branch August 15, 2026 23:20
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.

fix: defer fetch acknowledgement until downstream packet disposition

1 participant