Retained attempt deliverables
Status: Ready
Truth label: Current
Audience: Fleet operator
Reader outcome: Use retained attempt deliverables in Cortex, with every control, its verification, and its limits stated.
Last verified: 2026-09-13
Cortex can inspect, download, and create derived text versions of outputs retained from a worker attempt. Open Open attempt deliverables on a review card, Open retained deliverables in a task drawer, or Attempt deliverables in its history. Older runs can still show their legacy diff but have no reconstructed files.
What a worker captures
The worker records a bounded workspace baseline before execution, then compares the final workspace with that baseline. It uses file hashes and modes rather than only Git status. A worker that creates a file and commits it still reports the net change. A file already edited before the attempt is compared with its actual starting content. Untouched dirty or untracked files do not become this run's changes.
The manifest includes changed text and binary content when it fits, before/after hashes and modes, additions and deletions, exact-content rename links, starting/ending Git revisions, up to 25 intervening commit summaries, and capture limits. A rename with additional edits can appear as a deletion plus addition. Symlinks retain their link target as metadata; their target content is not followed. Ordinary output folders work without Git. A requested new output directory can start from an empty baseline.
The capture represents final net changes, not every intermediate save or every historical version inside a commit. Build output and environment/dependency directories are excluded. Git repositories use tracked and non-ignored untracked files, plus files explicitly named in the task brief. Declared ignored draft files are captured within the same bounds. Other reported ignored, missing, or external paths are listed as unobserved; this marks the manifest incomplete. They are not silently treated as retained outputs.
The baseline cannot attribute simultaneous external edits to a particular person or process. Cortex identifies pre-existing edits and states this attribution limit. File or scan limits also prevent a claim of complete capture. An incomplete directory scan labels uncertain additions/deletions as unverified rather than asserting that an unseen file was created or deleted.
Review and edit
Choose a file and open it. The editor shows its version, content kind, hash, and any unavailable-content reason. Text appears as plain text. Download retrieves the retained bytes, so it works even if the worker checkout no longer exists. Binary files are downloadable and do not enter the text editor. Download before the run retrieves retained starting content when available.
Saving text creates a derived version on Central. It leaves the original worker output, its diff, and the worker checkout unchanged. A later task can apply approved wording to a project. Open a previous version and save to restore its wording as a new version. Stale saves preserve the unsaved editor content and require reload. Each saved version has a hash, timestamp, source hash, parent hash, and operator note.
Export original manifest downloads its retained content and capture evidence. Download derived versions individually. Content exports can contain project or client material and should stay within that material's intended scope.
Storage and bounds
The existing report/outbox path transports the manifest to Central's private traces/raw/<run-id>/diff.json. Derived content lives in separate immutable deliverable-<id>.json artifacts. traces.sqlite3 indexes the versions and their lineage in deliverable_versions. Backups and restores need both the trace database and raw artifacts. They remain inside the existing runtime-data backup boundary.
Current bounds are 10,000 scanned files, 64 MiB hashed bytes per scan, 2 MiB per file, 8 MiB retained baseline content and 8 MiB of changed final content, 200 transported changed files, and a shared 4 MiB content/diff transport allocation. Large diff computation is skipped above 256,000 combined text characters; individual diff displays are capped at 64,000 characters. Retained file bytes can remain complete even when the displayed diff is shortened. Edited text is limited to 128,000 characters. Limits are implementation constants in shared/workspace_capture.py and are visible when they affect a run.
Captured file payloads are bounded, while metadata and JSON encoding add overhead beyond the payload allocation. A storage failure preserves the task result and logs the unavailable artifact. A failed edit database commit can leave an unreferenced raw file. Retention/cleanup, operator-configurable capture limits, external output paths, richer document previews, and portable cross-project artifacts remain follow-through work.
Value and remaining review work
A report that only names files cannot support review on another machine. A diff against the current Git HEAD loses committed work. Attempt baselines and retained content fix those gaps for captured files and allow later wording improvements without rewriting original evidence.
This does not establish that the work meets its acceptance criteria. Whitespace/path checks still have their original narrow meaning. Task acceptance now records criterion assessments tied to artifact versions, verification records, and explicit operator acceptance.
Tests: tests/test_deliverables.py, tests/test_run_diff.py, tests/test_no_change_guard.py, and tests/browser/deliverables.mjs. The browser fixture removes its private checkout before opening the result in Cortex and never executes a real worker.
Rate this version opens exact output feedback. Save or discard unsaved text edits before rating. Original and derived versions have separate judgments and histories.