Expand description
talon eval score and talon eval run: the golden-set regression
harness for investigation quality.
The scoring itself is pure and lives in talon_intel::eval; this
module does the I/O around it:
- loading golden cases (
evals/golden/<case id>.json), score: reading one already-produced report per case from a directory and printing the summary,run: submitting every case to a running Talon through the CoPilot HTTP API (POST /investigate, then pollingGET /investigations/{id}), i.e. the same path CoPilot uses, and scoring the verdict Talon recorded.
Reports are agent output: they are read without following symlinks and
with a size cap (crate::safe_fs), parsed as data only, and whatever
of them reaches the terminal has been stripped of control characters by
the scorer.
Exit codes: 0 pass rate reached, 1 pass rate below
--min-pass-rate, 2 unusable input or configuration.
Structs§
- CaseRun
- What investigating one case through the API produced.
- Http
Investigation Api InvestigationApiover HTTP against a running Talon.- RunOptions
- How the run loop waits.
- Submission
- Answer of
POST /investigate.
Constants§
- DEFAULT_
CASES_ DIR - Golden-case directory below the project root.
- EXIT_
BELOW_ THRESHOLD - Exit code: the pass rate is below the threshold.
- EXIT_
USAGE - Exit code: unusable input or configuration.
- MAX_
CASE_ BYTES - Largest golden-case file read.
- MAX_
POLL_ ERRORS - Consecutive failed status polls after which a case is given up.
- MAX_
REPORT_ BYTES - Largest report / investigation record read (file or HTTP body).
- TRIGGERED_
BY triggered_byof harness-submitted investigations (the HTTP API acceptsmanual,scheduledandwebhook).
Traits§
- Investigation
Api - The slice of the CoPilot HTTP API the harness uses; a trait so the run loop is tested without a server.
Functions§
- investigate_
body - The
POST /investigatebody for a case request. - investigate_
case - Submit
requestand wait for its investigation to finish. - load_
cases - Load and validate every
*.jsongolden case indir, sorted by file name. The file stem must equal the case id. - load_
outcome - What
<case_id>.jsonin the open reports directory says about a case. - parse_
alert_ map - Parse an
--alert-mapdocument:{"<case id>": <alert id>, ...}. - prepare_
requests - The request to submit for each case: the case’s own, with the alert id
from
alert_mapand the customer code fromcustomer_codewhen given. Validated against the HTTP API’s input rules before anything is sent. - run
talon eval run: returns the process exit code.- run_
cases - Investigate every case in turn (one at a time: the investigation lane
is serialized anyway, and a per-case timeout stays meaningful) and
score the outcomes.
progressreceives one line per step. - score
talon eval score: returns the process exit code.- score_
reports - Score the reports in
reports_diragainstcases.