Commit graph

760 commits

Author SHA1 Message Date
openhands
e088f3e7ae fix: dev-agent CI retrigger sets LAST_PHASE_MTIME equal to touched phase file — main loop never re-enters awaiting_ci (#148)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-18 11:16:05 +00:00
johba
ba48d8a3e3 Merge pull request 'fix: gardener objective: zero tech-debt issues per run (#151)' (#155) from fix/issue-151 into main 2026-03-18 12:12:13 +01:00
openhands
ff3e790f51 fix: remove head -10 cap and update tech-debt problem label (#151)
Remove the head -10 cap from TECH_DEBT_ISSUES so Claude sees all
tech-debt issues, not just the first 10. Apply a head -50 guard on
the list passed in PROBLEMS to avoid oversized prompts while still
feeding far more than the old cap. Update the problem label to drop
"max 10 per run" text which contradicted the zero-tech-debt objective.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-18 11:03:29 +00:00
openhands
716bea9d7c fix: gardener objective: zero tech-debt issues per run (#151)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-18 10:45:31 +00:00
johba
b008f07861 Merge pull request 'fix: TOCTOU in handle_ci_exhaustion: check-then-act not atomic (#125)' (#152) from fix/issue-125 into main 2026-03-18 11:41:51 +01:00
openhands
4dc64ea65b fix: restore deferred increment for backlog path to prevent counter leak
The previous commit introduced a counter leak in the backlog scan path:
handle_ci_exhaustion (without check_only) atomically incremented the CI
fix counter before the WAITING_PRS guard, so an exit 0 that never spawned
a dev-agent would silently consume one of the three allowed fix attempts.

Restore the READY_PR_FOR_INCREMENT / deferred-increment mechanism:
- Backlog scan calls handle_ci_exhaustion with "check_only" (read-only,
  no increment) to detect exhaustion without touching the counter.
- The counter is bumped atomically at LAUNCH time via handle_ci_exhaustion
  (without check_only), so the increment only happens when we are certain
  a dev-agent is being spawned. If a concurrent poller already exhausted
  the counter between scan and launch, the LAUNCH call returns 0 and we
  bail out cleanly without double-spawning.

The in-progress, stuck-PR, and try_merge_or_rebase paths are unaffected:
they call handle_ci_exhaustion without check_only, which continues to use
the atomic ci_fix_check_and_increment to prevent concurrent double-spawning.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-18 10:34:41 +00:00
openhands
7bf13567fd fix: TOCTOU in handle_ci_exhaustion: check-then-act not atomic (#125)
Add ci_fix_check_and_increment() that performs read + threshold-check +
conditional increment in a single flock-protected Python call, replacing
the prior three-step sequence (ci_fix_count / bash check / ci_fix_increment)
that allowed two concurrent poll invocations to both pass the threshold and
spawn duplicate dev-agents for the same PR.

handle_ci_exhaustion now calls ci_fix_check_and_increment atomically and
returns the new count in CI_FIX_ATTEMPTS; all separate ci_fix_increment
calls after handle_ci_exhaustion (including the deferred READY_PR_FOR_INCREMENT
mechanism) are removed. Log messages updated from CI_FIX_ATTEMPTS+1 to
CI_FIX_ATTEMPTS to reflect the post-increment count.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-18 10:22:24 +00:00
johba
8d5ec5c625 Merge pull request 'fix: Add formula guard to backlog scan path (#127)' (#149) from fix/issue-127 into main 2026-03-18 11:09:55 +01:00
openhands
7d51e5e333 fix: Add formula guard to backlog scan path (#127) 2026-03-18 09:49:44 +00:00
johba
75223d3943 Merge pull request 'fix: CODEBERG_WEB not exported from lib/env.sh — other agents may hit the same gap (#129)' (#146) from fix/issue-129 into main 2026-03-18 10:47:24 +01:00
openhands
deeedd0cbf fix: CODEBERG_WEB not exported from lib/env.sh — other agents may hit the same gap (#129)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-18 09:40:20 +00:00
johba
b56e0d413e Merge pull request 'fix: review-poll.sh cleanup paths do not remove sentinel files (#138)' (#145) from fix/issue-138 into main 2026-03-18 10:36:49 +01:00
openhands
2241a9d630 fix: review-poll.sh cleanup paths do not remove sentinel files (#138) 2026-03-18 09:29:41 +00:00
johba
d71a1e2f8c Merge pull request 'fix: Coordinate review injection between review-poll.sh and dev-agent.sh to prevent double-injection (#90)' (#137) from fix/issue-90 into main 2026-03-18 10:13:54 +01:00
openhands
19a245fe5e fix: Coordinate review injection between review-poll.sh and dev-agent.sh to prevent double-injection (#90)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-18 09:01:50 +00:00
johba
a340e57789 Merge pull request 'fix: AGENTS.md and README.md not updated to document vault and planner agents (#95)' (#133) from fix/issue-95 into main 2026-03-18 09:57:26 +01:00
openhands
3e98bb2e9d fix: AGENTS.md and README.md not updated to document vault and planner agents (#95) 2026-03-18 08:50:08 +00:00
johba
f9b4207548 Merge pull request 'fix: ALL_COMMENTS fetch is capped at limit=50 — watermark search may miss reviews on high-comment PRs (#100)' (#132) from fix/issue-100 into main 2026-03-18 09:46:00 +01:00
openhands
d5b3f9e6e5 fix: codeberg_api_all propagates API errors instead of silently returning []
Remove || break from the codeberg_api call in the pagination loop.
With set -euo pipefail in all callers, a failed fetch now exits the
function non-zero — matching the original curl -sf behaviour where a
network or auth error aborted the script rather than returning empty
results and risking a duplicate review.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-18 08:25:22 +00:00
openhands
9fa4846581 fix: ALL_COMMENTS fetch is capped at limit=50 — watermark search may miss reviews on high-comment PRs (#100)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-18 08:13:43 +00:00
johba
f4abe63b1b Merge pull request 'fix: needs_human notification sent every poll cycle pre-PR (#103)' (#131) from fix/issue-103 into main 2026-03-18 09:03:58 +01:00
openhands
9d2b92f0d5 fix: needs_human notification sent every poll cycle pre-PR (#103)
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-18 07:35:13 +00:00
johba
bf337aba20 Merge pull request 'fix: fix: idle timeout does not escalate — session dies silently (#123)' (#128) from fix/issue-123 into main 2026-03-18 08:29:25 +01:00
openhands
90762d8de3 fix: address review feedback — CODEBERG_WEB unbound, title prefix, emoji
- Replace ${CODEBERG_WEB} with inline https://codeberg.org/${CODEBERG_REPO}
  to avoid unbound variable crash in gardener-poll.sh (set -euo pipefail)
- Change sub-issue title prefix from fix: to chore: since it's an
  investigation task, not a code fix
- Add emoji prefix to idle_timeout matrix notification for consistency

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-18 07:18:57 +00:00
openhands
88f2268bc6 fix: idle timeout does not escalate — session dies silently (#123)
1. Timeout handler (dev-agent.sh): write escalation to project-suffixed
   file, restore backlog label, clean up phase file on idle timeout.
2. Fix escalation file naming: escalations.jsonl → escalations-${PROJECT_NAME}.jsonl
   everywhere in dev-agent.sh so gardener actually picks them up.
3. Gardener (gardener-poll.sh): handle idle_timeout reason before CI-specific
   recipe logic — create investigation sub-issue instead of silently returning.
4. Update .gitignore to match new escalations-*.jsonl pattern.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-18 07:02:33 +00:00
johba
0aec024f78 Merge pull request 'fix: In-progress formula issue causes infinite dev-agent respawn (#115)' (#126) from fix/issue-115 into main 2026-03-18 07:54:18 +01:00
openhands
32ee53517f fix: In-progress formula issue causes infinite dev-agent respawn (#115)
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-18 06:41:43 +00:00
johba
9b833532f5 Merge pull request 'fix: ci_fix_count/ci_fix_increment not atomic — potential race under concurrent polls (#118)' (#124) from fix/issue-118 into main 2026-03-18 07:37:54 +01:00
openhands
1352620c3d fix: ci_fix_count/ci_fix_increment not atomic — potential race under concurrent polls (#118)
Wrap ci_fix_count(), ci_fix_increment(), and ci_fix_reset() with flock
on a shared lockfile to prevent concurrent modification of the JSON
tracker. Uses flock(1) in command-wrapping mode so each Python process
holds an exclusive lock for the duration of its read-modify-write cycle.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-18 06:30:17 +00:00
johba
23364c6c01 Merge pull request 'fix: feat: planner emits formula instances instead of freeform issues (#21)' (#121) from fix/issue-21 into main 2026-03-18 05:49:23 +01:00
openhands
d498334dcc fix: address review feedback — restore -d flag, drop formula label, validate names, quote YAML
- Restore `-d` flag on codeberg_api POST /issues call (regression fix)
- Do NOT apply `formula` label — dev-agent rejects it, blocking the pipeline
- Keep YAML front matter in body only (structural, harmless to freeform processing)
- Quote YAML var values with @json to handle special characters
- Validate formula name against on-disk formulas/*.toml catalog
- Fall back to freeform if Claude hallucinates a formula name

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-18 04:37:17 +00:00
openhands
b5ec6f6cf3 fix: feat: planner emits formula instances instead of freeform issues (#21)
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-18 04:29:21 +00:00
johba
40f6598b87 Merge pull request 'fix: try_merge_or_rebase rebase-failure spawn bypasses ci_fix_increment (#56)' (#120) from fix/issue-56 into main 2026-03-18 05:20:57 +01:00
openhands
cf8446b451 fix: try_merge_or_rebase rebase-failure spawn bypasses ci_fix_increment (#56)
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-18 04:05:18 +00:00
johba
5c73ab3e53 Merge pull request 'fix: AGENTS.md absent from entire repository (#57)' (#119) from fix/issue-57 into main 2026-03-18 05:02:54 +01:00
openhands
f18537dd2a fix: address review feedback — AGENTS.md factual accuracy
- Planner: both phases use claude -p (one-shot), not interactive
- Vault: document auto-approve/auto-reject paths, not just human escalation
- CHECK_INFRA_RETRY: env var only, not a TOML toggle — separated from TOML keys
- underspecified label: also set by dev-agent.sh mid-run, not just dev-poll
- ci-helpers.sh: add missing review-poll.sh to sourced-by list
- parse-deps.sh: note it is executed via bash, not sourced
- vault: add PROMPT.md to key files list

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-18 03:51:26 +00:00
openhands
66de31ce63 fix: AGENTS.md absent from entire repository (#57)
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-18 03:41:46 +00:00
johba
f6ca1cc70c Merge pull request 'fix: Three near-identical CI-exhaustion blocks should be a shared function (#58)' (#117) from fix/issue-58 into main 2026-03-18 04:38:25 +01:00
openhands
ff02b1e653 fix: Three near-identical CI-exhaustion blocks should be a shared function (#58)
Extract CI-exhaustion check/escalate logic into handle_ci_exhaustion() helper.
All three call sites (orphaned PRs, stuck PRs, backlog PRs) now use the shared
function, eliminating future drift between the copies.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-18 03:21:27 +00:00
johba
c5daf475c2 Merge pull request 'fix: feat: gardener escalation recipes — pattern-matched playbooks for CI failures (#68)' (#116) from fix/issue-68 into main 2026-03-18 04:11:59 +01:00
openhands
d6e91b2466 fix: address review feedback — recipe engine robustness and correctness
- Bug: chicken-egg-ci create-per-file-issues was aliased to shellcheck-only
  function. Added generic playbook_lint_per_file() that handles any linter
  output format. Renamed action to lint-per-file.
- Bug: cascade-rebase fired retry-merge synchronously after async rebase.
  Removed retry-merge and re-approve from recipe — rebase settles, CI reruns,
  normal flow handles merge on subsequent cycle.
- Warning: jq calls on PR data lacked || true under set -euo pipefail. Fixed.
- Warning: playbook_rebase_pr and playbook_retrigger_ci incremented
  _PB_SUB_CREATED before confirming API success. Now check HTTP status code.
- Warning: Python import tomllib fails on < 3.11. Added try/except fallback
  to tomli package.
- Nit: failures_on_unchanged regex broadened to handle generic linter formats
  (file.sh:line:col patterns in addition to ShellCheck's "In file line N:").
- Info: match_recipe now logs Python stderr on error instead of silently
  falling back to generic recipe.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-18 03:05:09 +00:00
openhands
cb8a9bc6e5 fix: restore executable permission on gardener-poll.sh
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-18 02:53:08 +00:00
openhands
f293dd6269 fix: feat: gardener escalation recipes — pattern-matched playbooks for CI failures (#68)
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-18 02:53:03 +00:00
johba
5bba51b547 Merge pull request 'fix: feat/formula not merged but formula templates and label docs already on main (#69)' (#114) from fix/issue-69 into main 2026-03-18 03:29:24 +01:00
openhands
2446543545 fix: feat/formula not merged but formula templates and label docs already on main (#69)
- dev-agent.sh: add explicit guard that skips formula-labeled issues with a
  clear log message instead of silently producing no formula behavior
- BOOTSTRAP.md: rewrite formula label entry to state it is not yet functional
  and that dev-agent will skip such issues until feat/formula is merged

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-18 02:17:18 +00:00
johba
56dd469687 Merge pull request 'fix: ci_passed() still lives in dev/dev-poll.sh, not lib/ (#70)' (#112) from fix/issue-70 into main 2026-03-18 03:12:56 +01:00
openhands
8e600787c1 fix: ci_passed() still lives in dev/dev-poll.sh, not lib/ (#70)
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-18 02:05:54 +00:00
johba
87f5fb0390 Merge pull request 'fix: shellcheck TODO has no enforcement — || true may never be removed (#71)' (#108) from fix/issue-71 into main 2026-03-18 03:00:16 +01:00
openhands
bd02330b22 fix: shellcheck TODO has no enforcement — || true may never be removed (#71)
- Fix SC2164: add || exit 1 to bare cd in update-prompt.sh
- Fix SC2155: separate declare and assign in env.sh, supervisor-poll.sh, dev-agent.sh
- Fix SC2034: inline suppression for vars used by sourced helpers
- Remove unused `mergeable` declaration, rename unused loop var to `_w`
- Remove || true from shellcheck CI step — failures are now blocking

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-18 01:53:02 +00:00
johba
81e5e5aa50 Merge pull request 'fix: feat: gardener bundles dust into ore before promoting to backlog (#74)' (#107) from fix/issue-74 into main 2026-03-18 02:48:22 +01:00