Repository navigation
fix: validate archive index schema semantics before opening - #4472
Conversation
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars. ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Plus Run ID: Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
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. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: e6a107284a
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Summary Add canonical sqlite_master semantic manifests to index-tier bootstrap and the shared archive-layout opener. Fresh and same-version index initialization now verifies the complete declared object shape, including runtime indexes; undeclared or drifted objects produce an exact typed diff. Source-generation sealing is immutable and rejects unknown or already-sealed generations. Problem PRAGMA user_version alone accepted an index whose object shape had drifted, including historical undeclared FTS residue or indexes. A source generation could also be resealed after publication. Solution Render canonical DDL into an in-memory database, normalize its sqlite_master projection, fingerprint it, and compare it with the live projection at the open boundary. Ensure fresh index construction creates the same runtime indexes before validation. Add a regression proving a current user_version does not hide an undeclared table. Verification `bash nix/devtools-wrapper.sh test tests/unit/storage/test_index_generation.py tests/unit/maintenance/test_rebuild_index_candidate_promotion.py tests/unit/maintenance/test_inactive_candidate_durable_barrier.py tests/unit/storage/test_archive_tuple_location.py` — 93 passed. `bash nix/devtools-wrapper.sh verify schema-versioning` — Schema evolution policy intact. `bash nix/devtools-wrapper.sh verify oracle-integrity` — Oracle integrity intact. `bash nix/devtools-wrapper.sh verify --quick` — all quick gates passed. Residual risk The dispatch-named `tests/unit/storage/test_archive_tuple_activation.py` is absent from this branch, so that exact command cannot collect it. This change validates the existing index open/bootstrap route; it does not add a new whole-tuple activation API. Reviewed-by: Claude (Opus) cross-family review
The upward walk that resolves a session's repository stopped at nothing, so with the managed temp trees inside the checkout every scratch path resolved to the checkout itself. The walk now stops before a listed ceiling, as git does, and the ceiling is part of the normalization cache key. Tests: tool results without structural evidence are admitted as unknown with not_reported (#4539) and the writer refusal is exercised on a block with no evidence at all; block payloads carry tool_outcome (#4502); a provider-reported cost rolls up as "exact" (#4493); the v61 replace-table keeps the surviving canonical columns; the bulk-delete canaries and the naive-join survivor use TEMP objects on the opened connection so the schema manifest check at open no longer refuses them (#4472, #4594). Co-Authored-By: Claude Fable 5.1 <[email protected]> Claude-Session: https://claude.ai/code/session_01YGi8wLWGR2HYBh8p8fXFXz
|
Closing out open Codex review threads on this PR (evidence checked against master at 0914f89):
Resolving every thread listed; confirmed defects are fixed under the named bead. |
|
Historical Codex triage: evidence checked at 5ebcfe5. This records that source revision; it does not claim a fresh review of current master.
Only the rows listed above are dispositioned. Held findings remain open. |
|
Historical Codex triage: evidence checked at 5ebcfe5. This records that source revision; it does not claim a fresh review of current master.
Only the rows listed above are dispositioned. Held findings remain open. |
Summary
Add canonical sqlite_master semantic manifests to index-tier bootstrap and the shared archive-layout opener. Fresh and same-version index initialization now verifies the complete declared object shape, including runtime indexes; undeclared or drifted objects produce an exact typed diff. Source-generation sealing is immutable and rejects unknown or already-sealed generations.
Problem
PRAGMA user_version alone accepted an index whose object shape had drifted, including historical undeclared FTS residue or indexes. A source generation could also be resealed after publication.
Solution
Render canonical DDL into an in-memory database, normalize its sqlite_master projection, fingerprint it, and compare it with the live projection at the open boundary. Ensure fresh index construction creates the same runtime indexes before validation. Add a regression proving a current user_version does not hide an undeclared table.
Verification
bash nix/devtools-wrapper.sh test tests/unit/storage/test_index_generation.py tests/unit/maintenance/test_rebuild_index_candidate_promotion.py tests/unit/maintenance/test_inactive_candidate_durable_barrier.py tests/unit/storage/test_archive_tuple_location.py— 93 passed.bash nix/devtools-wrapper.sh verify schema-versioning— Schema evolution policy intact.bash nix/devtools-wrapper.sh verify oracle-integrity— Oracle integrity intact.bash nix/devtools-wrapper.sh verify --quick— all quick gates passed.Residual risk
The dispatch-named
tests/unit/storage/test_archive_tuple_activation.pyis absent from this branch, so that exact command cannot collect it. This change validates the existing index open/bootstrap route; it does not add a new whole-tuple activation API.Reviewed-by: Claude (Opus) cross-family review