Expand description
Artifacts: files of a job attempt that agents may read through the runner
(jobs artifact, MCP get_artifact), during the run and after it.
results (the result journal) is built in. A worker adds its own files,
such as an evaluation log or a warm-start snapshot, by declaring them with
declare before it first writes them. Declarations are checked records
in artifacts.jsonl of the attempt directory, so workers in any language
can write them, and a runner that predates them simply ignores the file.
The final manifest lists every declared file that exists, and
runner.artifact_index records its format, size and SHA-256 when the
attempt is sealed.
Structs§
- Declaration
- A file a worker declares in its attempt directory.
Constants§
- DECLARATIONS
- The declarations of an attempt: checked records, version 1.
- FORMATS
- Artifact formats.
- INLINE_
CAP - What one runner call returns inline: the whole content of an artifact, or the records of one page.
- MAX_
DECLARATIONS - Declarations per attempt.
- MAX_
DESCRIPTION - Bytes of a description.
- MAX_
PAGE - Records of one page at most.
- RESERVED
- Files of the runner and the SDK in an attempt directory. No artifact may
use them; nor a name that starts with
.or ends with.lockor.tmp. - RESULTS
- The built-in artifact: the result journal
results.jsonl.
Functions§
- all
- Every artifact of the attempt:
resultsfirst, then the declarations. Files that do not exist (yet) are included. - all_
or_ results all, orresultsalone and the error when the declarations are broken: what a running attempt serves.- content
- The whole content of an artifact, at most
INLINE_CAPbytes. Arecordsartifact is read up to its last complete line, so a record being appended is never cut. - declarations
- The declarations of the attempt in
dir, in declaration order; none if there are none. A declaration that breaks the rules, or a second declaration of a name or file, makes them all untrusted: an error. - declare
- Declares an artifact of the attempt in
dir, the attempt directory a worker’spreparereceives asbase. Declare it insolve, before the first write, so agents can read it while the job runs; never inprepare, which also runs for validation. Repeating an identical declaration is a no-op; another declaration of the same name or file is an error. Safe to call from concurrent tasks. - digest_
file - Size and SHA-256 of a file, read in blocks.
- page
- Records
offset..offset + limitof arecordsartifact: the payloads of complete records whose checksums hold, at mostINLINE_CAPbytes of payload (always at least one record).next_offsetis where the next page starts;availablecounts the complete records now in the file, which a running job may extend. - progress
- The artifact index of a running attempt, for
jobs get: every artifact whose file exists, with its current size, and the problems found (a broken declaration file leavesresultsalone). - sealed
- The manifest’s view of the artifacts when an attempt is sealed: the
artifactsmap (name to file),runner.artifact_index(format, size, SHA-256, task, description) and the problems found. Only regular files that exist are listed; a broken declaration file listsresultsalone. An artifact problem never fails the attempt: its results stand.