runner
runner
¶
DiagnosisRunner: orchestrates phase 1 of the distillation loop.
Builds diagnostic tools, runs the TeacherAgent, parses failure clusters from the teacher's output, and persists artifacts.
See spec §5.
Classes¶
DiagnosisResult
dataclass
¶
DiagnosisResult(diagnosis_md: str, clusters: list[FailureCluster] = list(), cost_usd: float = 0.0, tool_call_records: list[ToolCallRecord] = list())
The output of a diagnosis run.
DiagnosisRunner
¶
DiagnosisRunner(*, teacher_engine: Any, teacher_model: str, trace_store: Any, benchmark_samples: list, student_runner: Any, judge: Any, session_dir: Path, session_id: str, config: dict[str, Any], max_turns: int = 30, max_cost_usd: float = 5.0)
Orchestrates phase 1 of the distillation loop.
| PARAMETER | DESCRIPTION |
|---|---|
teacher_engine
|
The CloudEngine (or mock) for teacher inference.
TYPE:
|
teacher_model
|
Frontier model id (e.g. "claude-opus-4-6").
TYPE:
|
trace_store
|
TraceStore for reading student traces.
TYPE:
|
benchmark_samples
|
List of PersonalBenchmarkSample objects.
TYPE:
|
student_runner
|
Callable to re-execute the student on a task.
TYPE:
|
judge
|
TraceJudge for comparing outputs.
TYPE:
|
session_dir
|
Path where session artifacts are written.
TYPE:
|
session_id
|
Current session id.
TYPE:
|
config
|
Dict with config_path and openjarvis_home.
TYPE:
|
max_turns
|
Max teacher tool calls (default 30).
TYPE:
|
max_cost_usd
|
Max teacher API cost (default 5.0).
TYPE:
|
Source code in src/openjarvis/learning/distillation/diagnose/runner.py
Functions¶
run
¶
run() -> DiagnosisResult
Execute the diagnosis phase.
| RETURNS | DESCRIPTION |
|---|---|
DiagnosisResult
|
Contains the diagnosis markdown, parsed clusters, cost, and tool call records. |