practice: the rarely-needed set — files, research, pdf, map readers (round 10 slice 1)

The practice registry widens beyond problem+conclude: read/ls/find/grep
(the learner-filesystem set, always), research + pdf jobs (research
honestly absent when no engine is live; demo/visual stay teach-only),
and the prober's map readers behind the SAME settings gate as the
prober's (graphToolsEnabled at the composition root). Base prompt
carries the conditional doctrine: reach for them only when the
situation genuinely requires — no propositions → look at the map;
learner references a file → read it; load-bearing uncertainty →
research it. Not toggle-filtered: problem/conclude are the session,
these are exceptions.
This commit is contained in:
amosblomqvist
2026-10-05 06:49:15 +03:00
parent 83dad65481
commit a1596556df
4 changed files with 59 additions and 2 deletions
+19 -2
View File
@@ -182,9 +182,26 @@ describe("target validation — names normalize to ids, unknowns reject", () =>
// ── the registry + the agent ────────────────────────────────────────────────
describe("the practice agent", () => {
it("registry is problem + conclude ONLY — no question, plan, or job tools", () => {
it("bare registry: the session pair + the learner-filesystem set — no question, plan, or lesson tools", () => {
const tools = practiceTools(ctxOf([]));
assert.deepEqual(Object.keys(tools).sort(), ["conclude", "problem"]);
assert.deepEqual(
Object.keys(tools).sort(),
["conclude", "find", "grep", "ls", "problem", "read"],
);
});
it("THE RARELY-NEEDED SET (owner round 10): jobs + map readers compose in when their roots are passed", () => {
const jobs = { chatId: "c1", jobStore: null as never, spawn: (() => {}) as never, searchAvailable: () => false };
const graph = { chatStore: null as never, graphStore: null as never };
const tools = practiceTools({ ...ctxOf([]), jobs, graph });
// research honestly absent (no search engine live); pdf always; the
// prober's two map readers behind the settings gate.
assert.deepEqual(
Object.keys(tools).sort(),
["conclude", "find", "grep", "list_propositions", "list_sessions", "ls", "pdf", "problem", "read"],
);
const withSearch = practiceTools({ ...ctxOf([]), jobs: { ...jobs, searchAvailable: () => true }, graph });
assert.ok(withSearch.research, "a live engine adds research");
});
it("constructs with exactly the two practice tools", () => {