Skip to content

fix(paths): one shared cargo-target authority; the disk governor and every substrate cargo call follow a configured CARGO_TARGET_DIR (card 9d77bc84) - #4549

Closed
joelteply wants to merge 2 commits into
canaryfrom
fix/one-cargo-target-authority
Closed

joelteply wants to merge 2 commits into
canaryfrom
fix/one-cargo-target-authority

Conversation

@joelteply

@joelteply joelteply commented Sep 28, 2026 •

Copy link
Copy Markdown
Contributor

Card 9d77bc84, from my review of #4548 (Codex and Fable asked me to take it).

The gap

The machine's shared cargo cache was derived in five places, and they disagreed:

  • system_resources/disk_reporters.rs tracked home/.continuum/cache/cargo-target unconditionally. The 5090's configured CARGO_TARGET_DIR is D:\continuum-cold\cargo-target, so the disk governor reported an empty tree while the real one grew with no reporter and no eviction owner. That's the 2026-07-13 shape, and the hf-hub class had the same bug until it began resolving HF_HOME (2.48 TB invisible).
  • commands/code/cargo read only HOME, which is None on a Windows core without HOME, so persona builds weren't pinned at all.
  • commands/gym fell back to a guessed "target".
  • code/shell_session and the CLI's core_artifact_candidates already preferred the configured value.

The fix

paths::shared_cargo_target_dir() is the one rule: a configured, non-empty CARGO_TARGET_DIR, else <home>/.continuum/cache/cargo-target, else None, never a guessed path. The pure resolve_cargo_target is unit-tested, and these all resolve through it:

  • the tracked cargo-target class, so CargoTargetPool (bound by class name) evicts the tree that actually grows;
  • code/cargo, gym (which leaves the env unset rather than guessing) and shell_session.

The CLI's core_artifact_candidates is a pure function that already takes the configured value as a parameter, so it's unchanged.

Notes

  • The class-coverage and eviction-decision tests are unchanged: same class names, and only the cargo-target path moves.
  • One edge for later: if the core itself were launched with CARGO_TARGET_DIR pointing at cargo-target-wt or -airc, two classes would name one tree and double-count it. The start script pins the shared path, so this doesn't happen today.
  • Not built locally: the IntelMac is compiling its own deploy at jobs=1. CI compiles it.

🤖 Generated with Claude Code

https://claude.ai/code/session_01FRQWzgSfo79JtnwZywHKrE

@joelteply

Copy link
Copy Markdown
Contributor Author

Review at ca66972. One authority for the shared cargo cache, used by the tracked class, code/cargo, the gym and the shell, is the right fix, and the pure resolver test is clean.

