Commit graph

77 commits

Author SHA1 Message Date
Gardener
99933bef7b chore: gardener housekeeping 2026-03-26 2026-03-26 00:05:34 +00:00
openhands
8a912ec87e chore: gardener housekeeping 2026-03-25 2026-03-25 12:07:39 +00:00
openhands
40093e92e2 chore: gardener housekeeping 2026-03-25 2026-03-25 06:06:48 +00:00
openhands
b8dc01b06f chore: gardener housekeeping 2026-03-25 2026-03-25 00:07:52 +00:00
openhands
a5c141ce92 fix: feat: gardener recycles stale failed PRs back to backlog (#626)
Add stale-pr-recycle step to the gardener formula that detects open PRs
with failed CI older than 24 hours and no active tmux session. Stale PRs
are closed with a comment, and the linked issue is relabeled from
in-progress to backlog so dev-poll picks it up for a fresh attempt.

Also adds close_pr manifest action to the gardener executor.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-24 20:48:55 +00:00
openhands
e535ed776f fix: feat: active-state files — per-cron guard with self-off semantics (#622)
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-23 21:46:59 +00:00
openhands
7bc74caa63 fix: Push to public mirrors after merge (#614)
Add fire-and-forget mirror push support so merges to the primary branch
are automatically pushed to configured public mirrors (GitHub, Codeberg,
etc.). Mirror failures are logged but never block the pipeline.

- lib/mirrors.sh: new shared mirror_push() helper
- lib/load-project.sh: parse [mirrors] TOML section into MIRROR_* env vars
- dev/phase-handler.sh: call mirror_push after do_merge() success
- dev/dev-poll.sh: call mirror_push after try_direct_merge() success
- gardener/gardener-run.sh: call mirror_push after _gardener_merge() success
- bin/disinto: set up mirror remotes during init, add commented mirrors to
  generated TOML
- projects/*.toml.example: show [mirrors] section (commented out)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-23 19:19:16 +00:00
openhands
d9427ebe78 chore: gardener housekeeping 2026-03-23 2026-03-23 18:05:26 +00:00
openhands
50dff34b89 fix: Wire Woodpecker CI to local Forgejo (#612)
Add ci_commit_status() and ci_pipeline_number() helpers to
lib/ci-helpers.sh that query Woodpecker directly with a forge API
fallback. Replace all 12 inline forge commit status calls across 6
files with the new helpers.

Add setup_woodpecker() to bin/disinto init that creates a Forgejo
OAuth2 app for Woodpecker and activates the repo.

Document manual Woodpecker+Forgejo setup in BOOTSTRAP.md.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-23 17:19:01 +00:00
openhands
a66bd91721 fix: Replace Codeberg dependency with local Forgejo instance (#611)
- Add setup_forge() to bin/disinto: provisions Forgejo via Docker,
  creates admin + bot users (dev-bot, review-bot), generates API
  tokens, creates repo, and pushes code — all automated
- Rename env vars: CODEBERG_TOKEN→FORGE_TOKEN, REVIEW_BOT_TOKEN→
  FORGE_REVIEW_TOKEN, CODEBERG_REPO→FORGE_REPO, CODEBERG_API→
  FORGE_API, CODEBERG_WEB→FORGE_WEB, CODEBERG_BOT_USERNAMES→
  FORGE_BOT_USERNAMES (with backwards-compat fallbacks)
- Rename API helpers: codeberg_api()→forge_api(), codeberg_api_all()
  →forge_api_all() (with compat aliases)
- Add forge_url field to project TOML; load-project.sh derives
  FORGE_API/FORGE_WEB from forge_url + repo
- Update parse_repo_slug() to accept any host URL, not just codeberg
- Forgejo data stored under ~/.disinto/forgejo/ (not in factory repo)
- Update all 58 files: agent scripts, formulas, docs, site HTML

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-23 16:57:12 +00:00
openhands
0775514bf8 chore: gardener housekeeping 2026-03-23 2026-03-23 12:47:32 +00:00
openhands
38f4b385cc chore: gardener housekeeping 2026-03-23
- Update all AGENTS.md watermarks to f6fb79d (current HEAD)
- lib/AGENTS.md: document nudge behavior in agent-session.sh stop hook
- pending-actions.json: enrich #598 body + promote to backlog
2026-03-23 12:08:26 +00:00
openhands
d8cf0a39bc fix: restore closing --> on AGENTS.md watermark HTML comments
The sed watermark-update pattern stripped the closing --> from 9 of 10
AGENTS.md files, making entire file bodies invisible in rendered markdown.
Fix by appending --> to the affected lines.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-23 06:09:19 +00:00
openhands
30cc5688bd chore: gardener housekeeping 2026-03-23
- Update AGENTS.md watermarks to current HEAD (9ec0c02)
- lib/AGENTS.md: document parse-deps.sh inline scan now skips fenced
  code blocks to prevent false positives from code examples in issue bodies
- No blocked issues to review
- Pending actions: none

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-23 06:03:14 +00:00
openhands
d2db178d30 chore: gardener housekeeping 2026-03-23
- Update AGENTS.md watermarks to current HEAD (e8df73e)
- No code changes since last gardener run — watermark-only refresh
- No blocked issues to review
- Pending actions: none

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-23 00:47:57 +00:00
openhands
7d26c6a379 chore: gardener housekeeping 2026-03-23
- dev/AGENTS.md: document two-tier priority queue (priority+backlog first,
  then plain backlog); note do_merge() HTTP 405 already-merged detection
- gardener/AGENTS.md: document merge-through protocol (stay alive through
  CI/review/merge); note session kill on PHASE:escalate
- lib/AGENTS.md: add ensure_priority_label() to ci-helpers.sh entry;
  document optional CALLBACK param in run_formula_and_monitor()
- predictor/AGENTS.md: update watermark (content already current from v2 PR)
- Update watermarks for action, planner, review, supervisor, vault, root

Grooming actions:
- #574: added ## Affected files section (lib/parse-deps.sh) to meet quality gate
- #568: escalated — needs human decision on guard/merge architecture
- #466: escalated — dep #393 closed; needs decision on external vs in-repo example

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-23 00:46:42 +00:00
openhands
149211c78d chore: gardener housekeeping 2026-03-23
- dev/AGENTS.md: document two-tier priority queue (priority+backlog first,
  then plain backlog); note do_merge() HTTP 405 already-merged detection
- gardener/AGENTS.md: document merge-through protocol (stay alive through
  CI/review/merge); note session kill on PHASE:escalate
- lib/AGENTS.md: add ensure_priority_label() to ci-helpers.sh entry;
  document optional CALLBACK param in run_formula_and_monitor()
- predictor/AGENTS.md: update watermark (content already current from v2 PR)
- Update watermarks for action, planner, review, supervisor, vault, root

Grooming actions:
- #574: added ## Affected files section (lib/parse-deps.sh) to meet quality gate
- #568: escalated — needs human decision on guard/merge architecture
- #466: escalated — dep #393 closed; needs decision on external vs in-repo example

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-23 00:23:02 +00:00
openhands
7ecf372e40 fix: feat: gardener defers all repo actions to a manifest — review gate covers grooming decisions, not just docs (#572)
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-22 23:58:50 +00:00
openhands
df848e5a60 fix: kill session on PHASE:escalate to prevent zombie blocking future cron runs (#571)
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-22 22:05:57 +00:00
openhands
578a6ec81d fix: feat: gardener should stay alive until its PR merges — address review feedback, rebase if needed (#571)
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-22 20:48:07 +00:00
openhands
f37546c6fc chore: gardener housekeeping 2026-03-22
- Update all AGENTS.md watermarks to current HEAD (251d160)
- dev/AGENTS.md: document dev-poll's early direct-merge scan (before lock
  check) — approved PRs now merge without waiting for active dev sessions;
  chore/gardener PRs merge without issue numbers in branch name
- planner/AGENTS.md: document dispatch-idle-formulas phase (step 4); note
  that planner reads both factory and project-specific formulas; clarify
  that all planner artifacts use $PROJECT_REPO_ROOT, not $FACTORY_ROOT

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-22 12:07:31 +00:00
openhands
ea4c55dbbf chore: gardener housekeeping 2026-03-22 2026-03-22 10:43:58 +01:00
openhands
b4f1666a80 chore: gardener housekeeping 2026-03-21 2026-03-21 18:07:37 +00:00
openhands
24cf01028a chore: gardener housekeeping 2026-03-21
- Update AGENTS.md watermarks (all 10 files) to HEAD 038581e5
- Content already current from recent gardener migration and setup PRs

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-21 14:33:26 +00:00
openhands
b630c6fcc1 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
openhands
f480cbe5d0 chore: gardener housekeeping 2026-03-21
Progressive disclosure split of AGENTS.md (487→152 lines):
- Extracted per-directory AGENTS.md files for all 8 agents + lib/
- Root AGENTS.md now serves as a table of contents with summary table
- All watermarks updated to 16e430e

Grooming results:
- Promoted #469 (WATCH flow missing curl) and #436 (idle_pane_count bug) to backlog
- 12 dust items classified, no groups ripe for bundling yet
- No blocked issues, no AD violations
2026-03-21 12:44:23 +00:00
openhands
38f9b29867 Revert "Merge pull request 'fix: gardener-poll.sh needs to file action issues (not call gardener-agent.sh directly) (#367)' (#474) from fix/issue-367 into main"
This reverts commit cbd52972f3, reversing
changes made to 0dd607c1bb.
2026-03-21 11:00:48 +00:00
openhands
4c7baff05d fix: Two parallel dust-bundling codepaths need consolidation (#368)
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>
2026-03-21 10:41:31 +00:00
openhands
8193e7bc96 fix: extract build_formula_issue_body to eliminate duplicate code blocks
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>
2026-03-21 10:23:00 +00:00
openhands
1782cbd610 fix: gardener-poll.sh needs to file action issues (not call gardener-agent.sh directly) (#367)
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-21 10:19:27 +00:00
openhands
082a472b9e fix: gardener creates investigation issues for already-closed escalations (#289)
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>
2026-03-21 09:27:31 +00:00
openhands
7b6b56d761 fix: address review — restore +x, guard double comment, update stale docs (#352)
- 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>
2026-03-21 05:55:27 +00:00
openhands
61c44d31b1 fix: refactor: replace escalation JSONL with blocked label + diagnostic comment (#352)
Replace the unreliable escalation JSONL system (supervisor/escalations-*.jsonl
consumed by gardener) with direct blocked label + diagnostic comment on the
original issue.

When a dev-agent or action-agent session fails (PHASE:failed, idle timeout,
crash, CI exhausted):
- Capture last 50 lines from tmux pane via tmux capture-pane
- Post a structured diagnostic comment on the issue (exit reason, timestamp,
  PR number, tmux output)
- Label the issue "blocked" (instead of restoring "backlog")
- Remove in-progress label

Removed:
- Escalation JSONL write paths in dev-agent.sh, phase-handler.sh, dev-poll.sh,
  action-agent.sh
- is_escalated() helper in dev-poll.sh
- Escalation triage (P2f section) in supervisor-poll.sh
- Escalation processing + recipe engine in gardener-poll.sh
- ci-escalation-recipes step from run-gardener.toml formula
- escalations*.jsonl from .gitignore

Added:
- post_blocked_diagnostic() shared helper in phase-handler.sh
- ensure_blocked_label_id() helper (creates label via API if not exists)
- is_blocked() helper in dev-poll.sh (replaces is_escalated)
- Blocked issues listing in supervisor/preflight.sh

Kept:
- Matrix notifications on failure (unchanged)
- CI fix counter logic (still tracks attempts)
- needs_human injection in supervisor/gardener (not escalation-related)
- Gardener grooming (gardener-agent.sh still invoked)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-21 04:18:43 +00:00
openhands
aa89e2b31e fix: move write_compact_context after create_agent_session in gardener-agent
The context file was written before the reset block that deleted it,
making compaction re-injection a no-op for gardener sessions.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-20 23:35:34 +00:00
openhands
e3895ad3ac fix: feat: SessionStart compact hook re-injects phase protocol after context compaction (#274)
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-20 23:27:32 +00:00
openhands
7199bbf9b5 fix: feat: agents flush context to scratch file before compaction (#262)
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-20 20:12:45 +00:00
openhands
5bac4a8409 fix: extract lib/formula-session.sh to eliminate duplicate code blocks
Shared helpers for formula-driven cron agents: lock, memory guard,
formula loading, context building, session startup, crash recovery.

- planner-run.sh uses shared helpers instead of inline code
- gardener-agent.sh delegates crash recovery to formula_phase_callback
- agent-smoke.sh updated for renamed planner script + new lib file

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-20 13:53:33 +00:00
openhands
cc6a958245 fix: address review — guard grooming in gardener-poll.sh, doc fixes
- Add --recipes-only flag to gardener-poll.sh to skip grooming call when
  invoked by the formula's ci-escalation-recipes step (prevents double-run)
- Update formula step to pass --recipes-only
- Add lib/file-action-issue.sh to AGENTS.md shared helpers table
- Clarify TOML arg scope in gardener trigger description
- Fix log prefixes in gardener-run.sh (poll: → run:)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-20 13:02:33 +00:00
openhands
59b6d76afa fix: extract file_action_issue helper to eliminate duplicate code blocks
CI duplicate-detection flagged shared action-issue filing pattern between
gardener-run.sh and planner-poll.sh. Extract into lib/file-action-issue.sh
and refactor both scripts to use it.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-20 12:49:08 +00:00
openhands
eb90a42095 fix: gardener runs as cron-driven formula — runtime wrapper (#246)
Add gardener-run.sh as a thin cron wrapper that files an action issue
referencing formulas/run-gardener.toml, following the same pattern as
planner-poll.sh. The action-agent picks up the issue and executes the
gardener formula steps in an interactive Claude session.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-20 12:44:02 +00:00
openhands
ac04dc29a6 fix: feat: PostToolUse hook detects phase file writes in real-time (eliminates polling latency) (#278)
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-19 17:55:06 +00:00
openhands
45745d2bfd fix: gardener-poll escalation consumer does not handle idle_prompt reason (#268)
Widen the escalation dispatch pattern from `idle_timeout*` to also match
`idle_prompt*`. When an idle_prompt escalation arrives, the gardener now
creates an investigation sub-issue with a tailored description (session
returned to prompt without writing a phase signal) instead of silently
falling through to the recipe engine.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-19 12:55:16 +00:00
johba
d5c2c213a3 fix: bug: gardener hangs forever when Claude finishes without writing phase file (#261) (#263)
Fixes #261

## Changes
Fixed gardener hanging forever when Claude skips phase protocol. Three changes: (1) gardener-agent.sh: replaced 999999s timeout with 7200s (2h, matching dev-agent); (2) lib/agent-session.sh: added idle-prompt detection to monitor_phase_loop — if Claude returns to the ❯ prompt for 3 consecutive polls with no phase file written, exits immediately with _MONITOR_LOOP_EXIT=idle_prompt (only fires when phase file is empty, so awaiting_ci/review waits are unaffected); (3) gardener prompt: removed 'no time limit' wording, replaced with explicit phase-write requirement.

Co-authored-by: openhands <openhands@all-hands.dev>
Reviewed-on: https://codeberg.org/johba/disinto/pulls/263
Reviewed-by: Disinto_bot <disinto_bot@noreply.codeberg.org>
2026-03-19 13:47:10 +01:00
openhands
e853949b47 fix: Callbacks can't see the resolved _session from monitor_phase_loop (#200)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-19 01:05:21 +00:00
openhands
833b07ed6e fix: labels:["backlog"] passes string name to Codeberg API that expects integer IDs (#164)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-18 20:36:39 +00:00
openhands
7456af65e9 fix: feat: gardener formula — groom-backlog.toml with verify loop, remove timeouts (#183)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-18 18:42:30 +00:00
openhands
d83098f382 fix: pass SESSION_NAME to all agent-session.sh function calls
Library functions need explicit session name argument — they no longer
have closure over $SESSION_NAME from the parent script.

- agent_kill_session: add $SESSION_NAME to all 11 call sites
- agent_inject_into_session: add $SESSION_NAME to all call sites in
  phase-handler.sh and gardener-agent.sh
- agent_kill_session: guard against missing arg (defensive)
2026-03-18 16:24:58 +00:00
openhands
ae3e742f9f fix: rename function calls to match agent-session.sh exports (#176)
kill_tmux_session → agent_kill_session
inject_into_session → agent_inject_into_session
wait_for_claude_ready → agent_wait_for_claude_ready

Also restore status() function lost during #160 refactor.

Fixes dev-agent and gardener-agent crash on startup:
  line 149: status: command not found
  line 280: kill_tmux_session: command not found
2026-03-18 16:10:12 +00:00
johba
6d5cc4458f fix: feat: gardener-agent.sh — tmux + Claude interactive gardener using agent-session.sh (#159) (#163)
Fixes #159

## Changes
Add gardener-agent.sh (tmux+Claude) and lib/agent-session.sh (shared helpers). gardener-poll.sh slimmed to cron wrapper; grooming delegated to new agent; recipe engine for CI escalations unchanged.

Co-authored-by: openhands <openhands@all-hands.dev>
Reviewed-on: https://codeberg.org/johba/disinto/pulls/163
Reviewed-by: review_bot <review_bot@noreply.codeberg.org>
2026-03-18 16:21:07 +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