chore(db): rename csi_sections → spec_sections + open-issue sweep#79
Conversation
- Add reversible migration 009: ALTER TABLE RENAME + ALTER INDEX RENAME - Update INSERT/SELECT/JOIN SQL strings in seed + search queries - Rename listCsiSections / lookupCsiSectionTitle query functions to listSpecSections / lookupSpecSectionTitle and propagate to all call sites (file-loader, mcp/handlers, mcp/resources, db barrel + their tests) Completes the deferred Phase C3 of PR #78 trademark good-faith pass. Migration is reversible — round-trip verified locally. See docs/superpowers/specs/2026-05-18-csi-sections-rename-and-issue-sync.md
Updates active ADRs (007, 012, 013), UFGS README, and CLAUDE.md to reference spec_sections instead of csi_sections. ADR-013 keeps its filename for stable cross-reference and includes a historical note explaining the rename. Historical plan/spec files (pre-2026-05-18) intentionally retain original names as execution records.
📝 WalkthroughWalkthroughThe PR renames the PostgreSQL table ChangesDatabase table
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
Completes the deferred Phase C3 of PR #78. The internal
csi_sectionstable becomesspec_sections, finishing the alignment with theCsi*→Spec*type rename that already shipped.Also includes housekeeping on open-issue bodies that still referenced the old AST type names. Those updates were applied via
gh issue editon issues #39, #44, #47, #53 (no code in this PR for that — just the migration + SQL refs + docs).Migration approach
Reversible single-statement rename. No data copy, no downtime.
Postgres-derived constraint indexes (
csi_sections_pkey,csi_sections_section_number_key) keep their auto-generated names — they're transparent to application code and don't appear in any query string. Renaming them would add churn for no benefit.What changed
src/db/migrations/009_rename_csi_sections_to_spec_sections.ts— new migrationsrc/db/seed.ts,src/db/queries/search.ts— SQL string updateslistCsiSections→listSpecSections,lookupCsiSectionTitle→lookupSpecSectionTitle(+ propagation to all call sites inmcp/,lib/, tests)src/lib/infer-section.integration.test.ts,src/mcp/server.integration.test.ts— test comment + SQL updatesdocs/superpowers/specs/2026-05-18-csi-sections-rename-and-issue-sync.mdWhat didn't change
013-csi-sections-seed-public-domain-derivation.mdfor stable cross-reference. A historical note in the body explains the rename.docs/superpowers/plans/and pre-2026-05-18 specs — execution records, immutable.001_create_csi_sections.ts— still creates the table under its original name (that's the historical creation point; migration 009 renames it forward).Csiwas mid-identifier — already addressed in PR chore: trademark good-faith notices + Csi* → Spec* internal rename #78 for word-boundary matches. This PR catches the remaining DB-query function names.Test plan
pnpm lint— cleanpnpm test— 462/462 passpnpm migrate && pnpm seed && pnpm test:integrationlocally — 169/170 pass (1 unrelated CPI fixture test fails onmaintoo; not introduced by this PR)pnpm migrate:down && pnpm migrateround-trip — verified locally🤖 Generated with Claude Code
Summary by CodeRabbit
Release Notes
Documentation
Refactor