Files
NODEDC_MISSION_CORE/docs/LAB_AND_INSTALLER_STORAGE.md
T

22 KiB
Raw Blame History

LAB evidence and installation archive

Canonical cross-chat policy: MISSIONCOR-97 — Storage rules. The card records the current operator/Worker boundaries and separately preserves the 3 November distributed-storage research and its unresolved acceptance gates.

Owner decision: 7 November 2026. Mission Core is the operator viewport. Worker runtime owns heavy computation and evidence. The Git server owns historical installation packages. This migration does not alter scans, accepted semantic maps, installed plugins, observation recordings, or already published replay data.

LAB ownership and portability

The evidence store is experiments/archive-store relative to the existing Worker runtime volume. The installed LAB worker already mounts that volume at /runtime; evidence is therefore visible as /runtime/experiments/archive-store without a new container, a new service, or storage in a container writable layer. The host drive or machine name is a deployment binding, not an artifact identity.

The runtime descriptor state/laboratory-storage.json records ownership, location, catalog identity and migration state. PIN.json records the explicit exclusion from job/cache cleanup; it is an ownership marker, not an OS access-control mechanism. The installed runner mounts this archive read-only. The dedicated evidence service has narrowly scoped write mounts for explicit owner-authorized LAB deletion (see below). This is preserved evidence, not a TTL cache. Migration admission requires room for the whole planned copy and a 40 GiB free-space reserve; the archive admission budget is 128 GiB. Reaching it requires an explicit retention decision, never deletion of earlier evidence.

The store reuses missioncore.artifact-manifest/v1 and the existing CentralArtifactStore layout:

  • objects/sha256/<prefix>/<sha256>: one immutable copy per distinct payload.
  • manifests/sha256/<prefix>/<manifest-id>.json: standard artifact manifests.
  • refs/laboratory-archive/<reference>.json: stable named references.
  • catalog.json: source groups, registered work IDs, references and totals.
  • Each manifest has an index member mapping original relative paths to roles, hashes, sizes and original file modes. Groups are bounded to 1,500 paths.

Work IDs come from config/laboratories, including lifecycle evidence variants. Unregistered historical groups remain explicitly historical evidence; archiving does not promote them into accepted or runnable LAB results.

Copying is resumable. Existing byte-identical Worker files may be reused only after hashing, using independent copies so later writes to old job files cannot change the archive. The publisher rereads and hashes every remote payload before publishing the catalog. Local retirement requires this receipt and a separate review of live consumers. A transferred byte count alone is not acceptance.

Move the entire store (objects, manifests, refs, catalog and pin) when changing Worker hosts. Rebind the runtime volume in the existing deployment; do not edit file identities or bake host paths into an image. Verify after copying. The portable reader is k1link.laboratory.archive_store:

python -m k1link.laboratory.archive_store --store /runtime/experiments/archive-store catalog
python -m k1link.laboratory.archive_store --store /runtime/experiments/archive-store verify MANIFEST_ID
python -m k1link.laboratory.archive_store --store /runtime/experiments/archive-store restore-file ORIGINAL_RELATIVE_PATH NEW_DESTINATION

Historical migration command (7 November): the fixed LAB agent below was retired on 8 November. It is not a current execution target. The archive remains owned by the managed LAB evidence deployment; use the portable reader above and the current volume binding in deploy/laboratory/README.md. The original receipt recorded this invocation:

docker exec ndc-observatory-installed-lab-worker-agent python3 /runtime/experiments/archive-store/tools/archive_store-HASH.py --store /runtime/experiments/archive-store catalog

Use the actual filename from the descriptor; HASH is not literal. The same verify and restore-file arguments apply. The store mount is read-only, so restore into an explicitly chosen writable destination such as the owning job workspace.

Restoration is explicit and limited to one file. It verifies the index and bytes, rejects unsafe paths, refuses to overwrite an existing destination and makes a new copy rather than a mutable hardlink into evidence. Original POSIX names are lookup identities: literal Windows paths found inside historical Mac filenames are preserved as text and never interpreted as restore destinations. The destination parent must already exist. Original modes are recorded; permissions are not silently elevated during restoration.

Operator presentation is a separate retained product

Owner clarification, 8 November 2026: the viewing product is a complete playable visual recording: synchronized camera frames/segmentation, 3D cuboids, point layers, trajectories and a seekable timeline. A report, screenshot or catalog entry is not a replacement. Existing controls and viewer composition are unchanged. No new narrative/neural reports are introduced in the UI.

