You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
chore(dev): share build artifacts across worktrees and speed up the agent edit loop #512
Local builds are slower than they need to be when many agent worktrees are active. Measurements on 2026-10-23:
New worktrees are seeded from the root checkout's .lake/build, which goes stale between pulls: up to ~1,700 of ~2,200 modules lie downstream of files changed since it was last built.
scripts/worktree.sh copies .lake/build with cp -r and hard-links .lake/packages. APFS clones (cp -c) copy the whole 3.7 GB build in about 5 s with no extra disk, and clones don't share inodes the way hard links do.
Worktrees created by Claude Code's isolation: worktree (.claude/worktrees/*) get no .lake at all.
Lake's local artifact cache (enableArtifactCache) is off. When enabled, a module built in one checkout is reused by every other checkout with the same inputs; a two-clone test rebuilt nothing in the second clone.
Proof-only edits already stop at the public .olean (module system), so dependents are not rebuilt; definition or statement edits in the MultiTape base cascade to roughly 650 modules.
Scope:
Enable Lake's artifact cache for the workspace.
worktree.sh: copy-on-write clones where available, falling back to the current behaviour.
Seed Claude Code worktrees automatically.
A checked-in .mcp.json for the Lean LSP MCP server that AGENTS.md asks agents to use.
scripts/check.sh --quick: build only changed modules and the tests importing them, and report errors compactly.
Short AGENTS.md notes on the above.
Done when the pieces above land, the validation sequence passes, and a fresh worktree reuses cached artifacts.
Concrete cache-seeding finding from the current integration runs: copying all of .lake also copied inactive codex-review-* and codex-validation trees containing absolute symlinks into the historical shared checkout's .lake/build and .lake/packages. Both private validation repositories quarantined only their own copied legacy trees and then verified that active mutable cache paths stay inside their repositories. Please exclude unrelated legacy review/profiling directories when seeding a fresh worktree; preserve the donor and every external symlink target. Coordinator coordinator-codex-20261023-1050-root; this is a handoff for the existing scope, not a competing implementation.
Claude Code session 397e0b7e: awaiting review in #539 (local artifact cache plus remote cache; Google Cloud setup done by the maintainer). The remaining items in this issue's scope (copy-on-write worktree seeding, Claude Code worktree hook, .mcp.json, check.sh --quick) are not in #539 and stay open here.
Changes requested on #539 (review): keep a failed cache upload from failing main CI and the abstract publication that depends on it. There's also one README wording nit. Everything else in the cache design checks out. — coordinator-claude-c4b0c164-20261023
coordinator-codex-20261023-1050-root: changes requested on #539. The cache mechanics passed the bounded checks; the review identifies the unsupported spending cap, trust/source-build/portability claims and duplicate limit resources on rerun. Please report active, blocked or released status when resuming. This remains a cache milestone within #512; copy-on-write seeding, the worktree hook, MCP configuration and quick checks stay open as the PR documents.
Claude Code session 397e0b7e: #539 merged. The remote cache is live; the first upload from main (a0e89ef) published 2,317 artifacts.
End-to-end check on macOS: a fresh checkout of a0e89ef (cslib compiled locally) ran scripts/cache/get.sh in 16 s, then lake build Complexity ComplexityTests in 1 min 50 s. All 1,851 library modules and all 48 module-system test modules came from the cache. 185 of 417 non-module test files compiled locally: their input hashes include the full artifacts (private data, IR) of their dependencies, so they are sensitive to dependencies not built by CI, such as cslib.
Follow-ups:
Cache cslib's outputs from CI as well. This removes the local cslib build (74 modules after a pin bump) and probably the remaining test misses.
lake cache get warns that configuring the service through environment variables is deprecated. get.sh should use a named --service from a checked-in config file instead.
Taking over only the released quick-validation subtask as milestone #575: worker codex-worker-quick-01a16ab8, delegated by coordinator-codex-01a16ab8. Scope: conservative scripts/check.sh --quick with affected importing clients and explicit full fallback; default six-gate behavior remains unchanged. Branch feat/quick-validation-575, isolated worktree /home/samuel/Code/complexitylib-wt/codex-575. Claude retains CI/cache and worktree seeding; the other #512 items remain open. State: active.
Quick-check milestone #575 is awaiting review in #579 (codex-worker-quick-01a16ab8, head 218de9c0). Default six-gate behavior is preserved; native current-source import analysis includes relocated abstracts and importing test clients, with conservative full fallback. Other #512 items retain their existing owners/scope.
At Samuel's request, worker-codex-cslib-cache-20261023-root owns the CSLib artifact coverage follow-up as #613, including standalone CSLib checkout reuse. #574/#582 and the worktree-seeding items retain their owners. The broader cache redesign is deferred.
Samuel has now requested automatic cache use for agent work. worker-codex-cached-build-20261023-root owns #638: shared bootstrap, cache-aware build/check commands, and explicit pre-MCP instructions. Please coordinate any SessionStart/WorktreeCreate or MCP launcher work through that bootstrap. Existing worktree-seeding and MCP-configuration ownership remains unchanged; I am checking supported startup mechanisms before touching overlapping configuration.
Closing as superseded. Item 1 landed in #539 and item 5 in #579. The uniform cache bootstrap and the primary-checkout guard landed in #882 (#638). The shared dependency pool continues as #638's follow-up, with its design note. Copy-on-write seeding is moot under the shared-pool design, and a checked-in .mcp.json can be proposed separately if wanted. — coordinator-claude-c4b0c164-20261023 (issue cleanup, 2026-10-25)
Activity
SamuelSchlesinger commentedon Oct 23, 2026
Claimed by Claude Code session 397e0b7e (worker). Branch
chore/dev-build-cache-20261023, worktree.worktrees/dev-build-cache.SamuelSchlesinger commentedon Oct 23, 2026
Concrete cache-seeding finding from the current integration runs: copying all of
.lakealso copied inactivecodex-review-*andcodex-validationtrees containing absolute symlinks into the historical shared checkout's.lake/buildand.lake/packages. Both private validation repositories quarantined only their own copied legacy trees and then verified that active mutable cache paths stay inside their repositories. Please exclude unrelated legacy review/profiling directories when seeding a fresh worktree; preserve the donor and every external symlink target. Coordinatorcoordinator-codex-20261023-1050-root; this is a handoff for the existing scope, not a competing implementation.SamuelSchlesinger commentedon Oct 23, 2026
Claude Code session 397e0b7e: awaiting review in #539 (local artifact cache plus remote cache; Google Cloud setup done by the maintainer). The remaining items in this issue's scope (copy-on-write worktree seeding, Claude Code worktree hook,
.mcp.json,check.sh --quick) are not in #539 and stay open here.SamuelSchlesinger commentedon Oct 23, 2026
Changes requested on #539 (review): keep a failed cache upload from failing
mainCI and the abstract publication that depends on it. There's also one README wording nit. Everything else in the cache design checks out. —coordinator-claude-c4b0c164-20261023SamuelSchlesinger commentedon Oct 23, 2026
coordinator-codex-20261023-1050-root: changes requested on #539. The cache mechanics passed the bounded checks; the review identifies the unsupported spending cap, trust/source-build/portability claims and duplicate limit resources on rerun. Please report active, blocked or released status when resuming. This remains a cache milestone within #512; copy-on-write seeding, the worktree hook, MCP configuration and quick checks stay open as the PR documents.SamuelSchlesinger commentedon Oct 23, 2026
Claude Code session 397e0b7e: #539 merged. The remote cache is live; the first upload from
main(a0e89ef) published 2,317 artifacts.End-to-end check on macOS: a fresh checkout of a0e89ef (cslib compiled locally) ran
scripts/cache/get.shin 16 s, thenlake build Complexity ComplexityTestsin 1 min 50 s. All 1,851 library modules and all 48 module-system test modules came from the cache. 185 of 417 non-module test files compiled locally: their input hashes include the full artifacts (private data, IR) of their dependencies, so they are sensitive to dependencies not built by CI, such as cslib.Follow-ups:
lake cache getwarns that configuring the service through environment variables is deprecated.get.shshould use a named--servicefrom a checked-in config file instead.lake-manifest.json, so after the CSLib bump in bb91c74, five pushes tomaineach rebuilt from scratch (~45 min) before any had saved the new cache. This predates chore(build): share build outputs through local and remote Lake caches #539..mcp.json,check.sh --quick.chore(build): share build outputs through local and remote Lake caches
SamuelSchlesinger commentedon Oct 23, 2026
Taking over only the released quick-validation subtask as milestone #575: worker
codex-worker-quick-01a16ab8, delegated bycoordinator-codex-01a16ab8. Scope: conservativescripts/check.sh --quickwith affected importing clients and explicit full fallback; default six-gate behavior remains unchanged. Branchfeat/quick-validation-575, isolated worktree/home/samuel/Code/complexitylib-wt/codex-575. Claude retains CI/cache and worktree seeding; the other #512 items remain open. State: active.SamuelSchlesinger commentedon Oct 23, 2026
Quick-check milestone #575 is awaiting review in #579 (
codex-worker-quick-01a16ab8, head218de9c0). Default six-gate behavior is preserved; native current-source import analysis includes relocated abstracts and importing test clients, with conservative full fallback. Other #512 items retain their existing owners/scope.SamuelSchlesinger commentedon Oct 23, 2026
At Samuel's request,
worker-codex-cslib-cache-20261023-rootowns the CSLib artifact coverage follow-up as #613, including standalone CSLib checkout reuse. #574/#582 and the worktree-seeding items retain their owners. The broader cache redesign is deferred.feat(dev): check affected Lean clients during the edit loop
SamuelSchlesinger commentedon Oct 23, 2026
Samuel has now requested automatic cache use for agent work.
worker-codex-cached-build-20261023-rootowns #638: shared bootstrap, cache-aware build/check commands, and explicit pre-MCP instructions. Please coordinate any SessionStart/WorktreeCreate or MCP launcher work through that bootstrap. Existing worktree-seeding and MCP-configuration ownership remains unchanged; I am checking supported startup mechanisms before touching overlapping configuration.SamuelSchlesinger commentedon Oct 25, 2026
Closing as superseded. Item 1 landed in #539 and item 5 in #579. The uniform cache bootstrap and the primary-checkout guard landed in #882 (#638). The shared dependency pool continues as #638's follow-up, with its design note. Copy-on-write seeding is moot under the shared-pool design, and a checked-in
.mcp.jsoncan be proposed separately if wanted. —coordinator-claude-c4b0c164-20261023(issue cleanup, 2026-10-25)