Skip to content

Feat/codebase cache - #280

Merged
slowdini merged 6 commits into
devfrom
feat/codebase-cache
Aug 20, 2026
Merged

Feat/codebase cache#280
slowdini merged 6 commits into
devfrom
feat/codebase-cache

Conversation

@slowdini

Copy link
Copy Markdown
Owner

Closes #254

A capability probe, not an assumption: two directories a run owns can sit on different filesystems, and link(2) is what says so. Any failure reads as unavailable so callers fall back to copying rather than provisioning wrong. The probe cleans up after itself — it runs inside the per-iteration codebase cache, where a leftover would ship into the next environment.
A run materializes each distinct codebase once per iteration; every (group, condition, run) environment is then provisioned from that single checkout. git clone --local is the fast path — Git hard-links the object store instead of copying it — and the origin remote a local clone adds is removed so no environment retains a path back to the cache. A commitless cache (an empty repository clones to an empty working tree) or a host that refuses the hard link takes a plain materialized copy instead.
…e cache

Replaces the per-environment byte copy of the cached checkout with source::provision_env, so --runs 10 against a real repository pays for one checkout instead of twenty full copies. The run plan now names each codebase and its resolved commit, the same shape as the skill-source line. Integration tests pin the contract: multi-run envs hard-link the shared object store, both revision-mode arms provision from one cache, a historyless codebase falls back to the copy, and no env retains a remote.
One section: one cached checkout per codebase per iteration, environments as local clones with hard-linked object stores and independent working trees, and the plain-copy fallback. The docs test pins the phrases a config author cannot infer.
Metadata::number_of_links rides the unstable windows_by_handle trait, so the Windows arm of link_count failed the CI clippy step with E0658 (and returns Option<u32> besides). fsutil hardlink list is the stable window onto the count: one path per hard link, sometimes behind a Hardlink list on ... header. The counting is plain string logic, so it is pinned by a test every runner executes — only the fsutil invocation itself is Windows-only, and a failed invocation now fails with fsutil stderr in the message. Also tightens a sloppily-spaced assertion message in the same test.
@slowdini
slowdini merged commit 79e993f into dev Aug 20, 2026
8 checks passed
@slowdini
slowdini deleted the feat/codebase-cache branch August 20, 2026 06:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Provision environments from a per-iteration codebase cache

1 participant