Skip to content

Add reusable Grove repository runs#245

Merged
ferueda merged 3 commits into
mainfrom
codex/fer-271-grove-repository-runs
Jul 23, 2026
Merged

Add reusable Grove repository runs#245
ferueda merged 3 commits into
mainfrom
codex/fer-271-grove-repository-runs

Conversation

@ferueda

@ferueda ferueda commented Jul 23, 2026

Copy link
Copy Markdown
Owner

Summary

  • add a standalone lib/repository primitive over Grove for resolving an exact base, preparing or resuming a run, inspecting Git changes, and safely cleaning the run
  • keep a bounded pool of reusable worktrees warm across worker restarts, preserving ignored dependency caches while resetting tracked and untracked agent work
  • run repository setup after every acquire with a timeout and a strict environment allowlist
  • persist repository and pnpm caches in the local Docker Compose worker and extend the Compose smoke test through restart, reacquire, inspection, cleanup, and slot reuse
  • add harness configuration, import-boundary guards, integration tests, and contributor/runtime documentation

Why

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: true only 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~1 are rejected.

Validation

  • make check
  • make smoke-linear-automation-compose
  • repository integration tests for base resolution, durable reacquisition, setup retry, bounded pool reuse, warm dependency preservation, active-process cleanup refusal, cleanup repair, and plain Git change inspection
  • change-review workflow run 20260723-193227-05e580: implementation and quality both passed with zero findings

Linear: FER-271

@ferueda ferueda self-assigned this Jul 23, 2026
@ferueda
ferueda marked this pull request as ready for review July 23, 2026 20:15
@ferueda
ferueda merged commit afc7b11 into main Jul 23, 2026
5 checks passed
@ferueda
ferueda deleted the codex/fer-271-grove-repository-runs branch July 23, 2026 21:08
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.

1 participant