Skip to content

refactor(storage): describe schema bootstrap extensions (#372) - #372

Merged
Sinity merged 1 commit into
masterfrom
feature/refactor/schema-bootstrap-descriptors
Apr 23, 2026
Merged

Sinity merged 1 commit into
masterfrom
feature/refactor/schema-bootstrap-descriptors

Conversation

@Sinity

@Sinity Sinity commented Apr 23, 2026

Copy link
Copy Markdown
Owner

Summary

Replace the current-version schema bootstrap planner's repeated imperative extension checks with a typed descriptor catalog that drives both plan expansion and schema snapshot scope.

Problem

Issue #325 identified that polylogue/storage/backends/schema_bootstrap.py repeated column, index, FTS/script, and backfill facts inside build_current_schema_extension_plan(). That made it easy for detection state to drift from application state, especially when adding new current-version schema extensions.

Closes #325

Solution

  • Added column, index, script, and backfill descriptor types in polylogue/storage/backends/schema_bootstrap.py.
  • Replaced the imperative extension planning block with ordered descriptor expansion, preserving the existing SQL order and the raw source-mtime drift-replacement behavior.
  • Made sync and async schema snapshot capture derive inspected tables and indexes from the descriptor catalog.
  • Added backend tests covering descriptor expansion, descriptor-driven snapshot scope, and catalog-to-plan SQL expansion.

Verification

  • ruff check polylogue/storage/backends/schema_bootstrap.py tests/unit/storage/test_backend.py → passed
  • pytest -q tests/unit/storage/test_backend.py -k 'schema' → 9 passed
  • mypy polylogue/storage/backends/schema_bootstrap.py → no issues
  • pytest -q tests/unit/storage/test_backend.py tests/unit/storage/test_parse_tracking.py → 57 passed
  • devtools render-all --check → generated surfaces in sync
  • devtools verify → all checks passed
  • git push -u origin feature/refactor/schema-bootstrap-descriptors → pre-push quick verification passed

Problem: current-version schema bootstrap extension planning repeated table, column, index, and backfill facts inside imperative conditionals, making drift between detection and application easy.

What changed: add typed schema extension descriptors for columns, indexes, scripts, and backfills; expand the bootstrap plan from the ordered descriptor catalog; and derive snapshot table/index inspection from the same catalog.

Verification: ruff check polylogue/storage/backends/schema_bootstrap.py tests/unit/storage/test_backend.py; mypy polylogue/storage/backends/schema_bootstrap.py; pytest -q tests/unit/storage/test_backend.py tests/unit/storage/test_parse_tracking.py; devtools render-all --check; devtools verify.

Ref #325
@Sinity Sinity changed the title refactor(storage): describe schema bootstrap extensions refactor(storage): describe schema bootstrap extensions (#372) Apr 23, 2026
@coderabbitai

coderabbitai Bot commented Apr 23, 2026

Copy link
Copy Markdown

Warning

Rate limit exceeded

@Sinity has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 29 minutes and 19 seconds before requesting another review.

Your organization is not enrolled in usage-based pricing. Contact your admin to enable usage-based pricing to continue reviews beyond the rate limit, or try again in 29 minutes and 19 seconds.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: a9910c3d-8a20-4a4c-951c-0deacd6f0f98

📥 Commits

Reviewing files that changed from the base of the PR and between 9018e64 and 28e398d.

📒 Files selected for processing (2)
  • polylogue/storage/backends/schema_bootstrap.py
  • tests/unit/storage/test_backend.py
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feature/refactor/schema-bootstrap-descriptors

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@Sinity
Sinity merged commit cbee970 into master Apr 23, 2026
10 of 13 checks passed
@Sinity
Sinity deleted the feature/refactor/schema-bootstrap-descriptors branch April 23, 2026 00:20
@Sinity

Sinity commented May 1, 2026

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Nice work!

ℹ️ 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".

@Sinity
Sinity requested review from Copilot and removed request for Copilot May 1, 2026 01:54
Sinity added a commit that referenced this pull request May 7, 2026
## Summary

Replace the current-version schema bootstrap planner's repeated imperative extension checks with a typed descriptor catalog that drives both plan expansion and schema snapshot scope.

## Problem

Issue #325 identified that `polylogue/storage/backends/schema_bootstrap.py` repeated column, index, FTS/script, and backfill facts inside `build_current_schema_extension_plan()`. That made it easy for detection state to drift from application state, especially when adding new current-version schema extensions.

Closes #325

## Solution

- Added column, index, script, and backfill descriptor types in `polylogue/storage/backends/schema_bootstrap.py`.
- Replaced the imperative extension planning block with ordered descriptor expansion, preserving the existing SQL order and the raw source-mtime drift-replacement behavior.
- Made sync and async schema snapshot capture derive inspected tables and indexes from the descriptor catalog.
- Added backend tests covering descriptor expansion, descriptor-driven snapshot scope, and catalog-to-plan SQL expansion.

## Verification

- `ruff check polylogue/storage/backends/schema_bootstrap.py tests/unit/storage/test_backend.py` → passed
- `pytest -q tests/unit/storage/test_backend.py -k 'schema'` → 9 passed
- `mypy polylogue/storage/backends/schema_bootstrap.py` → no issues
- `pytest -q tests/unit/storage/test_backend.py tests/unit/storage/test_parse_tracking.py` → 57 passed
- `devtools render-all --check` → generated surfaces in sync
- `devtools verify` → all checks passed
- `git push -u origin feature/refactor/schema-bootstrap-descriptors` → pre-push quick verification passed
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.

refactor: describe schema bootstrap extensions declaratively

1 participant