Add reusable Grove repository runs#245
Merged
Merged
Conversation
ferueda
marked this pull request as ready for review
July 23, 2026 20:15
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
lib/repositoryprimitive over Grove for resolving an exact base, preparing or resuming a run, inspecting Git changes, and safely cleaning the runWhy
Planning and implementation workers need isolated writable repositories. The worker's read-only Harness checkout is not suitable for agent work, and cloning from scratch for every run would make dependency setup slow. This provides a small provider-neutral primitive that future functions can call without coupling repository lifecycle to Inngest, Linear, GitHub publication, or an agent provider.
Behavior and safety
A run resolves its base to an immutable commit SHA, leases a stable Grove worktree and branch, and reruns setup whenever that lease is acquired or resumed. Cleanup verifies Grove's process scan reports no active worktree processes before resetting to the original base and releasing the slot. Failed setup or unsafe cleanup keeps the lease and work intact so the same run can recover.
Grove 1.4.4 reserves a lease to the acquiring PID. Since the worker is a long-lived daemon, cleanup uses
force: trueonly after Grove itself verifies process safety; this bypasses the daemon owner reservation without bypassing actual worktree-process protection.Accepted base inputs are limited to origin remote branches and exact SHAs. Git revision expressions such as
main~1are rejected.Validation
make checkmake smoke-linear-automation-compose20260723-193227-05e580: implementation and quality both passed with zero findingsLinear: FER-271