practice: pose-time target validation — names normalize to ids, unknowns rejected (round 9 slice 2)

problemTool takes the whole-graph node source (chat-handler passes
graphStore.readNodes, read fresh per pose): prepareArguments silently
normalizes name targets to canonical ids so the RECORD carries ids
(the mastery trace groups on them); execute rejects unresolvable
targets with a one-line invalidInputResult — no re-listing, the [id]
proposition list already sits in the agent's context. Validation set
is the whole graph, not the picks: pickless sessions and future
graph-tools poses stay valid. Absent node source (tests) = no
validation.
This commit is contained in:
amosblomqvist
2026-10-05 06:29:02 +03:00
parent d47b3564ce
commit 0dfb1de246
3 changed files with 59 additions and 8 deletions
+12 -1
View File
@@ -328,7 +328,18 @@ export async function handleChatInput(
const constructed: TeachingAgent = buildAgent
? buildAgent({ ...agentOpts, teaching })
: record.kind === "practice"
? createPracticeAgent({ chatId, chatStore: stores.chatStore }, agentOpts)
? createPracticeAgent(
{
chatId,
chatStore: stores.chatStore,
// TARGET VALIDATION (owner round 9): the practice tools read the
// WHOLE graph fresh per pose — targets validate against every
// proposition, not just the session's picks (pickless sessions
// and future graph-tools poses stay valid).
graphNodes: () => stores.graphStore.readNodes(),
},
agentOpts,
)
: teaching
? createTeacherAgent(
{