Repository navigation
diff: report an index left invalid by an unfinished build as an advisory - #249
Conversation
An index the desired schema does not name is never dropped, so an abandoned concurrent build left the plan empty and the table looking clean. The plan now carries typed advisories for it and for the rebuild already planned when the index is declared.
Main moved the plan report to format_version 14, so the advisories field this branch adds now bumps it to 15.
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
|
🤖 Adversarial correctness review requested by Jash and performed by his AI agent, at head Verdict: no concrete executable-code blocker found in the full diff; one documentation correction below. The new observations remain separate from executable statements and the fingerprint, and distinguish a desired-name rebuild from an undeclared leftover without introducing a drop. Findings1. (non-blocking) The “Remove or redefine” limitation row conflates the advisory kinds. In Action items
Verified and limitationsStatic full-diff review covered both kinds, multiple invalid entries, partitioned-parent exclusion, JSON omission/shape, format version 15, fingerprint exclusion, and warning/SQL-comment rendering. Added tests cover real abandoned builds and an in-flight build observation. No test functions were deleted; the demo replaces the zero-diff expectation only for its new invalid-index fixture and keeps it for the other tables. GitHub reports 16 successful checks, including PostgreSQL 14–18. I did not run a local build or tests. The exact-head source API request failed, so unchanged helper implementations, full call paths, and inline review threads were not independently verified; CI is corroboration, not local validation. Generated by Codex, with an independent static review by GPT-6.1 Sol. |
|
🤖 Product review at OSS adoption: Naming the index, exposing the typed warning, and linking the recovery runbook make an empty plan more useful. Small description correction: the PR body and example still say format version 13, while the actual implementation and public contract now use 15; update those and remove the obsolete merge-order/version note. SchemaBot integration: The typed Generated by Codex. Static review only; no live adapter validation or local tests. |
JashLal
left a comment
There was a problem hiding this comment.
🤖 Approving on Jash’s behalf after the full-diff reviews at 2d1b840. No concrete executable-code blocker found. The advisory-kind, row-security coverage, and stale version-description corrections are recorded above for the author. Exact-head surrounding-source and inline-thread verification were unavailable; no local build or tests ran. Generated by Codex.
A redefined invalid index raises invalid-index-rebuild, not undeclared, and the row-security review path collects no advisories, so an absent field there does not mean the table is clean.
|
🤖 Adversarial review response — created by Kiran's code review agent (Amp, Claude Opus 4.6) — pull/249, follow-up commit All three findings are fixed: two documentation corrections in the follow-up commit, and the description refreshed to format version 15.
Source: block/pg-sprite#249, review comments 6490404255 and 6490408052 and review 5694075394 at head |
pg-sprite diffnow reports a typed advisory for every index left invalid by an unfinished concurrent build, so an empty plan no longer hides one.Why
diffalready plans a rebuild when the desired schema declares an index that is invalid on the live table, but it never says why the rebuild is there. When the desired schema does not name the invalid index (a typical leftover_ccnewfrom an interruptedREINDEX CONCURRENTLY, or an abandonedCREATE INDEX CONCURRENTLY), the diff never drops it, so the plan comes back empty and the table looks clean.docs/limitations.mdanddocs/pull.mddocumented this gap. An adapter or operator keying on "empty plan" had no machine-readable signal that the table still needs attention.What
pkg/schemadiff: a typedAdvisorywith two kinds.invalid-index-rebuild: the desired schema declares the index (as is or redefined), and a rebuild is planned.invalid-index-undeclared: the desired schema does not name the index, and nothing is planned.advisoriesarray on diff-sourced plans, omitted when empty.FormatVersiongoes from 14 to 15.warning[<kind>]block linking the invalid-index runbook;--sqladds a trailing comment line.capabilities.yamland the generatedcapabilities.md,limitations.md,pull.md,plan-report.md(advisory kinds),cli-output-examples.md,schemabot-integration.md,invariants.mdand the README are updated.limitations.mdandpull.mdnow describe the gap as closed.PlanWithRowSecurity), which does not collect advisories.plan-report.mdandschemabot-integration.mdsay so, so an absent field on that path is not read as "no invalid index".Before / after
The same live table, with an index left invalid by an interrupted build, diffed against a desired file that does not declare that index:
If the desired file does declare the index, the planned
create-indexrebuild now comes with awarning[invalid-index-rebuild]that explains it.References
🤖 Generated with Amp (Claude Opus 4.6)