feat: add quality_review task status and qualityReview initiative flag

Adds two new fields to the database and propagates them through the
repository layer:

- Task status enum gains 'quality_review' (between in_progress and
  completed), enabling a QA gate before tasks are marked complete.
- initiatives.quality_review (INTEGER DEFAULT 0) lets an initiative be
  flagged for quality-review workflow without a data migration (existing
  rows default to false).

Includes:
- Schema changes in schema.ts
- Migration 0037 (ALTER TABLE initiatives ADD quality_review)
- Snapshot chain repaired: deleted stale 0036 snapshot, fixed 0035
  prevId to create a linear chain (0032 → 0034 → 0035), then generated
  clean 0037 snapshot
- Repository adapter already uses SELECT * / spread-update pattern so
  no adapter code changes were needed
- Initiative and task repository tests extended with qualityReview /
  quality_review_status describe blocks (7 new tests)
- docs/database.md updated

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Lukas May
2026-03-06 21:47:34 +01:00
parent c150f26d4a
commit 5137a60e70
8 changed files with 1103 additions and 193 deletions

View File

@@ -26,6 +26,7 @@ export const initiatives = sqliteTable('initiatives', {
executionMode: text('execution_mode', { enum: ['yolo', 'review_per_phase'] })
.notNull()
.default('review_per_phase'),
qualityReview: integer('quality_review', { mode: 'boolean' }).notNull().default(false),
createdAt: integer('created_at', { mode: 'timestamp' }).notNull(),
updatedAt: integer('updated_at', { mode: 'timestamp' }).notNull(),
});
@@ -151,7 +152,7 @@ export const tasks = sqliteTable('tasks', {
.notNull()
.default('medium'),
status: text('status', {
enum: ['pending', 'in_progress', 'completed', 'blocked'],
enum: ['pending', 'in_progress', 'quality_review', 'completed', 'blocked'],
})
.notNull()
.default('pending'),