feat: complete M2 content workspace and inspector

This commit is contained in:
Rbanh committed 2026-07-17 23:40:49 -04:00
1 parent 931f561e7f
commit cf6eaba534
438 files changed
+59749 -19043

No files matched your search

@@ -0,0 +1,23 @@
---
name: blacksite-build-storage
description: Keep Blacksite Cargo and package build artifacts within a configured disk budget by selecting stable build lanes, measuring target/build directories, pruning only verified disposable caches, and preserving warm development performance. Use before or after heavy builds, when disk use grows, or when compile performance degrades from artifact accumulation.
---
# Blacksite build storage
Read `.codex/workflow.toml` and [the storage policy](references/build-storage-policy.md). Use `scripts/codex/cargo_lane.py` for every Cargo invocation and `scripts/codex/build_storage.py` for measurement or cleanup.
Trigger this Skill for candidate, all-feature, all-target, package, hot-reload, full-debug, cache-growth, low-space, unexplained rebuild, and cleanup requests.
- Keep one persistent `dev` lane. Candidate, hot-reload, full-debug, cross-target, and package lanes are exceptional and disposable.
- Use stable separate `CARGO_BUILD_BUILD_DIR` when supported; otherwise use bounded external `CARGO_TARGET_DIR` lanes.
- Account for repository final targets, external intermediates, package caches, Cargo timings/docs, free space, and an already-enabled `sccache`.
- Run storage preflight/postflight around heavy gates. When configured, pressure may prune only
expired disposable lanes after their complete checked plan is printed and flushed.
- Require valid sentinels, canonical workspace identity, no symlink traversal, and no active Cargo/rustc/linker/packager before deletion.
- Delete whole managed lanes only. Never delete individual Cargo internal files and never install cleanup/cache tools without explicit approval.
- Every apply prints and flushes its complete byte-counted checked plan before deletion begins.
- Preserve candidate binaries/packages and evidence outside the disposable lane, then establish the
generation-bound marker with `build_storage.py mark-candidate-preserved`; an absent, stale, or
hash-mismatched marker blocks candidate deletion.
- Report reclaimed bytes plus expected cold-build impact.
@@ -0,0 +1,27 @@
# Build-storage policy
The tracked limits live in `.codex/workflow.toml`. Defaults are a 55 GiB soft total, 80 GiB hard total, at least 40 GiB or 15% free space, a 40 GiB persistent-lane ceiling, and a 35 GiB ceiling per disposable lane.
The canonical workspace path is hashed so `/home/.../Bevy` and `/mnt/Fedora/.../Bevy` share one cache identity. Managed lanes carry a sentinel with workspace path/hash, lane, toolchain, feature/profile signature, target/build directories, and timestamps.
Enforcement order:
1. Report total/per-lane size and largest children.
2. Under storage pressure, print the checked byte plan and prune expired marked disposable lanes.
3. Prune stale package intermediates after preserving published output.
4. Remove non-evidence Cargo timing/doc output.
5. Block a new heavy gate if the hard limit or free-space floor still fails.
6. Reset the persistent lane only at a safe slice boundary, after a dry run and verification-ledger update.
`enforce --phase pre|post` automatically prunes only when tracked policy enables it, storage pressure
exists, and a disposable lane has expired. Automatic and explicit prune/reset paths first print and
flush the complete byte-counted plan, including sentinel, path, process, and preservation checks,
before deleting any lane. A candidate lane additionally requires
`.codex/session/candidate-prune-safe.json`, created only after preserved evidence and at least one
distinct binary/package file have been hashed with `mark-candidate-preserved`; any later candidate
lane use makes that generation-bound marker stale.
Never prune an active lane, an unmarked directory, a symlink, another workspace, `/`, home, Cargo
home, the workspace root, `.git`, or a parent of any protected path. `cargo clean` is not a routine
operation; the one-time legacy-target migration is the sole exception documented by the workflow
installation record.