fix(health): apply backlog indexes through the product API - #103
cursor[bot] wants to merge 29 commits into
Conversation
The first positive-millis conversion returned before Linux line coverage could see the later consumption and propagation timestamp checks.
Linux line coverage treats the later conversion ? as its own statement. Return those invalid stored times through an explicit match arm.
Client-only invalid timestamp probes left the GenericClient Transaction instantiation of each independent oldest-event conversion uncovered.
Backlog probes accept GenericClient, so an aborted transaction and a closed connection must both surface typed database errors on the query Result paths.
#76 already landed, so keep Active PR #82 as the remaining backlog-observation slice. Name the caller-policy probes in TRACEABILITY, OPERABILITY, and the changelog. HTTP probes and measured deployment-profile thresholds stay outside this branch. Co-authored-by: Seongho Bae <seonghobae@users.noreply.github.com>
The inherited #72 recovery fixture inserted a processing consumption row without claim_deadline_at. Migration 0019 requires that column for processing rows, and the deadline trigger is UPDATE-only, so exact-head CI failed closed. Seed a valid persisted claim and assert the deadline survives COPY restore. Co-authored-by: Seongho Bae <seonghobae@users.noreply.github.com>
Migration 0019 requires claim_deadline_at for processing consumption rows, and the deadline trigger is UPDATE-only. Direct INSERT fixtures used by the integration-backlog probe must persist that column so exact-head CI can observe in-flight work without weakening the fail-closed shape check. Co-authored-by: Seongho Bae <seonghobae@users.noreply.github.com>
PostgreSQL rejected $5 as both bigint claim expiry and double-precision interval input. Persist claim_deadline_at with clock_timestamp() so the 0019 shape check stays fail-closed without weakening the probe contract. Co-authored-by: Seongho Bae <seonghobae@users.noreply.github.com>
Migration 0020 only ran from a test include_str, so callers using the product apply functions never received readiness indexes. Add apply_backlog_health_index_migration and require the index contract to use that path, including missing-relation and idempotent apply cases. Co-authored-by: Seongho Bae <seonghobae@users.noreply.github.com>
|
Bugbot is not enabled for your account, so this pull request was not reviewed. Enable Bugbot in the Cursor dashboard to get automatic reviews on future PRs. |
|
Scheduled review-feedback autofix for this PR head.
|
|
Scheduled review-feedback autofix for this PR head.
|
|
Scheduled review-feedback autofix for this PR head.
|
|
Scheduled review-feedback autofix for this PR head.
|
|
Scheduled review-feedback autofix for this PR head.
|
|
Admission-state correction for exact head Finding: non-mergeable live base comparison is diverged (29 ahead / 659 behind); no current APPROVED review. This PR remains Open and is moved to Draft/Proposed. Commits, reviews, threads, and valid delta are preserved. Return it to Ready only after causal repair and fresh exact-head evidence. No bypass, synthetic status/approval, manual rerun, Force Push, review dismissal, or Close is used. |
Why
PR #82 adds partial readiness indexes in
migrations/0020_backlog_health_indexes.sql, but the only apply path was a private testinclude_str!. Callers that bootstrap throughapply_integration_migration,apply_inbox_consumption_migration, andapply_data_rights_migrationnever received those indexes. Recovery applies the directory chain, so the file and the product apply API had diverged.This branch is #82 at
b02bc5eplus the apply-path fix. Do not merge #82 without this commit.TDD
RED: the index contract imported
apply_backlog_health_index_migrationbefore the function existed (E0432).GREEN: the product function applies
0020, the index contract uses only that API, a second apply is idempotent, and a schema without the owned tables fails closed.What changed
apply_backlog_health_index_migrationinsrc/postgres_health.rs;include_str!;Verification
cargo fmt --check,cargo clippy --all-targets -- -D warnings,cargo test --lib, capability-health and backlog-health PostgreSQL contracts, including the new apply-path tests.Out of scope
HTTP probes remain PR #91. Scoring-job backlog observation remains a later slice. No universal SLO defaults are introduced.