Skip to content

fix(storage): a link inside the build tree no longer refuses every cargo-cache eviction - #5150

Merged
joelteply merged 1 commit into
canaryfrom
opus/evict-through-symlinks
Oct 18, 2026
Merged

joelteply merged 1 commit into
canaryfrom
opus/evict-through-symlinks

Conversation

@joelteply

Copy link
Copy Markdown
Contributor

The shared cargo-target pool refused to evict for 29 hours on the M5 (2026-10-17 04:58Z
to 10-18 09:28Z, 211 declines, "redirected cache path: .../webrtc-sys-*/out/cxxbridge/
include/webrtc-sys/src/peer_connection_factory.rs"). validate_tree ran the strict
root-chain check on every entry, so any link BELOW a rung refused the rung, and cargo's
cxxbridge always writes such links back to source. The disk sat at 96% (critical) all
morning; the KV page tier refuses at 95%, so every slot eviction dropped its page and
every resident turn re-prefilled cold (fresh p50 28,236 tokens, cached p50 0, 3 h).

The root and its ancestors stay strict (the escape risk #5058 guards). Below a physical
rung, a link (or Windows junction) is a leaf: unlinked, never followed. One is_redirect
definition serves both checks.

Tests: a_link_inside_the_build_tree_is_unlinked_and_the_rest_is_reclaimed (the cxxbridge
shape: rlib reclaimed, link unlinked, source untouched); the existing redirect test now
asserts the link is unlinked and its target kept. disk_eviction 22 passed; source-hygiene
32 passed.

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

🤖 Generated with Claude Code

https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo

…rgo-cache eviction

The shared cargo-target pool refused to evict for 29 hours on the M5 (2026-10-17 04:58Z
to 10-18 09:28Z, 211 declines, "redirected cache path: .../webrtc-sys-*/out/cxxbridge/
include/webrtc-sys/src/peer_connection_factory.rs"). validate_tree ran the strict
root-chain check on every entry, so any link BELOW a rung refused the rung, and cargo's
cxxbridge always writes such links back to source. The disk sat at 96% (critical) all
morning; the KV page tier refuses at 95%, so every slot eviction dropped its page and
every resident turn re-prefilled cold (fresh p50 28,236 tokens, cached p50 0, 3 h).

The root and its ancestors stay strict (the escape risk #5058 guards). Below a physical
rung, a link (or Windows junction) is a leaf: unlinked, never followed. One is_redirect
definition serves both checks.

Tests: a_link_inside_the_build_tree_is_unlinked_and_the_rest_is_reclaimed (the cxxbridge
shape: rlib reclaimed, link unlinked, source untouched); the existing redirect test now
asserts the link is unlinked and its target kept. disk_eviction 22 passed; source-hygiene
32 passed.

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

Copy link
Copy Markdown
Contributor Author

PASSED. #5150 at 98f2814, reviewed by Cormac (IntelMac), 2026-10-18 ~18:35Z. I read the source and did not compile it; CI is 9/9 green at this head.

Claim checked: a link inside the build tree no longer refuses the eviction, and a link is never followed.

  • validate_tree keeps the strict root-chain check for the rung itself (owned_metadata). Below it, validate_below treats a redirect (symlink, or a Windows reparse point via the single is_redirect definition) as a leaf and recurses only into physical directories.
  • On removal, free_owned_tree calls unlink_redirect when owned_metadata refuses an entry. It unlinks only when the parent is owned, the path is not the root, and symlink_metadata says it is a redirect. remove_file comes first and remove_dir only for a junction. Neither follows the link: on unix, remove_dir on a symlink-to-dir fails rather than deleting its target.
  • The new test a_link_inside_the_build_tree_is_unlinked_and_the_rest_is_reclaimed uses the real cxxbridge shape: the rlib is reclaimed, the link is unlinked, and the source is untouched. The existing redirect test now asserts the link is gone and its outside target kept.

@joelteply
joelteply merged commit aa30dd8 into canary Oct 18, 2026
9 checks passed
@joelteply
joelteply deleted the opus/evict-through-symlinks branch October 18, 2026 20:20
joelteply added a commit that referenced this pull request Oct 18, 2026
…tchet lands (159,784)

CI on the merge with canary caught it: #5150 grew disk_eviction.rs (2,406 lines) by 64 before
any ratchet could refuse it. The baseline is canary's measured state at landing, not a raise
of a landed number. That file's split is in the batch split under way.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo
joelteply added a commit that referenced this pull request Oct 18, 2026
…s a ratchet (baseline 256) (#5153)

* arch: the microkernel decomposition plan and its invariant as a ratchet (baseline 256 upward imports)

docs/architecture/MICROKERNEL-DECOMPOSITION.md: measured on canary bc42092, 2026-10-18.
continuum-core is 687,676 of the workspace's 740,643 lines in one crate; 45 files are
1,000+ lines. The module fan-in/fan-out matrix shows the shape: time/identity/paths/paging
are clean leaves, runtime is the microkernel but imports modules/persona back, and five
modules (cognition, modules, commands, persona, ipc) each import 29-36 others. Four rings
(kernel, engine, mind, surface); a module imports only its ring or below; one fact, one
owner, one ring. Cut order with gates: the giant files (in flight), this ratchet, live ->
its own crate, ring 0 -> continuum-kernel, modules/ split by owner, engine and mind crates
by device target (Apple TV / Quest 3 never link the core; a grid node links kernel+engine).

source-hygiene::layer_discipline: one violation per (file, imported module) where a lower
ring names a higher ring with crate::<mod>::. Baseline 256 across 73 pairs (cognition ->
modules 27 files, persona -> modules 20, cognition -> sdk_codegen 18, inference ->
cognition 9, runtime -> routing 8 / sdk_codegen 7) and it may only fall. An unplaced module
raises nothing: placing it is an edit to the table under review, never a guess.

Measured: cargo test -p source-hygiene: 34 passed; the ratchet printed 256 across 73 pairs,
matching the independent Python count of the same tree.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo

* arch: the file-size ratchet (baseline 159,729 lines past 1,000), and the cache fraction moves to its engine-ring owner (upward imports 257 -> 256)

source-hygiene::file_size: one violation per file over 1,000 lines carrying its excess;
the crate's total excess, 159,729 across 142 files on canary 2026-10-18 (largest
llm_deliberation_faculty.rs +11,357, serving_daemon.rs +11,120), may only fall.

The layering ratchet's first run against current canary caught my own #5142: the render
budget (cognition, ring 2) read the prompt-cache fraction from modules::citizen_health
(ring 3), 257 upward imports against the 256 baseline. The fact already had an engine-ring
owner: citizen_health's writer passes the same split to inference::prefill_knee::note_turn.
TurnPrefill now keeps (cached, prefilled) per turn and answers cache_fraction() over the
kept turns; the budget reads it there, and citizen_health::prompt_cache_fraction is deleted
(its only reader). citizen_health keeps its hourly counters for the room's health line.

Measured: cargo test -p source-hygiene after `cargo clean -p source-hygiene` (the shared
cache had served a test binary from another checkout: 0 tests ran). file_size printed
159,729 across 142 files; layer_discipline 257 before this commit.

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

* fix(hygiene): every ratchet locks its win; layering counts grouped crate::{...} imports

Cormac's #5153 review, both asks:
- A count that FALLS below its baseline now fails until the baseline is lowered in the same
  change (one helper, assert_baseline_is_current, beside each rule's own never-rise assert).
  It surfaced unlocked wins at once: spawn sites 166 -> 125, unwraps 2,257 -> 2,200,
  lines past 1,000 159,729 -> 159,720, nil-room lines 4 -> 3, unwired 61 -> 60; all lowered.
- layer_discipline reads use crate::{a::x, b::{c, d}} groups across lines and names each head.
  Measured: still 256 upward imports across 73 pairs (every grouped head was already counted
  in its file); the unit test pins the parse.

cargo test -p source-hygiene: 36 passed, after cargo clean -p source-hygiene (a stale shared
binary had reported 32 green without these tests).

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

* fix(hygiene): file_size baseline measured on canary e953bb1 as the ratchet lands (159,784)

CI on the merge with canary caught it: #5150 grew disk_eviction.rs (2,406 lines) by 64 before
any ratchet could refuse it. The baseline is canary's measured state at landing, not a raise
of a landed number. That file's split is in the batch split under way.

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

---------

Co-authored-by: Claude Fable 5.1 <[email protected]>
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