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

@@ -56,4 +56,10 @@ export interface BranchManager {
* Get the raw unified diff for a single commit.
*/
diffCommit(repoPath: string, commitHash: string): Promise<string>;
/**
* Push a branch to a remote.
* Defaults to 'origin' if no remote specified.
*/
pushBranch(repoPath: string, branch: string, remote?: string): Promise<void>;
}

View File

@@ -140,4 +140,10 @@ export class SimpleGitBranchManager implements BranchManager {
const git = simpleGit(repoPath);
return git.diff([`${commitHash}~1`, commitHash]);
}
async pushBranch(repoPath: string, branch: string, remote = 'origin'): Promise<void> {
const git = simpleGit(repoPath);
await git.push(remote, branch);
log.info({ repoPath, branch, remote }, 'branch pushed to remote');
}
}