From dab1a2ab134f3601df424a8eeaefde7e163acd45 Mon Sep 17 00:00:00 2001 From: Lukas May Date: Thu, 5 Mar 2026 17:00:38 +0100 Subject: [PATCH] docs: Add initiative review gate to dispatch-events, server-api, and database docs --- docs/database.md | 2 +- docs/dispatch-events.md | 5 ++++- docs/server-api.md | 4 ++++ 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/docs/database.md b/docs/database.md index f5ead10..e2180cd 100644 --- a/docs/database.md +++ b/docs/database.md @@ -18,7 +18,7 @@ All adapters use nanoid() for IDs, auto-manage timestamps, and use Drizzle's `.r |--------|------|-------| | id | text PK | nanoid | | name | text NOT NULL | | -| status | text enum | 'active' \| 'completed' \| 'archived', default 'active' | +| status | text enum | 'active' \| 'pending_review' \| 'completed' \| 'archived', default 'active' | | mergeRequiresApproval | integer/boolean | default true | | branch | text nullable | auto-generated initiative branch (e.g., 'cw/user-auth') | | createdAt, updatedAt | integer/timestamp | | diff --git a/docs/dispatch-events.md b/docs/dispatch-events.md index 658fcdd..ca7326c 100644 --- a/docs/dispatch-events.md +++ b/docs/dispatch-events.md @@ -11,7 +11,7 @@ - **Adapter**: `TypedEventBus` using Node.js `EventEmitter` - All events implement `BaseEvent { type, timestamp, payload }` -### Event Types (55) +### Event Types (57) | Category | Events | Count | |----------|--------|-------| @@ -27,6 +27,7 @@ | **Preview** | `preview:building`, `preview:ready`, `preview:stopped`, `preview:failed` | 4 | | **Conversation** | `conversation:created`, `conversation:answered` | 2 | `conversation:created` triggers auto-resume of idle target agents via `resumeForConversation()` | | **Chat** | `chat:message_created`, `chat:session_closed` | 2 | Chat session lifecycle events | +| **Initiative** | `initiative:pending_review`, `initiative:review_approved` | 2 | Initiative-level review gate events | | **Project** | `project:synced`, `project:sync_failed` | 2 | Remote sync results from `ProjectSyncManager` | | **Log** | `log:entry` | 1 | @@ -45,6 +46,8 @@ PhaseStartedEvent { phaseId, initiativeId } MergeConflictedEvent { taskId, agentId, worktreeId, targetBranch, conflictingFiles[] } PhaseChangesRequestedEvent { phaseId, initiativeId, taskId, commentCount } AccountCredentialsRefreshedEvent { accountId, expiresAt, previousExpiresAt? } +InitiativePendingReviewEvent { initiativeId, branch } +InitiativeReviewApprovedEvent { initiativeId, branch, strategy: 'push_branch' | 'merge_and_push' } ``` ## Task Dispatch diff --git a/docs/server-api.md b/docs/server-api.md index ccc045b..fcfe641 100644 --- a/docs/server-api.md +++ b/docs/server-api.md @@ -93,6 +93,10 @@ Each procedure uses `require*Repository(ctx)` helpers that throw `TRPCError(INTE | updateInitiative | mutation | Name, status | | deleteInitiative | mutation | Cascade delete initiative and all children | | updateInitiativeConfig | mutation | mergeRequiresApproval, executionMode, branch | +| getInitiativeReviewDiff | query | Full diff of initiative branch vs project default branch | +| getInitiativeReviewCommits | query | Commits on initiative branch not on default branch | +| getInitiativeCommitDiff | query | Single commit diff for initiative review | +| approveInitiativeReview | mutation | Approve initiative review: `{initiativeId, strategy: 'push_branch' \| 'merge_and_push'}` | ### Phases | Procedure | Type | Description |