Repository navigation
fix: follow promoted generations in runtime Config projections - #5872
Merged
Merged
Conversation
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. |
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.
Summary
Make default runtime Config projections follow the selected archive root’s promoted index generation. Preserve explicitly supplied database paths and defensive settings/source projection.
Problem
ResolvedRuntimeConfig.as_config passed its already-resolved default index path as Config(db_path=...). That marks the path explicit, so after generation A promotes to B, current_db_path still returns A. The production materialization_generation_lease and raw frontier attachment consume that path. Historical evidence: PR #3952 thread PRRT_kwDOR7_N4c6ZJigM, #3952 (comment).
Solution
Use the existing Config constructor default during runtime projection. No new flag or parallel path. Add production generation-lease tests reading distinct SQLite A/B contents, source-clone and explicit-pin controls, and selected-root/settings/source projection checks. Document the behavior. Correct an inherited test to assert the typed ConfigError refusal rather than diagnostic wording.
Verification
Self-review
Author review of f9bdf41...803f96a. Two whole-diff passes; final pass clean. Current repository guide contains 15 numbered items; generic worker-contract contains six. All 21 considered below.
✓ 1 Siblings and owners: Config owns implicit/explicit choice. Searched all current_db_path callers (two), with_sources, active_archive_root, archive_file_set_root, runtime projection and runtime resolver. Only as_config manufactured an explicit path; omission reuses existing constructor semantics.
✓ 2 Fix itself: no new state, flag or exception. Constructor already resolves an explicitly supplied root. Projection still copies sources and carries settings.
N/A 3 Memory and limits: no input loop/cache/cap added; two tiny synthetic SQLite witness rows exercise behavior.
✓ 4 Cost per unit: existing single pointer resolution per projection and per current_db_path call; no archive scan added.
N/A 5 Interruption: no product lifecycle/write transition added. Test leases retain existing context cleanup.
✓ 6 Ordering and races: materialization_generation_lease acquires shared generation exclusion before current_db_path; regression checks exclusive RebuildLease refusal during reads.
✓ 7 Failure classification: existing typed pointer errors propagate through constructor; no catch/fallback added.
N/A 8 Silent outcomes: no enumeration/status decision changed. Tests assert actual A/B rows rather than a success flag.
✓ 9 Cleanup on failure: test connections and generation leases use context managers; production cleanup unchanged.
N/A 10 Identity and keys: no semantic hashes, durable IDs or receipt keys changed. Derived-closure membership is pending recorded job5574; passing static gate is not a membership claim.
✓ 11 Lossless transforms: core regression checks archive/render roots, sources, Drive/index projections, embedding settings and interval; clearing projected sources leaves runtime tuple intact.
✓ 12 Degenerate inputs: existing constructor/default-path tests retained; core regression covers no initial index, production tests cover empty manual source list and both pin choices.
✓ 13 Consumers: two current_db_path consumers need no interface changes. with_sources already preserves implicit/explicit choice. Documentation states promotion and manual pin contract.
✓ 14 Tests and stubs: actual runtime resolver and actual generation-lease consumer read distinct SQLite A/B values. Reintroducing db_path=self.paths.index_db makes implicit branch read A. Discarding explicit path makes control read B. Ambient-root mutation and source clone exercise same production semantics without monkeypatched product functions.
✓ 15 Trust boundaries: only neutral synthetic witness values and tmp_path roots; no private archives/credentials. Changed config precommit scan spans pre-existing assignments, no new credential field or content.
✓ Generic 1 Criterion coverage: tests cover generation, pin, projection on production path. Focused5576 and quick5577 passed on the clean exact head. Delivery remains open until protected merge.
✓ Generic 2 Defect-class coverage: rg current_db_path yielded exactly two consumers; as_config one producer; with_sources one clone. Constructor manually explicit control retained.
✓ Generic 3 Consumers and predecessor: no interface removed; defective explicit argument deleted, existing implicit route becomes the sole default projection. Documentation updated.
✓ Generic 4 Typed visible failures: no new exception handling, statuses or fallback; existing ArchiveLocationError boundary unchanged.
✓ Generic 5 Anti-vacuity: restoring projection's explicit argument turns promoted implicit A/B assertion red; ignoring explicit pin turns explicit control red; removing list copy makes clear mutate source authority.
✓ Generic 6 Privacy: four-file public diff carries no operator data or private results; all evidence packets remain private scratch.
Inherited focused failure was corrected in the same test file: flat daemon keys must raise ConfigError, and prose wording is not its declared contract. Sibling search found exactly one daemon wording matcher. No findings in final pass. Broad suites were not requested; selected checks prove their declared scope only.
Residuals
Focused tests prove runtime resolution, source cloning, and production lease reads on Linux. They replace the pointer text directly and do not exercise the full IndexGenerationStore.promote lifecycle. No broad suite or live operator archive was run. Publication and merge remain subject to protected required statuses. The separate Darwin audit-leaf proof hold is outside this change and remains unverified.