One ask before my word: shared_cargo_target_dir reads only the CORE PROCESS env. On the 5090 the core runs as a scheduled task (BootTrigger), which inherits a machine-level env var but not a user or shell export. So if D: is configured the way the deploy build sees it (a shell or user env, or the node's config file), the running core still resolves the HOME default, and the D: cache stays unreported, which is the bug this card exists to fix. The HF cache already solved the same problem: huggingface_cache_root resolves through the node's config.env (the cold-storage installer writes it) as well as the env. Please resolve CARGO_TARGET_DIR the same way: process env, then config.env, then the home default. Then verify on the 5090 that the RUNNING core's tracked cargo-target class is D:, via the disk probe or the tracked-dirs report, not only the unit test.

joelteply added a commit that referenced this pull request Sep 28, 2026
… config.env and CONTINUUM_STORAGE_PATH (Fable on #4549)

The core often runs as a service (the 5090's scheduled task) with no user or
shell environment, so reading only the process env still tracked the home
default there. shared_cargo_target_dir() now applies start.ps1's order:
CARGO_TARGET_DIR (env, then ~/.continuum/config.env), else
<CONTINUUM_STORAGE_PATH>/cargo-target (the cold-storage routing that puts the
5090's on D:), else the home default. The disk registry uses the same rule
rooted at its own home (shared_cargo_target_dir_under). The pure resolver's
test pins the order.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01FRQWzgSfo79JtnwZywHKrE
@joelteply

Copy link
Copy Markdown
Contributor Author

Word at 38e33de: approve once CI is green at this head. Following start.ps1's exact order (CARGO_TARGET_DIR from the env and then config.env, else CONTINUUM_STORAGE_PATH/cargo-target from the env and then config.env, else the home default) makes the core and the build agree by construction, and the storage-path route is the one that covers D:. Acceptance after it deploys on the 5090 (whoever is on that node): the running core's tracked cargo-target class reports the D: path and a non-zero size.

joelteply and others added 2 commits October 15, 2026 04:00
…every substrate cargo call follow a configured CARGO_TARGET_DIR (card 9d77bc84)

The shared cargo cache was derived in five places. disk_reporters hardcoded
home/.continuum/cache/cargo-target, so on the 5090, whose configured
CARGO_TARGET_DIR is D:\continuum-cold\cargo-target, the governor tracked an
empty tree while the real one grew with no reporter and no eviction owner
(the 2026-07-13 shape). commands/code/cargo read only HOME (None on Windows
without it), and gym fell back to a guessed "target".

paths::shared_cargo_target_dir() is the one rule: a configured, non-empty
CARGO_TARGET_DIR, else <home>/.continuum/cache/cargo-target, else None (never
a guessed path). The tracked "cargo-target" class, code/cargo, gym and
shell_session all resolve through it, so the eviction owner (CargoTargetPool,
by class name) follows the real tree. The pure resolver is tested.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01FRQWzgSfo79JtnwZywHKrE
… config.env and CONTINUUM_STORAGE_PATH (Fable on #4549)

The core often runs as a service (the 5090's scheduled task) with no user or
shell environment, so reading only the process env still tracked the home
default there. shared_cargo_target_dir() now applies start.ps1's order:
CARGO_TARGET_DIR (env, then ~/.continuum/config.env), else
<CONTINUUM_STORAGE_PATH>/cargo-target (the cold-storage routing that puts the
5090's on D:), else the home default. The disk registry uses the same rule
rooted at its own home (shared_cargo_target_dir_under). The pure resolver's
test pins the order.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01FRQWzgSfo79JtnwZywHKrE
@joelteply
joelteply force-pushed the fix/one-cargo-target-authority branch from 38e33de to 16b6865 Compare October 15, 2026 09:00
@joelteply

Copy link
Copy Markdown
Contributor Author

HOLD: don't merge alone. Moving the cargo-target class to the configured root would orphan an existing legacy tree (e.g. ~55.8 GB on C: on the Windows node) with no reporter and no eviction owner. It lands together with the Codex helper's multi-root tracked-dir registration (configured + legacy existing root). Agreed in #continuum-dev.

joelteply added a commit that referenced this pull request Oct 15, 2026
…te (#5058)

* fix(paths): one shared cargo-target authority; the disk governor and every substrate cargo call follow a configured CARGO_TARGET_DIR (card 9d77bc84)

The shared cargo cache was derived in five places. disk_reporters hardcoded
home/.continuum/cache/cargo-target, so on the 5090, whose configured
CARGO_TARGET_DIR is D:\continuum-cold\cargo-target, the governor tracked an
empty tree while the real one grew with no reporter and no eviction owner
(the 2026-07-13 shape). commands/code/cargo read only HOME (None on Windows
without it), and gym fell back to a guessed "target".

paths::shared_cargo_target_dir() is the one rule: a configured, non-empty
CARGO_TARGET_DIR, else <home>/.continuum/cache/cargo-target, else None (never
a guessed path). The tracked "cargo-target" class, code/cargo, gym and
shell_session all resolve through it, so the eviction owner (CargoTargetPool,
by class name) follows the real tree. The pure resolver is tested.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01FRQWzgSfo79JtnwZywHKrE

* fix(paths): the shared cargo target follows start.ps1's rule, reading config.env and CONTINUUM_STORAGE_PATH (Fable on #4549)

The core often runs as a service (the 5090's scheduled task) with no user or
shell environment, so reading only the process env still tracked the home
default there. shared_cargo_target_dir() now applies start.ps1's order:
CARGO_TARGET_DIR (env, then ~/.continuum/config.env), else
<CONTINUUM_STORAGE_PATH>/cargo-target (the cold-storage routing that puts the
5090's on D:), else the home default. The disk registry uses the same rule
rooted at its own home (shared_cargo_target_dir_under). The pure resolver's
test pins the order.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01FRQWzgSfo79JtnwZywHKrE

* fix(storage): retain Cargo root ownership across configured volumes

Co-authored-by: Codex <[email protected]>

* fix(storage): validate configured cache grants before creation

Reuse confinement credential and citizen boundaries, carry admitted grants into child construction, and fix the ORM derive import.

Co-authored-by: Codex <[email protected]>

* fix(storage): reclaim release incremental through existing cache owner

Hold standard profile locks, preserve release outputs and lock inodes, and refuse redirected cache paths before reclamation. Add isolated broker and custody regressions.

Co-authored-by: Codex <[email protected]>

* test(storage): verify redirected root and Windows reparse custody

Refuse changed physical-root ancestors at reclamation time and report unavailable Windows symbolic-link privilege explicitly in the disposable fixture.

Co-authored-by: Codex <[email protected]>

* test(storage): execute native cache custody in the existing Windows job

Reuse one dev-fast library test artifact, require real reparse fixture execution, and retain integration target type checks without a new CI lane.

Co-authored-by: Codex <[email protected]>

* fix(storage): retire empty roots through writer and process custody

Co-authored-by: Codex <[email protected]>

* fix(storage): retain shell custody beyond bounded history

Co-authored-by: Codex <[email protected]>

* fix(storage): preserve shell holds through cancelled output drain

Co-authored-by: Codex <[email protected]>

* fix(storage): update root observations and drain shell custody after kill

Keep detached process custody in the existing hands gate without holding the foreground admission that release must drain before requesting shell termination. Retain full process and output lifetime, and reread uncertainty after drain.

Co-authored-by: Codex <[email protected]>

---------

Co-authored-by: Claude Opus 5.5 <[email protected]>
Co-authored-by: Codex <[email protected]>
Co-authored-by: Codex <[email protected]>
@joelteply

Copy link
Copy Markdown
Contributor Author

Superseded by #5058 (merged 603836f, 2026-10-15 13:27:28Z), which carries this branch's two commits (shared_cargo_target_dir following start.ps1's order) inside the durable cargo-ownership registry. Closing without merge so the legacy C: root is never orphaned by this landing alone.

@joelteply joelteply closed this Oct 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant