Files
NODEDC_MISSION_CORE/docs/STORAGE_RETENTION.md
T

731 lines
48 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# Mission Core storage lifecycle
Policy revision: `operator-storage-v2` (2026-10-16).
Build-input policy remains `two-closed-inputs-per-line-v1`.
This implements the storage boundaries in `AGENTS.md` and supplements
[the artifact policy](03_ARTIFACT_POLICY.md). It applies only to the canonical
operator checkout; other repositories, boards, Worker 006 and Docker storage
are separate owners. No system-wide prune or periodic deletion timer is installed. Cache budgets
run at publication; service journal rotation runs in the owning writer.
## Classes and enforcement
| Data | Retention and mechanism |
| --- | --- |
| Source, configuration, secrets, `.git`, installed dependencies and active UI | Not disposable storage. No generic age-based cleanup. |
| Rover/battery scene and environment profiles, materials/textures, camera/editor layout and battery UI | Durable configuration in `data_dir/scene-profiles/.../meta.json`, with `meta.previous.json` on replacement. No cache TTL or scratch cleanup; retain verified recovery sources. Browser records are migration inputs only. |
| Imported Gaussian worlds, recordings, evidence, missions, plans, accepted maps, session map versions | Durable application data. No TTL. Deletion belongs to the owning product workflow or an explicitly reviewed archive/removal operation. |
| Simulation qualifications, computation experiments/results, engineering materials | Preserve unique evidence and the exact input/configuration/result relationship. An old experiment is not a cache. Archive only with a verified destination and complete dependency inventory. |
| Qualified releases and rollback artifacts | Explicit pins; retain independently of the intermediate count. Retiring a release requires removing its pin by name and recording the reason. |
| Unpacked qualified `.deb` duplicates | Node/X4 owner builders automatically retire only their exact packaged payloads after atomic installer publication and full SHA-256 verification. The installer, qualification evidence and recovery pointer remain. Persistent consumer holds or an unavailable reader check defer cleanup. See qualified payload closeout below. |
| Intermediate Linux build inputs | Keep two most recently **published, completed, unpinned** inputs per line, plus every transitive base of retained inputs. Lines are `node/node-only`, `node/node-core`, `x4/native`, `x4/package`, `x4/owner`. Enforced by `scripts/packaging/build_retention.py`. |
| Active/disconnected builds, transfers and qualifications | Persistent active hold, with owner token. No automatic expiry. Explicit terminal outcome releases the hold. Eight unfinished inputs per archive family block the next publication. Node profiles share this conservative unfinished limit. |
| Old or unknown inputs | Protected as `legacy-unreviewed`; importing into the registry requires a named protective pin. Neither mtime nor lack of a reference proves that a legacy file is disposable. |
| General artifact gateway cache | Existing LRU/pin implementation: default 8 GiB local quota and 2 GiB free-space reserve; pinned objects survive eviction. Configuration may override these defaults. Not handled by build retention. |
| Portable replay, integrated/canonical LAB overlays, editor scene assets | Existing generations are protected. New publication has a per-owner quota and a 2 GiB free-space reserve; no automatic eviction or TTL. Cache hits and sealed recovery remain available at quota. See the limits below. |
| Worker source CAS and sealed modular-node results | Separate Worker/result ownership. No new deletion or expiry; a source/result can be unique or required by a retained job. Existing source admission/free-space checks remain. |
| Vite unit-test cache | Each server owns a unique `.runtime/frontend-unit-tests` directory and removes it on close or failed creation. Existing test helper enforces this; tests run sequentially. Abandoned crash files need a separate verified cleanup. |
| Python check caches | `scripts/check_python.py pytest/ruff/mypy` creates one owned `.runtime/python-checks` temporary directory, disables persistent pytest/Ruff caches and redirects mypy there. Stop owned helper processes before cleanup, including failed checks. Four active/unreconciled check directories or a 512 MiB admission budget block the next check; 64 MiB of headroom is required before admission. Existing/foreign crash residue is preserved. Direct ad-hoc tool invocation is outside this managed entry point. |
| Compiler caches and other task scratch | Disposable only with no active owner. Node Linux build jobs already place Go/npm state inside their owned build folder; remote staging is a separate lifecycle. Never purge shared toolchains, downloaded offline dependencies or another job’s directory. |
| Operator monitoring | Live-only RAM: one latest snapshot per node, maximum 32 nodes, 192 KiB snapshot plus 32 KiB duplicate-comparison sample per node; 30-second expiry, one-second idle sweep and UTC daily reset. No local history database. UI/API use current observations only. Retire an obsolete replica only after live-mode acceptance with the scoped plan/apply tool; see [operator monitoring](OPERATOR_MONITORING.md). |
| Routine service logs | Core, Observatory/Gaussian worker tunnels, telemetry startup/tunnel and Map Gateway link use `rotating_process`: 8 MiB × (current + 4 backups), at most 40 MiB per service. Legacy journals remain intact and stop growing after migration. Scanner diagnostics use 5 MiB + 5 backups with 16 KiB records and private files after rotation. Existing Docker logs remain `local`, 5 MiB × 2 per container. Experiment/build/mission calculation logs remain evidence and are excluded. |
A 6 GiB build-input soft budget is reported, not used to override pins. A
producer checks the uncompressed estimated payload plus ZIP overhead and leaves
at least 2 GiB free before staging. Existing Linux/qualification-specific space
checks still apply. If protected data consumes the budget, report it and stop
creating more inputs when the free-space guard fails; do not delete evidence.
The two-input rule is a count policy, not a promise of a total storage ceiling.
## Build lifecycle
The four generators (Node Linux, X4 native, X4 package, X4 owner wrapper) publish
through the same local helper. They write a uniquely owned temporary file,
validate manifest identity and base hashes, then publish without replacing an
existing path and persist the active hold. Their existing JSON response adds:
```json
{"retention": {"path": "apps/node-agent/build/mission-core-node-linux-build-<id>.pyz", "owner": "<token>", "state": "active"}}
```
A failed writer removes only its own temporary file. A crash after publication
but before registry commit leaves a protected unknown input. The helper is
operator packaging code, not a new board/runtime dependency. Production inputs
are not rebuilt just to exercise retention.
After the remote job and every dependent transfer/qualification actually end,
the owning engineer/agent must close the hold using the returned path and owner:
```sh
.venv/bin/python scripts/packaging/build_retention.py finish "$input" \
--owner "$owner" --outcome intermediate --reason "Build and transfer completed; no retained release uses this input" \
> .runtime/build-retention/review-plan.json
```
Choose `failed` or `cancelled` only after the job has stopped. These inputs join
the two-input history; failure does not silently delete diagnostic evidence.
Choose `qualified` or `rollback` to close the active hold **and** add the named
permanent pin. Add another named pin before a later qualification/release starts
using an already completed input. Do not close someone else's active build.
A disconnected job remains active until terminal state is established.
Review the returned plan (or generate a fresh one) and apply it as the final
build-storage step; this is part of build completion, not a user-facing manual
maintenance ritual. `finish` itself never deletes bytes.
```sh
.venv/bin/python scripts/packaging/build_retention.py plan \
> .runtime/build-retention/review-plan.json
.venv/bin/python scripts/packaging/build_retention.py apply \
--plan .runtime/build-retention/review-plan.json
```
On a never-initialized checkout, `plan` is read-only and does not create the
control directory; save its output to an existing task-owned directory instead.
An older plan is refused if a file, lifecycle state or pin changes. Review and
regenerate it. Do not edit the plan to force deletion. A malformed package,
missing/changed base, unexplained missing registered input, or unsafe path blocks
**all** deletions in that operation.
Explicit legacy enrollment and release pinning:
```sh
.venv/bin/python scripts/packaging/build_retention.py adopt "$input" \
--pin legacy-review --reason "Retained provenance; exact evidence record path"
.venv/bin/python scripts/packaging/build_retention.py pin "$input" \
--pin release-0.1.3 --reason "Qualified release and its evidence record"
.venv/bin/python scripts/packaging/build_retention.py unpin "$input" \
--pin legacy-review --reason "Reviewed as superseded intermediate; no release or rollback depends on it"
```
`unpin` is an explicit decision, not an automatic inference from time or a failed
build log. All unknown inputs remain protected even without registry enrollment.
## Integrity, interruption and audit
For `build_retention.py`, only exact build-input filenames directly under `apps/node-agent/build` and
`plugins/insta360-x4/build` are eligible. Installers, `.deb` releases, qualified
subdirectories, rollback copies and runtime data are outside the allowlist.
Symlinks and traversal paths are refused. Publications and maintenance share an
OS file lock; generators cannot race an applied plan. External tools must use
the same helper rather than mutating managed inputs in place.
The plan verifies full archive hashes, manifest IDs, profiles and dependency
closure. Apply independently recomputes the plan under lock and checks each file
again before unlink. Dependants are removed before their bases, so an interrupted
operation does not strand a retained delta. Every unlink is journaled under
`.runtime/build-retention/receipts`, including the planned identity, actual removed
paths, status and free-space observations. There is no recursive directory delete.
An interrupted apply can be reconciled using the receipt basename:
```sh
.venv/bin/python scripts/packaging/build_retention.py recover "$receipt_basename"
```
Recovery only reconciles already journaled missing files; it performs no deletion.
After reviewing the receipt, create a new plan for the remaining files. Receipts
and lifecycle records are small engineering evidence, not raw telemetry; preserve
them. A crash before an unlink is distinguishable from one after it by the file's
presence and verified identity.
`candidate_bytes_upper_bound` is logical file size, **not** promised reclaimed
space: hardlinks/APFS clones can share blocks. Receipts report filesystem free
space before/after; concurrent system activity can affect that delta.
## Qualified payload closeout (2026-11-16)
The owner installer builders previously kept both their `.pyz` installer and
all loose `.deb` files. Input-bundle retention cannot remove these: qualified
directories deliberately sit outside its allowlist. The separate
`scripts/packaging/qualified_payloads.py` now owns this narrow output lifecycle.
It is called by the Node and X4 `build_owner_release.py` entry points; the X4
standalone Ubuntu builder carries the same helper inside its verified bundle.
It does not change the Linux input-bundle policy, installed software, runtime
data, project sources, Worker storage or retained installers.
Publication and closeout share OS locks. The builder writes a private temporary
installer, flushes it and atomically publishes without replacement. A recorded
interrupted publication can remove only its own temporary inode on the next
invocation. An existing installer is reused only if every member matches.
Before any loose payload is removed, the helper verifies the complete installer
SHA-256, each archived member, the qualification report and all loose candidates.
It durably records member names, sizes and hashes in `PAYLOAD_LOCATION.json`.
Only the exact `.deb` members admitted by that builder are eligible. Unknown
files, directories, legacy pointers without managed membership, symlinks and
changed evidence never become cleanup candidates. Hardlinks are handled without
removing another owner's path. Logical bytes are not a physical-space guarantee.
The pointer journals each unlink and the final result. If the process stops
between unlinks, retry validates the retained archive and finishes the remaining
paths. There is no age-based sweep or background timer. Normal successful
publication closes out automatically; deferred/interrupted work is retried by
the same builder, explicit `retry`, or release of a consumer hold. The builder's
JSON includes `payload_cleanup` (`complete` or `deferred` with a reason).
`QualifiedPayloads.read(name)` reads a still-present package or its verified
installer member, without recreating a persistent copy. Both owner builders use
this path, including repeated/concurrent packaging after closeout. The Node
Linux source generator also embeds the retained X4 package directly from verified
archive bytes; `repack_runtime.py` reads its retained Node predecessor the same
way. Neither recreates a loose base package. Older
one-off repack scripts that directly open a `.deb` path must use this API or
register a hold **before** installer publication. They are not silently made
archive-aware. The historical v1 recovery pointers created by the reviewed
one-time cleanup remain readable and are not automatically enrolled for deletion.
A dependent consumer spanning multiple commands uses a persistent named hold.
Under the canonical repository, set `qualified_dir` to its exact qualification
directory and `archive_dir` to `apps/node-agent/build` or
`plugins/insta360-x4/build` (canonical absolute paths):
```sh
.venv/bin/python scripts/packaging/qualified_payloads.py hold \
--repository "$PWD" --archive-root "$archive_dir" --qualified "$qualified_dir" \
--owner "dependent transfer/qualification"
# Retain the returned token; after that consumer is confirmed terminal:
.venv/bin/python scripts/packaging/qualified_payloads.py release \
--repository "$PWD" --archive-root "$archive_dir" --qualified "$qualified_dir" \
--token "$payload_token"
```
Holds survive restarts and never expire. Releasing the final hold runs closeout.
An open reader detected by `lsof`, a missing `lsof` executable, a timeout or an
ambiguous reader-check result defers removal while preserving the installer and
loose payloads. After resolving the condition, use `retry` with the same three
path arguments. Do not force-delete the files or another consumer's hold.
`tests/test_qualified_payloads.py` exercises real Node/X4 builders using tiny
payloads, concurrent/repeated publication, the standalone isolated X4 entry,
reader deferral, persistent holds, modified evidence, publication failure,
interrupted deletion, pointer-write failure, hardlinks and unsafe paths. No
production rebuild or Core service restart is needed for this operator-script
change; it takes effect on subsequent owner packaging.
## Acceptance
`tests/test_build_retention.py` covers separate lines, transitive bases, release
and rollback pins, legacy protection, active owners and restart, stale/edited
plans, unsafe paths, hash changes, publication failure, missing bases, capacity
refusal, concurrent publication, partial deletion, crash recovery and hardlinks.
It also executes all four real producer wrappers with tiny synthetic input
fixtures. Existing delta reuse and artifact-cache tests remain applicable.
The initial live adoption preserves reviewed historical inputs and leaves new
unreviewed inputs protected. No old source bundle is declared disposable merely
because this policy has been installed.
## Local derived-cache budgets
`src/k1link/cache_budget.py` provides one admission/publication lock across local
processes, a full logical-byte inventory and a 2 GiB free-space reserve. Unknown
files, existing generations, partial outputs and sidecars count against capacity.
Symlink/special-file inventories are refused, never followed or deleted. Up to
10,000 files are admitted by default (4,096 for editor assets). Quotas are
conservative logical sizes; hardlinks/APFS clones do not authorize deletion.
| Cache owner | Publication quota | At capacity |
| --- | ---: | --- |
| Exact camera JPEG frames | 256 MiB | Return the validated decoded frame without a new disk copy; retained frames still work. |
| LiDAR validation proofs | 16 MiB | Validate the original normally; skip the optional proof write. |
| Prepared camera media sidecars | 64 MiB | Use the validated manifest in memory; skip the optional sidecar write. |
| Perception overlays | 1 GiB | Refuse a new cached generation; retain existing generations. |
| Calibrated fusion overlays | 1 GiB | Same. |
| Integrated perception overlays | 4 GiB | Same; reconstruct admission in memory if its optional sidecar cannot fit, so an existing sealed overlay remains usable. |
| Canonical LAB overlays + replay | 4 GiB combined | Reuse existing admitted output; refuse new publication when insufficient room. |
| Portable replay + camera proxies | 4 GiB combined | Same. |
| Editor scene assets | 4 GiB | Account for all declared, unfinished transfers before accepting a new manifest or chunk. Do not discard partial uploads or ready assets. |
Larger renderers check room before work and again under the publication lock.
The final check counts staged bytes already on disk, plus sidecar headroom. This
bounds accumulated published copies; it is **not an OS filesystem quota** or a
promise that transient renderer scratch never exceeds the publication budget.
Existing bounded renderer inputs/outputs/timeouts and `finally` cleanup still
apply. Crash residue is counted and protected, so it can stop further admission;
its owner must be investigated before removal. No broad crash-directory sweep
is enabled. A quota cannot both preserve arbitrary unique data and allow
unlimited new copies; capacity refusal is intentional and explicit.
General artifact/recording caches retain their established LRU/pin contracts.
No new automatic removal is applied to simulation worlds, source media, plans,
accepted geometry, qualifications, results, offline dependencies or rollback.
The earlier Vite SSR helper still owns/cleans each test cache and disables
unnecessary dependency prebundling. Ordinary development sessions and external
user commands are not silently enrolled into a global cleanup job.
## Bounded service journals and migration
`src/k1link/rotating_process.py` supervises the exact existing command and drains
merged stdout/stderr through a bounded binary writer. Rotation splits even a
large single write, retains current + four backups and holds an exclusive lock.
It does not copy/truncate a file concurrently written by a service. Binary bytes
are preserved within the retention window. Signals reach the child; launchd
continues to own the whole process group. If disk writes fail, the pipe is still
drained with a bounded loss counter so logging cannot deadlock Core. A recovery
marker reports dropped bytes when writing becomes possible again.
The outer `uv run --no-sync --project` uses the existing Mac execution boundary;
no packages are synchronized. Its pre-Python bootstrap stdout/stderr goes to
`/dev/null`; bootstrap failure is diagnosed through launchd exit status and the
hash-gated rollback check. Child output, including Python exceptions, goes to
`*.managed.log`. No credentials, SSH arguments, routes or Docker settings change.
The original command/environment/scheduling fields are preserved by
`scripts/manage_runtime_log_policy.py`. Apply requires an exact current plan,
saves the original plist under `.runtime/storage-maintenance/log-policy`, reloads
one existing service and verifies Core health or stable helper state. Failed
acceptance restores the exact previous declaration and checks it. Plans and
receipts contain hashes and service metadata, never environment secrets.
```sh
.venv/bin/python scripts/manage_runtime_log_policy.py plan core > .runtime/core-log-plan.json
.venv/bin/python scripts/manage_runtime_log_policy.py apply core --plan .runtime/core-log-plan.json
```
Other explicit owners: `observatory`, `gaussian`, `telemetry-startup`,
`telemetry-tunnel`, `map`. Existing journals are left byte-for-byte intact as a
one-time legacy baseline; they are not added to the rotating set or compressed
in place. Existing launch-agent generators emit the bounded writer declaration,
so a subsequent normal update does not restore unbounded output. A fresh plan
after installation is unchanged. No new long-running service besides each
existing service's output supervisor is introduced.
## Cache/log acceptance
Tests cover exact quotas, free-space reserve, protected unknown files, concurrent
publication, unfinished editor reservations, optional camera-cache fallback,
sealed-overlay recovery at capacity, bounded binary rotation across restart,
exclusive writers, linked-path rejection, child exit/signal handling, private
rotated diagnostics, stale migration refusal and exact rollback on failed health.
The Python-check wrapper is tested on successful and failed child exits while
preserving another job's directory. Live acceptance separately verifies all
six declarations, Core/API/catalog health, unchanged existing-cache hashes and
zero owned test-cache residue. No high-volume live log or renderer load test is
run on the operator Mac.
## Simulation experiment closeout — owner amendment 2026-10-19
The owner explicitly authorized retiring historical engineering frames, render
arrays and simulation trial traces after detailed textual preservation. This
supplements the evidence rule above; it does not remove protection from product
state, input worlds, working source, offline dependencies, releases or rollback.
For future engineering-owned simulation/infrastructure trials, closeout is part
of completing the experiment, not a later request for the owner to free disk:
1. Before capture/export, declare the exact owned temporary directory, expected
bytes and a finite capture limit. Check free space and reuse identical
source/observations by identity instead of exporting another complete copy.
2. Once all writers/remote owners are confirmed terminal, write the hypothesis,
inputs/configuration/source identities, observed result, quality/time,
failures and next decision. Preserve regression evidence and the small set
of images referenced by the final report. A failed experiment also closes.
3. Store exact textual material once per content hash; preserve the original
path-to-hash index. Verify the archive by reading it before deleting originals.
4. Review the exact file-level list, exclude sources/product data/releases and
active or unknown owners, then unlink only unchanged disposable files.
Journal removals and available space. No recursive age-based sweep.
5. Link the archive from the report and relevant Ops card. State explicitly
which original media is gone and requires rendering or running again.
The 2026-10-19 operation is recorded in
`outputs/SIMULATION_EXPERIMENT_ARCHIVE_2026-10-19/README.md`, its plan, SHA-256
inventory, archive verification and deletion receipt. Its helper is a one-shot
reviewed operation, not a scheduled garbage collector. Ad-hoc engineering
scripts have no universal disk quota: they must implement the declared capture
bound and perform closeout. Existing cache quotas and service-log rotation keep
their separate writer-owned enforcement. This amendment does not claim that a
filesystem-wide automatic limit or remote Worker cleanup has been installed.
## Imported scan originals — owner amendment, 2026-11-07
For manual Gaussian LCC/LCC2 folder and ZIP/RAR/7z imports, Mission Core owns
**temporary transfer staging**, not permanent original storage. An available
Gaussian provider advertising `durable-source/v1` is required before allocating
an upload project. An outage mid-transfer preserves unfinished staging for retry.
On complete transfer the provider verifies every admitted original by size and
SHA-256, flushes the bytes and publishes an independent retention receipt.
Core persists that receipt, freshly verifies remote hashes and its local hashes,
journals `verified → retiring → remote`, and removes only the declared local
source files. Interrupted retirement resumes using that persisted receipt.
There is no low-disk exception that deletes an unverified archive.
Conversion then runs from Worker storage. Its failure, job cancellation or job
removal does not remove retained originals. Retry uses the receipt; no full local
fallback copy is created. Core keeps optimized SOG/LOD/collision artifacts,
source identity/receipt, small optional trajectory metadata, and application edits.
The user's original file outside the imported project's source directory is not
part of staging and is never deleted by this workflow.
Older ready projects can be migrated with
`POST /api/v1/simulation-worlds/projects/{id}/source/retain`. The endpoint verifies
that the existing provider job includes **every** imported file, retains it,
then retires staging without changing the world manifest, source bundle identity,
viewer settings, artifacts or semantic map. Legacy archives are resolved through the matching Worker ingest record and their
original upload descriptor; missing or mismatched ownership is refused. An old job ID alone never authorizes deletion.
Provider receipts and pins live in the existing persistent Gaussian data volume,
independent of containers/jobs. Migration needs the entire volume, configuration,
secrets and compatible executor, not just a Docker image. Provider address is a
hint; receipt identity and hashes permit relocation to a different host. See the
provider repository `docs/SOURCE_RETENTION.md` for its API and portability boundary.
This supersedes local-original retention for this narrowly defined import flow;
other recordings, unique evidence and application data remain protected above.
## Road-marking and semantic storage — audit 2026-11-07
The ordinary infrastructure pipeline renders/infers/assembles on Worker. Core
receives bounded vector maps and job/provenance metadata; the raw UI layer is a
read-only geometry document, not the full RGB/depth/mask dataset. Saving human
edits sends revision packages to the separate Worker learning store, which builds
observations/datasets and returns delivery receipts. Neither path installs a
local training or full-observation fallback.
Operator-owned durable product data:
- `ai-polygon/urban-maps`: immutable raw/algorithmic versions, including bases of
manual edits. A shared 1 GiB publication limit and 2 GiB free-space reserve now
cover all scenes. A whole raw/algorithmic pair is admitted together, then its
pointer is replaced atomically. Full storage refuses new versions; it never
removes existing maps. Identical retries and reads remain available at capacity.
- `ai-polygon/semantic-edits`: manual branches, exact revision history and dataset
delivery receipts; existing 64 MiB aggregate/8 MiB state limits remain.
- `ai-polygon/editor-cache`: optimized SOG/collision assets with the existing
4 GiB publication quota and transfer reservations. Project-backed scenes use
artifact references, not another original-cloud copy.
- App runs, plans and accepted recovery evidence remain application state. Their
names do not make them disposable research cache.
Engineering exports on Mac must close within the working package: name the owner,
exact staging directory, finite byte allowance and expected output before copy;
retain a concise report, configuration/input hashes, required result/rollback
references, one verified text archive and at most two final proof images (16 MiB
aggregate). Heavy RGB/depth grids, NPZ/logits/features, full point-cloud
adaptations, datasets and checkpoints stay in the separate persistent Worker
store. A full street does not authorize a full local render dump. New unique
result/rollback data need an explicit retained reference; arbitrary old exports
are not automatically protected merely by being called evidence.
At closeout, verify stopped ownership and every retained archive/member hash;
remove only exact unchanged listed duplicates or explicitly disposable generated
media. Preserve a path-to-hash recovery index and deletion receipt. Do not sweep
by age or remove unknown files. The source-package helper remains source-only;
its caller must remove its own transferred staging after remote identity checks.
This is an engineering closeout obligation, not an automatic whole-disk quota.
Worker stores remain separate: learning `datasets`, `inbox`, `sources`, `work`;
infrastructure `jobs` and generated source caches; historical qualifications and
explicitly pinned archives. Container removal never removes its data mounts.
The November closeout adds bounded admission and terminal job handling:
- Learning Store: 20 GiB operational data, 8 GiB explicitly named research roots
(`experiments`, `agent-reviews`, `audits`, `archives`, `reviews`, `verification`),
12 GiB free-space reserve. Unknown roots count as operational data. Both budgets
are checked; exceeding either refuses new data. This is application admission,
not a filesystem quota for arbitrary external research scripts.
- New infrastructure jobs: 24 GiB per job, 48 GiB aggregate working directory,
40 GiB free-space reserve. The coordinator checks output/free space at heartbeat
intervals; a writer can overshoot between checks. These are not OS hard quotas.
- The separate terminal-job archive has a 128 GiB admission limit. A new job
reserves room for its maximum output before starting. Existing results are
never silently evicted to admit new work. A full archive blocks admission and
requires an explicit retention decision.
- `simulation/ai-polygon/evidence_closeout.py` runs only after owned producers
stop and Core confirms delivery/rejection and lease release. It creates an
archive of the exact inventory, verifies every SHA-256 and member, then retires
only unchanged non-kept files through a durable intent journal. Root map,
publication request/failure and an archive pointer remain in the job directory.
A pending closeout retains its durable marker across coordinator restarts.
Pins, links, changed files, invalid journal records and insufficient reserve
fail closed. A published ZIP is recoverable even if the following state commit
was interrupted. Archives are persistent data, not another disposable cache.
- Previously created jobs do not acquire cleanup authority retroactively. Failed
learning work and legacy experiments require their own explicit inventory,
stopped-owner proof, archival check and receipt. Accepted datasets/models,
shared sources, pending edits and required rollback remain protected.
`scripts/compact_closed_evidence.py` is a separate maintenance tool for explicitly
closed immutable historical snapshots. It groups only eligible NPZ/PNG/JPG files
by full bytes and identical permissions, anchors one NTFS inode in a pinned store
and keeps every original path as a read-only hardlink. It changes neither logical
content nor reference paths; logical byte totals and application quotas therefore
remain unchanged. It refuses reparse paths, foreign links, alternate streams,
changed files and cross-volume stores. Read-only is an accidental-write guard,
not a security boundary: owners must not clear it and edit a shared snapshot.
The full plan retains original identity/mtime/mode and a per-alias receipt.
Recovery creates a NEW independent file; it never unlocks the shared inode.
Windows restoration verifies owner/group/ACEs/protection, allowing only the
recomputed `SE_DACL_AUTO_INHERITED` bookkeeping bit. CAS aliases themselves keep
the original raw descriptor exactly. Keep the canonical store pinned outside
all job/scratch cleanup roots. This same-volume optimization is optional;
ordinary copies on another filesystem retain the data but may use more space.
ZIP/JSON datasets and results remain portable. Storage paths and byte limits live
in the worker profile. Coordinators are immutable source releases using the
existing Windows Python/Scheduled Tasks; heavyweight inference runs in pinned
Docker images with external persistent data. Runtime-only patch activation
preserves credentials, task settings, network and the previous release for rollback.
The audit/cleanup index is `outputs/semantic-storage-audit-20261107/REPORT.md`.
The 19 October content-addressed experiment archive remains protected; November
cleanup retires only extra Mac copies verified against that archive, with a
one-file restoration helper. That local-only audit did not delete Worker datasets or qualifications. The
subsequent explicit closeout is indexed separately at
`outputs/storage-closeout-20261107/REPORT.md`; do not add the two cleanup totals
without checking their distinct manifests.
## LAB and installer offload — 2026-11-07
The owner-authorized operator offload uses the existing Worker runtime volume
for preserved LAB evidence and a separate private Git LFS installation archive.
See [the ownership, portability and recovery contract](LAB_AND_INSTALLER_STORAGE.md).
This does not authorize removal of local viewer dependencies, source scans,
accepted maps, installed plugins or pinned build chains. Per-file retirement
requires a verified remote copy and a dependency review; archive transfer and
space reclamation are reported separately.
## LAB playback copies — 2026-11-08
Global Settings → Storage controls the retention of registered portable AI
Inference playback copies: 1–365 days, default 30. The store is
`data_dir/lab-local-storage.json`; owned files stay in
`data_dir/observatory-portable-replay-cache`. The renderer registers only a
validated complete merged RRD and its mapping sidecar. Unknown historical files
are not adopted through directory scanning and are not automatically removed.
Opening a supported result refreshes its last-use timestamp. Reading the catalog,
polling local availability or viewing Settings does not extend retention. Unpin
starts a full grace period. The reaper runs at service startup and then hourly;
changing policy may make unpinned copies eligible at the next sweep. Pin verifies
all registered file hashes and excludes that copy from expiration. Existing
cache publication budgets and free-space refusal still apply, including pinned
bytes; this is not a new global disk quota.
Local-copy deletion checks file identities, in-flight response leases and shared
references. Pinned copies must be unpinned first. Changed files, symlinks and
unknown paths are preserved. Only the reproducible presentation is removed;
source/result evidence, catalog history, configurations, Gaussian scenes and
semantic edits are outside this store. Reopening rebuilds the presentation from
retained validated source/result data, without running inference again.
Scope: portable results and composed portable runs only. Canonical/legacy replay
families, shared video caches, source/result CAS and install/build artifacts are
not silently included in this TTL. The portable source/result transport and
replay packager still require their separate Worker-only migration. A local pin
is not a new backup of the underlying evidence, nor proof that every historical
format can play offline. Existing protected source/result dependencies must stay
until that migration has a verified restoration contract.
History now lists all catalogued LAB formats independently of player support;
job attempts are no longer collapsed by configuration. Exact job/result identity
prevents duplicate rows. The jobs API remains bounded to 500 jobs per module;
older-than-bound histories need pagination rather than unbounded loading.
See [implementation and acceptance](../outputs/lab-history-storage-20261108/REPORT.md),
[storage ownership](LAB_AND_INSTALLER_STORAGE.md) and the prior
[fresh audit](../outputs/storage-fresh-audit-20261108/REPORT.md).
## Permanent LAB trash is distinct from cache expiry — 2026-11-08
An explicit confirmed LAB trash operation deletes its admitted private payloads
from both Core and Worker and removes its history entry. A pinned local copy is
included; an active playback lease blocks deletion until closed. Source sessions,
Gaussian products, semantic edits, other LABs and their shared files survive.
No retained remote archive is required for this intentional permanent deletion.
The archive/copy-preservation prerequisites elsewhere in this document apply to
storage offload and cache retirement, not to this owner-authorized destruction.
Worker receipt precedes local/catalog finalization. A failed or unavailable
Worker must not produce success or a hidden row. Durable IDs/receipts support
retry and block accidental republication. Keep only bounded audit metadata, not
inaccessible result payloads. HTTP callers cannot supply deletion paths.
The separate “delete local copy” action and 1–365 day cache TTL keep LAB history
and remote results. Pin excludes that copy from TTL, not from full LAB trash.
See `src/k1link/laboratory/{data_deletion,deletion_inventory,deletion_coordinator}.py`
and `outputs/lab-history-cleanup-20261108/REPORT.md` for actual acceptance/limits.
## Intermediate stores and protected models — owner clarification, 2026-11-08
The AI Inference UI/history/local-playback work is closed in its accepted scope.
The remaining audit is about transport copies, historical engineering materials
and component dependencies. It does not authorize treating the experimental
system itself as disposable run output.
Integrated and experimental model weights, required runtimes/environments,
registered component code, shared inputs, benchmarks, annotations and meaningful
regression evidence are protected owners. `cache`, `derived`, an old release
directory or absence from AI Inference history is never sufficient deletion
evidence. Retire a model/version only after checking all module, experiment,
qualification and rollback consumers and making an explicit retirement decision.
The local LAB-copy retention interval applies only to unpinned local viewing
copies in Mission Core. It does not apply to Worker experiments, installed
executor packages/images, models, environments or experimental configurations.
Preserve old and new model/executor/configuration versions until the owner makes
a separate pipeline-consolidation decision. A transport package in the rules
below means job input/output transfer data, not an executor/model distribution.
Every new intermediate producer must declare the owner and artifact role before
writing: source, model/runtime, scratch, transport package, accepted result,
presentation replica or engineering evidence. Bind exact input/code/model/config
identities and use volume-relative paths. Declare the family-level byte budget,
temporary peak/reservations, free-space reserve, active leases and terminal
cleanup/recovery contract. Single-file protocol maxima are not aggregate budgets.
An acknowledged transfer is not by itself permission to remove staging. Verify
the durable target, publication/catalogue binding and every retry/outbox reader.
After their readers use the durable copy, retire only the job-owned payload and
preserve small identity/transfer/publication receipts. Failed/interrupted jobs
also need terminal closeout. Active, shared, unclassified or sole-copy data stays
protected; never infer terminal ownership from mtime or run a recursive TTL sweep.
Historical duplicate bytes may be retired only with a protected retained copy,
hash/path restore index and a passing relevant evidence/consumer verification.
A product file matching an old audit file does not automatically protect that
product from later deletion or make the old audit layout reconstructible. Keep
decision-relevant negative results, exact configurations and useful regression
evidence; deduplicate their storage rather than discarding the knowledge.
Current implementation after the 9 November follow-up: registered portable/composed
viewing copies and scoped build retention remain. Source/result transport now
uses shared physical-device reservations with a 2 GiB free-space reserve. The
8/4 GiB aggregate directory ceilings introduced on 8 November could reject valid
large/multicomponent jobs; they have been removed specifically from transport.
Other product cache quotas are unchanged. The protocol bounds (2 TiB input,
64 GiB result member / 256 GiB package) also remain unchanged.
After verified archive and catalog publication, only exact result-package payload
duplicates in staging are retired. The immutable manifest and retirement receipt
remain; retries validate archive hashes and reject altered staging. A published
historical transfer can be closed against its original catalog/archive identity
without adding its old definition back to the compute allowlist. Original
publication timestamps and profile labels do not change during a retry.
Registered source copies now have last-consumer retirement as described below.
Other overlay families, unknown historical ownership and Worker build/materialized
inputs still require their own adapters. These remaining classes are not covered
by the local viewing-copy TTL. This is not a hard filesystem quota on arbitrary
scripts, and installed executors/models are not subject to these budgets.
Measured inventory, exact duplicate hashes, protected dependencies and ordered
acceptance gates: [intermediate storage review](../outputs/intermediate-storage-review-20261108/REPORT.md).
The follow-up [legacy LAB and duplicate-storage audit](../outputs/legacy-lab-and-duplicates-20261108/REPORT.md)
removed two unused old UI controllers and their exclusive test after owner approval.
That earlier audit retained the fixed V1 executor. The later owner-authorized
retirement below removes its admission and agent; shared module/API paths remain.
Thirty-three verified duplicate files now share APFS copy-on-write blocks; paths,
hashes and independent file semantics are preserved. The volume free-space delta
was about 247 MB, not the 3.38 GB logical duplicate size. This one-off physical
deduplication does not implement future source/staging retention or retire any
model, executor, configuration or historical evidence.
## Fixed LAB retirement and transport closeout — 8 November 2026
The old combined EoMT+DDRNet setup is removed from current admission/runtime
registries. Its standalone Worker agent was removed using the guarded migration
`deploy/laboratory/retire_fixed_lab_v1.ps1`; modular AI and TGS agents remain.
Actual DDRNet/EoMT weight hashes and shared bindings match the modular assets;
no unique model needed migration. Model files, environments and images remain.
The modular release builder now consumes `modular_model_assets.py` and current
module definitions, not the retired V1 promotion CLI. Frozen V1 registry fixtures
are for compatibility tests only. Old-named shared helpers remain where current
modules depend on them; filename age does not establish dead code.
Three published transport packages have been closed with archive verification
and repeat checks. Their catalog entries, payload archives, viewing copies and
pins remain. Logical duplicate payload volume is recorded separately from actual
physical free space because earlier APFS clones share blocks.
Evidence: [retirement and retention report](../outputs/lab-retirement-transport-20261108/REPORT.md).
## Source transfer lifecycle and capacity — 9 November 2026
`observatory/transfer_space.py` owns a small Core ledger shared by portable source
and result writers. Admission sums outstanding reservations on the target device
and checks actual filesystem free space, keeping 2 GiB free. Bytes already written
release the corresponding reservation to avoid double-counting disk usage. Locks
are held only for brief metadata updates, never across an async upload. Kernel
locks identify live reservations; after a process dies its private UUID reservation
metadata can be removed, including torn metadata, without deleting any partial
payload. Unknown filenames, symlinks and shared filesystem owners are preserved.
This is cooperative admission for these writers, not an OS quota against unrelated
programs or a prediction of a complete GPU run's output size.
A result manifest preflights all missing payload bytes; each actual member reserves
space again before writing. Source members/archives reserve their declared size
before construction. Already complete exact copies are reusable even if no room
remains for new copies. Storage shortage returns HTTP 503 and Retry-After, which
the existing Worker transport treats as transient. No change to model selection,
executor identities, compute allowlists or model retention is involved.
`observatory/source_transport_lifecycle.py` registers only producer-owned source
copies and their original paths/digests/lengths/session owners. The full durable
queue protects accepted/queued/claimed/running/paused/preemption/reconciliation
states, including hidden records. Pending or failed result publication also blocks
source retirement. A terminal failed compute job may release its duplicate only
when its exact source is still recoverable. A new run regenerates the same copy.
All associated session owners must finish; absence from a truncated UI list is
never used to infer liveness.
The existing 15-second publication-maintenance loop runs a separate bounded source
collection pass (up to 8 ledger rows). Cross-process shared reader locks protect
materialization and the complete HTTP response, including Range, errors and
cancellation. A collector needs an exclusive lock and skips while any reader is
active. It verifies every original and the copy, rejects symlinks/hardlinks/changed
identities, records `retiring`, unlinks only the registered duplicate and records
`retired`. Interrupted retirement is repeatable. Camera archive bindings remain;
a missing retired payload regenerates deterministically from admitted originals,
while a present corrupted payload still fails integrity validation.
The source ledger is a compact per-content receipt, not a second payload archive.
Unknown historical source files are not automatically adopted. A one-time audit
must prove ownership/restoration; `collect(only_paths=...)` fences deletion to the
reviewed paths and preserves even other registered copies outside the list.
Original recordings, models/executors, three accepted LABs, Gaussians and semantic
maps are outside this lifecycle. Worker source cache/build/expanded directories
and unowned interrupted payloads remain separate ownership work; no global
recursive cleanup or new age-based purge has been introduced.
Evidence and exact measured cleanup: [9 November closeout](../outputs/lab-source-lifecycle-20261109/REPORT.md).
## Automatic complete LAB assembly — 10 November 2026
New `worker-ready-v1` compositions become ready only after their full immutable
RRD is published on Worker. Existing accepted compositions are not enrolled or
rebuilt. Core's existing result reconciliation submits the source/member digest
plan and streams missing inputs from existing stores without transfer duplicates.
The current module-result publication/CAS path is preserved; this change moves
full-recording rendering, not every existing result transport, off the operator.
`presentation/replay-builds/<composition-id>` on the bound LAB volume owns only
that build's `inputs`, `assembly`, plan and state. Single-consumer assembly uses
the existing renderer and FFmpeg runtime. Immutable publication precedes removal
of input/assembly scratch. Active transfer/build leases block explicit deletion;
startup resumes interrupted builds and retires only identifiable upload partials
in verified owned build directories. Models, source recordings and unrelated LABs
are outside this cleanup. Failed jobs retain their retry inputs until recovery or
explicit owner deletion; they are not silently discarded by age.
The complete product stays under `presentation/portable-replays`; the operator
downloads that file into its ordinary viewing cache with size/SHA verification.
New compositions never fall back to local full-RRD assembly. Existing local-copy
expiry and pin rules apply only to viewing copies. Restore after Core restart
reads a previously published canonical source package without invoking an exporter.
Missing canonical preparation remains an explicit prerequisite failure.
Acceptance: a new short JA composition with DDRNet and TRAVEL TGS published
12,780,813 bytes before any view request. GUI download from zero local product
bytes, playback, seeking and both layer toggles passed. Existing accepted LABs
and their pins were preserved. Evidence, limits and release identities:
[Worker assembly report](../outputs/lab-worker-assembly-20261110/REPORT.md).