The operator composition routes the migrated legacy LAB and LiDAR APIs and four recorded-perception endpoints to the Worker service. Those routes stream responses with Range, ETag and their existing visualization contracts without restoring whole compute directories. This does not cover every Observatory path: the separate portable workflow still uses operator source CAS, result staging/artifact storage and local replay packaging. The 8 November fresh audit below records this remaining gap. Ready scenes, accepted visual recordings, semantic maps, edits and compact recovery metadata remain legitimate products.

The Worker owns experiments/laboratory under the runtime volume. This is a managed compatibility workspace for existing readers, separate from the immutable archive. It contains materialized evidence, current source bindings, annotations and bounded presentation caches. state/ownership.json identifies its owner and archive lineage; state/materialization.json and camera receipts prove migration. Container data never lives in its writable layer. See deploy/laboratory/README.md.

Missing/unreachable Worker returns an unavailable state (HTTP 503); it never starts local computation or restores large inputs onto Core. Existing standalone accepted recordings are retained, but the newly remote LAB routes require the Worker connection. Do not imply that this migration provides universal offline LAB playback.

Supported LaboratoryRunner execution requires explicit Worker authority and confines result/receipt paths to that volume. Existing installed-package dispatch remains the executor for new packaged jobs; the compatibility service is not a second scheduler or a training service. Arbitrary hand-written engineering scripts are not sandboxed by this Python composition boundary: they must also be run on Worker under the same ownership policy.

Lifecycle rules:

  • New raw inputs, intermediate arrays, model weights and training checkpoints stay on Worker. Core may receive only declared presentation products and small status/provenance metadata. No opportunistic fallback or unlimited result sync.
  • Source objects, accepted outputs, manual annotations, active jobs and rollback pins are protected. Scratch has a job owner and terminal cleanup; age alone never makes evidence disposable.
  • Materialization admission is capped at 128 GiB and requires 40 GiB free. Mutating service calls and runner admission check the 40 GiB reserve. This is admission protection, not a hard filesystem quota for arbitrary scripts.
  • Existing publication budgets remain enforced for generated visual products: camera frames 256 MiB, ordinary/fusion RRD caches 1 GiB each, integrated and LAB RRD caches 4 GiB each. Budget exhaustion refuses a new publication and preserves already accepted data. Temporary renderer files are bounded and removed in finally; container /tmp is limited to 512 MiB. No broad automatic eviction.
  • Docker logs rotate (two 10 MiB files); existing pipeline JSONL journals rotate. Keep only the active and one verified rollback service release when retiring this deployment's superseded intermediate images/contexts. Never global-prune another stack or delete shared image layers manually.
  • Legacy catalogs that order results by directory mtime need their metadata preserved during migration; copying bytes alone changes their selection. Preserve exact source/result identities; do not substitute a newer profile for an older sealed experiment. A historical profile mismatch remains a declared playback limitation, not evidence of successful playback.
  • Local retirement requires an immutable archive receipt, Worker verification, live playback comparison, current local SHA-256 equality, and no active owner. Changed/unrecognized files stay. Preserve operator storage-audit metadata and all viewer/map/capture roots. Keep a per-file retirement receipt outside UI.

Installation packages

The private repository dctouch/MISSION_CORE_INSTALLERS is separate from the application source repository. The source repository does not receive private binary payloads. Do not maintain a divergent "new PC" source branch.

The archive uses standard Git LFS for binary segments and ordinary small Git files for source indices, manifests and instructions. The server has release attachments disabled; no server setting change is required. The initial archive is a tar stream compressed with Zstandard (1 GiB window), split into 64 MiB LFS segments. Each segment is independently downloaded and SHA-256 checked before its pointer is published. A final manifest seals the ordered segment list and the checksum of the full compressed stream. An absent or incomplete manifest must never be interpreted as a complete backup.

The tar contains one SHA-256 object per distinct regular file and a path-to-object index, including original sizes/modes. The upload never needs a full temporary archive on the Mac. Source files are checked against the inventory before and during reading. Directory trees, links and working build environments are not retired merely because their regular files were archived.

