cdn.si

rendered markdown titpetric

Artifacts

The files runs leave behind: build output, reports, coverage, images, anything a job wants kept. task-ui gathers them into one tree with every run’s files side by side, and keeps the versions a later run replaced.

Artifacts

Leaving one

Every run gets an empty directory of its own in $TASK_UI_ARTIFACTS. A job that writes files or directories there leaves artifacts:

go build -o "$TASK_UI_ARTIFACTS/app" .
mkdir -p "$TASK_UI_ARTIFACTS/coverage" && cp coverage.html "$TASK_UI_ARTIFACTS/coverage/"

When the run ends, task-ui moves the files into the artifact tree, at the same paths. A job that writes job1.txt and another that writes job2.txt leave both at the top of the tree. A later run that writes job1.txt again replaces it there, and the history keeps the version before. A report a job writes on every run stays current. The run’s own directory goes, and nothing carries over into the next run’s.

The page

You see the files of the folders you may see, in the table and in a .tgz. With Allow Edits on Artifacts, artifact/edit, you delete a file or a directory from the tree, with the button on its row: the history keeps its versions, and the preview window still shows them. With Allow Deletes on Artifacts, artifact/delete, you delete a record, and Delete all, in the ⋯ menu at the top right, deletes every file, its history and every record.

Writing one

An agent outside task-ui writes into the tree too, over MCP with write_artifact, or with PUT /api/artifacts/files/<path> and the file as the body: a relative path, with no .. and no dot file, within the size limit the API names. The file replaces the version at that path, which the history keeps, as a run’s file would. Its record has no run, folder or job: the History names the user who wrote it, and whoever sees artifacts sees it. list_artifacts lists a directory and read_artifact reads a file, the latest version or an older one. Writing takes Allow Edits on Artifacts, artifact/edit, which the runner role holds; with it a runner also deletes a file from the tree (see MCP).

History

The tree is a git repository: each run that leaves files is a commit. Once the history holds more commits than TASK_UI_ARTIFACT_HISTORY (50 unless set), task-ui squashes it to one commit of the latest files, and the earlier versions and their records go. See Running the server.

Artifact history on the Data retention settings page keeps the earlier versions for an age and within a size: @cleanup drops the oldest commits of the history, and the versions only they held, until both rules hold. The latest version of every file in the tree stays.


Previous: Runs · Next: Scheduled · Contents