twining_promote
Promote provisional decisions to active status after validation through implementation and testing. Confirm decisions that have been successfully verified.
Instructions
Promote one or more provisional decisions to active status. Use this to confirm provisional decisions that have been validated through implementation and testing.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| decision_ids | Yes | IDs of provisional decisions to promote to active | |
| promoted_by | No | Who is promoting (default: "main") |
Implementation Reference
- src/engine/decisions.ts:621-679 (handler)The business logic implementation for the 'promote' operation, which updates provisional decisions to 'active' status.
async promote( decisionIds: string[], promotedBy?: string, ): Promise<{ promoted: string[]; already_active: string[]; not_found: string[]; wrong_status: Array<{ id: string; status: string }>; }> { const result: { promoted: string[]; already_active: string[]; not_found: string[]; wrong_status: Array<{ id: string; status: string }>; } = { promoted: [], already_active: [], not_found: [], wrong_status: [], }; for (const id of decisionIds) { const decision = await this.decisionStore.get(id); if (!decision) { result.not_found.push(id); continue; } if (decision.status === "active") { result.already_active.push(id); continue; } if (decision.status !== "provisional") { result.wrong_status.push({ id, status: decision.status }); continue; } await this.decisionStore.updateStatus(id, "active"); result.promoted.push(id); } // Post a single status entry if any were promoted if (result.promoted.length > 0) { await this.blackboardEngine.post({ entry_type: "status", summary: `Promoted ${result.promoted.length} provisional decision(s) to active`.slice( 0, 200, ), detail: `Decision IDs: ${result.promoted.join(", ")}`, scope: "project", agent_id: promotedBy ?? "main", }); } return result; } - src/tools/decision-tools.ts:237-271 (registration)The MCP tool registration for 'twining_promote', which delegates the request to the DecisionEngine 'promote' method.
// twining_promote — Promote provisional decisions to active server.registerTool( "twining_promote", { description: "Promote one or more provisional decisions to active status. Use this to confirm provisional decisions that have been validated through implementation and testing.", inputSchema: { decision_ids: z .array(z.string()) .min(1) .describe("IDs of provisional decisions to promote to active"), promoted_by: z .string() .optional() .describe('Who is promoting (default: "main")'), }, }, async (args) => { try { const result = await engine.promote( args.decision_ids, args.promoted_by, ); return toolResult(result); } catch (e) { if (e instanceof TwiningError) { return toolError(e.message, e.code); } return toolError( e instanceof Error ? e.message : "Unknown error", "INTERNAL_ERROR", ); } }, );