This is a preservation format, not a finished offline installer or new product download interface. Restore requires Git LFS, Zstandard with the declared window limit and the archive reconstruction helper. The standard Git LFS client reuses already completed segments on retry; a failed segment may need retransmission. The initial tar stream is sequential, so restoring a late member requires reading earlier segments. This preservation snapshot is not yet a selective network package catalog. The helper verifies and restores selected original files. Keep packages required by current install/update flows, active builds and pinned local dependency chains until those consumers have explicit archive support.

Validation and evidence

tests/test_laboratory_archive_store.py covers volume relocation with the source removed, corruption, unsafe member paths and preservation of existing work. tests/test_artifact_gateway.py checks the shared manifest/object transport. Private source inventories, network receipts, catalog identities and retirement receipts belong in the local migration report, not normal Git history.

Archive/installer migration: outputs/operator-storage-migration-20261107/REPORT.md. Worker execution/presentation cutover and verified local retirement: outputs/lab-worker-refactor-20261108/REPORT.md. These are technical evidence files outside the product UI. Their totals are separate measurements; do not add logical file sizes and observed free-space deltas as one freed-disk figure.

Fresh audit and implementation — 8 November 2026

The fresh audit measured approximately 90.48 GB logical checkout data and 68.62 GB free disk. The four migrated compute roots held only 4.68 MB of audit metadata. Material remaining channels were portable source/result copies (1.47 GB), five presentation-cache families (5.97 GB), and two build trees (27.46 GB). These are dated measurements, not deletion authority or current free-space telemetry.

The subsequent history/storage implementation adds Settings → Storage, 1–365 day retention (default 30), local availability, verified pinning and a separate local-copy deletion action for supported portable and composed AI Inference playback. Pinning retains the complete merged recording, not a thumbnail. Deleting it keeps source/result evidence and history; reopening rebuilds playback without rerunning models. The policy protects pins, shared files, in-flight response leases, changed files and unknown paths. It applies only to registered reproducible playback copies, not all LAB files on the operator. The detailed lifecycle and exclusions are in STORAGE_RETENTION.md.

History exposes catalogued LAB independently of player support. That revealed 19 results in the pre-cleanup snapshot (five TREE, fourteen RAVNOVES00), including 15 formats without an admitted player. The owner subsequently authorized their full removal, together with failed attempts. These snapshot counts are historical; the verified current inventory belongs to cleanup acceptance. A composition represents its exact jobs, not every attempt of the same setup.

The UI acceptance used an existing 13:28.779 composed recording: pin, Play/Pause, expanded view/Escape, unpin, local deletion, reopening and playback after rebuild all passed. The registered copy was 465.9 MiB. This proves that local portable path, not a universal remote stream or compatibility of every old experiment.

Remaining architecture work: bound and retire portable source/result staging and other intermediate families, preserving verified recovery; add other presentation families to the replica lifecycle through explicit adapters; and close install/build archival dependencies separately. Local playback copies and necessary local decoding are intended operator behavior, not migration defects. Local replay packaging currently exists; its retained inputs must have explicit ownership and bounded lifecycle. A mandatory move of every playback-preparation step to Worker is not established by this storage audit. Gaussian scenes, semantic maps, manual edits and unique evidence remain protected. No claim of complete LAB offload or a percentage of global storage completion is made by this bounded implementation.

Explicit LAB destruction — owner clarification, 2026-11-08

The LAB trash action means permanent deletion on Core and Worker, including its pinned playback copy, private output packages, admitted job scratch and legacy archive payloads. It is not catalog-only hiding or an implicit archive. Source recordings, Gaussian scenes, semantic maps and files shared by another retained LAB are separate owners and survive. Small deletion receipts remain; they do not retain a hidden playable result.

deletion_coordinator.py freezes exact job/result identities, checks active playback leases, blocks republication, requests authenticated Worker deletion, then removes local owned bytes and only finally removes the catalog projection. Missing Worker acknowledgement leaves an explicit failure and the history row. A repeated request resumes the journal. The UI warns that undo is unavailable. The separate local-copy button and TTL still preserve history and Worker data.

deletion_inventory.py adapts admitted producer layouts; data_deletion.py accepts opaque IDs and validated relative file inventories under deployment-bound roots. Unrecognised result ownership is refused, not treated as an empty result. Archive path tombstones prevent restore of deleted members; content shared with a retained source/result remains. New producers must add ownership integration. This is a scoped LAB lifecycle, not a universal sweep of every Worker directory.

