fix: fix: gardener-run.sh uses manual worktree setup instead of formula_worktree_setup() (#281) #290

Merged
dev-bot merged 1 commit from fix/issue-281 into main 2026-04-06 10:04:02 +00:00
Collaborator

Fixes #281

Changes

Fixes #281 ## Changes
dev-qwen added 1 commit 2026-04-06 09:55:00 +00:00
fix: fix: gardener-run.sh uses manual worktree setup instead of formula_worktree_setup() (#281)
All checks were successful
ci/woodpecker/push/ci Pipeline was successful
ci/woodpecker/pr/ci Pipeline was successful
a7eb051996
Collaborator

AI Review — Error\n\nReview failed.\n---\na7eb051

## AI Review — Error\n<!-- review-error: a7eb051996f3c736ed5610f1c7989d62d56b1d18 -->\nReview failed.\n---\n*a7eb051*
Collaborator

AI Review

Summary\n\nThis PR replaces 9 lines of manual worktree setup in gardener-run.sh with a single call to formula_worktree_setup(), which is already used by every other cron agent (planner, predictor, architect, supervisor).\n\n### Correctness\n\nThe function body (lib/formula-session.sh:716) is functionally identical to the removed code:\n- cd "$PROJECT_REPO_ROOT"\n- git fetch "${FORGE_REMOTE}" "$PRIMARY_BRANCH" 2>/dev/null || true\n- worktree_cleanup "$worktree"\n- git worktree add "$worktree" "${FORGE_REMOTE}/${PRIMARY_BRANCH}" --detach\n- trap "worktree_cleanup '$worktree'" EXIT\n\n### Minor behavioral delta (not a bug)\n\nThe old cleanup() EXIT trap also removed $GARDENER_PR_FILE. The new trap only runs worktree_cleanup. However, $GARDENER_PR_FILE is explicitly reset with rm -f at line 296 at the start of every run (before agent_run), so a stale file from a previous crash cannot cause incorrect behavior on the next run. Normal-path cleanup at line 343 is unchanged.\n\n### Verdict\n\nChange is correct, consistent with project conventions, and reduces code duplication.

Verdict

APPROVE — Correctly replaces manual worktree setup with formula_worktree_setup(), matching all other cron agents; minor behavioral delta (GARDENER_PR_FILE not removed on crash) is benign since it is reset at line 296 on each run.


Reviewed at a7eb051 | AGENTS.md

## AI Review <!-- reviewed: a7eb051996f3c736ed5610f1c7989d62d56b1d18 --> ### Summary\n\nThis PR replaces 9 lines of manual worktree setup in `gardener-run.sh` with a single call to `formula_worktree_setup()`, which is already used by every other cron agent (`planner`, `predictor`, `architect`, `supervisor`).\n\n### Correctness\n\nThe function body (`lib/formula-session.sh:716`) is functionally identical to the removed code:\n- `cd "$PROJECT_REPO_ROOT"`\n- `git fetch "${FORGE_REMOTE}" "$PRIMARY_BRANCH" 2>/dev/null || true`\n- `worktree_cleanup "$worktree"`\n- `git worktree add "$worktree" "${FORGE_REMOTE}/${PRIMARY_BRANCH}" --detach`\n- `trap "worktree_cleanup '$worktree'" EXIT`\n\n### Minor behavioral delta (not a bug)\n\nThe old `cleanup()` EXIT trap also removed `$GARDENER_PR_FILE`. The new trap only runs `worktree_cleanup`. However, `$GARDENER_PR_FILE` is explicitly reset with `rm -f` at line 296 at the start of every run (before `agent_run`), so a stale file from a previous crash cannot cause incorrect behavior on the next run. Normal-path cleanup at line 343 is unchanged.\n\n### Verdict\n\nChange is correct, consistent with project conventions, and reduces code duplication. ### Verdict **APPROVE** — Correctly replaces manual worktree setup with formula_worktree_setup(), matching all other cron agents; minor behavioral delta (GARDENER_PR_FILE not removed on crash) is benign since it is reset at line 296 on each run. --- *Reviewed at `a7eb051` | [AGENTS.md](AGENTS.md)*
review-bot approved these changes 2026-04-06 10:02:44 +00:00
review-bot left a comment
Collaborator

AI Review: APPROVE — Correctly replaces manual worktree setup with formula_worktree_setup(), matching all other cron agents; minor behavioral delta (GARDENER_PR_FILE not removed on crash) is benign since it is reset at line 296 on each run.

AI Review: **APPROVE** — Correctly replaces manual worktree setup with formula_worktree_setup(), matching all other cron agents; minor behavioral delta (GARDENER_PR_FILE not removed on crash) is benign since it is reset at line 296 on each run.
dev-bot merged commit 5cf058b04b into main 2026-04-06 10:04:02 +00:00
dev-bot deleted branch fix/issue-281 2026-04-06 10:04:03 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
3 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: disinto-admin/disinto#290
No description provided.