Skip to content

tools

diapason.learning.spec_search.diagnose.tools

Diagnostic tools exposed to the teacher in the diagnose phase.

All tools are read-only relative to the user's config. They do not mutate ~/.diapason/config.toml, agent prompts, or tool descriptions.

Tools that execute code (run_student_on_task, run_self_on_task) append new traces to TraceStore as a side effect. These traces are tagged with source=spec_search_session:<id> so they can be excluded from future learning input.

See spec §5.2.

build_diagnostic_tools(*, trace_store, config, benchmark_samples, student_runner, teacher_engine, teacher_model, judge, session_id)

Build all diagnostic tools as closures over shared dependencies.

Parameters

trace_store : A TraceStore instance for trace queries. config : Dict with config_path (Path) and diapason_home (Path). benchmark_samples : List of PersonalBenchmarkSample objects. student_runner : Callable that re-executes the student on a task. teacher_engine : The CloudEngine instance used by the teacher. teacher_model : Model id for teacher inference (e.g. "claude-opus-4-6"). judge : A TraceJudge instance for comparing outputs. session_id : Current session id for tagging traces.