Current cleanup acceptance (8 November): 14 failed attempts and 16 unsupported/broken LAB results were permanently removed on Core and Worker. All 26 source recordings remain; three current result projections back three playable history rows. See verified cleanup report.

Full cleanup clarification — 8 November 2026

Three accepted AI Inference views are not the complete LAB subsystem. The repository has 44 registered laboratory evidence definitions; the Worker archive also preserves their component evidence, input captures, annotations and dated qualification material. Keep these owners distinct from a user-deleted result. Absence from the AI Inference history is not a deletion criterion.

The full audit found presentation copies missed by the original flat-cache adapter: nested session/result RRD sidecars and a v12 derived recording cached under a deleted result ID. The deletion inventory now covers these exact legacy layouts. The latter accepts only a recognized result ID, matching session ID and missioncore.derived-rerun-recording-cache/v12 schema; original source recordings and non-cache files remain excluded. Supplemental receipts correct the prior cleanup's coverage without resetting completed deletion journals.

Audit, exact removals, protected component inventory and scope limitations: outputs/lab-global-cleanup-20261108/REPORT.md. The audit is not a qualification of every archived experiment, and no universal filesystem purge is implied.

Local LAB playback clarification and UX — 8 November 2026

The operator downloads/restores ready visual data and plays it locally. No WebRTC video stream from Worker is required. A registered complete recording is a valid local product; its pin protects it from expiry. Unpin begins the configured retention interval again. Local-copy removal/expiry preserves history and Worker results; full LAB trash remains the explicit cross-host deletion operation.

AI Inference now provides an active download action when the local copy is absent. It prepares the recording without opening the viewer or rerunning inference. The eye and pin use the same bounded, cancellable preparation coordinator. History shows date / actual registered recording bytes (decimal MB), or zero when absent; shared source/model dependencies are not misrepresented as this recording's size.

The opaque viewer spinner is replaced with canonical progress and short stages: availability check, recording preparation, recording opening. Unknown progress stays indeterminate. The opening fraction, where available, comes from the player's buffered timeline, not an invented timer or a claim about network byte transfer. The existing server still has a synchronous packaging step; there is no measured byte-level percentage for that step. Warm openings reuse the prepared recording.

The current portable renderer restores required saved artifacts, builds the replay on Core when absent, and serves the completed recording to the browser. Local .pack-* directories use TemporaryDirectory cleanup. This is distinct from model execution and from historical build outputs, source/result CAS and component benchmarks, whose lifecycles must be audited separately. Missing UI rows alone do not establish that component evidence is junk.

Acceptance: LAB playback UX.

Remaining intermediate stores — 8 November 2026

AI Inference is closed in the accepted UI/history/playback scope. The separate intermediate storage review records actual Mac/Worker owners, verified duplicate bytes and remaining lifecycle gates. Integrated/experimental models and their required environments, component inputs and regression evidence remain protected, including files named cache or derived. The detailed ownership/retirement policy is in STORAGE_RETENTION.md. That initial audit did not implement these mechanisms. The subsequent retirement/retention implementation added source/staging budgets, verified archive fallback and published-transfer retirement. The 9 November follow-up replaces the fixed transport ceilings with shared physical-disk admission and adds producer-owned source last-consumer GC; see the current transfer lifecycle in STORAGE_RETENTION.md.

Legacy review and package distinction — 8 November 2026

The monthly/default-30-day interval concerns only unpinned viewing copies on the operator Core. Worker models, executor distributions/images, environments and experimental configurations remain until a separate pipeline-consolidation decision. Retiring transfer/expanded-data duplicates is a different operation; it must not become model/runtime package garbage collection.

The follow-up audit traced the accepted modular UI and the then-retained fixed LAB V1 API/agent. The later owner-authorized migration removed V1 admission and its standalone container after verifying identical shared DDRNet/EoMT weights; models remain. Two unused UI controllers and their exclusive test were removed. Shared portable APIs, TGS and component evidence remain dependencies. Thirty-three duplicate data paths were retained with independent APFS copy-on-write backing; no evidence identity or model was removed. This is not a portable runtime requirement or an automatic retention implementation. Published result transport now supports CAS-aware closeout with immutable receipts and corruption checks. Source copies now retire after verified last-consumer completion, never by age. Unknown historical copies stay protected. Models, images and experimental environments are excluded. See outputs/lab-source-lifecycle-20261109/REPORT.md.