Orphan and stuck-PR CI-failure paths in dev-poll.sh called
handle_ci_exhaustion without check_only, incrementing the fix counter on
every poll cycle even when guards (session checks, is_blocked) prevented
an actual agent launch. This could exhaust the 3-attempt budget without
any real fix attempts.
Now both paths use the same two-phase pattern as the backlog scan:
1. check_only during the scan (no counter increment)
2. Increment atomically at actual launch time
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Replace string 'backlog' with $BACKLOG_LABEL_ID in the DELETE label API call
at dev-agent.sh:370. The Gitea API expects a numeric label ID in that path
segment. The variable is already resolved at the top of the script (line 46-48)
and used correctly elsewhere.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Remove the orphaned post-session dust accumulator from gardener-agent.sh
(no longer reached after #367 moved gardener-poll.sh to action issues).
Add a dedicated dust-bundling formula step to run-gardener.toml that
handles the full lifecycle: dedup, timestamps, 30-day TTL expiry, and
bundling groups with 3+ items into backlog issues.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Move TOML frontmatter construction into a shared helper in
lib/file-action-issue.sh, used by both gardener-poll.sh and
gardener-run.sh. Fixes CI duplicate-detection failure.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- redact_secrets now covers AWS AKIA keys and 0x-prefixed private keys,
matching all patterns that scan_for_secrets detects
- file-action-issue.sh no longer suppresses stderr from scan_for_secrets,
so blocked-issue diagnostics reach the caller's log
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Filter stale escalation entries in gardener-poll.sh before passing them
to the agent session. For each escalation reply line, extract referenced
issue numbers (#NNN) and check their current state via the API. Discard
entries where all referenced issues are already closed, preventing the
gardener from creating investigation issues for resolved problems.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The action-agent now creates an isolated git worktree before each run
and destroys it unconditionally on exit. The formula must push results
before signaling done — unpushed work is lost when the worktree is nuked.
Changes:
- WORKTREE now points to /tmp/action-{issue}-{timestamp} instead of
PROJECT_REPO_ROOT
- cleanup_worktree() properly removes the worktree + Claude session history
- cleanup() kills child processes, stops docker, then destroys the worktree
- Claude session runs inside the worktree (not FACTORY_ROOT)
- Prompt warns about push-before-done in both Path A and Path B
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Add check_script calls for all inline-sourced lib files (agent-session.sh,
ci-helpers.sh, file-action-issue.sh, formula-session.sh, load-project.sh)
so their internal function calls are verified
- Add check_script calls for standalone lib scripts (ci-debug.sh,
matrix_listener.sh, parse-deps.sh) and legacy prediction scripts
- Add documentation comment on LIB_FUNS listing included/excluded lib files
with rationale for each
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Add ci_failed() helper to lib/ci-helpers.sh and replace three compound
`! ci_passed && CI_STATE != "" && != "pending" && != "unknown"` patterns
in dev/dev-poll.sh with the cleaner ci_failed() call.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Restore executable bit on gardener/gardener-poll.sh (cron invokes it directly)
- Add _BLOCKED_POSTED guard to prevent duplicate diagnostic comments when
both _on_phase_change(PHASE:crashed) and the belt-and-suspenders exit
handler both call post_blocked_diagnostic()
- Update stale documentation:
- gardener-run.sh: remove "CI escalation recipes" from issue body
- AGENTS.md: update directory layout comment for gardener-poll.sh
- gardener-poll.sh: remove recipe engine description from header
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Move ensure_blocked_label_id() from dev/phase-handler.sh into
lib/ci-helpers.sh to eliminate the duplicate blocked-label creation
curl block that existed in both phase-handler.sh and dev-poll.sh.
Both dev-agent.sh and action-agent.sh now source lib/ci-helpers.sh
so the function is available when phase-handler.sh calls it.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>