Skip to content

fix(sync): recover unbound enrichment dispatch obligations - #21862

Merged
Git-on-my-level merged 2 commits into
mainfrom
sync-reprocess-dispatch-rebind
Oct 16, 2026
Merged

Git-on-my-level merged 2 commits into
mainfrom
sync-reprocess-dispatch-rebind

Conversation

@Git-on-my-level

@Git-on-my-level Git-on-my-level commented Oct 16, 2026 •

Copy link
Copy Markdown
Member

Problem and change

Batch projection on backend-integration persisted sync enrichment obligations with an empty queue. Enqueue and every repair attempt then failed, leaving 11 conversations without summaries and producing thousands of repair errors per hour.

  • Persist dispatch=null when the calling host lacks a complete sync worker binding. The obligation remains durable and claimable; invalid configuration does not cause enqueue retries.
  • Repair incomplete or invalid stored bindings using the bound host's configuration inside the existing CAS, rotating the task token. Preserve active leases, version/quiet-window fences, and valid backfill queue/worker bindings. Unbound hosts skip and increment a bounded-label counter instead of emitting per-row errors.
  • Give production backend-integration the fresh sync-jobs queue in the runtime overlay and regenerate the manifest. deploy-backend-stack already resolves the fresh backend-sync handler and invoker identity; both handler and OIDC audience use that receiving handler URL. The queue and audience names are explicitly classified as non-secret deployment configuration. No new workflow or IAM changes are needed. Reject incomplete backfill projection overrides before committing their ready receipt.

Repair hosts: the batch projection pump invokes the shared sweep on backend-integration; the existing two-minute sequencer Scheduler target invokes it on backend-sync. Read-only production logs confirm successful backend-sync sweep requests, and its live dispatch environment is complete. Direct Scheduler describe was denied to the read-only account, so Scheduler cadence/state is source-confirmed only.

Product invariants affected

  • INV-MEM-4: retains the canonical consolidation route and fenced, idempotent projection authority. This changes enrichment dispatch bindings only; no promotion or memory-policy flags change.
  • INV-DATA-1: preserves the production data plane and the existing production/emulator ownership fence; no dev host gains access to the production outbox.
  • INV-MEM-5: preserves processing, privacy, and account-generation authority; the projection receipt and obligation still commit in one transaction. No account-specific recovery branch is introduced.

Failure-Class: none

This is incomplete durable-dispatch configuration recovery. The sibling-handler audience class is prevented by requiring the audience to equal the receiving sync handler, covered by regression tests.

Verification

Targeted tests only, using the required file-list runner (Python 3.11.15, two workers, nice 19):

printf '%s\n' tests/unit/test_sync_reprocess_coalesce.py tests/unit/test_batch_pipeline_projection.py tests/unit/test_render_backend_runtime_env.py tests/unit/test_backend_runtime_env_validator.py > /tmp/l.txt
cd backend
BACKEND_UNIT_TEST_FILE_LIST=/tmp/l.txt BACKEND_PYTEST_WORKERS=2 nice -n 19 bash test.sh

281 passed: 39 outbox/coalescing; 24 projection; 50 renderer; 168 runtime validator. Covers poison rebind, quiet unbound skips, claimable marks, stale tasks, live leases, real CAS-conflict reread, processing crash retention, concurrent appends, valid backfill binding preservation, and injected transactional projection/ready-receipt replay. The strict Firestore fixture verifies read-before-write and shared-transaction writes; emulator contention and live task execution were not run. Emulator fixtures now declare complete bindings and matching handler audiences.

Also passed: runtime manifest composition check; dev/prod runtime validators with workflow checks; async blocker scanner (zero selected findings); diff whitespace check. Full-suite/pre-deploy scripts were intentionally not invoked because this task requires targeted tests only. Normal commit/push hooks remain enabled.

The two 05:21Z / 05:28Z conversations were re-read with metadata-only field projections: both now have nonempty title and overview, completed status, sync_update relevance decisions, revisions 12/5, and no outbox row. This is consistent with successful consumption, not evidence of dropped work. run() deletes only after normal processing and matching owner/version; processor exceptions and lifecycle fences retain the obligation, and concurrent marks retain a follow-up. Their earlier summary-less snapshot cannot be attributed retrospectively from the current metadata. No transcript content was read or printed.

After-deploy verification plan

  1. Deploy through the normal release owner; confirm backend-integration has the fresh queue, receiving handler audience, and invoker identity.
  2. Verify event=sync_reprocess action=repair outcome=error reaches zero for this failure, and check sync_reprocess_unbound_total for unexpected unbound hosts.
  3. Confirm the 11 poisoned obligations acquire complete bindings, enqueue, and drain; separately watch due count and oldest age for the remaining backlog.
  4. Confirm David's affected conversations receive persisted titles/overviews and appear with summaries in the client. An empty outbox alone is insufficient acceptance evidence.

No production writes, merge, or deployment performed. Reverting the code alone restores the poison behavior; keep the complete integration binding when rolling back.

View guided diff Turn on auto-fix

Persist unbound obligations safely, repair poisoned rows under CAS, and give the batch projection host a complete fresh-lane dispatch binding.
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 16, 2026 •

Copy link
Copy Markdown

Codex Review Summary

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

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-16T14:16:46.350525Z a77176d PR opened
ℹ️ 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.

@Git-on-my-level
Git-on-my-level merged commit a218436 into main Oct 16, 2026
72 of 74 checks passed
@Git-on-my-level
Git-on-my-level deleted the sync-reprocess-dispatch-rebind branch October 16, 2026 14:45
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.

1 participant