Skip to content

integrate(subscriber): BEGIN rollback guard and queued-dispatch orphan recovery - #59

Closed
echoomegaprime wants to merge 3 commits into
mainfrom
fix/subscriber-pr40-pr41-combined-20261112
Closed

echoomegaprime wants to merge 3 commits into
mainfrom
fix/subscriber-pr40-pr41-combined-20261112

Conversation

@echoomegaprime

Copy link
Copy Markdown
Owner

Purpose

Guarded integration candidate combining the two reviewed but unmerged CertForge subscriber repairs, without production deployment. Source baseline is PR #41 exact head 3adb7e0c4931a61254a6786cf40bc53416f29aa7; the only additional source change is PR #40's connection.in_transaction guard in _migrate_legacy_platform_tables, plus its exact regression-test file.

Source provenance and verification

Safety

Draft and unmerged; no service restart, schema migration, queue reconciliation, metering change, grant, or certification bypass. Never treat past standalone PR tests as combined exact-head success. Coordinate rollout with release owner; don't merge PR #40/#41 separately into an incompatible sequence after this candidate without reconciling.

Related: #40 #41; Build Tracker issue #38.

ECHO-OMEGA-PRIME and others added 3 commits November 3, 2026 06:35
…ution starts (#49604)

finish_dispatch() marked a dispatch FAILED when its last attempt
errored (for example subscriber_worker_claim_denied) with the run's
reservation still BOUND, but never transitioned the run. The run stayed
QUEUED forever, the metered run was never compensated, and every
"queue idle" check (swarm re-certification, etc.) stayed blocked. On
FORGE seven runs (2026-10-09..10-30) were stuck exactly this way.

- New _terminalize_unstarted_run(): QUEUED -> INFRASTRUCTURE_FAILURE,
  run_outcome INFRA_FAILED, BOUND reservation RELEASED, meter
  compensated with the same 'dispatch-crash' key as lease-expiry
  exhaustion, so a run is never compensated twice.
- finish_dispatch(): use it for an error on the last attempt with a
  BOUND reservation (QUEUED run). Retries, completion and the
  RELEASED-reservation path are unchanged.
- _recover_expired_dispatches() (run on every claim_dispatch): reconcile
  runs already orphaned by the old code (dispatch FAILED, reservation
  BOUND, run QUEUED) with reason dispatch_failed_run_orphaned and an
  audit event. Idempotent: terminalized runs no longer match.
- The existing lease-expiry exhaustion block is unchanged.

Tests: 4 new (tests/test_dispatch_orphaned_runs.py); the 7 subscriber
and dispatch test modules pass 107/107; 6/6 mutants killed. A read-only
dry run of the reconciler selection on the live FORGE DB matches exactly
the 7 orphans and nothing else.

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

Copy link
Copy Markdown
Owner Author

Duplicate-safety reconciliation (2026-11-12): This guarded PR #59 was prepared from PR #41 before rediscovering the existing canonical combined draft PR #49 (0ab617ab6ed97e1a40e5cb3d160215dc93dc86d5) and stacked verification chain #53–#56. Independent exact-file comparisons verified the two test files are byte-identical to #49 and the subscriber source is semantically byte-identical after removing only the different explanatory comment block for the same connection.in_transaction guard. Both branches have the same three changed paths. Closing this redundant draft without merge or deletion to retain one integration source of truth. Keep PR #49 and its later scoped test/security follow-ups as the release review path; they still require current CI, independent review, backup/rollback and signed production E2E attestation. Any CI from this redundant branch does not authorize production.

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.

2 participants