You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The low-churn audit in #315 found that polylogue/storage/backends/schema_bootstrap.py imperatively appends many column, index, and FTS extension operations. The repository uses fresh-current schema semantics, but bootstrap extension planning still repeats facts that also live in schema DDL.
This is not urgent correctness debt, but it is a drift risk around a high-blast-radius boundary.
Scope
Replace repeated imperative extension planning with declarative schema extension descriptors where practical.
Candidate descriptor facts:
table name
required columns and column DDL
required indexes
FTS table/trigger requirements
optional backfill/update statements
Acceptance criteria
Common column/index/FTS extension checks are represented declaratively.
Existing bootstrap behavior remains compatible for current-version databases.
Schema tests cover descriptor expansion and missing-object detection.
The design keeps raw DDL reviewable; do not hide schema facts behind opaque generation.
Starting implementation on feature/refactor/schema-bootstrap-descriptors.
Tactic:
Keep the descriptor catalog close to polylogue/storage/backends/schema_bootstrap.py for this slice, rather than introducing a repo-wide schema DSL.
Split descriptor kinds by behavior: columns, indexes, scripts, and backfills.
Let snapshot capture derive the tables/indexes it needs from the descriptor catalog, so detection state cannot drift from planning state.
Preserve current bootstrap behavior for current-version databases, including legacy raw table rejection and the raw source-mtime index replacement path.
Verification target before PR: focused schema/storage tests plus devtools verify if the local changes stay broad enough to warrant the full gate.
Activity
Sinity commentedon Apr 23, 2026
Starting implementation on
feature/refactor/schema-bootstrap-descriptors.Tactic:
polylogue/storage/backends/schema_bootstrap.pyfor this slice, rather than introducing a repo-wide schema DSL.Verification target before PR: focused schema/storage tests plus
devtools verifyif the local changes stay broad enough to warrant the full gate.Sinity commentedon Apr 23, 2026
Implementation checkpoint on
feature/refactor/schema-bootstrap-descriptors.What changed locally:
polylogue/storage/backends/schema_bootstrap.py.build_current_schema_extension_plan()to expand the ordered descriptor catalog instead of maintaining repeated imperative conditionals.capture_schema_snapshot()andcapture_schema_snapshot_async()derive inspected tables/indexes from the descriptor catalog.Verification so far:
ruff check polylogue/storage/backends/schema_bootstrap.py tests/unit/storage/test_backend.pypytest -q tests/unit/storage/test_backend.py -k 'schema'→ 9 passedmypy polylogue/storage/backends/schema_bootstrap.py→ no issuespytest -q tests/unit/storage/test_backend.py tests/unit/storage/test_parse_tracking.py→ 57 passeddevtools render-all --check→ all generated surfaces in syncNext: run the full local
devtools verify, then commit/open PR if it stays clean.refactor(storage): describe schema bootstrap extensions (#372)
Sinity commentedon Apr 23, 2026
Closed via PR #372, merged as
cbee9706e3c23dfddbf438b1c98546e042882ddc.Final implementation:
Final verification before merge:
mypy polylogue/storage/backends/schema_bootstrap.py→ no issuespytest -q tests/unit/storage/test_backend.py tests/unit/storage/test_parse_tracking.py→ 57 passeddevtools render-all --check→ generated surfaces in syncdevtools verify→ all checks passeddevtools verify --quick→ all checks passedGitHub CI was left pending per the quota caveat; local verification was clean.
refactor(storage): describe schema bootstrap extensions (#372)