twining_override
Override a decision by providing a reason, recording who made the change, and optionally creating a replacement decision automatically.
Instructions
Override a decision with a reason. Sets the decision to overridden status, records who overrode it and why, and optionally creates a replacement decision automatically.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| decision_id | Yes | ID of the decision to override | |
| reason | Yes | Reason for the override | |
| new_decision | No | Summary of the replacement decision to auto-create | |
| overridden_by | No | Who is overriding (default: "human") |
Implementation Reference
- src/tools/decision-tools.ts:198-216 (registration)Registration of the 'twining_override' tool within the server.
server.registerTool( "twining_override", { description: "Override a decision with a reason. Sets the decision to overridden status, records who overrode it and why, and optionally creates a replacement decision automatically.", inputSchema: { decision_id: z.string().describe("ID of the decision to override"), reason: z.string().describe("Reason for the override"), new_decision: z .string() .optional() .describe("Summary of the replacement decision to auto-create"), overridden_by: z .string() .optional() .describe('Who is overriding (default: "human")'), }, }, async (args) => { - src/engine/decisions.ts:546-585 (handler)The core logic of the 'twining_override' tool is implemented in the 'override' method of the Decisions engine.
async override( decisionId: string, reason: string, newDecision?: string, overriddenBy?: string, ): Promise<{ overridden: boolean; old_summary: string; new_decision_id?: string; }> { const decision = await this.decisionStore.get(decisionId); if (!decision) { throw new TwiningError( `Decision not found: ${decisionId}`, "NOT_FOUND", ); } // Set status to overridden with extra fields await this.decisionStore.updateStatus(decisionId, "overridden", { overridden_by: overriddenBy ?? "human", override_reason: reason, }); // Post override entry to blackboard (internal — bypasses decision rejection) const overrider = overriddenBy ?? "human"; await this.blackboardEngine.post({ entry_type: "decision", summary: `Override: ${decision.summary} -- overridden by ${overrider}`.slice( 0, 200, ), detail: reason, tags: [decision.domain], scope: decision.scope, agent_id: overrider, _internal: true, });