Commit graph

23 commits

Author SHA1 Message Date
johba
e1101894d6 fix: clean stale git worktrees in P4 housekeeping (Closes #11)
Add unconditional worktree cleanup to factory supervisor:
- Remove review + dev worktrees older than 2h with no active agent
- Use git worktree remove --force instead of rm -rf
- Run git worktree prune every poll to clear dangling refs

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-15 16:05:38 +01:00
openhands
240ba62b28 factory: learned — False Positive: 'Waiting for CI + Review' Alert 2026-03-15 14:52:58 +00:00
johba
996d197401 fix: supervisor only kills factory-spawned claude, not interactive sessions
pgrep matched all claude processes including manual screen sessions.
Narrow to "claude -p" so only non-interactive (factory-spawned) processes
get reaped by the stale-process cleanup.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-15 10:39:40 +01:00
johba
f215fbe3cf feat: add Matrix coordination channel, replace openclaw (Closes #8)
Add matrix_send() to lib/env.sh and matrix_listener.sh daemon for
real-time notifications, threaded escalations, and human-in-the-loop
replies. All agents now notify via Matrix instead of openclaw.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-14 16:25:33 +01:00
johba
90ef03a304 refactor: make all scripts multi-project via env vars
Replace hardcoded harb references across the entire codebase:
- HARB_REPO_ROOT → PROJECT_REPO_ROOT (with deprecated alias)
- Derive PROJECT_NAME from CODEBERG_REPO slug
- Add PRIMARY_BRANCH (master/main), WOODPECKER_REPO_ID env vars
- Parameterize worktree prefixes, docker container names, branch refs
- Genericize agent prompts (gardener, factory supervisor)
- Update best-practices docs to use $-vars, prefix harb lessons

All project-specific values now flow from .env → lib/env.sh → scripts.
Backward-compatible: existing harb setups work without .env changes.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-14 13:49:09 +01:00
openhands
a6dea87de0 factory: learned — keccak-derived FEE_DEST requires anvil_setBalance before impersonation 2026-03-13 22:34:44 +00:00
openhands
2f14d12032 factory: learned — False Positive: Status Unchanged Alert 2026-03-13 20:21:54 +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
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
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