Commit graph

788 commits

Author SHA1 Message Date
openhands
3a7b95046d fix: Project knowledge graph for structural defect detection (#629)
Add lib/build-graph.py that builds a NetworkX DiGraph from project docs
and forge API, runs structural analyses (orphans, cycles, disconnected
clusters, thin objectives, bottlenecks), and outputs a JSON report.

Predictor and reviewer agents now call build-graph.py before launching
their Claude sessions and inject the report as context.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-24 21:24:20 +00:00
johba
e0b70d67f4 Merge pull request 'fix: fix: stale phase file poisons recovery — clear before respawn (#628)' (#631) from fix/issue-628 into main 2026-03-24 22:04:02 +01:00
openhands
a5cbd30bb6 fix: stale phase file poisons recovery — clear before respawn (#628)
- Clear phase file after reading it in recovery mode so new sessions
  start clean instead of inheriting stale state
- When last phase was escalate, tell Claude "previous session escalated —
  starting fresh" instead of "resume from escalate" to prevent re-escalation
- Add explicit "PR already exists — do NOT create a new PR" instructions
  to recovery prompt to prevent Claude from calling forge API directly

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-24 20:56:41 +00:00
johba
fda8e99634 Merge pull request 'fix: feat: gardener recycles stale failed PRs back to backlog (#626)' (#630) from fix/issue-626 into main 2026-03-24 21:55:23 +01: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
johba
9a9b82eea5 Merge pull request 'fix: Containerize full stack with docker-compose (#618)' (#625) from fix/issue-618 into main 2026-03-24 21:43:39 +01:00
johba
a4fdebce67 Merge pull request 'fix: escalation notifications should @mention human on Matrix (#624)' (#627) from fix/issue-624 into main 2026-03-24 21:39:02 +01:00
openhands
4f99a7a26a fix: Clean up decrypted secrets on failure, verify Claude CLI install (#618)
Add EXIT trap in disinto_up() so the plaintext .env is removed even if
docker compose up fails.  Previously set -euo pipefail would abort
before the cleanup block, leaving secrets on disk.

Replace the silent || true in the Dockerfile with an explicit
claude --version check so the build fails visibly if the CLI cannot
be installed.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-24 20:36:55 +00:00
openhands
0aa3890fb8 fix: Start cron daemon in agent container entrypoint (#618)
The entrypoint installed a crontab but never started a cron daemon,
leaving the container idle.  Fix by running as root in the entrypoint
(cron requires it), installing the crontab for the agent user via
`crontab -u agent`, and starting cron in the foreground with `cron -f`.
Remove `USER agent` from the Dockerfile and `user: "1000:1000"` from
the compose template accordingly — cron jobs still execute as UID 1000.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-24 20:30:44 +00:00
openhands
32c336f3df fix: escalation notifications should @mention human on Matrix (#624)
Add MATRIX_MENTION_USER config to project TOML and include a Matrix
mention pill in escalation notify_ctx calls so humans get notified
even in muted rooms.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-24 19:21:46 +00:00
openhands
e38866ab61 fix: Containerize full stack with docker-compose (#618)
Add docker-compose.yml generation, agent Dockerfile, and new CLI
commands (up/down/logs/shell) so the full stack runs containerized.
The --bare flag preserves the current bare-metal setup.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-24 18:53:55 +00:00
johba
e58e60fe7c Merge pull request 'fix: feat: active-state files — per-cron guard with self-off semantics (#622)' (#623) from fix/issue-622 into main
Reviewed-on: https://codeberg.org/johba/disinto/pulls/623
2026-03-23 22:59:30 +01: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
johba
e041b20823 Merge pull request 'fix: Push to public mirrors after merge (#614)' (#621) from fix/issue-614 into main 2026-03-23 20:27:23 +01:00
openhands
d3f831f39e fix: Register lib/mirrors.sh in CI smoke test (#614)
Add mirrors.sh to the LIB_FUNS scan and check_script list so the
agent-smoke function resolution test recognizes mirror_push.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-23 19:20: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
johba
a4cbe1e8c6 Merge pull request 'fix: Encrypt secrets at rest with SOPS + age (#613)' (#620) from fix/issue-613 into main 2026-03-23 20:09:02 +01:00
openhands
3e2f8f9623 fix: Address review feedback on SOPS integration (#613)
- Warn on stderr when .env.enc decryption fails instead of silent || true
- Guard ensure_age_key() against empty age-keygen -y output
- Fix stale comment on write_secrets_encrypted()

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-23 19:04:58 +00:00
openhands
5ccf09b28d fix: Encrypt secrets at rest with SOPS + age (#613)
- lib/env.sh: Two-tier secret loader (SOPS .env.enc > plaintext .env),
  remove ~/.netrc fallback
- bin/disinto: Add age key generation and SOPS encryption during init,
  remove write_netrc(), add `disinto secrets` subcommand (edit/show/migrate),
  add sops+age to preflight warnings
- .env.example: Annotate vars as [SECRET] or [CONFIG]
- .gitignore: Allow .env.enc and .sops.yaml to be committed
- BOOTSTRAP.md: Document SOPS + age setup, key backup, secret management
- AGENTS.md: Update AD-005 and coding conventions for .env.enc

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-23 18:58:33 +00:00
johba
28cdec3e7b Merge pull request 'chore: gardener housekeeping' (#617) from chore/gardener-20260323-1805 into main 2026-03-23 19:29:02 +01:00
openhands
d9427ebe78 chore: gardener housekeeping 2026-03-23 2026-03-23 18:05:26 +00:00
johba
a2016db5c3 Merge pull request 'fix: Wire Woodpecker CI to local Forgejo (#612)' (#616) from fix/issue-612 into main 2026-03-23 18:54:48 +01: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
johba
7de1dca12c Merge pull request 'fix: Replace Codeberg dependency with local Forgejo instance (#611)' (#615) from fix/issue-611 into main 2026-03-23 18:08:59 +01: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
johba
39d30faf45 Merge pull request 'fix: feat: predictor v3 — abstract adversary with explore/exploit and formula dispatch (#609)' (#610) from fix/issue-609 into main 2026-03-23 16:34:03 +01:00
openhands
14e1c9ecde fix: feat: predictor v3 — abstract adversary with explore/exploit and formula dispatch (#609)
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-23 13:56:59 +00:00
johba
537a4ae567 Merge pull request 'chore: gardener housekeeping' (#606) from chore/gardener-20260323-1247 into main 2026-03-23 13:59:02 +01:00
johba
979f872a68 Merge pull request 'fix: fix: increase planner constraint budget from 3 to 5 issues per run (#607)' (#608) from fix/issue-607 into main 2026-03-23 13:54:02 +01:00
openhands
6d3294823e fix: increase planner constraint budget from 3 to 5 issues per run (#607)
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-23 12:50:28 +00:00
openhands
0775514bf8 chore: gardener housekeeping 2026-03-23 2026-03-23 12:47:32 +00:00
johba
6b27ae3692 Merge pull request 'fix: fix: gardener must enrich issue body when promoting to backlog — add acceptance criteria + affected files (#598)' (#605) from fix/issue-598 into main 2026-03-23 13:44:02 +01:00
openhands
1522fa698c fix: gardener must enrich issue body when promoting to backlog — add acceptance criteria + affected files (#598)
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-23 12:32:36 +00:00
johba
eb7e24cb1d Merge pull request 'chore: gardener housekeeping 2026-03-23' (#603) from chore/gardener-20260323-1208 into main 2026-03-23 13:28:38 +01:00
johba
64b0412e41 Merge pull request 'fix: feat: planner reads issue comments to detect bounced/stuck work — delegates spec-out to formula (#595)' (#604) from fix/issue-595 into main 2026-03-23 13:24:03 +01:00
openhands
9f0a81145b fix: feat: planner reads issue comments to detect bounced/stuck work — delegates spec-out to formula (#595)
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-23 12:16:33 +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
johba
1c909e58b3 Merge pull request 'fix: feat: predictor re-evaluates prediction/backlog issues — evolve stale watches into targeted warnings (#588)' (#602) from fix/issue-588 into main 2026-03-23 12:59:02 +01:00
openhands
a225b05070 fix: feat: predictor re-evaluates prediction/backlog issues — evolve stale watches into targeted warnings (#588)
Add a re-evaluate-backlog step to the predictor formula between
collect-signals and analyze-and-predict. For each open prediction/backlog
issue, the predictor now reads the original context and planner comments,
extracts the assumptions that made it "watch, don't act", and re-checks
those conditions against current system state.

Three outcomes:
- CONDITIONS_CHANGED → file new prediction/unreviewed, close old as superseded
- STALE (30+ days, conditions stable) → close as prediction/actioned
- UNCHANGED_RECENT → skip (existing behavior)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-23 11:51:43 +00:00
johba
f6fb79d94b Merge pull request 'fix: fix: parse-deps.sh inline regex matches every line — awk /pattern/i flag is invalid (#600)' (#601) from fix/issue-600 into main 2026-03-23 12:19:02 +01:00
openhands
c7d7ee9cfb fix: parse-deps.sh inline regex matches every line — awk /pattern/i flag is invalid (#600)
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-23 10:59:47 +00:00
johba
c1110e5e48 Merge pull request 'fix: fix: stop hook should nudge Claude when PHASE file is empty — prevents silent exit without PHASE:done (#585)' (#599) from fix/issue-585 into main 2026-03-23 11:14:02 +01:00
openhands
742b64e743 fix: stop hook should nudge Claude when PHASE file is empty — prevents silent exit without PHASE:done (#585)
When Claude finishes a response but hasn't written to the PHASE file,
the stop hook now injects a nudge into the tmux session instead of just
marking idle. This gives Claude another chance to complete the phase
protocol before the monitor loop times out.

Key changes:
- on-idle-stop.sh: check phase file emptiness, nudge via tmux (max 2)
- agent-session.sh: pass phase_file + session to stop hook, clean up
  nudge counter on session teardown

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-23 09:56:49 +00:00
johba
c316d2a3b6 Merge pull request 'fix: monitor_phase_loop docstring lists 'break' as a possible _MONITOR_LOOP_EXIT value but it is never set (#435)' (#597) from fix/issue-435 into main 2026-03-23 10:49:02 +01:00
openhands
b769eaa182 fix: monitor_phase_loop docstring lists 'break' as a possible _MONITOR_LOOP_EXIT value but it is never set (#435)
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-23 09:39:48 +00:00
johba
4b9f12fdf7 Merge pull request 'fix: Unnecessary SC2034 suppression on REPO_ROOT in review-poll.sh (#433)' (#596) from fix/issue-433 into main 2026-03-23 10:34:02 +01:00
openhands
e42a49285f fix: Unnecessary SC2034 suppression on REPO_ROOT in review-poll.sh (#433)
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-23 09:19:56 +00:00
johba
8382d245fb Merge pull request 'fix: P4 sweep uses ${PROJECT_NAME} without fallback, unlike proj_name (#429)' (#594) from fix/issue-429 into main 2026-03-23 10:14:02 +01:00
openhands
7627aef1c0 fix: P4 sweep uses ${PROJECT_NAME} without fallback, unlike proj_name (#429)
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-23 09:10:24 +00:00
johba
a490ac7183 Merge pull request 'fix: Hook scripts don't follow #!/usr/bin/env bash convention from AGENTS.md (#330)' (#593) from fix/issue-330 into main 2026-03-23 10:08:28 +01:00