fix(health): name scoring-job index migrations in the as-built map - #139
Draft
cursor[bot] wants to merge 32 commits into
Draft
fix(health): name scoring-job index migrations in the as-built map#139cursor[bot] wants to merge 32 commits into
cursor[bot] wants to merge 32 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>
The capability-health row still described #82 as observation-only. Record apply_backlog_health_index_migration so TRACEABILITY matches the reviewed product apply contract. Co-authored-by: Seongho Bae <seonghobae@users.noreply.github.com>
Operators could not classify queued, leased, retry-scheduled, or quarantined scoring work with the same content-free policy used for outbox and data-rights readiness. Add the probe, caller-supplied classifier, and product apply path for partial scoring-job indexes. Co-authored-by: Seongho Bae <seonghobae@users.noreply.github.com>
A healthy outbox or data-rights queue must not hide a stalled or unknown scoring-job observation. Classify the three families together and keep stalled above unknown above within-bounds. Co-authored-by: Seongho Bae <seonghobae@users.noreply.github.com>
Count leased rows whose persisted expiry is already past the database clock so a dead worker cannot hide behind a healthy enqueue-age bound. Apply the leased-expiry partial index through apply_scoring_job_migration. Co-authored-by: Seongho Bae <seonghobae@users.noreply.github.com>
Record the dead-worker residual, prefer this successor over #113 alone, and cite lease and probe sources in APA 7th. Co-authored-by: Seongho Bae <seonghobae@users.noreply.github.com>
The TRACEABILITY migrations tree still ended at 0012 while 0020-0022 already shipped on the scoring-job readiness branch. Name those files in the tree and AS_BUILT_SCHEMA as Active PR evidence, and round EXTRACT(EPOCH) millisecond conversions so a fractional created_at cannot truncate to an invalid stored time. Co-authored-by: Seongho Bae <seonghobae@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
PR #131 classifies expired scoring-job leases, but the TRACEABILITY
migrations/tree still ended at0012anddocs/architecture/AS_BUILT_SCHEMA.mdhad no Active-PR note for0020/0021/0022. Reviewers would treat that tree as the physical inventory and miss the product apply path.This branch is #131 at
8c51e3dplus the inventory and millisecond-rounding repair. Prefer this head over merging #82, #113, or #131 alone.TDD
RED:
active_backlog_health_indexes_are_named_in_the_physical_inventoryfailed because the TRACEABILITY tree did not name0020_backlog_health_indexes.sql.GREEN: the tree and as-built map name
0020/0021/0022as Active PR evidence, not protected-main truth.What changed
0020,0021, and0022in the TRACEABILITY migrations tree;docs/architecture/AS_BUILT_SCHEMA.md;EXTRACT(EPOCH)millisecond conversions so a 0.6 mscreated_atbecomes1instead of truncating to an invalid stored time.Verification
cargo test --test documentation_architecture_contract(11/11);cargo fmtandcargo clippy --all-targets -- -D warnings.The fractional-millisecond PostgreSQL case is in
tests/postgres_scoring_job_backlog_health.rsfor exact-head CI (TEST_DATABASE_URLis not available in this writer environment).Coordination
0022.