Skip to content

Firestore enrichment outbox pull claims starve behind excluded rows and silently cap at 100 #23558

Description

@Git-on-my-level

The daily architecture-parity conformance run reproduced the bounded-discovery failure class in the Firestore enrichment outbox at main a6f9d31. This affects the old adapter; the same tests pass on Postgres and the simulator.

FirestoreEnrichmentOutbox.claim(n, ...) asks utils.enrichment.outbox.due_rows for n * 4 candidates. The query silently clamps to 100 before filtering live leases. It also does not refill after privacy-fenced candidates retire.

Required invariants (KB PL-002/PL-003):

  • 101 earlier live-leased rows cannot hide the next runnable row from one pull claim.
  • 101 earlier privacy-fenced rows must retire without consuming the actionable claim budget.
  • An explicit claim budget of 125 returns all 125 eligible due rows; it must not silently return only 100. Future rows and active leases remain excluded.

Reproduction: backend/tests/integration/test_parity_recovery_conformance.py on lane/parity-pl-001, all backends required, isolated Firestore emulator and local Postgres. Baseline: 9 passed, 3 failed, no skips. The three failing cases are the Firestore parameters above. The fourth case proves failed-wake/error versus successful-repair accounting on all three stores.

Recommended fix: page using an explicit stable cursor past excluded/retired rows until the actionable budget is filled or the due set is exhausted; keep per-query pages bounded without turning that page size into the total claim budget. Preserve privacy and lease CAS fences. Qualify against the real emulator. This report does not establish production frequency or a deployed repair.

The parity PR will carry strict, assertion-only xfails on these exact Firestore parameters linked to this issue. The invariant stays unchanged; remove the xfails with the repair.

Failure-Class: FC-bounded-discovery-pinned-by-blocked-page

Activity

  1. moved this from Someday to In progress in omi TODO / bountieson Oct 25, 2026
  2. huynhnhatquandongnai-source commented on Oct 25, 2026

    @huynhnhatquandongnai-source

    Submitted fix in PR #23569 with full cursor-paging in due_rows, claim candidate refilling in FirestoreEnrichmentOutbox.claim, and unit tests in �ackend/tests/unit/test_enrichment_outbox_paging.py verifying all 3 invariants.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions