Skip to content

Postgres/simulator queue signals lag Store: allowance-hold age and eligible-capacity count #23840

Open

Description

@Git-on-my-level

The daily target-architecture parity harvest found two Store contract gaps on unchanged main 08ff6c68a9dd6a85675531799744854a0991102f. Firestore already carries the old-infrastructure fixes (#23767/#23824); simulator and Postgres do not.

  • PL-100: SimStore.oldest(..., ready_only=False) and PostgresStore.oldest(...) still select the minimum merge-pending enqueue time without excluding durable allowance holds. Both a current allowance decision and last_policy_hold during an unevaluated/BLIND recheck return the old parked age instead of the real commitment behind it. This can falsely trip migration guards. Raw ready_only=True age must remain diagnostic; other current decisions must override stale markers. The Firestore bounded-scan truncation behavior must remain conservative.
  • PL-101: ready_for_capacity(priority, now) is already declared in database/batch_pipeline_store.py::Store, but absent from SimStore and PostgresStore. Count only available ready, merge-pending unattempted/allowed work; never parked/held/decisionless legacy debt.
  • PL-102 consequence: shared QueueMetrics cannot establish a complete three-priority capacity sample on these stores. Missing data must remain stale/unobserved, never become fresh zero. Atomic partial-query and malformed-response tests pass on Firestore.

Reproduction: new synthetic backend/tests/integration/test_queue_signal_conformance.py, using the existing testing/store_fixtures.py matrix, a loopback Firestore emulator and throwaway local Postgres, OMI_REQUIRE_STORE_BACKENDS=all, serially through workspace bin/omi-heavy. Initial result: 30 failed / 27 passed / zero skips. All 19 Firestore parameters pass; sim/Postgres each have 15 failures. Six age-classification cases and one real Scheduler hold/recover/recheck case fail per affected backend; capacity method absence accounts for the other eight. Firestore's SDK returns real zero through the native aggregate path successfully.

Recommend workstream A implements both existing Store contracts on sim/Postgres, retaining held custody and backend read-only semantics. Workstream B consumes the same atomic freshness contract. This is a local conformance finding; no deployed Postgres or production failure is inferred. No interface/design change, workflow, provider call, deploy or configuration change is requested. A follow-up parity PR will link strict, backend-scoped expected failures; they will fail on unexpected pass and never count as cutover acceptance.

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