diff --git a/docs/dispatch-events.md b/docs/dispatch-events.md index dca044b..558a325 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 (57) +### Event Types (58) | Category | Events | Count | |----------|--------|-------| @@ -27,7 +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 | +| **Initiative** | `initiative:pending_review`, `initiative:review_approved`, `initiative:changes_requested` | 3 | Initiative-level review gate events | | **Project** | `project:synced`, `project:sync_failed` | 2 | Remote sync results from `ProjectSyncManager` | | **Log** | `log:entry` | 1 | @@ -48,6 +48,7 @@ PhaseChangesRequestedEvent { phaseId, initiativeId, taskId, commentCount } AccountCredentialsRefreshedEvent { accountId, expiresAt, previousExpiresAt? } InitiativePendingReviewEvent { initiativeId, branch } InitiativeReviewApprovedEvent { initiativeId, branch, strategy: 'push_branch' | 'merge_and_push' } +InitiativeChangesRequestedEvent { initiativeId, phaseId, taskId } ``` ## Task Dispatch @@ -122,4 +123,5 @@ Multiple rapid events (e.g. several `phase:queued` from `queueAllPhases`) are co - **YOLO**: phase completes → auto-merge → auto-dispatch next phase → auto-dispatch tasks - **review_per_phase**: phase completes → set `pending_review` → STOP. User approves → `approveAndMergePhase()` → merge → dispatch next phase → dispatch tasks -- **request-changes**: phase `pending_review` → user requests changes → creates revision task (category=`'review'`) → phase reset to `in_progress` → agent fixes → phase returns to `pending_review` +- **request-changes (phase)**: phase `pending_review` → user requests changes → creates revision task (category=`'review'`, dedup guard skips if active review exists) → phase reset to `in_progress` → agent fixes → phase returns to `pending_review` +- **request-changes (initiative)**: initiative `pending_review` → user requests changes → creates/reuses "Finalization" phase → creates review task → initiative reset to `active` → agent fixes → initiative returns to `pending_review` diff --git a/docs/frontend.md b/docs/frontend.md index 523bdbf..4c8ebfa 100644 --- a/docs/frontend.md +++ b/docs/frontend.md @@ -111,7 +111,7 @@ The initiative detail page has three tabs managed via local state (not URL param ### Review Components (`src/components/review/`) | Component | Purpose | |-----------|---------| -| `ReviewTab` | Review tab container — orchestrates header, diff, sidebar, and preview | +| `ReviewTab` | Review tab container — orchestrates header, diff, sidebar, and preview. Phase-level review has inline comments + Request Changes; initiative-level review has Request Changes (summary prompt) + Push Branch / Merge & Push | | `ReviewHeader` | Consolidated toolbar: phase selector pills, branch info, stats, preview controls, approve/reject actions | | `ReviewSidebar` | VSCode-style icon strip (Files/Commits views) with file list, comment counts, and commit navigation | | `DiffViewer` | Unified diff renderer with inline comments | diff --git a/docs/server-api.md b/docs/server-api.md index 90095db..337ec2a 100644 --- a/docs/server-api.md +++ b/docs/server-api.md @@ -95,6 +95,7 @@ Each procedure uses `require*Repository(ctx)` helpers that throw `TRPCError(INTE | 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'}` | +| requestInitiativeChanges | mutation | Request changes on initiative: `{initiativeId, summary}` → creates review task in Finalization phase, resets initiative to active | ### Phases | Procedure | Type | Description | @@ -115,7 +116,7 @@ Each procedure uses `require*Repository(ctx)` helpers that throw `TRPCError(INTE | getPhaseReviewCommits | query | List commits between initiative and phase branch | | getCommitDiff | query | Diff for a single commit (by hash) in a phase | | approvePhaseReview | mutation | Approve and merge phase branch | -| requestPhaseChanges | mutation | Request changes: creates revision task from unresolved comments, resets phase to in_progress | +| requestPhaseChanges | mutation | Request changes: creates revision task from unresolved comments (dedup guard skips if active review exists), resets phase to in_progress | | listReviewComments | query | List review comments by phaseId | | createReviewComment | mutation | Create inline review comment on diff | | resolveReviewComment | mutation | Mark review comment as resolved |