Skip to content

refactor: Forge owns its checkouts - #1

Merged
RjBiermann merged 1 commit into
masterfrom
forge-owns-checkouts
Sep 12, 2026
Merged

RjBiermann merged 1 commit into
masterfrom
forge-owns-checkouts

Conversation

@RjBiermann

Copy link
Copy Markdown
Owner

Closes none — part of the architecture review (candidate 1: pull workdir out of the Forge interface).

What

start_work(number, branch) -> str allocates the build checkout and returns its path; new finish_work(number) removes it (tolerant no-op when the issue never started). Callers never name paths, so the adapter can never rmtree one it didn't create — the old caller-supplied workdir parameter let /retry run with `workdir=".") and have the adapter delete the repo checkout.

  • process_issue owns the create/cleanup bracket (try/finally); run_once sheds its worktree plumbing
  • repair's verification round now runs in the PR worktree (was cwd=".")
  • build prompts switch to replace-based substitution — braces in an issue body crashed .format() before the agent ran

Adapter impact

Forge adapter interface changed — custom adapters need a two-line update (start_work returns the path; add finish_work). Declare minor at merge per ADR-0002.

Verification

$ python3 tests/test_devloop.py
queue full: 1 build(s) in flight (devloop/issue-9); nothing started — merge/close the open devloop PR(s) or raise pipeline.max_parallel
all checks passed

start_work(number, branch) allocates the build checkout and returns its
path; new finish_work(number) removes it (no-op when never started).
Callers never name paths, so the adapter can never rmtree one it didn't
create — fixes /retry wiping the checkout via the old workdir='.' path.
process_issue owns the create/cleanup bracket; run_once sheds its
worktree plumbing. Also: repair verifier runs in the PR worktree (was
cwd='.'), and build prompts switch to replace-based substitution
(braces in issue bodies crashed .format() before the agent ran).

Adapter interface changed — custom adapters need a two-line update.

python3 tests/test_devloop.py: all checks passed
@RjBiermann
RjBiermann merged commit 316be5f into master Sep 12, 2026
8 checks passed
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