Review: Schema ownership transfer -- pg_dump to Rails structure.sql + first migration (retroactive post-merge)

review-1559-2026-06-23 Review

review approved

Verdict: APPROVED

Retroactive post-merge review. Board item #1559 reached done via PR #60 (merged 2026-06-23) while check-board-advance was fail-open. This review confirms scope compliance after the fact. Note: the ticket was properly reviewed before implementation -- see review-1559-2026-06-22 (NEEDS_REFINEMENT) and review-1559-2026-06-22-r2 (APPROVED). The gate failure was in column advancement enforcement, not in review execution.

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 -- thorough background on ownership transfer rationale, includes application.rb comment update
  • [x] File Targets -- 5 modify/create targets, 2 exclusions
  • [x] Feature Flag -- none, justified (default status preserves behavior)
  • [x] Acceptance Criteria -- 6 items
  • [x] Test Expectations -- correct: bundle exec rspec
  • [x] Constraints -- 4 items, well-scoped
  • [x] Checklist -- present
  • [x] Related -- present, references story and arch notes

Traceability

  • [x] story:consolidation label -- story-paldocs-consolidation note exists (id 2092)
  • [x] story note verified -- found in project-paldocs user-stories section (4th entry: "absorb pal-e-docs into Rails monolith")
  • [x] arch:rails-db label -- arch-rails-db note exists (id 1840) with ER diagram, components table, key decisions
  • [x] arch note verified -- arch-rails-db note exists in pal-e-docs, tags: architecture, active
  • [x] Forgejo issue -- https://forgejo.tail5b443a.ts.net/ldraney/paldocs/issues/49, closed (merged via PR #60)

File Targets -- Post-Merge Verification

All 5 file targets from the issue were delivered in PR #60. Additionally, 2 spec files and ci_schema.sql were updated (appropriate extras, not scope creep).
  • [x] db/structure.sql -- created: 841 lines, pg_dump of production paledocs schema including pgvector extension, all tables, indexes, triggers, foreign keys
  • [x] config/application.rb -- verified: schema_format = :sql set; ownership comment updated from "managed by pal-e-docs FastAPI" to "Rails is the sole migration authority for the paledocs database"; dump_schema_after_migration = false and migration_error = false set
  • [x] Gemfile -- verified: gem "neighbor" added (line 18) with comment explaining pgvector support
  • [x] db/migrate/20260622120000_add_status_to_projects.rb -- created: adds status VARCHAR(50) DEFAULT 'active' to projects table. Clean, additive migration.
  • [x] app/models/project.rb -- verified: 3 scopes added (.active, .archived, .by_status(s))
Extra files (not in scope but appropriate):
  • [x] db/ci_schema.sql -- updated to include status column for CI environment
  • [x] spec/models/project_spec.rb -- 4 tests covering all 3 scopes + default status value
  • [x] spec/migrations/add_status_to_projects_spec.rb -- 2 tests covering column type, default, and limit

Repo Placement

OK. Issue filed on ldraney/paldocs, PR #60 merged to paldocs main. Single-repo change as scoped.

Dependencies

  • This was wave:0 -- the foundation for the consolidation sprint. Downstream tickets (#50 sprint schema, #52 embedding pipeline, #57 API endpoints) are correctly sequenced after this.
  • No blocking dependencies existed. Production database access was required for pg_dump -- constraint was met.

Acceptance Criteria -- Post-Merge Assessment

  • [x] AC 1: rails db:schema:dump generates db/structure.sql -- delivered (841-line structure.sql present)
  • [x] AC 2: rails db:migrate adds status column -- delivered (migration 20260622120000 adds status to projects)
  • [x] AC 3: Project.active returns only active projects -- delivered (scope in model, tested in spec)
  • [x] AC 4: Project.all returns all projects -- inherent ActiveRecord behavior, no filter applied
  • [x] AC 5: neighbor gem loads and vector columns accessible -- delivered (gem in Gemfile, no model-level vector changes yet per scope)
  • [~] AC 6: pal-e-docs Alembic no longer generates migrations -- coordination concern, not verifiable from paldocs repo. Acceptable as manual check.

Blast Radius

  • pal-e-docs (FastAPI) -- unaffected. Adding status VARCHAR(50) DEFAULT 'active' is additive. Existing rows get default value automatically.
  • pal-e-mcp -- unaffected. Proxies to pal-e-docs API, no schema dependency.
  • Embedding worker -- unaffected. Writes to blocks.embedding, not projects table.
  • CI -- ci_schema.sql updated to include status column, keeping CI test database aligned.

Decomposition Assessment

5 file targets, 1 repo, 6 acceptance criteria, single PR. Correctly sized for a single agent pass. No decomposition was needed.

Scope Issues That Should Have Been Caught by Gate

None. The ticket was properly scoped and reviewed before implementation. The review-fix-re-review loop worked correctly:
  • review-1559-2026-06-22 -- NEEDS_REFINEMENT (4 issues: wrong test command, missing comment update in targets, missing story note, missing arch note)
  • All 4 issues were fixed in the issue body and pal-e-docs
  • review-1559-2026-06-22-r2 -- APPROVED
The failure was in check-board-advance being fail-open, which allowed the board item to advance to done without the hook verifying the APPROVED review note existed. The scope review process itself functioned correctly.

Recommendation

No action needed. Scope was solid, implementation matches spec, review process was followed. The only process gap was the fail-open check-board-advance hook -- that is tracked separately in claude-custom.