2.8 KiB
2.8 KiB
Stage: publish
Purpose
Upload run/session outputs to object storage and atomically advance remote current state.
Inputs
- successful preceding stages from the canonical stage set
- invocation-scoped run files
- resolved publish output rules
- effective publish locks (static + remote merged lock set)
- durable previous-session cache files when present
Outputs
- uploaded invocation record and selected publish outputs;
- uploaded durable previous-session cache files when present;
- updated remote current manifest; and
- remote current-run commit marker, written last.
Exact remote placement and the operator workflow belong in Operations.
Key Behavior
- stage can self-skip when publish disabled or run upload disabled.
- validates prerequisite stage success and object-store availability.
- collects a deterministic run file list plus run
manifest.json, excludingaudio/**and the run-localextract/notarius-output/**staging bundle. - keeps run-local Notarius receipt and stderr diagnostics eligible for the run archive.
- resolves publish output sources through runtime artifact catalog and manifest-aware resolution.
- publishes extraction lanes only through explicit configured output rules; neither run-local nor durable Notarius bundles are scanned or uploaded wholesale.
- selected artifact filter applies to configured artifact sources only.
- locked outputs are skipped intentionally (including required ones).
- optional missing outputs are skipped; required missing unlocked outputs fail.
- writes remote current manifest before current run pointer.
Metadata Signals
Includes counts/lists for:
- run uploads
- published output uploads
- previous uploads
- skipped optional outputs
- skipped unselected outputs
- locked outputs
- current-state key paths
current_pointer_written
Invariants
current/run_id.txtis the remote commit marker and is written last.- run upload excludes
audio/**andextract/notarius-output/**. extract/notarius.receipt.jsonandextract/notarius.stderr.logremain eligible run-record diagnostics.- publish locks are not overridden by
--force.
The commit boundary and cleanup gate are normative architecture invariants; see Architecture.
Related Contracts And Tests
- Configuration owns output and static-lock fields.
- Operations owns remote lock lifecycle and physical remote state.
- Artifact Internals explains source resolution and current-state helpers.
- Implementation and tests:
internal/stage/publish.go,internal/stage/publish_test.go,internal/app/operator_helpers_test.go,internal/app/post_publish_cleanup_test.go