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:
@@ -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(
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user