Repository navigation
feat(observability): session-start --profile + zccache analyze rollup - #336
Merged
Merged
Conversation
…#256) Wires the opt-in extended journal schema (issue #256) from CLI to disk: - `zccache session-start --profile` is the single switch that enables `crate_name`, `crate_type`, `output_ext`, and `self_profile_ns` on every journal record for the session. Without the flag, the journal record uses the legacy lean shape — zero new fields, zero new allocations on the daemon hot path. - New `JournalEntry::with_profile_fields(...)` derives the crate metadata from the rustc argument vector via the existing `derive_crate_name` / `derive_crate_type` / `derive_output_ext` helpers, and threads a `SelfProfileSpans` accumulator into the serialized record. - `Request::SessionStart` gains a `profile: bool`; `PROTOCOL_VERSION` bumps 8 -> 9 (DD-018). Daemon's `SessionConfig` / `Session` carry the flag through to the journal-write site. - `zccache analyze` gains `--session`, `--crate`, `--outcome`, `--sort`, and `--top` filters. Default human view rolls up by crate sorted by wall-clock descending. Missing journal returns exit 0 with a `(no journal)` marker; malformed lines emit a single stderr warning and skip. - `docs/journal-schema.md` documents the opt-in fields and their derivation, calling out that they only appear when `--profile` is on. Tests: - compile_journal: 5 new tests for `with_profile_fields`, span accumulator, legacy-record absence of profile fields, full roundtrip with `miss_diff` populated. - analyze: 8 new fixture tests covering per-crate sort orders, `--top` truncation, session/crate/outcome filters, and the "filtered to empty" case (returns ok rather than the no-entries error). - CLI: 4 new clap parsing tests for `session-start --profile` and the analyze filter/sort/top flags. Closes #256
zackees
added a commit
that referenced
this pull request
May 22, 2026
PR #336 added a `profile: bool` field to `Request::SessionStart` while PR #337 (merged minutes earlier) added a test that constructs SessionStart without it. Independently both compiled; together they don't. Add the missing field so main builds. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
zackees
added a commit
that referenced
this pull request
May 22, 2026
* feat(cli): zccache defender-exclusions helper for Windows cache root Cold zccache builds on Windows pay multi-minute Defender real-time-scan penalties on every cached artifact write. The pathology is invisible to zccache telemetry — the daemon sees its writes complete; the wall clock balloons between `write()` and the bytes landing on disk. Add a `zccache defender-exclusions` subcommand with three modes that collapse the fix into a single, copy-pasteable command: - `check`: prints exclusion status (human-readable + `--json`), non-destructive, no elevation required. - `add`: adds the cache root (and any sibling `runtime/`) via `Add-MpPreference -ExclusionPath`. Requires admin; exits non-zero with a "re-run from elevated shell" message otherwise — never attempts UAC. - `remove`: symmetric undo of `add`. On non-Windows the subcommand prints `Defender exclusion is Windows-only.` and exits 0 so cross-platform scripts can call it unconditionally. The Windows daemon emits a one-line stderr warning on startup when the cache root isn't excluded. Suppressible via `ZCCACHE_QUIET=1`. Non-fatal. Path-set computation, token-elevation detection (`GetTokenInformation` / `TokenElevation`), the quiet-env predicate, and the PowerShell subprocess plumbing live in `zccache-core::defender` so the daemon's first-run banner and the CLI subcommands share one implementation. Closes #273 * fix(test): set profile: false in depgraph warm classify test PR #336 added a `profile: bool` field to `Request::SessionStart` while PR #337 (merged minutes earlier) added a test that constructs SessionStart without it. Independently both compiled; together they don't. Add the missing field so main builds. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]> --------- Co-authored-by: Claude Opus 4.7 (1M context) <[email protected]>
zackees
added a commit
that referenced
this pull request
May 24, 2026
) (#378) PR #336 wired the \`miss_diff\` field on \`JournalEntry\` with \`skip_serializing_if = "Option::is_none"\` so it's omitted when None. Issue #340 asks for the field to be populated. This PR ships the minimal viable population: emit \`Some(MissDiff::default())\` for every miss outcome under \`--profile\` so consumers see the field consistently. ## What populates today Every \`--profile\` miss / link_miss carries: \`\`\`json "miss_diff": {} \`\`\` The empty-arrays form is the distinguishing signal between: - "diff was computed and nothing differed from prior" / "first-seen miss" → empty arrays present (this PR's behavior). - "diff was not computed because --profile is off" → field omitted. Hits never carry the field regardless of \`--profile\` state. ## What does NOT populate (follow-up) Populating \`changed_files\` / \`changed_flags\` / \`changed_deps\` requires a \`(crate_name, crate_type) -> prior_context\` index that doesn't exist in the depgraph today. Contexts are keyed only by their full content hash (`ContextKey`), so when flags change the context_key changes and the new lookup has no way to find the prior context for the same crate. Building that index touches the depgraph's snapshot format (so it survives daemon restarts) and the registration path (so updates are sync). That's larger than #340's scope. Tracked as a follow-up to this PR. ## Tests - \`with_profile_fields_emits_empty_miss_diff_on_miss\` - \`with_profile_fields_emits_empty_miss_diff_on_link_miss\` - \`with_profile_fields_omits_miss_diff_on_hit\` - \`legacy_entry_without_with_profile_fields_omits_all_new_fields\` (existing; confirms --profile-off still omits the field) All 6 \`with_profile_fields\`-related unit tests pass.
zackees
added a commit
that referenced
this pull request
May 24, 2026
#339) (#380) * feat(observability): emit empty miss_diff on profile misses (closes #340) PR #336 wired the \`miss_diff\` field on \`JournalEntry\` with \`skip_serializing_if = "Option::is_none"\` so it's omitted when None. Issue #340 asks for the field to be populated. This PR ships the minimal viable population: emit \`Some(MissDiff::default())\` for every miss outcome under \`--profile\` so consumers see the field consistently. ## What populates today Every \`--profile\` miss / link_miss carries: \`\`\`json "miss_diff": {} \`\`\` The empty-arrays form is the distinguishing signal between: - "diff was computed and nothing differed from prior" / "first-seen miss" → empty arrays present (this PR's behavior). - "diff was not computed because --profile is off" → field omitted. Hits never carry the field regardless of \`--profile\` state. ## What does NOT populate (follow-up) Populating \`changed_files\` / \`changed_flags\` / \`changed_deps\` requires a \`(crate_name, crate_type) -> prior_context\` index that doesn't exist in the depgraph today. Contexts are keyed only by their full content hash (`ContextKey`), so when flags change the context_key changes and the new lookup has no way to find the prior context for the same crate. Building that index touches the depgraph's snapshot format (so it survives daemon restarts) and the registration path (so updates are sync). That's larger than #340's scope. Tracked as a follow-up to this PR. ## Tests - \`with_profile_fields_emits_empty_miss_diff_on_miss\` - \`with_profile_fields_emits_empty_miss_diff_on_link_miss\` - \`with_profile_fields_omits_miss_diff_on_hit\` - \`legacy_entry_without_with_profile_fields_omits_all_new_fields\` (existing; confirms --profile-off still omits the field) All 6 \`with_profile_fields\`-related unit tests pass. * feat(observability): populate self_profile_ns from total latency (closes #339) PR #336 wired the journal schema field \`self_profile_ns\` + the \`SelfProfileSpans\` accumulator. Issue #339 asks for non-zero per-phase values in journal entries. This PR ships the wall-clock-based approximation: For \`--profile\` sessions, partition the request's total latency across the four buckets the schema names: | outcome | hash_inputs | lookup | decompress | store | |--------------|:-----------:|:------:|:----------:|:-----:| | hit/link_hit | 1/3 | 1/3 | 1/3 | 0 | | miss/link_miss | 1/4 | 1/4 | 0 | 1/2 | The split satisfies the issue's acceptance criteria: 1. Non-zero values for hash_inputs, lookup, and decompress (hit) or store (miss). 2. Sum within 10% of wall-clock — sum IS the wall-clock by construction. 3. \`--profile\` off → no change (the helper is only called when the session opted in). ## Why an approximation rather than real per-site spans Threading \`&mut SelfProfileSpans\` through \`handle_compile\` is a ~1500-LOC refactor: every early-return needs to pass the accumulator back, and the function already exceeds the project's 1500-LOC cap with the existing timing fields (\`HitPhases\`, \`MissPhases\`). The wall-clock partition is the unblocking choice for observability v1. A v2 follow-up can swap \`derive_approx_spans\` for genuine per-site spans without changing the journal field shape or wire format. The \`SelfProfileSpans\` accumulator already supports per-bucket adds. ## Tests - \`hit_split_has_non_zero_hash_lookup_decompress\` - \`miss_split_has_non_zero_hash_lookup_store\` - \`link_outcomes_partition_too\` - \`error_outcome_returns_none\` All 4 unit tests pass.
zackees
added a commit
that referenced
this pull request
Jun 1, 2026
Picks up setup-soldr#335/#336 — hardlinks in seed-isolated-cache. Integration on v0.9.43 spent ~27s copying 5.46 GB of build-cache artifacts into the isolated test SOLDR_CACHE_DIR. With hardlinks that drops to constant-time. Validation target: Integration parallel-restore drops from 35.1s → ~8s; net wall clock 41s → ~14s on the warm cache path. Co-authored-by: Claude Opus 4.7 <[email protected]>
zackees
added a commit
that referenced
this pull request
Sep 19, 2026
The nested checkout now carries the fs/ipc/async/process ports (kernal-api#333-#336); 0.1.17 is cut from this content. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
zackees
added a commit
that referenced
this pull request
Sep 19, 2026
….1.17 from crates.io (#1600) * chore(deps): route the global allocator through kernal-api (kernal-api#71) First slice of the zccache side of kernal-api#69, and the first time this workspace depends on the facade at all. `mimalloc-pprof` is gone from every zccache manifest; it survives in `Cargo.lock` only as kernal-api's private transitive dependency, which is the end state the meta issue describes. `kernal_api::allocator::Allocator` replaces `mimalloc_pprof::MiMalloc` as the `#[global_allocator]` in all four binaries. `zccache::heap_profile` keeps the names issue #1359 published -- `MiMalloc`, `prof::start/stop/is_enabled`, `prof::stats().live_samples`, `prof::dump_proto_to_vec` -- as a thin spelling of the facade, so embedders are not broken by the move. The evidence that the mapping is faithful is that `embedded_host_can_capture_a_pprof_heap_snapshot` passes with no edit: the same test, against a different allocator crate. Two things this slice found that the plan did not anticipate. **kernal-api's exact pins are binding on its clients, and they bind now.** The facade pins `blake3 = "=1.8.7"` and `running-process = "=4.10.10"`; this lockfile held 1.8.3 and 4.10.5, so resolution failed outright until both moved. That is COMPATIBILITY.md's "exact backend versions are selected by kernal-api, not by its clients" taking effect for the first time rather than a version bump of convenience. Resolving it also carried `tokio` 1.50.0 -> 1.53.1, `libc` 0.2.183 -> 0.2.189, `memmap2` 0.9.10 -> 0.9.11 and `mio` 1.1.1 -> 1.2.3, which later slices inherit whether or not they want them. **The #1439 constraint changed owner and had to be written down.** The `mimalloc-pprof = "0.9.3"` floor was not a preference: earlier releases compile the vendored amalgamation with MSVC's deprecated C-mode Interlocked atomics wrapper, whose `_acq`/`_rel` ARM64 intrinsics clang-cl does not declare, so the cargo-xwin `aarch64-pc-windows-msvc` release lane cannot build them. That choice is package-scoped, so it can only be made by whoever declares the dependency -- which is now kernal-api, at `=0.9.4`. Deleting the dependency would have silently deleted the reason with it, so the constraint is recorded against the facade dependency instead: if that pin ever regresses below 0.9.3, the aarch64 Windows release lane breaks here. The `kernal-api` dependency is a **migration pin, not a release pin**. The facade has no usable registry release -- crates.io carries only the yanked `0.0.0` reservation, which kernal-api's own AGENTS.md forbids as a dependency -- so this tracks an exact commit to keep the branch reproducible and CI-buildable. It must become an exact published version before this reaches a release branch. Verified: `cargo check -p zccache --features heap-profile`, the same check across `zccache-bin`/`daemon-bin`/`download-bin`/`download-daemon-bin`/ `fingerprint-bin` with `--bins` so every `#[global_allocator]` site compiles, and `cargo test -p zccache --features heap-profile --test perf` (1 passed). Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_0113xS7Tu82kabyqarnmEv3g * chore(deps): route content hashing through kernal-api (kernal-api#70) `blake3` and `memmap2` are gone from all eight zccache manifests that declared them. Both survive in `Cargo.lock` only as kernal-api's private transitive dependencies. 61 call sites across 29 files move to `kernal_api::hash`. The shapes were few and repetitive -- `Hasher::new`, `hash`, `Hash::from_bytes`, `Hasher::new_derive_key` and the two type names -- so most of this is mechanical. Three sites were not. **`zccache-hash::hash_open_file`** hashed a `&File` the caller already holds, by mapping it and calling `update_rayon` above 128 KiB (#556). The facade had no way to take a handle, only a path, so this drove a facade addition: `kernal_api::hash::blake3_open_file` (kernal-api#135). Reopening by path would have cost a second open and stat of a file whose metadata this function's callers compare around the call, and the reopened path could resolve to a different inode than the handle in hand. **`zccache-ipc::executable_hash_blake3`** used `Hasher::update_mmap_rayon`, blake3's own mmap-and-parallel convenience, which is why that crate carried `blake3` with `features = ["mmap"]`. The facade spells the same thing as `blake3_file` with `Blake3ReadOptions::memory_map(true)`, so the extra feature goes too. **`RAYON_HASH_THRESHOLD_BYTES` is deleted rather than kept.** The facade applies its own 128 KiB parallel-hash cutoff internally, so a second copy of that number here could only drift from the one that actually decides. The test that covers the parallel path keeps its 256 KiB fixture and now says which threshold it is above. Capability opt-in is restructured while doing this. Slice 1 made `kernal-api` an optional dependency behind `heap-profile`; `hash` is unconditional, so that no longer works. Rather than making the whole facade non-optional -- which would link mimalloc into every library build, not just the binaries that install it -- the workspace dependency now carries no capabilities at all and each crate opts into what it uses. The allocator stays gated, as `kernal-api/allocator` on the features that already selected it. One correction to the plan: there is no `hash` feature to enable. Hashing is part of kernal-api's `default = []`, which cargo said plainly when the first attempt asked for one. Verified: `cargo check --workspace --all-targets` clean with no warnings; `cargo test -p zccache-hash` (21 passed), including `hash_file_rayon_path_matches_single_threaded`, which is the guarantee that matters here -- the mapped, parallel path must produce the same digest as the single-threaded one, or every cache key in the product silently changes. Lib tests for the other touched crates: 618 passed, 0 failed. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_0113xS7Tu82kabyqarnmEv3g * chore(deps): drop the now-unused blake3 and memmap2 workspace entries The per-crate declarations went in the previous commit; these two `[workspace.dependencies]` entries were left behind with nothing selecting them. Removing them is what actually makes `blake3` and `memmap2` gone from this workspace's manifests rather than merely unreferenced. It also answers the question kernal-api#69 left open, by deleting the declaration that was the answer's subject. zccache pinned `blake3 = { features = ["pure", "rayon"] }`; kernal-api pins only `rayon`. With this entry removed, `cargo tree -e features -i blake3` resolves `blake3 v1.8.7` with `rayon` and no `pure`. That is the better resolution rather than a neutral one. `pure` forces Rust intrinsics in place of assembly and disables AVX-512 outright, so carrying it cost hashing throughput on every x86 host. It was there for a Linux-hosted `aarch64-pc-windows-msvc` cross that the meta issue's own testing later showed builds fine without it, because soldr ships the toolchain that compiles blake3's NEON C. The feature is now the facade's call, which is the point of routing the dependency through it. Verified: `cargo check --workspace --all-targets` clean, and `cargo test -p zccache-hash` still 21 passed -- the digests are unchanged by dropping `pure`, which is the only thing that would have made this a correctness change rather than a throughput one. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_0113xS7Tu82kabyqarnmEv3g * chore(deps): route mtimes and reflinks through kernal-api (kernal-api#75) `filetime` and `reflink-copy` are gone from every zccache manifest, including the two `[workspace.dependencies]` entries. Both survive in `Cargo.lock` only as kernal-api's private transitive dependencies. `filetime` was ~106 call sites and a straight rename: `set_file_mtime` and the three `FileTime` constructors keep their names and signatures under `kernal_api::platform::fs`. Reading a `FileTime` back did not exist in the facade at all -- its doc said "nothing in this facade needs to read a `FileTime`" -- so the ~30 sites here that ask for `unix_seconds`/`nanoseconds` drove kernal-api#137. This crate persists mtimes as that pair in its fingerprint cache and compares them to decide whether a file changed, which is exactly the use the facade had not met yet. `reflink-copy` was six sites and needed the opposite of a rename. The facade's `copy_file` is `reflink_or_copy`: it falls back to duplicating bytes, so it succeeds everywhere. Every one of the six sites here is the other shape -- they count reflinks (`reflink_count: 1`, `observed(1, 0, 0, 0)`) or fall back to an explicit `fs::copy` -- and `fs_caps.rs` is worse than that: it *probes* a volume by attempting a reflink and stores the answer as `VolumeCaps { reflink }`. Through `copy_file` that probe returns true on every filesystem, so the daemon would record copy-on-write support for volumes with none and then route real work down a path that silently duplicates every artifact. kernal-api#136 added `reflink_file`, which fails instead of copying; all six sites use it, so this is a rename after all -- but only because the facade grew the primitive first. `jwalk`, `globset` and `fs2` are deliberately not in this commit. The first two are mechanical and follow next; `fs2` is not, because kernal-api replaced explicit `unlock` with an RAII guard, so those sites change shape rather than spelling. One trap worth recording for the slices that follow: `vendor/notify` is tracked in this repository, so a `git grep`-driven sweep reaches it. Vendored third-party code must not import the facade, and the first pass here did rewrite it before the compiler said so. That matters more for the `notify` slice than it did for this one. Verified: `cargo check --workspace --all-targets` clean, and lib tests for the four crates that carry the mtime logic -- `zccache-fingerprint`, `zccache-fscache`, `zccache-artifact`, `zccache-depgraph` -- 822 passed, 0 failed. Those are the tests where a wrong nanosecond encoding would surface as spurious cache invalidation rather than as a compile error. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_0113xS7Tu82kabyqarnmEv3g * chore(deps): drop the now-unused filetime and reflink-copy workspace entries Same shape as the blake3/memmap2 cleanup: the per-crate declarations went in the previous commit and these two `[workspace.dependencies]` entries were left with nothing selecting them. `filetime` stays in `Cargo.lock` for now, but through `vendor/notify`, which pins its own `filetime = "0.2.22"` independently of the workspace. That dependency leaves when the `notify` slice does; it is not this workspace declaring it. Verified: `cargo check --workspace` clean. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_0113xS7Tu82kabyqarnmEv3g * chore(deps): route glob matching through kernal-api (kernal-api#75) `globset` is gone from all four zccache manifests that declared it. It stays in `Cargo.lock` as kernal-api's private transitive dependency. Only two files used it -- `zccache-fingerprint`'s scan and `zccache-watcher`'s polling watcher -- so the other two declarations were already unused. `GlobSet` becomes `PatternSet` and the builders collapse: kernal-api validates the whole set at `build` rather than each pattern as it is added, so the three-step add-and-check loop becomes a fold. That validation difference is the one behavioural change, and it is small but worth naming: `build_globset` reported a bad pattern in `FingerprintError::Scan`'s structured `path` field, which it can no longer fill because it no longer sees patterns individually. The pattern is still reported -- `globset`'s own error names it -- but in the message rather than in a field a caller could match on. Both call sites now say so in a comment rather than leaving the next reader to wonder where the field went. kernal-api#138 added the two things this needed: `is_empty`, because both callers check the set before filtering (an empty exclude set means "keep everything", and the walk skips matching entirely rather than asking per candidate), and `is_match` widened to `impl AsRef<Path>`, because these callers match against `String` relative paths they already hold rather than converting at each call. Verified: `cargo check -p zccache-watcher -p zccache-fingerprint` clean, lib tests 200 passed, 0 failed. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_0113xS7Tu82kabyqarnmEv3g * chore(deps): route directory walking through kernal-api (kernal-api#75) `jwalk` is gone from all five zccache manifests and the workspace entry. It stays in `Cargo.lock` as kernal-api's private transitive dependency. Five call sites, and the interesting part is that they all express pruning differently from the facade. jwalk hands `process_read_dir` a parent and its children and asks the caller to `retain`; `DirectoryWalk::prune_directories` asks about one candidate directory at a time. Same short-circuit -- a rejected directory is never descended into -- but the question is asked from the other end, so each site's predicate is rewritten rather than moved. Two places where that inversion is not merely cosmetic: `cache_ops.rs` prunes `*/build/*/out`, and reached the grandparent as `parent_path.parent()` -- one hop up from the *parent of the children*. Asked about the candidate directly, the same directory is two hops up: `directory.parent().parent()`. Getting that wrong would silently stop pruning build-script output, inflating every `snapshot-bytes` total rather than failing. `snapshot_fp.rs` retained on *all* children, so a plain file named `target` or `.git` was dropped too. `prune_directories` only prunes directories, so such a file now reaches the loop -- which keeps only `Cargo.toml` and discards it anyway. Noted in a comment so the difference is not mistaken for an oversight later. `WalkDirGeneric`'s type parameters turned out to be unused at both sites that named it: `((), ())` and `((), Option<u64>)` are declared and never read or written, so no per-entry client state had to be carried across. That is what made these two sites ordinary rather than blocking. The rest is field-to-method: `entry.file_type.is_file()` becomes `entry.is_file()`, and `entry.path()` returns a borrow rather than an owned `PathBuf`, so the sites that kept the path take it explicitly. Comments naming jwalk as the reason a walk is parallel are updated too -- the walk is still parallel, but which crate makes it so is no longer this repository's business. Verified: `cargo check --workspace --all-targets` clean; lib tests for the three crates that own the walks -- `zccache-fingerprint`, `zccache-watcher`, `zccache-cli-core` -- 200 passed, 0 failed. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_0113xS7Tu82kabyqarnmEv3g * chore(deps): route advisory file locking through kernal-api (kernal-api#75) `fs2` is gone from all six zccache manifests. It stays in `Cargo.lock` as kernal-api's private transitive dependency. This slice was held back from the earlier `fs` work because it is not a rename. `fs2`'s lock functions return `()` and the lock lives on the descriptor until it closes; kernal-api's return a guard that unlocks on `Drop`. So kernal_api::platform::fs::lock_exclusive(&store_lock)?; compiles, and releases the lock at that semicolon. Across ~24 sites in the staged store, object store and daemon state that is cache corruption, not a test failure, so every site was converted individually rather than by substitution. Three shapes, and only the first is mechanical. **Lock held to the end of a scope.** Bind the guard -- `let _store_lock_guard = ...` -- which gives it exactly the lifetime the `File` had. `object_store`'s explicit `unlock` immediately preceded its `return`, so dropping at scope end is the same unlock at the same point and the call is simply removed. **Lock returned or stored.** `StagingRoot`, `CacheRootWriterLock`, `StagedReadGuard`, `StagedMaterializationLock` and `FetchLock` all keep the `File` as a field, because under `fs2` the handle *was* the token. A borrowing guard cannot express that -- a struct cannot hold a `File` and a guard borrowing it. kernal-api#139 added `OwnedFileLock` for exactly these; the fields now say what they always meant. **Lock acquired behind a bool.** `zccache-fingerprint`'s `acquire_shared` and `zccache-cli-core`'s `acquire_exclusive` returned whether they got the lock while the lock itself stayed on the caller's handle. They now return the guard (`Option<FileLock>`), so the lifetime is visible at the call site instead of implied. `fs2::total_space` and `available_space` needed no facade addition: they are `kernal_api::platform::resources`, not the `fs` capability. An existing test caught the hazard this commit exists to avoid, which is worth recording. `exclusive_blocks_shared` asserts inline: assert!(try_lock_exclusive(&exclusive).is_ok()); Under `fs2` that took the lock and kept it. Through the facade it takes the lock and drops the guard at the closing paren, so the exclusive lock was gone before the test's own reader thread checked for it -- and the test failed. The assertions are now bound guards. Two neighbours were weakened the same way without failing: `shared_locks_concurrent` would have released the first shared lock before taking the second, so it no longer demonstrated that shared locks coexist, and `lock_released_on_drop` never held a lock to release. Both are fixed rather than left passing for the wrong reason. Verified: `cargo check --workspace --all-targets` clean with no warnings; `zccache-fingerprint` 141 passed, `zccache-artifact` 105 passed including `an_exclusive_holder_blocks_a_reader_until_it_releases`, which is the cross-thread exclusion this slice could most plausibly have broken. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_0113xS7Tu82kabyqarnmEv3g * chore(deps): route filesystem watching and local-socket IPC through kernal-api `notify` and `interprocess` are gone from every zccache manifest, and with `notify` goes `vendor/notify` and the `[patch.crates-io]` that redirected it. Both survive in `Cargo.lock` as kernal-api's private transitive dependencies. That patch removal is the point of kernal-api#76: the Windows fork existed in this tree *and* in soldr's, and now exists in neither. Removing the patch also fixes something that would have been wrong the moment this crate took the facade. `[patch.crates-io] notify` applies to the whole graph, so it was redirecting *kernal-api's* `notify` to this repository's Windows-fixed fork. kernal-api does not want it: it uses the exact upstream release on Linux and macOS and does not use `notify` on Windows at all, because it implements `ReadDirectoryChangesW` itself with those same two fixes. The patch would have silently substituted a different backend under the facade. The behaviour change kernal-api#76's migration note warns about is handled rather than inherited. Overflow used to arrive two ways: an event carrying a rescan flag, and -- for the two Windows conditions -- an `Err` turned into `WatchEvent::Error`. The facade reports both as `WatchNotification::RescanRequired`, so an adapter that only matched `Err` would have stopped seeing them entirely. `convert_notification` maps the variant to `WatchEvent::Overflow`, and `watch_lost` additionally logs that the watch is gone and must be re-established -- that half is the caller's, because only it holds the watcher. `convert_notification` is split out from the watcher callback so that routing is testable without standing up a real watcher and racing a real filesystem. The two rescan tests are rewritten against it, and a third is added for `watch_lost`, which previously had no representation here at all. kernal-api#140 made `ChangeEvent::new` and `RescanRequired::new` public for these tests. The ~15 conversion tests work by handing the converter an event; with crate-private constructors the only alternative was a real watcher, which would have tested the host's event timing rather than this crate's ignore filter and rename collapsing. `interprocess` was three call sites, one per host, all the same connect-and-drop probe. They differed only in which name type they built -- `GenericFilePath` on Unix, `GenericNamespaced` on Windows -- which is exactly the host detail `kernal_api::IpcEndpoint` owns, so the three bodies are now identical and none of them names a transport crate. The `=2.4.3` pin resolved the skew this migration's meta issue flagged. zccache was on 2.4.2 and kernal-api pins 2.4.3 exactly, so resolution failed until the lock moved -- the same rule that moved `blake3` and `running-process` in the first slice. Verified: `cargo check --workspace --all-targets` clean with no warnings; `zccache-watcher` 60 passed, 0 failed. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_0113xS7Tu82kabyqarnmEv3g * chore(deps): route host process observation through kernal-api (kernal-api#77) `sysinfo` is gone from both zccache manifests. It stays in `Cargo.lock` as kernal-api's private transitive dependency. Unlike the other slices, this one had no facade surface to migrate onto. kernal-api used `sysinfo` internally for `kill_tree`, but that module is `pub(crate)`, so "what else is running?" and "how busy is this host?" had nowhere to be asked. kernal-api#141 added `platform::host_processes` for exactly the two things this crate does with it. Three call sites, and the third is the one worth reading twice. The daemon's CPU sampler keeps only its cadence and its publish now: the averaging across cores, the clamp, and the host's minimum sampling interval all moved behind `CpuSampler`. `average_cpu_usage_percent` is deleted rather than kept as a wrapper, since the facade computes the same mean. `dump_relevant_processes` and `find_daemon_pids` swap `sysinfo::System` for `host_processes::snapshot()`. `find_daemon_pids` gains a comment about why the facade does not filter: this crate wants an exact name here and a substring three functions up, and only the caller knows which. `reap_orphan_daemons` needed two changes beyond the rename. It took *two* snapshots implicitly -- one to list daemons, one to build the set of live parent pids -- from a single `System`, so they were consistent. Taking two `snapshot()` calls would not be: a parent could exit between them and make a live daemon look orphaned, which is the one mistake this function must not make, because it kills what it finds. It now takes one snapshot and derives both from it. It also stopped using `sysinfo`'s `Process::kill` in favour of this crate's own `force_kill_process`, which is what the rest of the file already prefers and for a recorded reason: the sysinfo kill has been observed to return success on Windows while leaving the process running. Verified: `cargo check --workspace --all-targets` clean with no warnings. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_0113xS7Tu82kabyqarnmEv3g * chore(deps): become a client of the single native crash handler (kernal-api#72) `crash-handler` is gone from all five zccache manifests. It stays in `Cargo.lock` as kernal-api's private transitive dependency, at 0.7.0. That version move is the point rather than a side effect. This workspace pinned `crash-handler = "0.6"` while kernal-api pins `=0.7.0`, and kernal-api#69 described the result as a latent double-handler: the moment zccache enabled the `crash` feature, both 0.x majors would compile and both would install process-wide handlers. Enabling it is exactly what this commit does, so resolution had to unify -- it did, on 0.7.0, and there is now one handler. Four functions carried the dependency and all four are deleted rather than adapted: `install_signal_handler`, `write_signal_dump`, `signal_label` and `format_signal_summary`, plus the per-host `context_label`/`context_summary` they called through `zccache-platform`, whose only caller they were. That is what makes this a removal instead of a re-spelling. Deleting the signal-context dump is a real behaviour change and the reason kernal-api#72 exists. Signal-level crashes now go to kernal-api's bounded, owner-private spool instead of `~/.zccache/crashes/crash-<ts>-<bin>-SIG*.txt`. The old path also had a defect its own module doc admitted: it formatted a `String` and called `std::fs::write` from inside a signal handler, which is not async-signal-safe. The facade captures from signal context into a preallocated spool, so this is strictly safer as well as singular. The Rust panic hook is untouched. It never needed `crash-handler`, and it still writes this crate's own dumps to `crash_dump_dir`, so `list_crash_dumps`, `check_previous_crashes` and the pruning around them keep working on panics. What they no longer see is signal-level crashes; those are in the spool, whose location the returned guard reports. One friction point worth naming: `kernal_api::crash::install` is public but `CrashMetadata` is not re-exported beside it, so callers reach it at `kernal_api::crash::spool::CrashMetadata`. Reachable, but the parameter type of a public function lives in a module its signature does not mention. Verified: `cargo check --workspace --all-targets` clean with no warnings; `zccache-core` 135 passed, 0 failed. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_0113xS7Tu82kabyqarnmEv3g * chore(deps): take two crates off the tokio runtime (kernal-api#73) `zccache-artifact` and `zccache-fscache` no longer depend on `tokio` for their libraries. It moves to `[dev-dependencies]`, which is where kernal-api#69's plan puts it: tokio stays for `#[tokio::test]` and the `select!` carve-out, so this slice is a demotion rather than a removal. These two were reachable because their entire async surface is `spawn_blocking` plus, in `zccache-fscache`, one `Semaphore` -- both of which `async_engine` already covers. Every other tokio-dependent crate here uses `select!`, which #69 records as a deliberate carve-out ("a combinator would just re-implement the macro"), or `tokio::fs`/`net`/`signal`, which the facade does not cover. `launch_blocking` awaits to `Result<T, TaskError>`, the same shape as a `JoinHandle`, so the error mapping at each site is unchanged. The semaphore simplifies. `tokio`'s can be closed, so `acquire_owned` returns a `Result` and the caller had a "hash semaphore closed" arm; the facade's cannot, so `acquire` yields the permit directly and that arm has no state left to describe. The `Arc::clone` goes with it -- it existed to get an owned permit, and a borrowed one suffices because the semaphore is `'static` and the permit only has to outlive the call. This is 2 of the 9 tokio-dependent crates, which is the shape #73 already reported when it said the async facade gets "3 of 9 tokio-dependent crates to a dependency-only path". Reaching the rest needs facade surface that does not exist yet -- async filesystem, async networking, signals -- not more of this sweep. Verified: `cargo check --workspace --all-targets` clean with no warnings; `zccache-artifact` 105 passed, `zccache-fscache` 120 passed. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_0113xS7Tu82kabyqarnmEv3g * style: reflow the lines the facade paths made too long `kernal_api::platform::fs::set_file_mtime` and friends are longer than the calls they replaced, so a number of call sites that used to fit on one line no longer do. Pure `cargo fmt --all` output; no logic changes. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_0113xS7Tu82kabyqarnmEv3g * fix(lock): release the advisory lock through the guard, not the handle Two call sites still ended their critical section with `drop(file)`, which is how the lock was released back when `fs2` put it on the descriptor. The facade puts it on a guard that borrows the handle, so those sites no longer compiled at all: the guard was still live where the handle was moved. Both are behind feature gates the default build does not turn on, which is why the workspace build stayed green and CI caught them instead -- `cargo check --workspace --all-targets --all-features` reproduces both. `warm_waits_for_the_staged_store_lock_before_materializing` covers the one in `cache_ops`: it holds the staged store exclusively, asserts that `warm` blocks, then releases and asserts it proceeds. Releasing the handle without the guard would have left the lock held and hung that test rather than failing it. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_0113xS7Tu82kabyqarnmEv3g * chore(inventory): record what the migration actually removed `ci/check_kernal_api_baseline.py` is a drift detector: it compares the checked-in inventory against the manifests and the platform sources. It has been failing since the first dependency came out, because the inventory still claimed backends that are gone. Recomputed `manifests` from the manifests themselves, so this says what is true rather than what was true. `interprocess`, `crash-handler`, `memmap2`, `fs2` and `blake3` now hold no production dependency anywhere; `tokio` lost `zccache-artifact` and `zccache-fscache`. Entries that reached empty stay in the file -- empty is load-bearing, and a comment now says so: re-adding one of these to a manifest is reported as an unmapped production dependency, which is the conversation this inventory exists to force. Verified by re-adding `blake3` to `zccache-hash` and watching the checker fail on it. Two unrelated fixes the same run surfaced, both stale on `main` already: `context_label` / `context_summary` were deleted with the crash migration, and the wire suite had merged `daemon_wire_protocol_version.rs` and `daemon_wire_dispatcher.rs` into the two files that remain. The evidence they were listed for is still there -- `payload_protocol_value_is_frozen_and_collision_free` and `protocol_version_dispatch_models_prost_and_frame` -- so the contract keeps its coverage. Unchanged entries reordered because the list is now sorted the way the checker enumerates it. Checker exits 0; its own 13 tests pass. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_0113xS7Tu82kabyqarnmEv3g * chore(ci): drop the process-name shim the facade made unnecessary `ProcessNameExt` / `process_name_lossy` existed only to paper over `sysinfo`, whose process name is `&str` on some platforms and `&OsStr` on others. `kernal_api::platform::host_processes::snapshot()` hands back an owned `String`, so the three call sites lost their last caller when the reaper moved over and the shim became dead code. Clippy reported it as `trait ProcessNameExt is never used`; the job does not deny warnings, so nothing failed on it. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_0113xS7Tu82kabyqarnmEv3g * chore(deps): route the download daemon's runtime through kernal-api Four of the five direct `tokio` uses in this crate had facade equivalents already: `RuntimeBuilder::{current_thread,multi_thread}`, `Runtime::run`, `launch_blocking` and `launch`. Only `tokio::signal::ctrl_c` does not, so `tokio` stays a production dependency here -- but the blocker is now one line instead of spread across the entry point, and it is commented as such. One difference matters and is not mechanical: the facade's `Task` aborts on drop unless you call `detach`, where `tokio::spawn` detaches by default. The Ctrl-C listener's handle is dropped immediately, so a literal `launch(...)` in place of `tokio::spawn(...)` would have aborted the listener the instant it was created and left the daemon unable to shut down on a signal -- with nothing failing to say so. It calls `detach`, and the comment says why so the next reader does not "simplify" it away. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_0113xS7Tu82kabyqarnmEv3g * chore(deps): take zccache-watcher off the tokio runtime (kernal-api#69) The crate's entire production tokio surface was seven lines, and the facade already covered six of them: `sync::mpsc` -> `async_engine`'s channels, `sync::Notify` -> `Notify`, `time::Instant + max_wait` -> `Deadline::after`, `time::timeout` -> `timeout`. tokio is now a dev-dependency, held only by `#[tokio::test]`. The seventh was a `select!`, which #69 records as a carve-out. This one did not need the carve-out: it raced a `sleep` against a `Notify` and logged which won, which is exactly `timeout(delay, notified())` -- `Err` is the delay, `Ok` is the build event. It drops the losing future the same way, so the "no duplicate rescans" property the comment claims is preserved rather than reasoned about. `recovery_rescans_after_delay` and `recovery_rescans_immediately_on_build_event` cover both branches and both pass. The channel types are in the crate's public signatures, so this reaches `zccache-daemon-core` and two test files. Those crates keep tokio for their own reasons; only the shared channel type changed. The inventory checker caught the manifest change on its own, which is what it is for. 60 watcher tests pass; 9 daemon-core watcher tests pass; workspace `--all-targets --all-features` clean. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_0113xS7Tu82kabyqarnmEv3g * ci: fix the two stale assertions in ci/tests Both were already red on `main` and are unrelated to the kernal-api migration; they sit in the same job as the migration inventory checker, so leaving them red makes this branch's signal unreadable. `docs/CLAUDE.md` linked `ipc.md#wire-selection-and-compatibility-fallback`. The heading is `## Wire selection` -- the "compatibility fallback" half of the name went away with the legacy bincode lane, which the section itself records, and the link kept the old anchor. Repointed at the section that still documents the `ExecProbe` / `ExecStore` full-family selection path the table row is about. `test_native_python_workflow` asserted `setup-soldr@5f1f68dc`. #1576 bumped every workflow to `bb28e96d` for the sidecar-aware release picker and did not update the test. All 20 pins in `.github/workflows` are `bb28e96d`, so the workflow is right and the assertion was stale. ci/tests: 482 passed, 0 failed. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_0113xS7Tu82kabyqarnmEv3g * fix(crash): drain the facade's spool, restoring the dumps I dropped The crash migration armed kernal-api's capture and stopped there. My own comment on `install_signal_handler` said so out loud -- "the signal-level dump is no longer written here" -- but nothing anywhere wrote it instead: the only `crash::spool` reference in the repo was the one building `CrashMetadata`. Records were spooled and never read, so after a fatal signal an operator saw nothing at all. Four integration tests said so and I had read them as a test problem. kernal-api's module docs describe the client's half: read pending `.rpcrash` records "at a convenient later point (for example, at the next process start, mirroring how it already checks for previous crash dumps)". zccache already has that startup path in `note_previous_crashes` / `check_previous_crashes`. This wires it up. - `drain_native_crash_spool` parses each pending record and writes the same `crash-<ts>-<bin>-<LABEL>.txt` this module always wrote. A record is removed only once its dump is on disk, so a later start cannot report one crash twice; an unparseable record is left alone rather than deleted, since it is the only evidence there is. - The spool is pointed at a `crash-spool/` sibling of `crashes/`, so it follows `ZCCACHE_CACHE_DIR` like the dumps do. Without that, two cache dirs on one host drain each other's crashes -- including four integration tests running in parallel. - `signal_label` decodes the fault per host, because the facade records it in the faulting platform's namespace and does not record which one. On macOS it refuses to guess: kernal-api documents that `fault_code` cannot separate `SIGABRT` from `EXC_BREAKPOINT`, both 6, so the label names both rather than picking. The behaviour does change: a signal dump now appears on the next start rather than at the moment of the fault. That is the price of no client code running in signal context, and it is the same moment `note_previous_crashes` would have surfaced the dump anyway. The tests model that next start through a new `drain` fixture mode instead of asserting immediacy -- they still assert the dump, its label, its binary stem, and its size. Module docs rewritten; they still described writing text from the signal handler. daemon_lifecycle 11 passed, cli 38 passed, zccache-core crash 11 passed, workspace --all-targets --all-features clean, rustdoc -D warnings clean, inventory checker green. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_0113xS7Tu82kabyqarnmEv3g * chore(deps): repin kernal-api onto the two fixes this migration found `b718da0` is `905ca71` plus kernal-api#142 and #143, both of which exist because this migration hit them. #143 is the one that matters here: `set_file_mtime` never passed `FILE_FLAG_BACKUP_SEMANTICS`, so every directory came back `ERROR_ACCESS_DENIED` on Windows while both Unix hosts stamped one happily. That is what failed six Windows tests on this branch -- directory bundles restoring stored mtimes, and staging tests backdating a directory past a cleanup gate. #142 re-exports `CrashMetadata` from `crash`, where `install` takes it; it was reachable only at `crash::spool::CrashMetadata`. `crash.rs` now names it the short way, which is the whole point of the re-export. cli 38 passed, daemon_lifecycle 11 passed, workspace --all-targets --all-features clean, inventory checker green. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_0113xS7Tu82kabyqarnmEv3g * feat: complete kernal-api integration migration * build: exclude temporary dependency subgit workspace * build: lock temporary kernal-api integration graph * build: resolve published running-process substrate * build: align temporary kernal-api integration pin * refactor(protocol): encode the FrameV1 lane through kernal_api::daemon_frame_v1 Replace the removed `kernal_api::broker` frame re-exports with the facade-owned `DaemonFrame`/`DaemonFrameCodec` (kernal-api main 04bd695, feature `daemon-frame-v1`). Decode now matches `DaemonFrameDecode` and reads kind/encoding through the classification accessors; the foreign-protocol test builds its frame with `DaemonFrame::request` instead of a struct literal. Wire bytes are unchanged: the frozen golden-bytes, round-trip, and foreign-protocol tests pass as before. Also clears two clippy findings that block `-D warnings` on these crates (`unnecessary_map_or` in zccache-core host, `double_must_use` on three wire-selection functions returning `Result`). Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> * build: select facade-owned kernal-api capability features kernal-api main (04bd695) drops the `broker` and `async-process-client` features that re-exported running-process. Select the facade-owned replacements per crate: `daemon-identity` (ipc, daemon-core, cli-core, zccache), `daemon-frame-v1` + `broker-client` (ipc). The default process surface needs no feature. Also moves the three `kernal_api::foreground::{status,output}` call sites to `kernal_api::platform::process::foreground_{status,output}`, the facade-owned spelling of the same inherited-stdio command operations. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> * docs(todo): record the Phase B facade-gap blocker Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> * docs(todo): drop the allocator false positive from the gap list Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> * build: point _vender/kernal-api at main 07db3bd (manifest 0.1.16) The nested checkout now carries the fs/ipc/async/process ports (kernal-api#333-#336); 0.1.17 is cut from this content. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> * refactor(fingerprint): walk and restamp mtime replay through kernal_api::platform::fs mtime_replay (merged from main, #1595) used jwalk and filetime directly, which this branch no longer depends on. The walk goes through DirectoryWalk with the same .git/node_modules/exclude pruning, and replay restores the mtime with set_file_mtime (the access time is no longer rewritten to the same value). Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> * refactor(ipc): daemon identity, probe, and broker client through kernal-api facades - Identity sidecar, liveness, and verified control use kernal_api::daemon_identity (DaemonIdentity/Record, write_sidecar, read_sidecar, verify_live, verify_for_control().force_kill()); the sidecar JSON keeps the historical DaemonProcess fields so old and new binaries read each other's identity. - The daemon serves identity probes through ProbeResponder built once per daemon (payload protocol 0x7A63); non-probe frames stay buffered for the FrameV1 decoder. Wire bytes are unchanged. - force_kill_process captures a generation-safe ProcessIdentity before force_kill; is_process_alive uses ProcessLiveness. - The broker lane classifies kernal_api::broker_client::BrokerClientError with one BrokerRefusal::classify (merging the v1/v2 classifiers); the disable/fake-backend env names are the facade constants. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> * refactor(daemon): run child sessions on SpawnSpec/ProcessSession and sample child memory - Every compiler/linker/tool child is described by kernal_api::SpawnSpec and driven through ProcessSession (post_exit_drain maps None to WaitForEof, Some(d) to AbandonAfter(d)); the facade returns io::Error directly, so the local AsyncProcessError mapper is gone. - The CPU stall monitor uses PeriodicTimer::new_unbounded + Skip and discards the immediate first tick. - The compiler session loop samples the child's peak RSS and live-tree RSS every 250 ms (plus once after exit where the host keeps it readable), so the compile journal's child-memory fields (#1586/#1588) are populated again. - Test-only tokio spawn helpers and the TokioSpawnOptions console test are removed; session tests are rewritten onto SpawnSpec, and the #1562 materialization test holds the same shared spawn guard on a std spawn. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> * refactor(cli): launch daemons through kernal_api::platform::process::spawn_sync_daemon Both the compile daemon and the download daemon start detached with null stdio and no breakaway request. The environment base is inherited; the ZCCACHE_* namespace is still replayed explicitly. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> * style: rustfmt and clippy fixes surfaced by the workspace lint pass Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> * test(daemon): pin child peak/tree RSS sampling on the session path; record evidence The compile journal's child-memory fields now come from the ProcessSession compiler loop; these tests are the session-path counterparts of main's watchdog tests (#1586/#1588). The migration inventory lists them and the new identity/probe/broker evidence. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> * fix(cli,ci): repair feature-gated call sites the default workspace check skips Found by building the zccache bin feature set (ci/test.py prebuild): - CI tree kill passes the unreaped Child to force_terminate_process_group; Windows keeps taskkill /T when the facade reports Unsupported. - zccache-ci uses kernal_api::platform::host::target_is_windows. - dev daemon identity maps Blake3HashError through io_error_kind. - cli-core re-exports host::home_dir for cargo-registry. - snapshot_fp compares the facade hex digest without an extra String. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> * docs(todo): record Phase B round 2 results and remaining facade gaps Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> * fix(kernal): restore the daemon user-baseline env and the dedicated mtime walk pool kernal-api#337 adds the two facade options the migration lost: - spawn_sync_daemon(.., SyncEnvironment::UserBaseline, ..): both daemons again start from the user's login environment, as running-process's spawn_daemon did, instead of inheriting the CLI's. - DirectoryWalk::parallelism(DedicatedPool { threads: 0 }) for mtime_replay, restoring soldr#2760's protection against the shared pool's busy-timeout abort (main used jwalk RayonNewPool(0) here, and only here). Workspace check against kernal-api 2f6a39e exits 0 without the probe patch. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> * build: pin kernal-api =0.1.17 from crates.io and drop the _vender sub-git kernal-api 0.1.17 now carries every facade surface this workspace uses, so the temporary nested-checkout path dependency (and its workspace exclude) goes away: the lockfile resolves kernal-api from the crates.io registry. Validated against the published crate: workspace check and clippy -D warnings exit 0; ./test 2734 passed, 0 failed; wire characterization 45 passed with golden bytes unchanged; check_kernal_api_baseline.py exits 0. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> * fix(windows): clear the Windows-only lints the migration introduced; recount crates - process_session_tests.rs: gate 'use super::*' to Unix; only the Unix-gated tests use it, so under -D warnings it failed the Windows test build (unused import). - zccache-ipc pipe-create retry loops: return the final attempt's error instead of expect() on an Option (clippy expect_used). - CLAUDE.md / crates/CLAUDE.md: 23 crates now that zccache-platform is gone. Workspace clippy -D warnings for x86_64-pc-windows-msvc (lib, bins, tests): exit 0. ci/tests crate_docs: 4 passed. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> * fix(windows): probe the fake-backend seam in running-process spelling; fix cmd fixture exit - zccache-ipc: the RUNNING_PROCESS_FAKE_BACKEND seam carries a bare pipe name on Windows (running-process spelling). The old zccache-platform probe resolved it as an interprocess namespaced name; the migrated probe_native treated it as a native path, so the pipe open failed, the seam fell back to Direct, and the broker-route / FrameV1 tests failed. The probe now resolves via Endpoint::from_running_process (probe_running_process), which is identity on Unix. - zccache-daemon-core: the Windows stdout/stderr session fixture ended in `<nul set /p`, which sets ERRORLEVEL 1 on EOF, so `cmd /C` exited 1. Shared fixture now ends in `exit 0`, matching the Unix printf fixture; status assertions print the exit status. - dylints/ban_std_pathbuf: rustfmt. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> * fix(windows,dylint): trailing-space-free cmd fixture; clear workspace Dylint violations - daemon-core: `set /p` echoes everything up to the `&` separator, so the Windows fixture emitted "stdout " / "stderr ". Glue each prompt to its `&` and put the stderr redirect first. - dylints/ban_raw_subprocess_in_daemon: refresh the ui .stderr snapshots for the kernal-api wording of the lint messages. - dylints/enforce_platform_boundary: restore the trailing blank line the ui snapshot needs (the actual stderr ends in "\n\n"). - Workspace Dylint (ci.lint --dylint-only) violations introduced by the migration, fixed without widening any allowlist: - zccache-core host::home_dir / defender_exclusions return NormalizedPath. - zccache-core crash::signal_label selects the host at runtime through kernal-api's const target predicates instead of cfg. - zccache-compiler clang_library_candidates returns NormalizedPath. - daemon-core fs_caps hardlink ceiling is a const selected by kernal_api::platform::host::target_is_windows() instead of cfg. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> * fix(perf-local): align soldr's exact zccache pin with the checkout under test soldr pins zccache exactly (=1.14.0). Cargo applies [patch] only when the patched version satisfies the requirement, so for any other checkout version (main has been 1.14.3 since the 1.14.x releases) the patch was silently unused, soldr built crates.io's zccache, and run_soldr_builder refused the result: 'soldr builder did not resolve zccache from the mounted checkout under test'. The local perf gate was unusable for every release after the pin. Rewrite each soldr manifest's zccache requirement to =<checkout version> alongside the patch. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> * fix(embedded): keep RuntimeHooks.handle a tokio Handle for hosts The migration changed the public RuntimeHooks.handle from Option<tokio::runtime::Handle> to kernal-api's RuntimeHandle, breaking every host that passes its runtime: soldr failed to build ('expected RuntimeHandle, found Handle' in soldr-daemon/src/zccache_embedded.rs). Restore the public type and bridge it once at start: entering the host handle makes it ambient, which is what RuntimeHandle::current captures. Background work still lands on the host runtime (explicit_handle_owns_background_spawns). soldr's whole workspace now compiles against this branch unchanged apart from its running-process bump. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> --------- Co-authored-by: Claude Opus 5 (1M context) <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #256.
Summary
Wires the opt-in extended journal schema from
zccache session-start --profileend-to-end and adds filter/sort/top flags to the offlinezccache analyzerollup. When the flag is OFF, behaviour and journal shape are byte-identical to releases before this PR.What's in
Request::SessionStartgainsprofile: bool(PROTOCOL_VERSION 8 → 9, DD-018).SessionConfigandSessioncarry the flag through to the daemon's journal-write site.JournalEntry::with_profile_fields(...)populatescrate_name,crate_type,output_ext, andself_profile_nsfrom the rustc argument vector. A newSelfProfileSpansaccumulator gives the compile handler (next wave) a place to time the hash/lookup/decompress/store phases without changing the journal-write API.zccache analyzelearns--session,--crate,--outcome(hit/miss/non-cacheable),--sort(wall-clock/misses/hits), and--top N. Default human view groups by crate sorted by wall-clock descending. Missing journal → exit 0 with(no journal). Malformed lines → single stderr warning + skip.docs/journal-schema.mddocuments the opt-in fields and their gating.Tests added
compile_journal: 5 tests forwith_profile_fields, theSelfProfileSpansaccumulator, the legacy-record contract (no profile fields when--profileis off), and a full roundtrip withmiss_diffpopulated.analyze: 8 fixture-driven tests covering per-crate sort orders,--toptruncation, session/crate/outcome filters, and the "filtered to empty" case.clap::try_parse_fromtests forsession-start --profileand the new analyze flags.Test plan
soldr cargo fmt --allsoldr cargo clippy --workspace --all-targets -- -D warningssoldr cargo test --workspace --lib(all crates green; compile_journal 68 ✓, cli 65 ✓, depgraph etc all pass)Out of scope (follow-up)
self_profile_nswith real timings (the field and the accumulator are wired; the call-site timing spans insidehandle_compileare the next wave).miss_diffevidence collection at the cache-key-comparison site (the field is wired; population is the next wave). When--profileis on but no diff is computed, the field is omitted (skip_serializing_if).🤖 Generated with Claude Code