docs: Add initiative review gate to dispatch-events, server-api, and database docs

This commit is contained in:
Lukas May
2026-03-05 17:00:38 +01:00
parent 763871a2a5
commit dab1a2ab13
3 changed files with 9 additions and 2 deletions

View File

@@ -18,7 +18,7 @@ All adapters use nanoid() for IDs, auto-manage timestamps, and use Drizzle's `.r
|--------|------|-------| |--------|------|-------|
| id | text PK | nanoid | | id | text PK | nanoid |
| name | text NOT NULL | | | 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 | | mergeRequiresApproval | integer/boolean | default true |
| branch | text nullable | auto-generated initiative branch (e.g., 'cw/user-auth') | | branch | text nullable | auto-generated initiative branch (e.g., 'cw/user-auth') |
| createdAt, updatedAt | integer/timestamp | | | createdAt, updatedAt | integer/timestamp | |

View File

@@ -11,7 +11,7 @@
- **Adapter**: `TypedEventBus` using Node.js `EventEmitter` - **Adapter**: `TypedEventBus` using Node.js `EventEmitter`
- All events implement `BaseEvent { type, timestamp, payload }` - All events implement `BaseEvent { type, timestamp, payload }`
### Event Types (55) ### Event Types (57)
| Category | Events | Count | | Category | Events | Count |
|----------|--------|-------| |----------|--------|-------|
@@ -27,6 +27,7 @@
| **Preview** | `preview:building`, `preview:ready`, `preview:stopped`, `preview:failed` | 4 | | **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()` | | **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 | | **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` | | **Project** | `project:synced`, `project:sync_failed` | 2 | Remote sync results from `ProjectSyncManager` |
| **Log** | `log:entry` | 1 | | **Log** | `log:entry` | 1 |
@@ -45,6 +46,8 @@ PhaseStartedEvent { phaseId, initiativeId }
MergeConflictedEvent { taskId, agentId, worktreeId, targetBranch, conflictingFiles[] } MergeConflictedEvent { taskId, agentId, worktreeId, targetBranch, conflictingFiles[] }
PhaseChangesRequestedEvent { phaseId, initiativeId, taskId, commentCount } PhaseChangesRequestedEvent { phaseId, initiativeId, taskId, commentCount }
AccountCredentialsRefreshedEvent { accountId, expiresAt, previousExpiresAt? } AccountCredentialsRefreshedEvent { accountId, expiresAt, previousExpiresAt? }
InitiativePendingReviewEvent { initiativeId, branch }
InitiativeReviewApprovedEvent { initiativeId, branch, strategy: 'push_branch' | 'merge_and_push' }
``` ```
## Task Dispatch ## Task Dispatch

View File

@@ -93,6 +93,10 @@ Each procedure uses `require*Repository(ctx)` helpers that throw `TRPCError(INTE
| updateInitiative | mutation | Name, status | | updateInitiative | mutation | Name, status |
| deleteInitiative | mutation | Cascade delete initiative and all children | | deleteInitiative | mutation | Cascade delete initiative and all children |
| updateInitiativeConfig | mutation | mergeRequiresApproval, executionMode, branch | | 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 ### Phases
| Procedure | Type | Description | | Procedure | Type | Description |