question tools: phase-visible names, hardened teach schemas, context-slim seams

The tools_fails_2 diagnosis (glm-5.3 dropping trailing required fields):
- probe-phase quiz/explain renamed to probe/recall — a shared name carried
  the probe call shape into teaching (the first teach quiz dropped nodeId);
  display seams accept the old names forever
- teach quiz+explain schemas lead with the required pair (type, nodeId);
  explain gains the predict/check type and joins the reveal law (checks
  collapse, predictions arrive open; no-type records render check-style)
- plan_init/probe_done results go context-slim (owner, context diet):
  content = validated nodeIds + binding-id reminder / fixed ack; details
  keeps the tree for the popup and {ok:true} — serializer-verified that
  details never reaches the model; failure echoes dropped
- the cards carry the tool's own name (Probe/Recall) and the quiz type
  reads on the label (Prediction/Check) in composer and transcript
This commit is contained in:
amosblomqvist
2026-10-09 07:59:23 +03:00
parent c23eb1f15b
commit 1f41fb05a5
21 changed files with 411 additions and 127 deletions
+14 -4
View File
@@ -38,13 +38,23 @@ export interface PendingToolCall {
input: unknown;
}
/** Tools that render in the question dock and gate the composer. */
export const QUESTION_TOOLS = ["quiz", "ask_user_question", "explain"] as const;
/** Tools that render in the question dock and gate the composer. The
* probe-phase names (probe/recall, owner 2026-10-09) join their teach
* twins — old records keep the teach names; new probe-phase calls carry
* the phase names. */
export const QUESTION_TOOLS = [
"quiz",
"probe",
"ask_user_question",
"explain",
"recall",
] as const;
/** The tool→kind map (the dock's own fold, named once — the dismissal
* path and the dock must never disagree on what a tool is). */
* path and the dock must never disagree on what a tool is). The probe
* names fold onto their teach kinds — the dock is kind-driven. */
export function toolQuestionKind(tool: string): "quiz" | "ask" | "explain" {
return tool === "quiz" ? "quiz" : tool === "explain" ? "explain" : "ask";
return tool === "quiz" || tool === "probe" ? "quiz" : tool === "explain" || tool === "recall" ? "explain" : "ask";
}
/** Tools fulfilled by background sub-agent jobs (W2/W6). */