Commit graph

981 commits

Author SHA1 Message Date
openhands
8e3b72d13f feat: dev-agent auto-rebase before merge
When PR has merge conflicts (mergeable=false), attempt git rebase
before merge. If rebase fails, abort and escalate via notify.

Flow: approval → check mergeable → rebase if needed → wait CI → merge

Resolves the serial seed PR bottleneck where append-only files
(manifest.jsonl) create trivial conflicts that block the pipeline.
2026-03-13 19:56:12 +00:00
openhands
0132c7acc4 fix: 405 treated as merge success + STATE.md push dismissed approvals
Root cause: Two bugs combined to silently close PRs without merging.

1. HTTP 405 ('not allowed to merge') was in the success condition
   alongside 200/204. Codeberg returns 405 when branch protection
   blocks the merge (e.g., stale approvals).

2. append_state_log pushed a new commit AFTER review_bot approved,
   but BEFORE the merge attempt. With dismiss_stale_approvals=true,
   the new commit automatically dismissed the approval → 405.

Impact: 6 PRs (#683, #688, #692, #695, #696, #699) were 'merged'
(logged as success, branch deleted, issue closed) but never actually
merged into master. All work was lost.

Fixes:
- Remove 405 from merge success check
- Move STATE.md append out of pre-merge path
2026-03-13 17:41:10 +00:00
openhands
f7531d6ee9 Revert "lesson: fork safety — ERC-4337 code, impersonation, chain addresses, docker perms"
This reverts commit 0d0838bea0.
2026-03-13 16:16:47 +00:00
openhands
0d0838bea0 lesson: fork safety — ERC-4337 code, impersonation, chain addresses, docker perms 2026-03-13 16:13:01 +00:00
openhands
4362f58a16 factory: learned — FEE_DEST address must match DeployLocal.sol 2026-03-13 15:53:45 +00:00
openhands
36fe3c8575 lesson: dep resolution — trust closed state, don't hunt for PRs 2026-03-13 11:26:52 +00:00
openhands
98210cc302 fix: dep check — trust closed state, drop merged-PR search
The merged-PR search was over-engineered and caused false negatives
(couldn't match PR to issue when title/body didn't contain #NNN).
Issue closed = dep satisfied. Factory only closes after merging.
2026-03-13 11:25:35 +00:00
openhands
d61dead3f1 fix: dep check fallback — also check PR with same number as issue
Codeberg uses shared issue/PR numbering. When a PR IS the dep issue
(e.g. PR #665 fixes issue #665), the title search misses it.
Fallback checks if pulls/{dep_num} is merged.
2026-03-13 11:24:14 +00:00
openhands
b8097f1144 fix: gitignore *.log.old, *.log.*, escalations.jsonl 2026-03-13 10:43:37 +00:00
openhands
499f6d8828 feat: STATE.md append before merge, lives in harb repo
Moved from dark-factory to harb. Dev-agent appends one line to
STATE.md on the PR branch right before merge — goes through
review like any other change.
2026-03-13 10:27:10 +00:00
openhands
f10e0a1545 state: seed with current reality snapshot 2026-03-13 10:25:23 +00:00
openhands
ed58874890 feat: STATE.md append on merge (dark-factory#5)
After each successful PR merge, dev-agent appends one line to
STATE.md: - [date] what now exists (#PR)

Lives in dark-factory repo (harb master is protected).
Planner will collapse this into a compact snapshot later.
2026-03-13 10:25:00 +00:00
openhands
cdbe668b0d security: gardener uses codeberg_api helper, never exposes tokens
Prompt now references codeberg_api function instead of raw curl+token.
Explicit instruction to never echo/log credentials.
2026-03-13 09:33:38 +00:00
openhands
4ce16f30dc feat: gardener primary mission — promote tech-debt to actionable backlog
Reads source files + repo docs to understand each issue, adds
acceptance criteria + affected files + deps, relabels backlog.
Max 10 per run. Escalates ambiguous scope with options.
2026-03-13 09:32:39 +00:00
openhands
4f34e2dd01 fix: gardener reads repo docs (PRODUCT-TRUTH, ARCHITECTURE, AGENTS) before making decisions 2026-03-13 09:30:49 +00:00
openhands
d9de5b3708 fix: gardener dupe detection — strip series prefixes (LLM seed, Push3 evolution) 2026-03-13 09:22:44 +00:00
openhands
174187f6a6 feat: issue gardener — daily backlog grooming agent
Bash pre-checks (zero tokens): duplicate titles, thin issues, stale
issues, missing deps. Then claude -p for analysis and action.

Escalates decisions in compact format:
  1. #123 "title" — reason (a) opt1 (b) opt2 (c) opt3

Cron: daily 07:00 UTC. Light touch — grooms, doesn't invent work.
2026-03-13 09:17:09 +00:00
openhands
64b464b01b feat: dev-agent → supervisor escalation via escalations.jsonl
When dev-agent exhausts CI fix budget, writes escalation marker.
Supervisor picks it up next poll and invokes claude -p to diagnose
(flaky test? rate limit? real bug?) and decide: fix, close PR, or
escalate to human.
2026-03-13 06:51:53 +00:00
openhands
6abe24f3a5 docs: PR #608 post-mortem — staleness detection lessons 2026-03-13 06:47:07 +00:00
openhands
2262fcaab1 docs: supervisor owns merge-conflict rebases 2026-03-13 06:37:35 +00:00
openhands
2778fa4ea5 fix: detect merge conflicts in approved PRs
PR #649 sat blocked for hours — CI passed, review approved, but
merge conflict from other PRs landing. Supervisor said 'all clear'.

Now checks mergeable=false before CI state, alerts on conflict.
2026-03-13 06:36:23 +00:00
openhands
00dc3a6195 fix: don't revert files during evolution runs
Factory supervisor reverted OptimizerV3.sol during an active evolution run,
killing all candidate scoring. Added evolution pipeline awareness to git
best-practices: check for running evolve.sh before reverting dirty state.
2026-03-12 20:08:38 +00:00
openhands
4895ad1989 refactor: ci-debug to lib, rewrite README
- Moved ci-debug.sh from dev/ to lib/ (shared utility)
- README: fixed supervisor description (all alerts go to claude)
- README: replaced implementation details with actual design principles
2026-03-12 18:10:25 +00:00
openhands
04e80ee391 feat: factory stall detection + Codeberg rate-limit best practices
- New P2 check: backlog exists + no agent ran in 20min = stalled
- best-practices/codeberg.md: rate limiting awareness, retrigger cooldown
- PROMPT.md: added codeberg best-practices reference
2026-03-12 18:06:08 +00:00
openhands
56cf332575 docs: moved roadmap to Codeberg issues #1-#4 2026-03-12 13:21:02 +00:00
openhands
f89b0611ab docs: factory roadmap — resource management, self-tuning, multi-repo, multi-VPS 2026-03-12 13:18:47 +00:00
openhands
d48b0f17ac fix: swap threshold — only P0 if swap >3GB AND avail <2GB
High swap with healthy available RAM is normal (dockerd pages out).
Only alert when both swap is high and available RAM is low.
2026-03-12 13:16:24 +00:00
openhands
19ef44f5b9 feat: review-agent best practices + credential access in prompt 2026-03-12 13:09:55 +00:00
openhands
5eb17020d5 feat: progressive disclosure + escalate everything to claude
- PROMPT.md references best-practices/ files instead of inlining all knowledge
- best-practices/{memory,disk,ci,dev-agent,git}.md — loaded on demand by claude
- All alerts go to claude -p. Claude decides what to fix and what to escalate.
- update-prompt.sh targets specific best-practices files for self-learning
2026-03-12 13:04:50 +00:00
openhands
cb7dd398c7 feat: factory supervisor with priorities, auto-fix, and claude -p escalation
- P0: memory crisis (auto-kill stale claude, drop caches, restart Anvil)
- P1: disk pressure (docker prune, log truncate, worktree cleanup, WP log trim)
- P2: factory stopped (CI stuck, dev-agent dead, git broken — auto-fix where possible)
- P3: factory degraded (derailed PRs, auto-trigger reviews)
- P4: housekeeping (stale processes, log rotation)

Calls claude -p only for P0/P1 issues that auto-fix couldn't resolve.
PROMPT.md contains distilled operational knowledge + self-update mechanism.
2026-03-12 13:00:17 +00:00
openhands
cb24968d9b feat: dark factory — autonomous CI/CD agents for harb
Three agents extracted from ~/scripts/harb-{dev,review}/:

- dev/ — pull-based dev agent (find ready issues → implement → PR → merge)
- review/ — AI code review (structured verdicts, follow-up issues)
- factory/ — supervisor (bash health checks, auto-fix, escalation)

All secrets externalized to .env (see .env.example).
Shared env/helpers in lib/env.sh.
2026-03-12 12:44:15 +00:00