Tool: refine_thoughts

Purpose

Apply an explicit feedback-loop refinement to a thought node. This is the GoT operator for corrections produced by critique, verification failure, or adversarial review.

Input

  • deliberation_id: target deliberation.
  • source_node_id: thought being refined.
  • node_id: accepted alias for source_node_id for compatibility.
  • critique: optional critique that motivated the refinement.
  • verification_failure: optional failed claim, evidence gap, or CoVe finding.
  • refined_content: optional replacement/corrected content.
  • branch_id: optional branch label for the new refinement node.

At least one of critique, verification_failure, or refined_content is required.

Behavior

  • Creates a new thought node tagged got, refined, and feedback-loop.
  • Adds a strict directed refines edge from the new node to the source node.
  • Rejects cycles in the strict GoT subgraph.
  • Respects limits.max_nodes and limits.max_edges before mutating state.
  • Updates the frontier to the new refinement node.

Output

  • refined_node_id: ID of the new correction node.
  • refinement_edge: the refines edge with critique/failure notes.
  • frontier_nodes: updated frontier.
  • analysis: heuristic provenance and limitations.

Failure Semantics

Limit failures, missing source nodes, missing refinement inputs, and cycle rejections return structured MCP errors. The operation is atomic on limit failure: no node or edge is inserted when the refinement cannot be accepted.