@chorus-aidlc/chorus-openclaw-plugin 0.14.1 → 0.16.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -8,6 +8,21 @@ export interface DaemonTranscriptMessage {
8
8
  role: "user" | "assistant";
9
9
  text: string;
10
10
  }
11
+ /**
12
+ * Normalized per-turn token usage (daemon-token-usage). Byte-for-byte mirror of the CLI
13
+ * client's `TokenUsage` JSDoc typedef (cli/upload-hooks.mjs). All token fields + `model`
14
+ * are nullable (a backend fills only what it can obtain); `source` is always set. Tokens
15
+ * only — no cost field. The OpenClaw plugin does not currently PRODUCE this, but the wire
16
+ * contract must not drift between the two daemon hosts.
17
+ */
18
+ export interface TokenUsage {
19
+ inputTokens: number | null;
20
+ outputTokens: number | null;
21
+ cacheCreationTokens: number | null;
22
+ cacheReadTokens: number | null;
23
+ model: string | null;
24
+ source: string;
25
+ }
11
26
  /** One execution-snapshot row, in the server's exact `execution-state` shape. */
12
27
  export interface DaemonExecutionRow {
13
28
  entityType: string;
@@ -59,9 +74,12 @@ export interface CreateDaemonRestClientOptions {
59
74
  export interface DaemonRestClient {
60
75
  turnAdvance(p: {
61
76
  sessionId: string;
62
- status: "running" | "ended";
77
+ status: "running" | "ended" | "interrupted";
63
78
  entityType?: string | null;
64
79
  entityUuid?: string | null;
80
+ interruptedReason?: "user" | "crash" | "shutdown" | null;
81
+ transcriptRelayError?: string | null;
82
+ usage?: TokenUsage | null;
65
83
  }): Promise<DaemonRestResult>;
66
84
  transcript(p: {
67
85
  sessionId: string;
@@ -1 +1 @@
1
- {"version":3,"file":"daemon-rest-client.d.ts","sourceRoot":"","sources":["../src/daemon-rest-client.ts"],"names":[],"mappings":"AA4CA,MAAM,WAAW,gBAAgB;IAC/B,IAAI,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,CAAC;IAC5B,IAAI,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,CAAC;IAC5B,KA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H,wBAAgB,sBAAsB,CAAC,IAAI,EAAE,6BAA6B,GAAG,gBAAgB,CA8L5F"}
@@ -91,22 +91,33 @@ export function createDaemonRestClient(opts) {
91
91
  /**
92
92
  * POST /api/daemon/turn-advance — advance a wake's DaemonSessionTurn lifecycle.
93
93
  * The server resolves the turn by the session BUSINESS KEY (`sessionId`); the
94
- * optional `entityType`/`entityUuid` stamp the weak executionUuid link. Requires
95
- * the connectionUuid.
94
+ * optional `entityType`/`entityUuid` stamp the weak executionUuid link. A terminal
95
+ * edge may also carry `interruptedReason`, `transcriptRelayError`, and the whole
96
+ * normalized `usage` (daemon-token-usage) — byte-for-byte the CLI client's shape.
97
+ * Requires the connectionUuid.
96
98
  */
97
- async turnAdvance({ sessionId, status, entityType, entityUuid }) {
99
+ async turnAdvance({ sessionId, status, entityType, entityUuid, interruptedReason, transcriptRelayError, usage }) {
98
100
  const connectionUuid = getConnectionUuid();
99
101
  if (!connectionUuid) {
100
102
  const error = `cannot advance turn for session ${sessionId} → ${status} — no connection uuid yet`;
101
103
  logger.warn(`[Chorus] ${error}`);
102
104
  return { ok: false, status: null, error, skipped: true };
103
105
  }
106
+ // Per-turn token usage rides the TERMINAL edge only (daemon-token-usage), matching the
107
+ // CLI client. Guarded on the terminal status so a stray usage on → running is never sent.
108
+ const isTerminal = status === "ended" || status === "interrupted";
104
109
  const body = {
105
110
  connectionUuid,
106
111
  sessionId,
107
112
  status,
108
113
  // Only sent when BOTH are present, so the server never gets a partial linkage.
109
114
  ...(entityType && entityUuid ? { entityType, entityUuid } : {}),
115
+ // Only meaningful alongside status=interrupted; never sent otherwise.
116
+ ...(status === "interrupted" && interruptedReason ? { interruptedReason } : {}),
117
+ // Transcript-relay failure annotation (fix #444 follow-up): only when truthy.
118
+ ...(transcriptRelayError ? { transcriptRelayError } : {}),
119
+ // The whole normalized TokenUsage object, nested under `usage`, only on a terminal edge.
120
+ ...(usage && isTerminal ? { usage } : {}),
110
121
  };
111
122
  return post("turn-advance", "/api/daemon/turn-advance", body, `advanced turn for session ${sessionId} → ${status}`);
112
123
  },
@@ -1 +1 @@
1
- {"version":3,"file":"daemon-rest-client.js","sourceRoot":"","sources":["../src/daemon-rest-client.ts"],"names":[],"mappings":"AAAA,qDAAqD;AACrD,iFAAiF;AACjF,uDAAuD;AACvD,EAAE;AACF,6EAA6E;AAC7E,gFAAgF;AAChF,kEAAkE;AAClE,gFAAgF;AAChF,iFAAiF;AACjF,iFAAiF;AACjF,mFAAmF;AACnF,kFAAkF;AAClF,iFAAiF;AACjF,gFAAgF;AAChF,6EAA6E;AAC7E,EAAE;AACF,8EAA8E;AAC9E,kFAAkF;AAClF,qDAAqD;AACrD,uFAAuF;AACvF,mDAAmD;AACnD,iEAAiE;AACjE,wDAAwD;AACxD,gFAAgF;AAChF,2EAA2E;AAC3E,qFAAqF;AACrF,4EAA4E;AAC5E,yDAAyD;AACzD,0EAA0E;AAC1E,uEAAuE;AACvE,mFAAmF;AACnF,qDAAqD;AACrD,EAAE;AACF,kDAAkD;AAClD,qFAAqF;AACrF,uFAAuF;AACvF,yDAAyD;AACzD,gFAAgF;AAChF,mFAAmF;AACnF,qFAAqF;AACrF,6CAA6C;AAC7C,qFAAqF;AACrF,yDAAyD;AAQzD,MAAM,WAAW,GAAqB,EAAE,IAAI,KAAI,CAAC,EAAE,IAAI,KAAI,CAAC,EAAE,KAAK,KAAI,CAAC,EAAE,CAAC;AAkF3E;;;GAGG;AACH,MAAM,UAAU,sBAAsB,CAAC,IAAmC;IACxE,MAAM,GAAG,GAAG,IAAI,CAAC,GAAG,CAAC,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;IACxC,MAAM,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC;IAC3B,MAAM,iBAAiB,GAAG,IAAI,CAAC,iBAAiB,IAAI,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,CAAC;IACjE,MAAM,SAAS,GAAG,IAAI,CAAC,SAAS,IAAI,UAAU,CAAC,KAAK,CAAC;I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GACT,IAAI,IAAI,OAAO,IAAI,KAAK,QAAQ,CAAC,CAAC,CAAE,IAA4B,CAAC,KAAK,CAAC,CAAC,CAAC,SAAS,CAAC;YACrF,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC;gBAC1B,MAAM,KAAK,GAAG,oDAAoD,CAAC;gBACnE,MAAM,CAAC,IAAI,CAAC,YAAY,KAAK,EAAE,CAAC,CAAC;gBACjC,OAAO,EAAE,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,QAAQ,CAAC,MAAM,EAAE,KAAK,EAAE,CAAC;YACvD,CAAC;YACD,OAAO,EAAE,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,CAAC,MAAM,EAAE,IAAI,EAAE,EAAE,KAAK,EAAE,KAA4B,EAAE,EAAE,CAAC;QAC9F,CAAC;KACF,CAAC;AACJ,CAAC"}
1
+ {"version":3,"file":"daemon-rest-client.js","sourceRoot":"","sources":["../src/daemon-rest-client.ts"],"names":[],"mappings":"AAAA,qDAAqD;AACrD,iFAAiF;AACjF,uDAAuD;AACvD,EAAE;AACF,6EAA6E;AAC7E,gFAAgF;AAChF,kEAAkE;AAClE,gFAAgF;AAChF,iFAAiF;AACjF,iFAAiF;AACjF,mFAAmF;AACnF,kFAAkF;AAClF,iFAAiF;AACjF,gFAAgF;AAChF,6EAA6E;AAC7E,EAAE;AACF,8EAA8E;AAC9E,kFAAkF;AAClF,qDAAqD;AACrD,uFAAuF;AACvF,mDAAmD;AACnD,iEAAiE;AACjE,wDAAwD;AACxD,gFAAgF;AAChF,2EAA2E;AAC3E,qFAAqF;AACrF,4EAA4E;AAC5E,yDAAyD;AACzD,0EAA0E;AAC1E,uEAAuE;AACvE,mFAAmF;AACnF,qDAAqD;AACrD,EAAE;AACF,kDAAkD;AAClD,qFAAqF;AACrF,uFAAuF;AACvF,yDAAyD;AACzD,gFAAgF;AAChF,mFAAmF;AACnF,qFAAqF;AACrF,6CAA6C;AAC7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;gBACnE,MAAM,CAAC,IAAI,CAAC,YAAY,KAAK,EAAE,CAAC,CAAC;gBACjC,OAAO,EAAE,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,QAAQ,CAAC,MAAM,EAAE,KAAK,EAAE,CAAC;YACvD,CAAC;YACD,OAAO,EAAE,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,CAAC,MAAM,EAAE,IAAI,EAAE,EAAE,KAAK,EAAE,KAA4B,EAAE,EAAE,CAAC;QAC9F,CAAC;KACF,CAAC;AACJ,CAAC"}
@@ -67,6 +67,21 @@ export declare class ChorusEventRouter {
67
67
  * Instructs the agent to @mention the actor after completing work.
68
68
  */
69
69
  private buildMentionGuidance;
70
+ /**
71
+ * Orchestrator-handoff guidance for a wake — the OpenClaw twin of the daemon's
72
+ * orchestratorGuidance in cli/prompts.mjs. KEEP THE TWO WORDINGS IN SYNC. Returns
73
+ * null unless the resource has an AGENT orchestrator; a human-assigned resource
74
+ * hands back to the human via the actor @mention above (buildMentionGuidance).
75
+ */
76
+ private buildOrchestratorGuidance;
77
+ /**
78
+ * Append orchestrator-handoff guidance (when the resource has an agent orchestrator)
79
+ * to a wake message and dispatch it. Every handler routes its wake through this so the
80
+ * handback instruction rides EVERY action — parity with the daemon, which appends
81
+ * orchestratorGuidance once in buildPrompt (cli/prompts.mjs). No orchestrator → the
82
+ * message is dispatched unchanged.
83
+ */
84
+ private wakeWithHandoff;
70
85
  private handleTaskAssigned;
71
86
  private handleMentioned;
72
87
  private handleElaborationRequested;
@@ -1 +1 @@
1
- {"version":3,"file":"event-router.d.ts","sourceRoot":"","sources":["../src/event-router.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AACvD,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AAC9D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAEpD;;;;;;GAMG;AACH,MAAM,W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MAAM,KAAK,IAAI,CAAA;KAAE,CAAC;CACpG;AA2BD,qBAAa,iBAAiB;IAC5B,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAkB;IAC5C,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAe;IACpC,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAkB;IAC3C,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAqC;gBAEhD,IAAI,EAAE,wBAAwB;IAO1C;;;OAGG;IACH,QAAQ,CAAC,KAAK,EAAE,oBAAoB,GAAG,IAAI;IAgC3C;;;;OAIG;IACH,OAAO,CAAC,aAAa;YAIP,aAAa;IA8F3B;;;OAGG;IACH,OAAO,CAAC,oBAAoB;IAO5B;;;;;OAKG;IACH,OAAO,CAAC,yBAAyB;IAYjC;;;;;;OAMG;IACH,OAAO,CAAC,eAAe;IAUvB,OAAO,CAAC,kBAAkB;IAW1B,OAAO,CAAC,eAAe;IAavB,OAAO,CAAC,0BAA0B;IASlC,OAAO,CAAC,sBAAsB;IAc9B,OAAO,CAAC,sBAAsB;IAc9B,OAAO,CAAC,iBAAiB;IAazB,OAAO,CAAC,kBAAkB;IAU1B,OAAO,CAAC,kBAAkB;IAY1B,OAAO,CAAC,yBAAyB;IAgBjC;;;;;;OAMG;IACH,OAAO,CAAC,yBAAyB;IAcjC;;;;;;OAMG;IACH,OAAO,CAAC,sBAAsB;IAiB9B;;;;;;;;OAQG;IACH,OAAO,CAAC,mBAAmB;CAgB5B"}
@@ -147,56 +147,83 @@ export class ChorusEventRouter {
147
147
  return (`After completing your work, post a comment on this ${entityType} using chorus_add_comment with @mention:\n` +
148
148
  `Use this exact mention format: @[${n.actorName}](${n.actorType}:${n.actorUuid})`);
149
149
  }
150
+ /**
151
+ * Orchestrator-handoff guidance for a wake — the OpenClaw twin of the daemon's
152
+ * orchestratorGuidance in cli/prompts.mjs. KEEP THE TWO WORDINGS IN SYNC. Returns
153
+ * null unless the resource has an AGENT orchestrator; a human-assigned resource
154
+ * hands back to the human via the actor @mention above (buildMentionGuidance).
155
+ */
156
+ buildOrchestratorGuidance(n) {
157
+ if (n.orchestrator?.type !== "agent")
158
+ return null;
159
+ return (`Your orchestrator for this resource is @${n.orchestrator.name}.\n` +
160
+ `At a human-only gate you cannot cross, or when this child resource is complete, hand control ` +
161
+ `back by commenting on the resource and mentioning ` +
162
+ `@[${n.orchestrator.name}](agent:${n.orchestrator.uuid}) with the decision needed or completion ` +
163
+ `evidence, then leave any human-gated resource pending and end the turn. Do not @mention the ` +
164
+ `orchestrator for ordinary internal progress.`);
165
+ }
166
+ /**
167
+ * Append orchestrator-handoff guidance (when the resource has an agent orchestrator)
168
+ * to a wake message and dispatch it. Every handler routes its wake through this so the
169
+ * handback instruction rides EVERY action — parity with the daemon, which appends
170
+ * orchestratorGuidance once in buildPrompt (cli/prompts.mjs). No orchestrator → the
171
+ * message is dispatched unchanged.
172
+ */
173
+ wakeWithHandoff(message, contextKey, n, attr) {
174
+ const handoff = this.buildOrchestratorGuidance(n);
175
+ this.wake(handoff ? `${message}\n\n${handoff}` : message, contextKey, attr);
176
+ }
150
177
  handleTaskAssigned(n, attr) {
151
178
  const mentionGuidance = this.buildMentionGuidance(n, "task");
152
- this.wake(`[Chorus] Task assigned: ${n.entityTitle}. Task UUID: ${n.entityUuid}, Project UUID: ${n.projectUuid}. Use chorus_get_task to review the task, then chorus_claim_task to start work.\n${mentionGuidance}`, this.contextKeyFor("task_assigned", n.entityUuid), attr);
179
+ this.wakeWithHandoff(`[Chorus] Task assigned: ${n.entityTitle}. Task UUID: ${n.entityUuid}, Project UUID: ${n.projectUuid}. Use chorus_get_task to review the task, then chorus_claim_task to start work.\n${mentionGuidance}`, this.contextKeyFor("task_assigned", n.entityUuid), n, attr);
153
180
  }
154
181
  handleMentioned(n, attr) {
155
182
  const mentionGuidance = this.buildMentionGuidance(n, n.entityType);
156
- this.wake(`[Chorus] You were @mentioned in ${n.entityType} '${n.entityTitle}' (entityType: ${n.entityType}, entityUuid: ${n.entityUuid}, projectUuid: ${n.projectUuid}): ${n.message}\n` +
183
+ this.wakeWithHandoff(`[Chorus] You were @mentioned in ${n.entityType} '${n.entityTitle}' (entityType: ${n.entityType}, entityUuid: ${n.entityUuid}, projectUuid: ${n.projectUuid}): ${n.message}\n` +
157
184
  `Review the ${n.entityType} content and use chorus_get_comments (targetType: "${n.entityType}", targetUuid: "${n.entityUuid}") to see the full conversation, then respond.\n` +
158
- mentionGuidance, this.contextKeyFor("mentioned", n.entityUuid), attr);
185
+ mentionGuidance, this.contextKeyFor("mentioned", n.entityUuid), n, attr);
159
186
  }
160
187
  handleElaborationRequested(n, attr) {
161
- this.wake(`[Chorus] Elaboration requested for idea '${n.entityTitle}' (ideaUuid: ${n.entityUuid}, projectUuid: ${n.projectUuid}). Use chorus_get_elaboration to review questions.`, this.contextKeyFor("elaboration_requested", n.entityUuid), attr);
188
+ this.wakeWithHandoff(`[Chorus] Elaboration requested for idea '${n.entityTitle}' (ideaUuid: ${n.entityUuid}, projectUuid: ${n.projectUuid}). Use chorus_get_elaboration to review questions.`, this.contextKeyFor("elaboration_requested", n.entityUuid), n, attr);
162
189
  }
163
190
  handleProposalRejected(n, attr) {
164
191
  const mentionGuidance = this.buildMentionGuidance(n, "proposal");
165
- this.wake(`[Chorus] Proposal '${n.entityTitle}' was REJECTED (proposalUuid: ${n.entityUuid}, projectUuid: ${n.projectUuid}). Review note: "${n.message}". ` +
192
+ this.wakeWithHandoff(`[Chorus] Proposal '${n.entityTitle}' was REJECTED (proposalUuid: ${n.entityUuid}, projectUuid: ${n.projectUuid}). Review note: "${n.message}". ` +
166
193
  `Use chorus_get_proposal to review the proposal, then fix issues with chorus_update_task_draft / chorus_update_document_draft. ` +
167
194
  `After fixing, call chorus_validate_proposal then chorus_submit_proposal to resubmit.\n` +
168
- mentionGuidance, this.contextKeyFor("proposal_rejected", n.entityUuid), attr);
195
+ mentionGuidance, this.contextKeyFor("proposal_rejected", n.entityUuid), n, attr);
169
196
  }
170
197
  handleProposalApproved(n, attr) {
171
198
  const mentionGuidance = this.buildMentionGuidance(n, "proposal");
172
199
  const reviewInfo = n.message.includes("Note: ") ? ` Review note: "${n.message.split("Note: ").pop()}"` : "";
173
- this.wake(`[Chorus] Proposal '${n.entityTitle}' was APPROVED (proposalUuid: ${n.entityUuid}, projectUuid: ${n.projectUuid})!${reviewInfo} Documents and tasks have been created. ` +
200
+ this.wakeWithHandoff(`[Chorus] Proposal '${n.entityTitle}' was APPROVED (proposalUuid: ${n.entityUuid}, projectUuid: ${n.projectUuid})!${reviewInfo} Documents and tasks have been created. ` +
174
201
  `Use chorus_get_available_tasks with projectUuid: "${n.projectUuid}" to see the new tasks ready for work.\n` +
175
- mentionGuidance, this.contextKeyFor("proposal_approved", n.entityUuid), attr);
202
+ mentionGuidance, this.contextKeyFor("proposal_approved", n.entityUuid), n, attr);
176
203
  }
177
204
  handleIdeaClaimed(n, attr) {
178
205
  const mentionGuidance = this.buildMentionGuidance(n, "idea");
179
- this.wake(`[Chorus] Idea '${n.entityTitle}' has been assigned to you (ideaUuid: ${n.entityUuid}, projectUuid: ${n.projectUuid}). ` +
206
+ this.wakeWithHandoff(`[Chorus] Idea '${n.entityTitle}' has been assigned to you (ideaUuid: ${n.entityUuid}, projectUuid: ${n.projectUuid}). ` +
180
207
  `Use chorus_get_idea to review the idea, then chorus_claim_idea to start elaboration.\n` +
181
- mentionGuidance, this.contextKeyFor("idea_claimed", n.entityUuid), attr);
208
+ mentionGuidance, this.contextKeyFor("idea_claimed", n.entityUuid), n, attr);
182
209
  }
183
210
  handleTaskVerified(n, attr) {
184
- this.wake(`[Chorus] Task '${n.entityTitle}' has been verified and is now done (taskUuid: ${n.entityUuid}, projectUuid: ${n.projectUuid}). ` +
185
- `Check if this unblocks other tasks: use chorus_get_unblocked_tasks with projectUuid "${n.projectUuid}" to find tasks that are now ready to start.`, this.contextKeyFor("task_verified", n.entityUuid), attr);
211
+ this.wakeWithHandoff(`[Chorus] Task '${n.entityTitle}' has been verified and is now done (taskUuid: ${n.entityUuid}, projectUuid: ${n.projectUuid}). ` +
212
+ `Check if this unblocks other tasks: use chorus_get_unblocked_tasks with projectUuid "${n.projectUuid}" to find tasks that are now ready to start.`, this.contextKeyFor("task_verified", n.entityUuid), n, attr);
186
213
  }
187
214
  handleTaskReopened(n, attr) {
188
215
  const mentionGuidance = this.buildMentionGuidance(n, "task");
189
- this.wake(`[Chorus] Task '${n.entityTitle}' has been reopened and needs rework (taskUuid: ${n.entityUuid}, projectUuid: ${n.projectUuid}). ` +
190
- `Use chorus_get_task to review the task and chorus_get_comments to see verification feedback, then fix the issues.\n${mentionGuidance}`, this.contextKeyFor("task_reopened", n.entityUuid), attr);
216
+ this.wakeWithHandoff(`[Chorus] Task '${n.entityTitle}' has been reopened and needs rework (taskUuid: ${n.entityUuid}, projectUuid: ${n.projectUuid}). ` +
217
+ `Use chorus_get_task to review the task and chorus_get_comments to see verification feedback, then fix the issues.\n${mentionGuidance}`, this.contextKeyFor("task_reopened", n.entityUuid), n, attr);
191
218
  }
192
219
  handleElaborationAnswered(n, attr) {
193
220
  const mentionGuidance = this.buildMentionGuidance(n, "idea");
194
- this.wake(`[Chorus] Elaboration answers submitted for idea '${n.entityTitle}' (ideaUuid: ${n.entityUuid}, projectUuid: ${n.projectUuid}). ` +
221
+ this.wakeWithHandoff(`[Chorus] Elaboration answers submitted for idea '${n.entityTitle}' (ideaUuid: ${n.entityUuid}, projectUuid: ${n.projectUuid}). ` +
195
222
  `Review the answers with chorus_get_elaboration, then either:\n` +
196
223
  `- Call chorus_validate_elaboration with empty issues [] to resolve and proceed to proposal creation\n` +
197
224
  `- Call chorus_validate_elaboration with issues + followUpQuestions for another round\n\n` +
198
225
  `After reviewing, @mention the answerer to ask if they have any further questions before you proceed.\n` +
199
- mentionGuidance, this.contextKeyFor("elaboration_answered", n.entityUuid), attr);
226
+ mentionGuidance, this.contextKeyFor("elaboration_answered", n.entityUuid), n, attr);
200
227
  }
201
228
  /**
202
229
  * A human clicked "Verify Elaborate" (add-elaboration-verify-wake). The elaboration
@@ -207,10 +234,10 @@ export class ChorusEventRouter {
207
234
  */
208
235
  handleElaborationVerified(n, attr) {
209
236
  const mentionGuidance = this.buildMentionGuidance(n, "idea");
210
- this.wake(`[Chorus] Elaboration for idea '${n.entityTitle}' was VERIFIED by a human (ideaUuid: ${n.entityUuid}, projectUuid: ${n.projectUuid}). ` +
237
+ this.wakeWithHandoff(`[Chorus] Elaboration for idea '${n.entityTitle}' was VERIFIED by a human (ideaUuid: ${n.entityUuid}, projectUuid: ${n.projectUuid}). ` +
211
238
  `The idea is now elaborated — do NOT answer elaboration questions. Proceed to WRITE THE PROPOSAL: gather context with ` +
212
239
  `chorus_get_idea and chorus_get_elaboration, then author the proposal via the existing proposal flow ` +
213
- `(chorus_pm_create_proposal / the proposal skill).\n${mentionGuidance}`, this.contextKeyFor("elaboration_verified", n.entityUuid), attr);
240
+ `(chorus_pm_create_proposal / the proposal skill).\n${mentionGuidance}`, this.contextKeyFor("elaboration_verified", n.entityUuid), n, attr);
214
241
  }
215
242
  /**
216
243
  * A human clicked "Start Development" (add-stage-advance-start-development). The idea's
@@ -221,13 +248,13 @@ export class ChorusEventRouter {
221
248
  */
222
249
  handleStartDevelopment(n, attr) {
223
250
  const mentionGuidance = this.buildMentionGuidance(n, "idea");
224
- this.wake(`[Chorus] A human started DEVELOPMENT for idea '${n.entityTitle}' (ideaUuid: ${n.entityUuid}, projectUuid: ${n.projectUuid}). ` +
251
+ this.wakeWithHandoff(`[Chorus] A human started DEVELOPMENT for idea '${n.entityTitle}' (ideaUuid: ${n.entityUuid}, projectUuid: ${n.projectUuid}). ` +
225
252
  `The idea's proposal is approved and unfinished tasks remain. Claim and execute ALL remaining tasks of that proposal in ` +
226
253
  `dependency order, following the develop workflow: repeatedly find claimable tasks (chorus_get_unblocked_tasks with ` +
227
254
  `projectUuid: "${n.projectUuid}"), claim one (chorus_claim_task), implement it, self-check its acceptance criteria ` +
228
255
  `(chorus_report_criteria_self_check), and submit it (chorus_submit_for_verify) — then loop until NO claimable task remains. ` +
229
256
  `Do NOT stop after one task. Leave tasks already in to_verify (awaiting human verification) and tasks claimed by other ` +
230
- `sessions untouched. If nothing is claimable, post a brief status comment on the idea and end the turn.\n${mentionGuidance}`, this.contextKeyFor("start_development", n.entityUuid), attr);
257
+ `sessions untouched. If nothing is claimable, post a brief status comment on the idea and end the turn.\n${mentionGuidance}`, this.contextKeyFor("start_development", n.entityUuid), n, attr);
231
258
  }
232
259
  /**
233
260
  * A human clicked "Yolo" (add-stage-advance-yolo). Unlike start_development (always the
@@ -240,13 +267,13 @@ export class ChorusEventRouter {
240
267
  */
241
268
  handleYoloRequested(n, attr) {
242
269
  const mentionGuidance = this.buildMentionGuidance(n, "idea");
243
- this.wake(`[Chorus] A human requested a YOLO run for idea '${n.entityTitle}' (ideaUuid: ${n.entityUuid}, projectUuid: ${n.projectUuid}). ` +
270
+ this.wakeWithHandoff(`[Chorus] A human requested a YOLO run for idea '${n.entityTitle}' (ideaUuid: ${n.entityUuid}, projectUuid: ${n.projectUuid}). ` +
244
271
  `Drive this idea all the way to done following the yolo skill (the full-auto AI-DLC pipeline: Idea → Elaboration → Proposal → ` +
245
272
  `Execute → Verify). First read the idea's current state with chorus_get_idea (plus chorus_get_elaboration / ` +
246
273
  `chorus_get_proposals as needed) and RESUME from whatever phase it is already in — do NOT assume a fixed stage: if ` +
247
274
  `elaboration isn't resolved, self-elaborate then write the proposal; if a proposal is approved with open tasks, execute them; ` +
248
275
  `and so on. Complete the pipeline through the final done state and completion report, but do NOT merge or push a pull request ` +
249
- `without explicit human approval.\n${mentionGuidance}`, this.contextKeyFor("yolo_requested", n.entityUuid), attr);
276
+ `without explicit human approval.\n${mentionGuidance}`, this.contextKeyFor("yolo_requested", n.entityUuid), n, attr);
250
277
  }
251
278
  }
252
279
  //# sourceMappingURL=event-router.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"event-router.js","sourceRoot":"","sources":["../src/event-router.ts"],"names":[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BAAgB,EAAE,CAAC,CAAC,UAAU,CAAC,EAClD,CAAC,EACD,IAAI,CACL,CAAC;IACJ,CAAC;CACF"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@chorus-aidlc/chorus-openclaw-plugin",
3
- "version": "0.14.1",
3
+ "version": "0.16.2",
4
4
  "description": "OpenClaw plugin for Chorus AI-DLC collaboration platform — native MCP + SSE real-time events",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -4,7 +4,7 @@ description: Optional divergent-then-convergent dialogue for fuzzy ideas. Invoke
4
4
  license: AGPL-3.0
5
5
  metadata:
6
6
  author: chorus
7
- version: "0.14.1"
7
+ version: "0.16.2"
8
8
  category: project-management
9
9
  mcp_server: chorus
10
10
  ---
@@ -4,7 +4,7 @@ description: Chorus AI Agent collaboration platform — overview, common tools,
4
4
  license: AGPL-3.0
5
5
  metadata:
6
6
  author: chorus
7
- version: "0.14.1"
7
+ version: "0.16.2"
8
8
  category: project-management
9
9
  mcp_server: chorus
10
10
  ---
@@ -71,7 +71,7 @@ All Agent roles can use the following tools for querying information and collabo
71
71
 
72
72
  The checkin response includes **owner/master information** for the agent:
73
73
  - `agent.owner`: `{ uuid, name, email }` or `null` — the human user who owns this agent
74
- - Use the owner info to know who to @mention for confirmations and approvals
74
+ - Use the owner info as one @mention target — but hand a finished or gated resource back to whoever engaged you (the human or agent that assigned, @mentioned, or woke you), which is not always your owner
75
75
 
76
76
  #### Project Filtering
77
77
 
@@ -130,7 +130,7 @@ Projects can be organized into **Project Groups** — a single-level grouping th
130
130
 
131
131
  ### Reports
132
132
 
133
- A **report** is a short idea-completion summary persisted as a `type="report"` Document at end-of-Idea, authored via `chorus_create_report` (gated on `document:write`). The tool's description carries the section template — read it there. `/yolo` writes one mandatorily; `/develop` offers it advisorily on last-task verify.
133
+ A **report** is a short idea-completion summary persisted as a `type="report"` Document at end-of-Idea, authored via `chorus_create_report` (gated on `document:write`). The `content` parameter's description carries the section template — read it there. `/yolo` writes one mandatorily; `/develop` offers it advisorily on last-task verify.
134
134
 
135
135
  ### References
136
136
 
@@ -197,14 +197,14 @@ Use @mentions to notify specific users or agents. Mention syntax: `@[DisplayName
197
197
  **When to @mention:**
198
198
  - **Elaboration completion** — confirm understanding with the answerer before validating (see `/idea`)
199
199
  - **Proposal creation/update** — notify stakeholders when submitting
200
- - **Task submission** — notify PM/owner for significant decisions
200
+ - **Handback & significant decisions** — @mention whoever engaged you (a human, or an agent orchestrator), not only the PM/owner
201
201
  - **Blocking issues** — notify relevant person for human input
202
202
 
203
203
  ### Search
204
204
 
205
205
  | Tool | Purpose |
206
206
  |------|---------|
207
- | `chorus_search` | Search across tasks, ideas, proposals, documents, projects, and project groups |
207
+ | `chorus_search` | Search compact summaries across tasks, ideas, proposals, documents, projects, and project groups; canonical UUIDs use exact lookup |
208
208
 
209
209
  **Parameters:**
210
210
  - `query`: Search query string
@@ -212,6 +212,8 @@ Use @mentions to notify specific users or agents. Mention syntax: `@[DisplayName
212
212
  - `scopeUuid`: Project group UUID (when scope=group) or project UUID (when scope=project)
213
213
  - `entityTypes`: Array of entity types to search (default: all types)
214
214
 
215
+ Prefer `chorus__chorus_search` for discovery, including exact UUID lookup. Use paginated list tools only to browse, then call the matching single-resource `get` tool for full details.
216
+
215
217
  ### Notifications
216
218
 
217
219
  | Tool | Purpose |
@@ -317,7 +319,20 @@ The plugin bundles three independent **review skills**: `/proposal-reviewer`, `/
317
319
 
318
320
  **How review runs on OpenClaw.** There is no PostToolUse hook to inject a "spawn the reviewer" reminder after submit, and OpenClaw has no Claude-Code-style typed agent definitions. Instead, the proposal/develop/yolo skills put the reviewer step **inline**: the orchestrating agent uses the OpenClaw `sessions_spawn` tool to spawn a sub-agent and instructs it (in the spawn `task`) to **run the `/proposal-reviewer`, `/task-reviewer`, or `/code-reviewer` skill** against the entity (passing the `ideaUuid` for code review), then waits for the VERDICT (poll `subagents` / `sessions_yield`). Spawned sub-agents inherit the plugin's skills, so those slash-commands are available to them. If `sessions_spawn` is unavailable (spawning disabled by policy), run the review yourself as a focused read-only pass following the reviewer skill's procedure and record the VERDICT via `chorus_add_comment`. See the relevant stage skill for the exact procedure.
319
321
 
320
- Results are advisory — they do not hard-block approval, verification, or ship (the code-review gateway is behavioral — it does not change the Idea's stored status), but you should act on a FAIL by fixing the listed BLOCKERs before proceeding. For a code-review FAIL, fix it via the **quick-dev** workflow (`/quick-dev`): `chorus_create_tasks` with `proposalUuid` set to the current approved proposal so the fix tasks attach to it (do not reopen old tasks), then execute verify and re-run.
322
+ Results are advisory — they do not hard-block approval, verification, or ship (the code-review gateway is behavioral — it does not change the Idea's stored status), but you should act on a FAIL by fixing the listed BLOCKERs before proceeding. For a code-review FAIL, the orchestrator invokes **quick-dev** (`/quick-dev`) to create new tasks on the original approved proposal; it does not reopen completed tasks or apply untracked fixes. Group related small BLOCKERs by default and split only materially large or independently testable fixes. Every fix task must pass AC self-check, independent task review, and admin verification. Re-run aggregate review only after all fixes are successfully `done`; a failed or cancelled fix stops the loop and escalates. Keep `maxCodeReviewRounds` authoritative.
323
+
324
+ ### 6. Enable OpenSpec Mode (Optional)
325
+
326
+ Opt-in spec-driven path: `/proposal`, `/develop`, `/yolo` write `proposal.md` / `design.md` / spec deltas on disk and mirror them into Chorus drafts. Fully optional — free-form authoring works without it. The stage skills re-check the three activation signals inline (OpenClaw has no SessionStart hook): `CHORUS_OPENSPEC_MODE` ≠ `off`, an `openspec/` directory at the project root, and the `openspec` CLI on `PATH`.
327
+
328
+ **When the user wants it on**, actually **enable it for them** — run whichever steps are missing, don't just describe them:
329
+
330
+ ```bash
331
+ npm i -g @fission-ai/openspec # 1. install the CLI if it's not on PATH (global, pure Node)
332
+ openspec init --tools none # 2. scaffold the openspec/ directory
333
+ ```
334
+
335
+ OpenSpec has no OpenClaw integration (it's not in the `--tools` list), so `--tools none` is correct — Chorus's detection only needs the `openspec/` directory and the stage skills drive the CLI directly. There's no SessionStart banner on OpenClaw — the stage skills re-check the three signals inline, so once the directory and CLI are both present they fold in `/openspec-aware` automatically. To turn it off, set `CHORUS_OPENSPEC_MODE=off`.
321
336
 
322
337
  ---
323
338
 
@@ -439,6 +454,7 @@ This is the core overview skill. For stage-specific workflows, use:
439
454
  | **Planning** | `/proposal` | Create Proposals with document & task drafts, manage dependency DAG, submit for review |
440
455
  | **Development** | `/develop` | Claim Tasks, report work, manual session & sub-agent management |
441
456
  | **Review** | `/review` | Approve/reject Proposals, verify Tasks, project governance |
457
+ | **Docs** | `/docs` | Consult the live Chorus documentation site to answer product-usage questions — UI workflow, agent/plugin setup, API/MCP, deployment, operations |
442
458
  | **OpenSpec mode** | `openspec-aware` | Opt-in **shared sub-procedure** invoked by `/proposal`, `/develop`, and `/yolo` whenever the user has the `openspec` CLI installed. Scaffolds `openspec/changes/<slug>/` on disk and mirrors files into Chorus document drafts via the `chorus-api.sh` wrapper. Runs an inline three-check detection (no SessionStart hook on OpenClaw). Skips silently in fallback mode. |
443
459
 
444
460
  ### Getting Started
@@ -4,7 +4,7 @@ description: Final ship-time review of an Idea's aggregate code change — the w
4
4
  license: AGPL-3.0
5
5
  metadata:
6
6
  author: chorus
7
- version: "0.14.1"
7
+ version: "0.16.2"
8
8
  category: project-management
9
9
  mcp_server: chorus
10
10
  ---
@@ -56,7 +56,7 @@ Read each task's work report (in its comments) — the developers describe what
56
56
  **Step 3: Review the whole-feature dimensions** (what per-task review cannot catch — cover each):
57
57
 
58
58
  1. **Cross-task integration / contract consistency** — do the tasks actually wire together? Interface contracts, return formats, error patterns, call points across module boundaries different tasks built.
59
- 2. **Architecture & convention consistency (no drift)** — does the aggregate conform to project patterns, or did tasks each invent their own approach? Duplicated logic, divergent naming, inconsistent layering.
59
+ 2. **Architecture & convention consistency (no drift)** — does the aggregate conform to project patterns and the rules its context files declare (CLAUDE.md / AGENTS.md / .cursorrules, if present), or did any task drift from them or violate a declared project-level constraint? Duplicated logic, divergent naming, inconsistent layering.
60
60
  3. **Security** — does the combination introduce a security risk (authz gaps at a seam, injection, secret handling, unsafe deserialization, missing tenant scoping) — especially risks visible only when the pieces are seen together.
61
61
  4. **Regression risk / impact on untouched areas / performance** — does the change break or degrade code no single task owned? N+1s, hot-path cost, shared-state contention.
62
62
  5. **Feature-level test coverage adequacy** — across the whole feature, are integration seams and end-to-end paths tested, or only per-task units? Gaps between tasks.
@@ -124,4 +124,4 @@ chorus_add_comment({
124
124
  })
125
125
  ```
126
126
 
127
- On a FAIL verdict, the orchestrator creates new fix tasks on the existing approved proposal (it does NOT reopen old tasks); once those are done, you are re-run for the next round, bounded by the configured max review rounds.
127
+ On FAIL, remain read-only. The orchestrator, not the reviewer, invokes Quick Dev to create new fix tasks on the original approved proposal; it never reopens completed tasks or applies untracked fixes. It groups related small BLOCKERs by default and splits only materially large or independently testable work. Every fix task must pass AC self-check, independent task review, and admin verification. You are re-run only after all fix tasks are successfully `done`; a failed or cancelled fix stops the loop and escalates. The configured maximum review rounds remains authoritative.
@@ -4,7 +4,7 @@ description: Chorus Development workflow — claim tasks, report work, manage se
4
4
  license: AGPL-3.0
5
5
  metadata:
6
6
  author: chorus
7
- version: "0.14.1"
7
+ version: "0.16.2"
8
8
  category: project-management
9
9
  mcp_server: chorus
10
10
  ---
@@ -257,7 +257,7 @@ Obtain an independent VERDICT before the task is verified:
257
257
 
258
258
  If you spawned a sub-agent and no new `VERDICT:` comment appears after it returns, it exhausted its turn budget. Respawn it ONCE with a concise-budget hint: *"Stay within turn budget. Skip deep verification. Fetch task/proposal/comments, run only the core tests, and post your VERDICT within the first 12 turns."* If the second attempt still produces no VERDICT, fall back to reviewing manually (Step 8.5 fallback) and post the VERDICT yourself.
259
259
 
260
- > **Final code-review gateway (after the Idea's LAST task is verified):** when the task you just verified is the **last** task of its idea-rooted proposal, the feature is about to ship — run the ship-time code-review gateway before declaring the Idea done. Inline (no hook on OpenClaw), same mechanism as Step 8.5: spawn a sub-agent via `sessions_spawn` whose `task` tells it to **invoke the `/code-reviewer` skill** against the idea (pass the `ideaUuid` + round number), and wait for it; fallback is a read-only self-review following the `/code-reviewer` procedure. It reviews the Idea's **aggregate** code change (cross-task integration, architecture, security, regression, feature-level coverage) and posts one `VERDICT:` comment on the **idea**. `PASS` / `PASS WITH NOTES` → ship; `FAIL` → fix via the **quick-dev** workflow (`/quick-dev`): `chorus_create_tasks` with `proposalUuid` set to the **current approved proposal** so the fix tasks attach to it (do not reopen old tasks), then execute verify and re-run the gateway. Advisory/behavioral. Run it **before** any idea-completion report.
260
+ > **Final code-review gateway (after the Idea's LAST task is verified):** when the task you just verified is the **last** task of its idea-rooted proposal, the feature is about to ship — run the ship-time code-review gateway before declaring the Idea done. Inline (no hook on OpenClaw), same mechanism as Step 8.5: spawn a sub-agent via `sessions_spawn` whose `task` tells it to **invoke the `/code-reviewer` skill** against the idea (pass the `ideaUuid` + round number), and wait for it; fallback is a read-only self-review following the `/code-reviewer` procedure. It reviews the Idea's **aggregate** code change (cross-task integration, architecture, security, regression, feature-level coverage) and posts one `VERDICT:` comment on the **idea**. `PASS` / `PASS WITH NOTES` → ship; `FAIL` → fix via the **quick-dev** workflow (`/quick-dev`): `chorus_create_tasks` with `proposalUuid` set to the **current approved proposal** so the fix tasks attach to it (do not reopen old tasks). Group related small BLOCKERs into one cohesive task by default; split only materially large or independently testable fixes. Each fix task must self-check its acceptance criteria and pass independent task review plus admin verification. Re-run the gateway only after every fix task is successfully `done`; if there is a failed or cancelled fix task, stop and escalate instead. Advisory/behavioral. Run it **before** any idea-completion report.
261
261
 
262
262
  ### Step 9: Handle Review Feedback
263
263
 
@@ -279,7 +279,7 @@ Once Admin verifies (status: `done`), move to the next available task (back to S
279
279
 
280
280
  ### Step 11: Idea Completion Report (advisory)
281
281
 
282
- If the task you just self-verified was the LAST one of its Idea (every Task across every approved Proposal is now `done`/`closed`) and you have `document:write`, offer to call `chorus_create_report`. On OpenClaw, ask the user as a plain-text prompt (e.g. "This was the last task of the idea. Want me to write a completion report? Reply yes/no.") — there is no `AskUserQuestion` primitive. The tool description carries the section template. Skip on decline.
282
+ If the task you just self-verified was the LAST one of its Idea (every Task across every approved Proposal is now `done`/`closed`) and you have `document:write`, offer to call `chorus_create_report`. On OpenClaw, ask the user as a plain-text prompt (e.g. "This was the last task of the idea. Want me to write a completion report? Reply yes/no.") — there is no `AskUserQuestion` primitive. The `content` parameter's description carries the section template. Skip on decline.
283
283
 
284
284
  ---
285
285
 
@@ -0,0 +1,68 @@
1
+ ---
2
+ name: docs
3
+ description: Chorus documentation router — consult the live Chorus docs site to answer product-usage questions (UI workflow, agent/plugin setup, API/MCP, deployment, operations).
4
+ license: AGPL-3.0
5
+ metadata:
6
+ author: chorus
7
+ version: "0.16.2"
8
+ category: project-management
9
+ mcp_server: chorus
10
+ ---
11
+
12
+ # Docs Skill
13
+
14
+ This skill is a **thin router to the live Chorus documentation site** (`https://doc.chorus-ai.dev`). Use it to answer questions about **how to use, configure, deploy, or operate Chorus** — grounding the answer in the current published docs instead of memory.
15
+
16
+ It is **not** a workflow skill: it does not drive the AI-DLC pipeline. For that, use `/idea`, `/proposal`, `/develop`, `/review`, or `/yolo`.
17
+
18
+ ---
19
+
20
+ ## When to Use
21
+
22
+ Use this skill whenever the user asks a **product-usage** question about Chorus, such as:
23
+
24
+ - **UI workflow** — how the Idea → Proposal → Task → Verify pipeline works in the web app, what a control does, how statuses flow.
25
+ - **Agent setup** — creating an API key, permissions and role presets, connecting an agent.
26
+ - **Plugin setup** — installing/configuring the Claude Code / Codex / OpenClaw / Kiro / Pi plugin.
27
+ - **API / MCP** — the REST API, the MCP tool surface, authentication, real-time events.
28
+ - **Deployment** — self-hosting, the CDK stack, environment configuration.
29
+ - **Operations / troubleshooting** — running Chorus, diagnosing connection or setup problems.
30
+
31
+ Do **NOT** use it to *drive* the pipeline (claiming ideas, writing proposals, executing tasks) — that is what the stage skills above are for. This skill answers "how does the product work / how do I set it up"; the stage skills *do* the work.
32
+
33
+ ---
34
+
35
+ ## Access Convention
36
+
37
+ The docs site is agent-friendly. Follow this three-step convention every time. **Do NOT** answer from memory, and **do NOT** hardcode a page list — the index is the source of truth and pages change over time.
38
+
39
+ 1. **Fetch the index.** Get `https://doc.chorus-ai.dev/llms.txt` — a machine-readable index that lists every documentation page with a one-line summary and its `.md` URL. **The index is a single, unlocalized file that lives ONLY at the root `/llms.txt`. Never prefix it with a locale — `https://doc.chorus-ai.dev/zh/llms.txt` (and `/ja/`, `/ko/`) does NOT exist and returns 404.**
40
+ 2. **Fetch the relevant page(s) as raw Markdown.** Pick the page(s) that match the question from the index, then fetch the raw Markdown by **appending `.md`** to the page URL (e.g. `https://doc.chorus-ai.dev/guides/getting-started` → `https://doc.chorus-ai.dev/guides/getting-started.md`).
41
+ 3. **Ground the answer and link the human page.** Base your answer on the fetched Markdown, and link the human-facing page (the `.md` URL **without** the `.md` suffix) so the user can open it in a browser.
42
+
43
+ Use whatever web-fetch capability your environment provides (your built-in fetch tool, `curl`, etc.) — this skill states the convention, not a specific tool binding.
44
+
45
+ ---
46
+
47
+ ## Locale
48
+
49
+ The `/llms.txt` index itself is **not** localized — there is exactly one, at the root. Localization applies to **pages**, not the index:
50
+
51
+ - The index always lives at `https://doc.chorus-ai.dev/llms.txt` and lists the root (`en`) page URLs. **Do not look for `/zh/llms.txt` — it does not exist.**
52
+ - `en` is the root (unprefixed): `https://doc.chorus-ai.dev/...`
53
+ - `zh`, `ja`, `ko` are **path-prefixed pages**: take a page path from the index and prepend the locale — `https://doc.chorus-ai.dev/zh/...`, `/ja/...`, `/ko/...`
54
+ - Appending `.md` works on the prefixed pages too (e.g. `https://doc.chorus-ai.dev/zh/guides/getting-started.md`).
55
+ - **Match the user's language** when the docs exist in it; fall back to `en` otherwise.
56
+
57
+ ---
58
+
59
+ ## Relationship to the Workflow Skills
60
+
61
+ This skill **complements** the AI-DLC workflow skills — it does not replace them:
62
+
63
+ | The user wants to… | Use |
64
+ |--------------------|-----|
65
+ | Learn how to use / configure / deploy / operate Chorus | **this skill** (`/docs`) |
66
+ | Drive an idea / write a proposal / execute or verify a task | `/idea`, `/proposal`, `/develop`, `/review`, `/yolo` |
67
+
68
+ Always use the live host `doc.chorus-ai.dev`. `docs.chorus-ai.dev` (with an "s") is a dead link — never use it.
@@ -4,7 +4,7 @@ description: Chorus Idea workflow — claim ideas, run elaboration rounds, and p
4
4
  license: AGPL-3.0
5
5
  metadata:
6
6
  author: chorus
7
- version: "0.14.1"
7
+ version: "0.16.2"
8
8
  category: project-management
9
9
  mcp_server: chorus
10
10
  ---
@@ -4,7 +4,7 @@ description: Opt-in OpenSpec-mode authoring for Chorus PM workflows on OpenClaw.
4
4
  license: AGPL-3.0
5
5
  metadata:
6
6
  author: chorus
7
- version: "0.14.1"
7
+ version: "0.16.2"
8
8
  category: project-management
9
9
  mcp_server: chorus
10
10
  ---
@@ -4,7 +4,7 @@ description: Chorus Proposal workflow — create proposals with document and tas
4
4
  license: AGPL-3.0
5
5
  metadata:
6
6
  author: chorus
7
- version: "0.14.1"
7
+ version: "0.16.2"
8
8
  category: project-management
9
9
  mcp_server: chorus
10
10
  ---
@@ -4,7 +4,7 @@ description: Adversarial read-only review of a submitted Chorus proposal — doc
4
4
  license: AGPL-3.0
5
5
  metadata:
6
6
  author: chorus
7
- version: "0.14.1"
7
+ version: "0.16.2"
8
8
  category: project-management
9
9
  mcp_server: chorus
10
10
  ---
@@ -52,6 +52,7 @@ chorus_get_elaboration({ ideaUuid: "<idea-uuid>" })
52
52
  - **Tech feasibility**: Does the architecture make sense? Missing auth, race conditions, no error handling?
53
53
  - **Module contracts**: If multiple tasks share interfaces, are return formats, error patterns, and call points defined?
54
54
  - **Hallucination risk**: Flag any specific external detail that looks LLM-fabricated (API signatures, model IDs, SDK versions, CLI flags, config keys, endpoint paths) as NOTE. The PM is an LLM — it confidently invents plausible-looking specifics.
55
+ - **Project constraints**: If the repo declares project rules in context files (CLAUDE.md / AGENTS.md / .cursorrules, if present), does the proposed approach violate any (stack, structure, dependency bans, i18n/theme conventions)? Conflict → BLOCKER.
55
56
 
56
57
  **Step 3: Review task drafts** — for each task draft, check:
57
58
  - **Granularity**: Each task should be cohesive and independently testable. 2–10 AC items is the sweet spot.
@@ -4,7 +4,7 @@ description: Quick Task workflow — skip Idea→Proposal, create tasks directly
4
4
  license: AGPL-3.0
5
5
  metadata:
6
6
  author: chorus
7
- version: "0.14.1"
7
+ version: "0.16.2"
8
8
  category: project-management
9
9
  mcp_server: chorus
10
10
  ---
@@ -22,7 +22,7 @@ Skip the full AI-DLC pipeline (Idea → Elaboration → Proposal → Approval) a
22
22
  The standard AI-DLC flow ensures quality through structured planning, but adds overhead that slows down small tasks. Quick Dev provides a lightweight alternative:
23
23
 
24
24
  ```
25
- [check admin role]chorus_create_taskschorus_claim_taskin_progress → report → self-check AC → submit for verify[self-verify if admin] → done
25
+ check explicit task:admin permissioncreate/claimimplement → self-check AC → submit independent task review → verify or hand off
26
26
  ```
27
27
 
28
28
  **Use Quick Dev when:**
@@ -42,13 +42,11 @@ For complex work, use `/idea` + `/proposal` instead.
42
42
 
43
43
  ---
44
44
 
45
- ## Pre-Flight: Admin Self-Verify Check
45
+ ## Pre-Flight: Permission Check
46
46
 
47
- **Before creating tasks**, if `chorus_checkin().agent.permissions.task` includes `"admin"`, ask the user (as a **plain-text prompt** — OpenClaw has no `AskUserQuestion`):
47
+ Call `chorus_checkin` and inspect the active agent's effective permissions. Set `canVerifyTask` to true **only** when `chorus_checkin().agent.permissions.task` explicitly contains `"admin"` (the `task:admin` permission).
48
48
 
49
- > "I have admin privileges. After development, should I verify the task myself, or leave it for another admin to verify? Reply 'self' or 'other'."
50
-
51
- This matters because admin agents can call `chorus_admin_verify_task` to close the loop autonomously. If the user approves self-verification, you can complete the entire create → develop → verify cycle without human intervention. Record the decision and apply it in Step 7.
49
+ Never infer verification authority from the agent's name, persona, preset/role label, task ownership, or tool availability. Do not prompt the user to choose: the explicit permission determines the terminal path.
52
50
 
53
51
  ---
54
52
 
@@ -147,7 +145,7 @@ chorus_report_criteria_self_check({
147
145
  })
148
146
  ```
149
147
 
150
- ### Step 7: Submit for Verification (or Self-Verify)
148
+ ### Step 7: Submit and Run Independent Review
151
149
 
152
150
  ```
153
151
  chorus_submit_for_verify({
@@ -156,15 +154,19 @@ chorus_submit_for_verify({
156
154
  })
157
155
  ```
158
156
 
159
- **Admin self-verification:** If you have `task: ["admin"]` in `permissions` and the user approved self-verification in the Pre-Flight check, you can verify the task yourself immediately after submitting:
157
+ Submitting is not final verification. Spawn the required task-reviewer skill through `sessions_spawn` as described in `/develop`, wait for it, and read the newest `VERDICT:` Task comment. `PASS` and `PASS WITH NOTES` continue. On `FAIL`, do not verify or hand off: fix every unresolved BLOCKER, repeat AC self-check and submission, then run a fresh independent task review.
158
+
159
+ ### Step 8: Permission-Aware Verification
160
+
161
+ With explicit `task:admin`, after every required AC self-check passes and independent review has no unresolved BLOCKER, verify and continue autonomously:
160
162
 
161
163
  ```
162
164
  chorus_admin_verify_task({ taskUuid: "<task-uuid>" })
163
165
  ```
164
166
 
165
- This completes the full autonomous cycle: create develop verify done.
167
+ Without explicit `task:admin`, do not call the admin tool. Post an evidence-rich comment on the Task containing AC results, test evidence, the latest independent-review verdict, and the exact requested action. @mention the responsible human (prefer `chorus_checkin().agent.owner`) to perform admin verification, then end the current turn.
166
168
 
167
- > **Optional independent review:** for non-trivial quick tasks you may still run the `/task-reviewer` skill in a spawned sub-agent (`sessions_spawn` with a task telling it to run `/task-reviewer` against the taskUuid, then wait for the VERDICT) or do a focused read-only self-review before verifying — same pattern as `/develop` Step 8.5. There is no PostToolUse hook on OpenClaw, so do this inline if you want it.
169
+ This handoff applies in interactive and headless daemon sessions. Do not send a plain-text interactive prompt, poll for the human response, or rely only on generic notifications.
168
170
 
169
171
  ---
170
172
 
@@ -186,7 +188,7 @@ Quick Tasks support sub-agent execution just like proposal-based tasks. **Sessio
186
188
  - Use `chorus_update_task` to refine tasks (including AC) after creation rather than deleting and recreating
187
189
  - Pass `proposalUuid` to attach follow-up or gap-filling tasks to an existing proposal — this keeps related work grouped in the same project context and DAG
188
190
  - Quick Tasks show up in the same project task list and DAG as proposal-based tasks
189
- - Admin agents can run the full lifecycle autonomously (create develop self-verify) but always confirm with the user first (plain-text prompt)
191
+ - Agents with explicit `task:admin` continue autonomously after AC and independent review pass; all others use the evidence-rich asynchronous human handoff
190
192
 
191
193
  ---
192
194
 
@@ -4,7 +4,7 @@ description: Chorus Review workflow — approve/reject proposals, verify tasks,
4
4
  license: AGPL-3.0
5
5
  metadata:
6
6
  author: chorus
7
- version: "0.14.1"
7
+ version: "0.16.2"
8
8
  category: project-management
9
9
  mcp_server: chorus
10
10
  ---
@@ -70,7 +70,7 @@ When reviewing proposals, tasks, or an Idea's final aggregate code change, get a
70
70
  2. **Read the VERDICT.** After the reviewer completes, call `chorus_get_comments` and find the most recent comment containing `VERDICT:`. There are exactly three possible outcomes:
71
71
  - **VERDICT: PASS** — No issues found. Approve (proposals) or mark AC passed and verify (tasks).
72
72
  - **VERDICT: PASS WITH NOTES** — Minor non-blocking notes. Still approve/verify. Notes are informational.
73
- - **VERDICT: FAIL** — BLOCKERs found. Reject (proposals) or reopen (tasks). For a **code-review gateway** FAIL, do not reopen the verified tasks — instead fix via the **quick-dev** workflow (`/quick-dev`): `chorus_create_tasks` with `proposalUuid` set to the current approved proposal so the fix tasks attach to it, then execute verify and re-run the gateway. Fix the specific BLOCKERs listed in the comment before resubmitting.
73
+ - **VERDICT: FAIL** — BLOCKERs found. Reject (proposals) or reopen (tasks). For a **code-review gateway** FAIL, do not reopen the verified tasks — instead fix via the **quick-dev** workflow (`/quick-dev`): `chorus_create_tasks` with `proposalUuid` set to the current approved proposal so the fix tasks attach to it. Group related small BLOCKERs into one cohesive task by default; split only materially large or independently testable fixes. Each fix task must self-check its acceptance criteria and pass independent task review plus admin verification. Re-run the gateway only after every fix task is successfully `done`; if there is a failed or cancelled fix task, stop and escalate instead. Fix the specific BLOCKERs listed in the comment before resubmitting.
74
74
  3. **No new VERDICT comment?** The sub-agent exhausted its turn budget before posting. Respawn it ONCE with an explicit prompt like: *"Stay within your turn budget. Skip deep source verification — batch all MCP fetches up front, skim for obvious BLOCKERs only, and reserve your last few turns to post the VERDICT comment."* If the second attempt also fails to post, review manually (step 5).
75
75
  4. **Track rounds.** Count existing VERDICT comments before spawning. After 3 rounds of FAIL on the same item, stop the loop and escalate to human review.
76
76
  5. **Fallback — review it yourself (no `sessions_spawn` on the host).** If spawning is unavailable (disabled by policy, or the spawn fails), perform the review yourself as a **focused, read-only pass** using the quality checklists in the workflows below: read the entity, its comments, and the relevant documents/code, run read-only test/build commands where applicable, and do NOT modify anything. Then record your VERDICT via `chorus_add_comment` ending with a `VERDICT:` line (PASS / PASS WITH NOTES / FAIL), classifying every finding as BLOCKER or NOTE. The `/proposal-reviewer`, `/task-reviewer`, and `/code-reviewer` skills are the authoritative checklists for this manual pass — read the relevant one and follow its procedure.
@@ -4,7 +4,7 @@ description: Adversarial verification of a submitted Chorus task against its AC
4
4
  license: AGPL-3.0
5
5
  metadata:
6
6
  author: chorus
7
- version: "0.14.1"
7
+ version: "0.16.2"
8
8
  category: project-management
9
9
  mcp_server: chorus
10
10
  ---
@@ -50,7 +50,7 @@ chorus_get_document({ documentUuid: "<doc-uuid>" })
50
50
 
51
51
  **Step 3: Verify each AC independently.** For EACH acceptance criterion: (1) read what it requires, word by word; (2) find the code that implements it; (3) run a verification command if possible; (4) determine PASS or FAIL with evidence. Do NOT batch AC as "all look good." Check each one.
52
52
 
53
- **Step 4: Cross-reference with proposal documents.** Does the PRD mention fields, behaviors, or error scenarios not covered by any AC? Does the tech design specify contracts the code doesn't follow?
53
+ **Step 4: Cross-reference with proposal documents.** Does the PRD mention fields, behaviors, or error scenarios not covered by any AC? Does the tech design specify contracts the code doesn't follow? **Project constraints:** read the repo's context files (CLAUDE.md / AGENTS.md / .cursorrules, if present); code that violates a declared project-level rule → BLOCKER.
54
54
 
55
55
  **Step 5: Run tests/build if available.** A broken build or failing tests is an automatic FAIL. Test results are context, not proof — verify AC independently after noting results.
56
56
 
@@ -4,7 +4,7 @@ description: Full-auto AI-DLC pipeline — from prompt to done. Automates the en
4
4
  license: AGPL-3.0
5
5
  metadata:
6
6
  author: chorus
7
- version: "0.14.1"
7
+ version: "0.16.2"
8
8
  category: project-management
9
9
  mcp_server: chorus
10
10
  ---
@@ -443,7 +443,7 @@ Once **every** task of the idea's proposal is verified (`done`) — Phase 3 find
443
443
  Act on the VERDICT:
444
444
 
445
445
  - **PASS** / **PASS WITH NOTES** — the feature is cleared to ship. Proceed to Phase 5 / 5b.
446
- - **FAIL** — do NOT ship. Read the BLOCKERs, then fix them via the **quick-dev** workflow (`/quick-dev`): call `chorus_create_tasks` with `proposalUuid` set to the **current approved proposal** so the fix tasks attach to it — do **not** reopen the already-verified tasks. Drive them through Phase 3 → Phase 4, then re-run the gateway for the next round. Loop bounded by `maxCodeReviewRounds` (default 3; 0 = unlimited).
446
+ - **FAIL** — do NOT ship. Read the BLOCKERs, then fix them via the **quick-dev** workflow (`/quick-dev`): call `chorus_create_tasks` with `proposalUuid` set to the **current approved proposal** so the fix tasks attach to it — do **not** reopen the already-verified tasks or apply untracked fixes. Group related small BLOCKERs into one cohesive task by default; split only materially large or independently testable fixes. Drive every fix task through Phase 3 → Phase 4, including AC self-check, independent task review, and admin verification. Re-run the gateway only after every fix task is successfully `done`; a failed or cancelled fix task, stop the automatic loop and escalate. Loop bounded by `maxCodeReviewRounds` (default 3; 0 = unlimited).
447
447
 
448
448
  ```
449
449
  ESCALATE: "Idea '{title}' failed code review after {maxCodeReviewRounds} rounds.
@@ -485,7 +485,7 @@ After all waves complete, output a markdown summary:
485
485
 
486
486
  ### Phase 5b: Idea Completion Report (mandatory)
487
487
 
488
- A successful `/yolo` run always finishes the Idea — call `chorus_create_report` once with `proposalUuid` set to the last verified proposal. The tool's description carries the section template; follow it. Surface the returned `documentUuid` in the Phase 5 summary. Skipping is a protocol violation.
488
+ A successful `/yolo` run always finishes the Idea — call `chorus_create_report` once with `proposalUuid` set to the last verified proposal. The `content` parameter's description carries the section template; follow it. Surface the returned `documentUuid` in the Phase 5 summary. Skipping is a protocol violation.
489
489
 
490
490
  > **Order:** write the completion report only **after** the Phase 4.5 code-review gateway returns PASS / PASS WITH NOTES — never while a code-review FAIL is outstanding.
491
491
 
@@ -56,6 +56,22 @@ export interface DaemonTranscriptMessage {
56
56
  text: string;
57
57
  }
58
58
 
59
+ /**
60
+ * Normalized per-turn token usage (daemon-token-usage). Byte-for-byte mirror of the CLI
61
+ * client's `TokenUsage` JSDoc typedef (cli/upload-hooks.mjs). All token fields + `model`
62
+ * are nullable (a backend fills only what it can obtain); `source` is always set. Tokens
63
+ * only — no cost field. The OpenClaw plugin does not currently PRODUCE this, but the wire
64
+ * contract must not drift between the two daemon hosts.
65
+ */
66
+ export interface TokenUsage {
67
+ inputTokens: number | null;
68
+ outputTokens: number | null;
69
+ cacheCreationTokens: number | null;
70
+ cacheReadTokens: number | null;
71
+ model: string | null;
72
+ source: string;
73
+ }
74
+
59
75
  /** One execution-snapshot row, in the server's exact `execution-state` shape. */
60
76
  export interface DaemonExecutionRow {
61
77
  entityType: string;
@@ -113,9 +129,13 @@ export interface CreateDaemonRestClientOptions {
113
129
  export interface DaemonRestClient {
114
130
  turnAdvance(p: {
115
131
  sessionId: string;
116
- status: "running" | "ended";
132
+ status: "running" | "ended" | "interrupted";
117
133
  entityType?: string | null;
118
134
  entityUuid?: string | null;
135
+ interruptedReason?: "user" | "crash" | "shutdown" | null;
136
+ transcriptRelayError?: string | null;
137
+ // Per-turn token usage (daemon-token-usage); sent only on a terminal edge.
138
+ usage?: TokenUsage | null;
119
139
  }): Promise<DaemonRestResult>;
120
140
  transcript(p: {
121
141
  sessionId: string;
@@ -186,22 +206,33 @@ export function createDaemonRestClient(opts: CreateDaemonRestClientOptions): Dae
186
206
  /**
187
207
  * POST /api/daemon/turn-advance — advance a wake's DaemonSessionTurn lifecycle.
188
208
  * The server resolves the turn by the session BUSINESS KEY (`sessionId`); the
189
- * optional `entityType`/`entityUuid` stamp the weak executionUuid link. Requires
190
- * the connectionUuid.
209
+ * optional `entityType`/`entityUuid` stamp the weak executionUuid link. A terminal
210
+ * edge may also carry `interruptedReason`, `transcriptRelayError`, and the whole
211
+ * normalized `usage` (daemon-token-usage) — byte-for-byte the CLI client's shape.
212
+ * Requires the connectionUuid.
191
213
  */
192
- async turnAdvance({ sessionId, status, entityType, entityUuid }) {
214
+ async turnAdvance({ sessionId, status, entityType, entityUuid, interruptedReason, transcriptRelayError, usage }) {
193
215
  const connectionUuid = getConnectionUuid();
194
216
  if (!connectionUuid) {
195
217
  const error = `cannot advance turn for session ${sessionId} → ${status} — no connection uuid yet`;
196
218
  logger.warn(`[Chorus] ${error}`);
197
219
  return { ok: false, status: null, error, skipped: true };
198
220
  }
221
+ // Per-turn token usage rides the TERMINAL edge only (daemon-token-usage), matching the
222
+ // CLI client. Guarded on the terminal status so a stray usage on → running is never sent.
223
+ const isTerminal = status === "ended" || status === "interrupted";
199
224
  const body = {
200
225
  connectionUuid,
201
226
  sessionId,
202
227
  status,
203
228
  // Only sent when BOTH are present, so the server never gets a partial linkage.
204
229
  ...(entityType && entityUuid ? { entityType, entityUuid } : {}),
230
+ // Only meaningful alongside status=interrupted; never sent otherwise.
231
+ ...(status === "interrupted" && interruptedReason ? { interruptedReason } : {}),
232
+ // Transcript-relay failure annotation (fix #444 follow-up): only when truthy.
233
+ ...(transcriptRelayError ? { transcriptRelayError } : {}),
234
+ // The whole normalized TokenUsage object, nested under `usage`, only on a terminal edge.
235
+ ...(usage && isTerminal ? { usage } : {}),
205
236
  };
206
237
  return post(
207
238
  "turn-advance",
@@ -63,6 +63,14 @@ interface NotificationDetail {
63
63
  actorType: string;
64
64
  actorUuid: string;
65
65
  actorName: string;
66
+ /**
67
+ * The agent orchestrator for this resource (server read-projection,
68
+ * add-agent-orchestrator-handoff). Present only when the resource was assigned by an
69
+ * agent; null/absent for human-assigned or unattributed resources. Mirrors the
70
+ * daemon's cli/prompts.mjs `orchestrator` field so buildOrchestratorGuidance can
71
+ * inject the same handback instruction the daemon does.
72
+ */
73
+ orchestrator?: { type: string; uuid: string; name: string } | null;
66
74
  }
67
75
 
68
76
  export class ChorusEventRouter {
@@ -228,12 +236,48 @@ export class ChorusEventRouter {
228
236
  );
229
237
  }
230
238
 
239
+ /**
240
+ * Orchestrator-handoff guidance for a wake — the OpenClaw twin of the daemon's
241
+ * orchestratorGuidance in cli/prompts.mjs. KEEP THE TWO WORDINGS IN SYNC. Returns
242
+ * null unless the resource has an AGENT orchestrator; a human-assigned resource
243
+ * hands back to the human via the actor @mention above (buildMentionGuidance).
244
+ */
245
+ private buildOrchestratorGuidance(n: NotificationDetail): string | null {
246
+ if (n.orchestrator?.type !== "agent") return null;
247
+ return (
248
+ `Your orchestrator for this resource is @${n.orchestrator.name}.\n` +
249
+ `At a human-only gate you cannot cross, or when this child resource is complete, hand control ` +
250
+ `back by commenting on the resource and mentioning ` +
251
+ `@[${n.orchestrator.name}](agent:${n.orchestrator.uuid}) with the decision needed or completion ` +
252
+ `evidence, then leave any human-gated resource pending and end the turn. Do not @mention the ` +
253
+ `orchestrator for ordinary internal progress.`
254
+ );
255
+ }
256
+
257
+ /**
258
+ * Append orchestrator-handoff guidance (when the resource has an agent orchestrator)
259
+ * to a wake message and dispatch it. Every handler routes its wake through this so the
260
+ * handback instruction rides EVERY action — parity with the daemon, which appends
261
+ * orchestratorGuidance once in buildPrompt (cli/prompts.mjs). No orchestrator → the
262
+ * message is dispatched unchanged.
263
+ */
264
+ private wakeWithHandoff(
265
+ message: string,
266
+ contextKey: string,
267
+ n: NotificationDetail,
268
+ attr: WakeAttribution,
269
+ ): void {
270
+ const handoff = this.buildOrchestratorGuidance(n);
271
+ this.wake(handoff ? `${message}\n\n${handoff}` : message, contextKey, attr);
272
+ }
273
+
231
274
  private handleTaskAssigned(n: NotificationDetail, attr: WakeAttribution): void {
232
275
  const mentionGuidance = this.buildMentionGuidance(n, "task");
233
276
 
234
- this.wake(
277
+ this.wakeWithHandoff(
235
278
  `[Chorus] Task assigned: ${n.entityTitle}. Task UUID: ${n.entityUuid}, Project UUID: ${n.projectUuid}. Use chorus_get_task to review the task, then chorus_claim_task to start work.\n${mentionGuidance}`,
236
279
  this.contextKeyFor("task_assigned", n.entityUuid),
280
+ n,
237
281
  attr
238
282
  );
239
283
  }
@@ -241,19 +285,21 @@ export class ChorusEventRouter {
241
285
  private handleMentioned(n: NotificationDetail, attr: WakeAttribution): void {
242
286
  const mentionGuidance = this.buildMentionGuidance(n, n.entityType);
243
287
 
244
- this.wake(
288
+ this.wakeWithHandoff(
245
289
  `[Chorus] You were @mentioned in ${n.entityType} '${n.entityTitle}' (entityType: ${n.entityType}, entityUuid: ${n.entityUuid}, projectUuid: ${n.projectUuid}): ${n.message}\n` +
246
290
  `Review the ${n.entityType} content and use chorus_get_comments (targetType: "${n.entityType}", targetUuid: "${n.entityUuid}") to see the full conversation, then respond.\n` +
247
291
  mentionGuidance,
248
292
  this.contextKeyFor("mentioned", n.entityUuid),
293
+ n,
249
294
  attr
250
295
  );
251
296
  }
252
297
 
253
298
  private handleElaborationRequested(n: NotificationDetail, attr: WakeAttribution): void {
254
- this.wake(
299
+ this.wakeWithHandoff(
255
300
  `[Chorus] Elaboration requested for idea '${n.entityTitle}' (ideaUuid: ${n.entityUuid}, projectUuid: ${n.projectUuid}). Use chorus_get_elaboration to review questions.`,
256
301
  this.contextKeyFor("elaboration_requested", n.entityUuid),
302
+ n,
257
303
  attr
258
304
  );
259
305
  }
@@ -261,12 +307,13 @@ export class ChorusEventRouter {
261
307
  private handleProposalRejected(n: NotificationDetail, attr: WakeAttribution): void {
262
308
  const mentionGuidance = this.buildMentionGuidance(n, "proposal");
263
309
 
264
- this.wake(
310
+ this.wakeWithHandoff(
265
311
  `[Chorus] Proposal '${n.entityTitle}' was REJECTED (proposalUuid: ${n.entityUuid}, projectUuid: ${n.projectUuid}). Review note: "${n.message}". ` +
266
312
  `Use chorus_get_proposal to review the proposal, then fix issues with chorus_update_task_draft / chorus_update_document_draft. ` +
267
313
  `After fixing, call chorus_validate_proposal then chorus_submit_proposal to resubmit.\n` +
268
314
  mentionGuidance,
269
315
  this.contextKeyFor("proposal_rejected", n.entityUuid),
316
+ n,
270
317
  attr
271
318
  );
272
319
  }
@@ -275,11 +322,12 @@ export class ChorusEventRouter {
275
322
  const mentionGuidance = this.buildMentionGuidance(n, "proposal");
276
323
 
277
324
  const reviewInfo = n.message.includes("Note: ") ? ` Review note: "${n.message.split("Note: ").pop()}"` : "";
278
- this.wake(
325
+ this.wakeWithHandoff(
279
326
  `[Chorus] Proposal '${n.entityTitle}' was APPROVED (proposalUuid: ${n.entityUuid}, projectUuid: ${n.projectUuid})!${reviewInfo} Documents and tasks have been created. ` +
280
327
  `Use chorus_get_available_tasks with projectUuid: "${n.projectUuid}" to see the new tasks ready for work.\n` +
281
328
  mentionGuidance,
282
329
  this.contextKeyFor("proposal_approved", n.entityUuid),
330
+ n,
283
331
  attr
284
332
  );
285
333
  }
@@ -287,20 +335,22 @@ export class ChorusEventRouter {
287
335
  private handleIdeaClaimed(n: NotificationDetail, attr: WakeAttribution): void {
288
336
  const mentionGuidance = this.buildMentionGuidance(n, "idea");
289
337
 
290
- this.wake(
338
+ this.wakeWithHandoff(
291
339
  `[Chorus] Idea '${n.entityTitle}' has been assigned to you (ideaUuid: ${n.entityUuid}, projectUuid: ${n.projectUuid}). ` +
292
340
  `Use chorus_get_idea to review the idea, then chorus_claim_idea to start elaboration.\n` +
293
341
  mentionGuidance,
294
342
  this.contextKeyFor("idea_claimed", n.entityUuid),
343
+ n,
295
344
  attr
296
345
  );
297
346
  }
298
347
 
299
348
  private handleTaskVerified(n: NotificationDetail, attr: WakeAttribution): void {
300
- this.wake(
349
+ this.wakeWithHandoff(
301
350
  `[Chorus] Task '${n.entityTitle}' has been verified and is now done (taskUuid: ${n.entityUuid}, projectUuid: ${n.projectUuid}). ` +
302
351
  `Check if this unblocks other tasks: use chorus_get_unblocked_tasks with projectUuid "${n.projectUuid}" to find tasks that are now ready to start.`,
303
352
  this.contextKeyFor("task_verified", n.entityUuid),
353
+ n,
304
354
  attr
305
355
  );
306
356
  }
@@ -308,10 +358,11 @@ export class ChorusEventRouter {
308
358
  private handleTaskReopened(n: NotificationDetail, attr: WakeAttribution): void {
309
359
  const mentionGuidance = this.buildMentionGuidance(n, "task");
310
360
 
311
- this.wake(
361
+ this.wakeWithHandoff(
312
362
  `[Chorus] Task '${n.entityTitle}' has been reopened and needs rework (taskUuid: ${n.entityUuid}, projectUuid: ${n.projectUuid}). ` +
313
363
  `Use chorus_get_task to review the task and chorus_get_comments to see verification feedback, then fix the issues.\n${mentionGuidance}`,
314
364
  this.contextKeyFor("task_reopened", n.entityUuid),
365
+ n,
315
366
  attr
316
367
  );
317
368
  }
@@ -319,7 +370,7 @@ export class ChorusEventRouter {
319
370
  private handleElaborationAnswered(n: NotificationDetail, attr: WakeAttribution): void {
320
371
  const mentionGuidance = this.buildMentionGuidance(n, "idea");
321
372
 
322
- this.wake(
373
+ this.wakeWithHandoff(
323
374
  `[Chorus] Elaboration answers submitted for idea '${n.entityTitle}' (ideaUuid: ${n.entityUuid}, projectUuid: ${n.projectUuid}). ` +
324
375
  `Review the answers with chorus_get_elaboration, then either:\n` +
325
376
  `- Call chorus_validate_elaboration with empty issues [] to resolve and proceed to proposal creation\n` +
@@ -327,6 +378,7 @@ export class ChorusEventRouter {
327
378
  `After reviewing, @mention the answerer to ask if they have any further questions before you proceed.\n` +
328
379
  mentionGuidance,
329
380
  this.contextKeyFor("elaboration_answered", n.entityUuid),
381
+ n,
330
382
  attr
331
383
  );
332
384
  }
@@ -341,12 +393,13 @@ export class ChorusEventRouter {
341
393
  private handleElaborationVerified(n: NotificationDetail, attr: WakeAttribution): void {
342
394
  const mentionGuidance = this.buildMentionGuidance(n, "idea");
343
395
 
344
- this.wake(
396
+ this.wakeWithHandoff(
345
397
  `[Chorus] Elaboration for idea '${n.entityTitle}' was VERIFIED by a human (ideaUuid: ${n.entityUuid}, projectUuid: ${n.projectUuid}). ` +
346
398
  `The idea is now elaborated — do NOT answer elaboration questions. Proceed to WRITE THE PROPOSAL: gather context with ` +
347
399
  `chorus_get_idea and chorus_get_elaboration, then author the proposal via the existing proposal flow ` +
348
400
  `(chorus_pm_create_proposal / the proposal skill).\n${mentionGuidance}`,
349
401
  this.contextKeyFor("elaboration_verified", n.entityUuid),
402
+ n,
350
403
  attr
351
404
  );
352
405
  }
@@ -361,7 +414,7 @@ export class ChorusEventRouter {
361
414
  private handleStartDevelopment(n: NotificationDetail, attr: WakeAttribution): void {
362
415
  const mentionGuidance = this.buildMentionGuidance(n, "idea");
363
416
 
364
- this.wake(
417
+ this.wakeWithHandoff(
365
418
  `[Chorus] A human started DEVELOPMENT for idea '${n.entityTitle}' (ideaUuid: ${n.entityUuid}, projectUuid: ${n.projectUuid}). ` +
366
419
  `The idea's proposal is approved and unfinished tasks remain. Claim and execute ALL remaining tasks of that proposal in ` +
367
420
  `dependency order, following the develop workflow: repeatedly find claimable tasks (chorus_get_unblocked_tasks with ` +
@@ -370,6 +423,7 @@ export class ChorusEventRouter {
370
423
  `Do NOT stop after one task. Leave tasks already in to_verify (awaiting human verification) and tasks claimed by other ` +
371
424
  `sessions untouched. If nothing is claimable, post a brief status comment on the idea and end the turn.\n${mentionGuidance}`,
372
425
  this.contextKeyFor("start_development", n.entityUuid),
426
+ n,
373
427
  attr
374
428
  );
375
429
  }
@@ -386,7 +440,7 @@ export class ChorusEventRouter {
386
440
  private handleYoloRequested(n: NotificationDetail, attr: WakeAttribution): void {
387
441
  const mentionGuidance = this.buildMentionGuidance(n, "idea");
388
442
 
389
- this.wake(
443
+ this.wakeWithHandoff(
390
444
  `[Chorus] A human requested a YOLO run for idea '${n.entityTitle}' (ideaUuid: ${n.entityUuid}, projectUuid: ${n.projectUuid}). ` +
391
445
  `Drive this idea all the way to done following the yolo skill (the full-auto AI-DLC pipeline: Idea → Elaboration → Proposal → ` +
392
446
  `Execute → Verify). First read the idea's current state with chorus_get_idea (plus chorus_get_elaboration / ` +
@@ -395,6 +449,7 @@ export class ChorusEventRouter {
395
449
  `and so on. Complete the pipeline through the final done state and completion report, but do NOT merge or push a pull request ` +
396
450
  `without explicit human approval.\n${mentionGuidance}`,
397
451
  this.contextKeyFor("yolo_requested", n.entityUuid),
452
+ n,
398
453
  attr
399
454
  );
400
455
  }