Data migration: retype doc notes to new types (review, architecture, validation) #224

Closed
opened 2026-03-28 01:54:41 +00:00 by forgejo_admin · 0 comments

Type

Feature

Lineage

Related to forgejo_admin/claude-custom #180 (spike: note type system audit).
Depends on pal-e-api#223 (merged via PR #226).

Repo

forgejo_admin/pal-e-api

User Story

As a PM (Betty Sue)
I want doc notes retyped to their correct types
So that the type system reflects actual note categories and enables enforcement

Context

The audit found 70% of doc notes are actually reviews, architectures, or validations. With the new NoteTypes deployed (PR #226 merged), notes can now be migrated to their correct types. Also folds deprecated types (reference, journal, incident, post, issue) into doc.

File Targets

Files to create:

  • alembic/versions/{hash}_retype_notes_to_new_types.py -- Alembic data migration

Acceptance Criteria

  • 0 doc notes with tag 'review' remain (all retyped to review)
  • 0 doc notes with slug prefix 'arch-' remain (all retyped to architecture) — verified count: 14 notes
  • 0 doc notes with slug prefix 'validation-' remain (all retyped to validation) — verified count: 6 notes
  • 0 doc notes with slug prefix 'board-' remain (all retyped to board) — verified count: 4 notes
  • 0 notes with type reference remain (27 → doc)
  • 0 notes with type journal remain (3 → doc)
  • 0 notes with type incident remain (3 → doc)
  • 0 notes with type post remain (3 → doc)
  • 0 notes with type issue remain (1 → doc)
  • All retyped notes retain their existing tags

Test Expectations

  • Alembic migration runs without error: alembic upgrade head
  • Post-migration counts verified via SQL COUNT queries
  • Run command: alembic upgrade head && pytest tests/ -v

Constraints

  • WHERE clauses must use tag joins for review notes (not all have slug prefix)
  • arch-* count is 14 (not 16 — 2 architecture-tagged docs lack arch- prefix: agent-paradigm, tf-environment-strategy)
  • board-* count is 4 (not 7 — verified via database query)
  • Review count (~191) should be verified with SQL COUNT before migration, not hardcoded
  • Migration must be idempotent (safe to run twice)

Checklist

  • PR opened
  • Tests pass
  • No unrelated changes
  • project-pal-e-agency
  • forgejo_admin/claude-custom #180 -- parent spike
  • forgejo_admin/pal-e-api #223 -- prerequisite (merged)

Review History

  • review-224-2026-03-27: NEEDS_REFINEMENT — arch-* count wrong (14 not 16), board-* count wrong (4 not 7), type should be Feature not Task. Fixed in this update.
### Type Feature ### Lineage Related to `forgejo_admin/claude-custom #180` (spike: note type system audit). Depends on pal-e-api#223 (merged via PR #226). ### Repo `forgejo_admin/pal-e-api` ### User Story As a PM (Betty Sue) I want doc notes retyped to their correct types So that the type system reflects actual note categories and enables enforcement ### Context The audit found 70% of doc notes are actually reviews, architectures, or validations. With the new NoteTypes deployed (PR #226 merged), notes can now be migrated to their correct types. Also folds deprecated types (reference, journal, incident, post, issue) into doc. ### File Targets Files to create: - `alembic/versions/{hash}_retype_notes_to_new_types.py` -- Alembic data migration ### Acceptance Criteria - [ ] 0 doc notes with tag 'review' remain (all retyped to review) - [ ] 0 doc notes with slug prefix 'arch-' remain (all retyped to architecture) — verified count: 14 notes - [ ] 0 doc notes with slug prefix 'validation-' remain (all retyped to validation) — verified count: 6 notes - [ ] 0 doc notes with slug prefix 'board-' remain (all retyped to board) — verified count: 4 notes - [ ] 0 notes with type reference remain (27 → doc) - [ ] 0 notes with type journal remain (3 → doc) - [ ] 0 notes with type incident remain (3 → doc) - [ ] 0 notes with type post remain (3 → doc) - [ ] 0 notes with type issue remain (1 → doc) - [ ] All retyped notes retain their existing tags ### Test Expectations - [ ] Alembic migration runs without error: `alembic upgrade head` - [ ] Post-migration counts verified via SQL COUNT queries - Run command: `alembic upgrade head && pytest tests/ -v` ### Constraints - WHERE clauses must use tag joins for review notes (not all have slug prefix) - arch-* count is 14 (not 16 — 2 architecture-tagged docs lack arch- prefix: `agent-paradigm`, `tf-environment-strategy`) - board-* count is 4 (not 7 — verified via database query) - Review count (~191) should be verified with SQL COUNT before migration, not hardcoded - Migration must be idempotent (safe to run twice) ### Checklist - [ ] PR opened - [ ] Tests pass - [ ] No unrelated changes ### Related - `project-pal-e-agency` - `forgejo_admin/claude-custom #180` -- parent spike - `forgejo_admin/pal-e-api #223` -- prerequisite (merged) ### Review History - review-224-2026-03-27: NEEDS_REFINEMENT — arch-* count wrong (14 not 16), board-* count wrong (4 not 7), type should be Feature not Task. Fixed in this update.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
forgejo_admin/pal-e-api#224
No description provided.