Repository navigation
Description
Managed snapshot publication in #448 renames a completed staging directory into indexes/<index_build_id>, rewrites _SUCCESS, then publishes its graph/data-version reference. A crash between these steps can leave an unreferenced physical build. Before the marker rewrite, _SUCCESS still contains absolute staging paths. The next Graph.snapshot() cannot discover that build and can ingest another one. #403 shares indexes/ with independent PyTorch ingests, so lack of a core reference alone does not prove a build is disposable. #404 supplies the physical build identities used by bases, task extensions, and caches.
Implement recovery and a safe orphan-retention/collection policy under the single configured Kumo root. Keep logical graph/data-version identity separate from physical build identity; do not copy bases, adopt an unrelated physical build, or change export identities as a side effect.
Acceptance criteria:
- Inject process interruption immediately after rename, after success-marker rewrite, and before/after reference publication. Preserve completed bytes and validate recovery/retry behavior without silently associating a reference with the wrong build.
- Handle stale absolute paths in the moved
_SUCCESSusing verified physical metadata. Repeated recovery is idempotent, and incomplete or damaged builds are not published. - Coordinate recovery and collection with ingest/publication and other processes through appropriate locking or an equivalent ownership protocol. Do not race an active writer or reader.
- Define how live core references, PyTorch-created bases, retained snapshot handles,
tasks/<build>/..., andcache/<build>/...protect a build. Unreferenced core output must be distinguishable from another producer's valid base before any deletion is possible. - Make retention and any destructive cleanup explicit and inspectable. Never overwrite or remove a different build to make a retry succeed; document collision/staging cleanup and retry semantics.
- Test interrupted publication, concurrent recovery/collection, multiple producers, protected live state, legacy snapshots, and repeated cleanup. Document the policy and remaining crash/durability limits.
Follow-up to #448, #403, and #404. This issue tracks lifecycle work beyond the publication migration; those PRs do not currently provide automatic orphan collection.
Activity
Publish core snapshots under managed build-ID locations (#448)