Review: Schema ownership transfer -- pg_dump to Rails structure.sql + first migration
Verdict: NEEDS_REFINEMENT
Template Completeness
- [x] Type -- Feature
- [x] Lineage -- standalone, supersedes pal-e-api#282
- [x] Repo -- ldraney/paldocs
- [x] User Story -- present and clear
- [x] Context -- good background on ownership transfer rationale
- [x] File Targets -- 5 modify/create targets, 2 exclusions
- [x] Feature Flag -- none, justified (default status preserves behavior)
- [x] Acceptance Criteria -- 6 items
- [ ] Test Expectations -- ISSUE: says
rails testbut project uses RSpec (rspec-railsin Gemfile,spec/directory). Should bebundle exec rspec - [x] Constraints -- 4 items, well-scoped
- [x] Checklist -- present
- [x] Related -- present
Traceability
- [ ] story:consolidation label -- story note MISSING. project-paldocs user-stories section lists: kanban, project-pages, auth. No consolidation story. [SCOPE] Create user story entry on project-paldocs user-stories section for story:consolidation.
- [ ] arch:rails-db label -- arch note MISSING. No
arch-rails-dbnote found in pal-e-docs. [SCOPE] Create architecture note arch-rails-db for the Rails database layer component. - [x] Forgejo issue -- https://forgejo.tail5b443a.ts.net/ldraney/paldocs/issues/49, open
File Targets
- [x]
db/structure.sql-- does not exist yet (correct, will be created via pg_dump import) - [x]
config/application.rb-- verified: exists, line 46 currentlyconfig.active_record.schema_format = :ruby, needs change to:sql - [x]
Gemfile-- verified: exists, noneighborgem present currently - [x]
db/migrate/XXXXXX_add_status_to_projects.rb-- will be created (correct, 2 existing migrations in db/migrate/) - [x]
app/models/project.rb-- verified: exists, no status scopes currently (8 lines, basic model with has_many/belongs_to)
Repo Placement
OK. Issue filed on ldraney/paldocs, all file targets are in paldocs. Single-repo change.
Dependencies
- No blocking dependencies on the board. This is wave:0 -- it is the foundation that wave:1 (sprint planning UI, #1560) and wave:2 (API endpoints #1561, embedding pipeline #1562) depend on.
- Downstream items #1560, #1561, #1562, #1563 all depend on this completing first. Wave ordering correctly captures this.
- Requires access to production database for pg_dump. Constraint documented in issue.
Acceptance Criteria
- [x] AC 1-5 are verifiable by an agent (run commands, check output)
- [ ] AC 6 ("When I check pal-e-docs Alembic, then no new migrations are being generated there") -- not directly agent-verifiable from the paldocs repo. This is a coordination concern, not a code change. Acceptable as a manual check.
- [ ] Test Expectations say
rails testbut should saybundle exec rspec-- project uses RSpec, not minitest
Blast Radius
- pal-e-docs (FastAPI) -- continues to read/write the same database. Adding a
status VARCHAR(50) DEFAULT 'active'column is additive and non-breaking. Existing rows get default value. - pal-e-mcp -- proxies to pal-e-docs API, unaffected by schema additions.
- Embedding worker -- writes to
blocks.embeddingcolumn, unaffected by projects table changes. - application.rb comment -- lines 42-44 say "Tables are managed by pal-e-docs FastAPI -- Rails migrations are limited to additive objects (triggers, indexes)." This comment must be updated since the ticket changes this paradigm. Not mentioned in file targets.
- schema.rb -- does not exist currently (dump disabled). Switching to
:sqlformat is clean.
Decomposition Assessment
5 file targets, 1 repo, 6 acceptance criteria. Estimated agent work under 5 minutes. No decomposition needed.
Recommendation
[BODY]Fix test command:rails testshould bebundle exec rspec[BODY]Add file target note: update comment inconfig/application.rblines 42-44 to reflect Rails as schema owner[SCOPE]Create user story entrystory-paldocs-consolidationon project-paldocs user-stories section[SCOPE]Create architecture notearch-rails-dbfor the Rails database layer component