♻️ feat: Reuse Verified Environment Preparation - #286
Merged
Merged
Conversation
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.
Summary
Repeated worker starts currently rerun environment setup even when a checkout's dependencies have not changed. For installation recipes this wastes time and makes restart recovery perform unnecessary writes.
Add opt-in
setup.reusewith explicit input files and a sandboxed readiness check. Existing definitions still run setup on every startup. Matching preparation evidence now checks readiness instead of reinstalling; changed inputs or missing artifacts run setup again.Mechanism
Receipts are owner-only worker state outside registered roots and denied to native commands. Hashing uses held root descriptors and bounded regular-file reads. Inputs must remain unchanged through setup and readiness. Cancellation, uncertain termination, timeout and failure cannot publish success. Startup retains the existing mutation guard; fresh conversation instances use the same contract.
This is the first slice of a resource-lifecycle stack. It does not share installed dependencies between worktrees, prepare linked lanes on command admission, alter sandbox grants, add disk quotas or modify a live deployment. Those need separate reviewable changes. The README documents the contract, example configuration and these limits.
Verification
npm run buildinpackages/code).git diff --check.No live worker restart or deployment performed. Full repository CI is left to this PR.