2026-03-22 12:07:31 +00:00
|
|
|
<!-- last-reviewed: 251d160e213b19a4fcc0cd8f8e3be9ea3283887f -->
|
2026-03-21 12:44:23 +00:00
|
|
|
# Gardener Agent
|
|
|
|
|
|
|
|
|
|
**Role**: Backlog grooming — detect duplicate issues, missing acceptance
|
2026-03-21 18:07:37 +00:00
|
|
|
criteria, oversized issues, stale issues, and circular dependencies. Enforces
|
|
|
|
|
the quality gate: strips the `backlog` label from issues that lack acceptance
|
|
|
|
|
criteria checkboxes (`- [ ]`) or an `## Affected files` section. Invokes
|
2026-03-21 12:44:23 +00:00
|
|
|
Claude to fix or escalate to a human via Matrix.
|
|
|
|
|
|
fix: gardener migration — run-gardener.toml via direct cron, remove legacy scripts (#490)
Rewrite gardener-run.sh as direct cron runner (matching supervisor/planner/
predictor pattern): lock guard, memory check, worktree, tmux session with
Claude sonnet + formulas/run-gardener.toml, phase monitoring, cleanup.
- Delete gardener-poll.sh and gardener-agent.sh (superseded)
- Extract consume_escalation_reply() to lib/formula-session.sh (shared
by gardener and supervisor, eliminates duplicate blocks)
- Update AGENTS.md, gardener/AGENTS.md, lib/AGENTS.md, CI smoke test,
and cross-references
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-21 13:09:17 +00:00
|
|
|
**Trigger**: `gardener-run.sh` runs 4x/day via cron. It creates a tmux
|
|
|
|
|
session with `claude --model sonnet`, injects `formulas/run-gardener.toml`
|
|
|
|
|
with escalation replies as context, monitors the phase file, and cleans up
|
|
|
|
|
on completion or timeout (2h max session). No action issues — the gardener
|
|
|
|
|
runs directly from cron like the planner, predictor, and supervisor.
|
2026-03-21 12:44:23 +00:00
|
|
|
|
|
|
|
|
**Key files**:
|
fix: gardener migration — run-gardener.toml via direct cron, remove legacy scripts (#490)
Rewrite gardener-run.sh as direct cron runner (matching supervisor/planner/
predictor pattern): lock guard, memory check, worktree, tmux session with
Claude sonnet + formulas/run-gardener.toml, phase monitoring, cleanup.
- Delete gardener-poll.sh and gardener-agent.sh (superseded)
- Extract consume_escalation_reply() to lib/formula-session.sh (shared
by gardener and supervisor, eliminates duplicate blocks)
- Update AGENTS.md, gardener/AGENTS.md, lib/AGENTS.md, CI smoke test,
and cross-references
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-21 13:09:17 +00:00
|
|
|
- `gardener/gardener-run.sh` — Cron wrapper + orchestrator: lock, memory guard,
|
|
|
|
|
consumes escalation replies, sources disinto project config, creates tmux session,
|
|
|
|
|
injects formula prompt, monitors phase file, handles crash recovery via
|
|
|
|
|
`run_formula_and_monitor`
|
2026-03-21 12:44:23 +00:00
|
|
|
- `formulas/run-gardener.toml` — Execution spec: preflight, grooming, dust-bundling, blocked-review, agents-update, commit-and-pr
|
|
|
|
|
|
|
|
|
|
**Environment variables consumed**:
|
|
|
|
|
- `CODEBERG_TOKEN`, `CODEBERG_REPO`, `CODEBERG_API`, `PROJECT_NAME`, `PROJECT_REPO_ROOT`
|
fix: gardener migration — run-gardener.toml via direct cron, remove legacy scripts (#490)
Rewrite gardener-run.sh as direct cron runner (matching supervisor/planner/
predictor pattern): lock guard, memory check, worktree, tmux session with
Claude sonnet + formulas/run-gardener.toml, phase monitoring, cleanup.
- Delete gardener-poll.sh and gardener-agent.sh (superseded)
- Extract consume_escalation_reply() to lib/formula-session.sh (shared
by gardener and supervisor, eliminates duplicate blocks)
- Update AGENTS.md, gardener/AGENTS.md, lib/AGENTS.md, CI smoke test,
and cross-references
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-21 13:09:17 +00:00
|
|
|
- `PRIMARY_BRANCH`, `CLAUDE_MODEL` (set to sonnet by gardener-run.sh)
|
2026-03-21 12:44:23 +00:00
|
|
|
- `MATRIX_TOKEN`, `MATRIX_ROOM_ID`, `MATRIX_HOMESERVER`
|
fix: gardener migration — run-gardener.toml via direct cron, remove legacy scripts (#490)
Rewrite gardener-run.sh as direct cron runner (matching supervisor/planner/
predictor pattern): lock guard, memory check, worktree, tmux session with
Claude sonnet + formulas/run-gardener.toml, phase monitoring, cleanup.
- Delete gardener-poll.sh and gardener-agent.sh (superseded)
- Extract consume_escalation_reply() to lib/formula-session.sh (shared
by gardener and supervisor, eliminates duplicate blocks)
- Update AGENTS.md, gardener/AGENTS.md, lib/AGENTS.md, CI smoke test,
and cross-references
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-21 13:09:17 +00:00
|
|
|
|
|
|
|
|
**Lifecycle**: gardener-run.sh (cron 0,6,12,18) → lock + memory guard →
|
|
|
|
|
consume escalation replies → load formula + context → create tmux session →
|
|
|
|
|
Claude grooms backlog, bundles dust, reviews blocked issues, updates AGENTS.md,
|
|
|
|
|
commits and creates PR → `PHASE:done`.
|