feat: Add initiative review gate before push

When all phases complete, the initiative now transitions to
pending_review status instead of silently stopping. The user
reviews the full initiative diff and chooses:
- Push Branch: push cw/<name> to remote for PR workflows
- Merge & Push: merge into default branch and push

Changes:
- Schema: Add pending_review to initiative status enum
- BranchManager: Add pushBranch port + SimpleGit adapter
- Events: initiative:pending_review, initiative:review_approved
- Orchestrator: checkInitiativeCompletion + approveInitiative
- tRPC: getInitiativeReviewDiff, getInitiativeReviewCommits,
  getInitiativeCommitDiff, approveInitiativeReview
- Frontend: InitiativeReview component in ReviewTab
- Subscriptions: Add initiative events + missing preview/conversation
  event types and subscription procedures
This commit is contained in:
Lukas May
2026-03-05 17:02:17 +01:00
parent dab1a2ab13
commit 865e8bffa0
14 changed files with 519 additions and 13 deletions

View File

@@ -48,7 +48,7 @@ export interface InitiativeRepository {
* Find all initiatives with a specific status.
* Returns empty array if none exist.
*/
findByStatus(status: 'active' | 'completed' | 'archived'): Promise<Initiative[]>;
findByStatus(status: 'active' | 'completed' | 'archived' | 'pending_review'): Promise<Initiative[]>;
/**
* Update an initiative.

View File

@@ -19,7 +19,7 @@ import { relations, type InferInsertModel, type InferSelectModel } from 'drizzle
export const initiatives = sqliteTable('initiatives', {
id: text('id').primaryKey(),
name: text('name').notNull(),
status: text('status', { enum: ['active', 'completed', 'archived'] })
status: text('status', { enum: ['active', 'completed', 'archived', 'pending_review'] })
.notNull()
.default('active'),
mergeRequiresApproval: integer('merge_requires_approval', { mode: 'boolean' })