feat(swarm): SP3 — real warm boot (shared cargo cache the worker reuses, gated)#14
Closed
New1Direction wants to merge 4 commits into
Closed
feat(swarm): SP3 — real warm boot (shared cargo cache the worker reuses, gated)#14New1Direction wants to merge 4 commits into
New1Direction wants to merge 4 commits into
Conversation
…orker reuses, gated)
…metic, timeout-guarded) New execution/warm_boot.rs: warm_target_dir(session) derives a STABLE shared cargo target dir under the OS cache dir; warm_boot(session, repo, enabled) runs cargo check into it with CARGO_TARGET_DIR set, wrapped in a 60s tokio timeout + cargo-presence guard. Disabled -> Skipped (no dir); success -> Warmed (cache non-empty = structural reuse proof); cargo-absent/spawn-fail/timeout -> Unavailable, never hang/panic/abort. Deprecate the dag.rs speculative_warm_boot no-op with a doc note pointing at the real mechanism. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…ARGET_DIR) Pure worker_cargo_env(session_id, speculative) returns the CARGO_TARGET_DIR pair (== warm_target_dir(session)) under speculative, empty otherwise — the testable anti-theater link. SubprocessBackend::spawn applies it to the worker Command, so the live worker's observation::cargo_check (which honors CARGO_TARGET_DIR) reuses the warmed cache. SessionSpec gains session_id + speculative; RuntimeCoordinator carries an AtomicBool speculative flag (set_speculative/speculative) the leader flips through its Arc, and spawn_worker_process reads both onto the spec. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…ult off) Adds clap --speculative to Cli (mirrors --inject-stress), threaded into the leader via set_speculative(bool) which flips both the leader flag and the runtime coordinator's AtomicBool (so spawned workers inherit CARGO_TARGET_DIR). The campaign calls maybe_warm_boot() before dispatch in run_full_campaign and run_observable_campaign: speculative on -> warm_boot(session, cwd, true) populates the shared cache; off -> no-op (Skipped), unchanged path. Leader tests assert speculative defaults off (leader + coordinator) and that set_speculative propagates to the coordinator. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
New1Direction
added a commit
that referenced
this pull request
Jun 15, 2026
…er reuses) Lands the stacked branch 'feat/swarm-warm-boot' (PR #14) onto main.
Owner
Author
|
Landed on |
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.
Track B SP3: a warm boot that isn't theater
speculative_warm_bootwas a no-op bool-setter sitting onSpeculativeScheduler::run— a path production never runs. The real campaign work is the separatekorg workerchild'scargo check, which ran cold per worktree. SP3 makes warm boot do real work the real worker reuses.The anti-theater mechanism
warm_target_dir(session_id)→ a stable shared cargo target dir. Both the warm boot and the worker spawn derive it from the samesession_id(the leader'ssidis the coordinator'ssid), so the worker reuses exactly what was warmed — with zero cross-process plumbing.7a08f69): runs a realcargo checkwithCARGO_TARGET_DIR=warm_target_dir, compiling the dependency graph into the shared cache once. Hermetic: wrapped in a 60stimeout+ cargo-presence guard, returnsSkipped|Warmed|Unavailable(neverErr, never hangs) — the bare-host path always completes.fc0b8f0):SubprocessBackend::spawnsetsCARGO_TARGET_DIR=warm_target_dir(session)on the workerCommandwhen speculative;cargo checkhonors it automatically (nothing clobbers it). So workers reuse the warmed dep artifacts instead of recompiling cold.e371246):--speculativeflag (default off → unchanged behavior); flips the leader + coordinatorAtomicBool, read atspawn_worker_process.maybe_warm_bootis called before dispatch in the live campaign loop.Honest scoping
SandboxPoolleft untouched (it primes a node/LSP world the cargo campaign never queries — wrong shape).--tui/--webcampaign entrypoints don't thread the flag yet (headless leader paths do).Test plan
cargo test --workspace— 32 binaries, 0 failures (korg-runtime 141 lib + keystone + run_once + 9 new SP3 tests)worker_cargo_envpoints the worker at the warmed dir when speculative, empty when off--speculativedefaults off; flag read end-to-end into the worker spawnStacked on
feat/swarm-collaboration(SP2). For review — not for merge ahead of the stack.Spec:
docs/superpowers/specs/2026-06-14-korg-swarm-sp3-warm-boot-design.md