Skip to content

fix: distinguish due Wire rows from FIFO eligible heads - #455

Open
CountableNewt wants to merge 2 commits into
mainfrom
codex/tsw-122-inbox-diagnostics
Open

CountableNewt wants to merge 2 commits into
mainfrom
codex/tsw-122-inbox-diagnostics

Conversation

@CountableNewt

@CountableNewt CountableNewt commented Sep 15, 2026

Copy link
Copy Markdown
Collaborator

Existing Wire backlog telemetry counts due rows even when a future retry or active lease blocks them in repository FIFO order. Add a read-only operational diagnostic that separates sampled due rows, FIFO-eligible heads, and blocked followers without changing public health response shapes or hiding retained work.

The SQL selects up to 65 rows through each existing due index, checks up to 64 per branch with a bounded lateral predecessor seek, and reports truncation, the observation cutoff, and sampled age lower bounds. A zero eligible sample is explicitly inconclusive when truncated. It emits no identifiers or payloads, takes no claim locks, and uses a three-second statement timeout plus a 500ms lock timeout. No migration, cleanup, retry, or reconciliation occurs.

Five PostgreSQL tests cover future-retry/live-lease barriers, expired leases, terminal predecessors, source/environment isolation, unchanged durable rows, empty/64-row/truncated samples, and existing-index plans over a 20,200-row fixture. They run in the existing Database Migrator CI harness using a fresh isolated local database. All five PostgreSQL fixtures passed in CI run34918985303, Database Migrator job104222787217, including the 20,200-row EXPLAIN ANALYZE test using all three expected indexes without sequential scans. The combined migration/diagnostic harness passed 10 tests with 0 failures. Local syntax and diff checks also pass; local Docker was unavailable, so this PostgreSQL evidence comes from CI. The full aggregate Required gate remains pending other jobs.

This completes the diagnostics portion of TSW-122 alongside the separate classification PR451 and its Development companion. Coordinate promotion with those staged changes; required CI must pass. It does not change due-row telemetry labels or assert a sampled FIFO-eligible head can acquire a currently held claim lock.

Production catalog verification confirmed all three expected indexes valid and ready. One authorized read-only sample at 2026-09-15T02:00:06.467107Z found 0 due rows and no truncation. This database-wide result includes historical generations and does not establish current-lane freshness, recovery completeness, or absence of future retries/active leases. No hosted mutation occurred.

@linear-code

linear-code Bot commented Sep 15, 2026

Copy link
Copy Markdown

TSW-122

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