free-recall explain tool: the quizzing-mechanic switch (owner 2026-09-27)
Sycophancy mitigation as a structural commitment: the model writes its full correctAnswer (plus explanation, in that order) BEFORE the learner sees the question; the commitment rides the persisted call args, is revealed on submit, and grades his free text in the model's next reply — the client never grades free recall. - tools.explain setting (segmented 'Quizzing — Multiple choice | Free recall' in Agent settings' Tools group): free arms explain and drops quiz for BOTH agents (prober variant carries no nodeId, same pattern as the probe quiz); mechanics keys never pass filterEnabledTools — quiz stays unwritable (the 2026-09-19 wedge ruling stands) - doctrine lives pi-natively in the tool descriptions (owner ruling — no conditional system-prompt chunks): explain carries the commitment rule; the MC option-building craft moved out of the prompt into the quiz description; shared/20-question-tools.md slims to the quiz-agnostic core - display seams: parseExplainInput (LaTeX-debris restoration included), dock text-mode with an 'I don't know' row (kbd row 0), AnsweredCard reveal (The answer / Why, no verdict chips), [Explain answer] format - phases/plan seams recognize both quizzing tools' nodeId tags; explain answers deliberately feed no ledger evidence (no client grading to key on — a future ruling can parse the model's grade) 1049/1049 tests, typecheck/lint/build green.
This commit is contained in:
@@ -16,6 +16,7 @@ import {
|
||||
parseAskInput,
|
||||
parseProbeDoneInput,
|
||||
parseQuizInput,
|
||||
parseExplainInput,
|
||||
} from "../src/core/tool-parts.ts";
|
||||
import { quizInputSchema, probeQuizInputSchema } from "../src/core/question-core.ts";
|
||||
import { probeDoneInputSchema } from "../src/core/contracts/probe.ts";
|
||||
@@ -266,3 +267,42 @@ describe("display-math newline rule (Option A, owner ruling 2026-09-27)", () =>
|
||||
assert.equal(parsed.question, "Is \\(p \\neq q\\) valid?");
|
||||
});
|
||||
});
|
||||
|
||||
// ─── parseExplainInput (free-recall display parse, owner 2026-09-27) ───────
|
||||
|
||||
describe("parseExplainInput: the dock's display seam for explain calls", () => {
|
||||
const good = {
|
||||
question: "Explain why Mercury is hard to observe.",
|
||||
explanation: "It never strays far from the Sun in our sky.",
|
||||
correctAnswer: "Its small angular separation from the Sun.",
|
||||
nodeId: "planet-order", // the teacher's field — STRIPPED by Clean, like quiz
|
||||
details: "Think about where it appears at dusk.",
|
||||
};
|
||||
|
||||
it("parses a valid call and strips the teacher-only nodeId", () => {
|
||||
const parsed = parseExplainInput(good)!;
|
||||
assert.equal(parsed.question, "Explain why Mercury is hard to observe.");
|
||||
assert.equal(parsed.correctAnswer, "Its small angular separation from the Sun.");
|
||||
assert.equal(parsed.details, "Think about where it appears at dusk.");
|
||||
assert.ok(!("nodeId" in parsed), "the teacher-only key is cleaned away");
|
||||
});
|
||||
|
||||
it("an empty commitment never arms the dock", () => {
|
||||
assert.equal(parseExplainInput({ ...good, correctAnswer: " " }), undefined);
|
||||
});
|
||||
|
||||
it("restores LaTeX escape debris inside math spans (the pi-ai streaming wobble)", () => {
|
||||
// \f of \forall was eaten by the lenient args parse: U+000C + "orall".
|
||||
const dirty = "Because \(orall x\) holds.";
|
||||
const parsed = parseExplainInput({ ...good, correctAnswer: dirty })!;
|
||||
assert.equal(parsed.correctAnswer, "Because \(\forall x\) holds.");
|
||||
});
|
||||
|
||||
it("wrong-shape input never arms the dock (numeric strings DO coerce — the seam's leniency)", () => {
|
||||
assert.equal(parseExplainInput("just a string"), undefined);
|
||||
assert.equal(parseExplainInput({ explanation: "e", correctAnswer: "a" }), undefined, "missing question");
|
||||
assert.equal(parseExplainInput({ question: "q", explanation: "e", correctAnswer: { nested: true } }), undefined);
|
||||
// 42 → "42": the same numeric coercion the quiz seam pins.
|
||||
assert.equal(parseExplainInput({ question: "q", explanation: "e", correctAnswer: 42 })?.correctAnswer, "42");
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user