The types in crates/saci-core are the shared vocabulary of the CLI, the
backend and the worker. They are serialized as JSON on the wire and in the
database; schema_version (currently 1) marks the run specification and
report formats.
| Identity | Form | Notes |
|---|---|---|
| Run | run-<32 hex> |
Generated by the backend on acceptance. |
| Unit key | 1.1, or 1.1>common/setup.md#2 |
The authored ID; units reached through a procedure are prefixed with the invoking unit and the procedure path, so repeated invocations stay distinct. |
| Attempt | 1, 2, … |
One-based, per unit. Every attempt is kept. |
| Evidence | ev-<n> |
Run-unique, assigned by the worker in recording order. |
| Event | seq 1, 2, … |
Contiguous per run. Receivers apply exactly the next seq. |
Source locations are { "document": "<bundle path>", "line": <1-based> }.
Lifecycle (accepted → starting → running → stopping → finished) and outcome
are separate. Runs only move forward; any non-terminal state may go to
stopping or straight to finished (for example on a launch failure), and
finished is terminal.
Outcomes are passed, failed, blocked, inconclusive, error,
skipped and cancelled. Units and runs use the same outcomes:
| Outcome | Meaning |
|---|---|
passed |
Every expected criterion is supported by evidence. |
failed |
Evidence contradicts at least one expected criterion. |
blocked |
A prerequisite or required input prevents execution. |
inconclusive |
Execution produced insufficient evidence to establish the expected result. |
error |
The agent, worker, tool infrastructure, provider, or execution limit prevented reliable completion. |
skipped |
A unit was not attempted, with its reason recorded. |
cancelled |
A user or external controller explicitly stopped execution. |
A command failure can be a passing negative test, and a command that exits 0 can be evidence of a failed test: the outcome follows the authored expectation, not the transport status. A run’s summary outcome is the highest of its unit outcomes in the order cancelled, error, failed, blocked, inconclusive, passed. A skipped unit counts as blocked for the summary, so a run with unattempted units cannot pass. When the run ends:
cancelled (on cancellation) or
error (any other interruption), and so is its unit;skipped with the reason;cleanup_not_run.The agent finishes each attempt by submitting an assessment through the
step-assessment tool: an outcome, one result per expected criterion
(criterion index from 0, status satisfied, contradicted or
undetermined, basis mechanical or model_judgment, the evidence
ids it relies on, and an explanation), and an overall explanation.
saci_core::assessment::validate rejects a submission, telling the model
every problem so it can resubmit, when:
passed, failed, blocked or inconclusive (error,
skipped and cancelled are decided by Saci, not the model);satisfied or
contradicted result cites none;satisfied result with basis mechanical cites only evidence that
holds no answer from the target: an HTTP request with no response (for
example, connection refused), a shell command that did not finish, an
MCP call with no result, or a rejected call. A refused connection does
not show a service is healthy. When the expected result is that the
call fails, for example a port that must be closed, the model uses
basis model_judgment, and the report shows it as a judgment;passed has any criterion that is not satisfied; failed has none
contradicted; blocked or inconclusive has one contradicted or none
undetermined;So a pass needs evidence for every criterion: a printed PASS or a zero
exit status is only evidence for the criteria it actually shows. A negative
test passes when its evidence matches the authored expectation, for example
a recorded HTTP 401 for “the request is rejected”. basis records whether a
result rests on a direct check or on the model’s interpretation; Saci
records that claim but does not prove it.
An attempt’s outcome is its assessment’s outcome, unless an execution error
occurred, which makes it error. A unit’s outcome is its last attempt’s
outcome; earlier attempts stay in the report.
A worker reports progress as ordered RunEvents (run_started,
attempt_started, observation, command_running, attempt_finished,
unit_finished, unit_skipped, cancellation_requested,
investigation_concluded, run_finished). The backend folds
them into a RunReport with RunReport::apply, which rejects events for
another run, events out of sequence (including retransmissions), events
after run_finished, and unit events that do not match the unit’s state:
an attempt outcome that does not follow its assessment, an assessment that
fails the same checks the worker applies (assessment::validate: every
authored criterion assessed once, outcome consistent with the criteria,
evidence recorded in the run), a unit outcome other than its last
attempt’s, or a skip of a unit that was attempted. Each unit’s identity
carries its authored criteria for this. A rejected event leaves the
report unchanged.
run_started also carries environment: the worker’s Saci build, operating
system, kernel, architecture and tool versions
(environment details). The report keeps it
as worker_environment. Workers that do not send it leave the field absent.
attempt_finished also carries timing: model_requests (the model
requests sent), model_ms (the time spent on model requests, retries
included), tool_ms (the time spent in tool calls), and the token counts
that the provider reported: input_tokens, cached_tokens (the part of
the input read from the provider’s prompt cache, absent when the provider
does not report it) and output_tokens. The report keeps it on the
attempt. Use it to find where a run spends its time.
command_running reports a shell command that is still running, every 15
seconds while it runs (long commands). It
carries the redacted command and elapsed_secs. It does not change the
report: the observation that follows carries the result.
Examples of complete event streams live in
crates/saci-core/tests/fixtures/runs/ (success, failure with stop, and a
retried-then-cancelled run).
A run specification contains exactly one of these fields:
bundle: the plan documents of a test run;investigation: the failure to investigate, for an investigation run.A test run has the same format as before investigations existed, so the
backend reads stored runs without change. A worker rejects a
specification with both fields or with neither. A worker that does not
run investigations rejects an investigation. The backend creates
investigations from stored runs (failure investigations).
The design describes investigations.
These types are in saci_core::investigation.
InvestigationRequest: what a client sends. run_id, an optional
unit (the first unsuccessful unit when omitted) and optional sources
(configured repository names, each with an optional ref).InvestigationSpec: what the worker receives. The parent run, the plan
title, the failed unit’s report (identity, expected results, outcome and
attempts), the evidence that the attempts cite, the repositories with
their refs, the prepare commands and the instructions.InvestigationReport: what the worker produces. outcome is
concluded, inconclusive, error or cancelled. It also contains
a summary, the cloned sources with their commit SHAs, the
hypotheses, and the bug or a no_bug_reason. Each hypothesis has a
statement, a confidence (high, medium or low), evidence IDs
and code locations (repository, commit, path, start_line,
end_line).InvestigationReport::check applies the rules that do not need the
clones:
end_line at or after start_line;concluded report needs a hypothesis with a code location, and a
bug or a no_bug_reason.An investigation run has one unit, investigation, with one attempt (see
investigation mode). These rules apply to
the investigation_concluded event, which carries the report:
attempt_finished, and only once;InvestigationReport::check, its outcome is
concluded or inconclusive, and each evidence ID that it cites is
recorded in this run;passed for concluded and inconclusive for
inconclusive. Without a conclusion, the attempt can only end error
or cancelled.The report keeps the result as its investigation field.
Public types hold secret references only: { "env": "NAME" } for a backend
environment variable or { "secret": "name", "key": "key" } for a
Kubernetes Secret. No serializable type has a field for a secret value.