Skip to content

fix: follow promoted generations in runtime Config projections - #5872

Merged
Sinity merged 2 commits into
masterfrom
fix/runtime-config-generation
Oct 1, 2026
Merged

Sinity merged 2 commits into
masterfrom
fix/runtime-config-generation

Conversation

@Sinity

@Sinity Sinity commented Oct 1, 2026

Copy link
Copy Markdown
Owner

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

  • devtools test tests/unit/core/test_config.py tests/unit/core/test_config_resolution_regression.py tests/unit/product/test_raw_authority.py: job5576, 115 passed, exit0, exact clean head803f96affc14970a64eb1b0d02830207831707c8.
  • devtools verify --quick: job5577, Success, exit0 on the same head.
  • Normal precommit format/lint hooks passed. git diff f9bdf41...HEAD --check passed.
  • Initial focused job5571 is void because the checkout moved after launch; it exposed the inherited wording assertion subsequently corrected. It supplies no passing evidence.

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.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 1, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
🔒 Security Review ✅ Completed 2026-10-01T14:38:39.804747Z 803f96a PR opened
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@Sinity
Sinity enabled auto-merge (squash) October 1, 2026 14:35
@Sinity
Sinity merged commit 5af38ee into master Oct 1, 2026
3 checks passed
@Sinity
Sinity deleted the fix/runtime-config-generation branch October 1, 2026 14:38
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