Commit graph

746 commits

Author SHA1 Message Date
openhands
50b5cea2cb fix: tea_relabel uses edit subcommand, add sha256 checksum for tea binary (#666)
- tea_relabel: use `tea issues edit` instead of `tea issues labels`
  (the latter is the list subcommand and ignores --labels)
- Dockerfile: verify tea binary sha256 after download

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-25 13:34:58 +00:00
openhands
687bf0ad5b fix: move tea-helpers.sh out of LIB_FUNS loop in smoke test (#666)
On Alpine/busybox, adding tea-helpers.sh to the LIB_FUNS for-loop
caused forge_api to go missing from the extracted function set.
Since no other script currently calls tea_* functions, tea-helpers.sh
is checked standalone via check_script instead.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-25 13:22:56 +00:00
openhands
44cbbbde62 feat: integrate tea CLI for forge issue/label/comment operations (#666)
- Add lib/tea-helpers.sh with tea_file_issue, tea_relabel, tea_comment,
  tea_close — thin wrappers preserving secret scanning on write ops
- Add tea 0.9.2 binary to docker/agents/Dockerfile
- Configure tea login in docker/agents/entrypoint.sh from FORGE_TOKEN/FORGE_URL
- Derive TEA_LOGIN in lib/env.sh (codeberg vs local forgejo)
- Source tea-helpers.sh conditionally when tea binary is available
- Migrate predictor formula from inline curl to tea CLI commands
- Register tea-helpers.sh in smoke test function resolution

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-25 12:20:15 +00:00
johba
5e66ba7d12 Merge pull request 'chore: gardener housekeeping' (#677) from chore/gardener-20260325-1207 into main 2026-03-25 13:13:44 +01:00
johba
3b8d69cfab Merge pull request 'fix: fix: Forgejo 11.x ignores --must-change-password=false — token creation fails with password change required (#665)' (#676) from fix/issue-665 into main 2026-03-25 13:10:35 +01:00
openhands
8a912ec87e chore: gardener housekeeping 2026-03-25 2026-03-25 12:07:39 +00:00
openhands
48185108af fix: add change-password handler to smoke test docker mock (#665)
The mock docker in smoke-init.sh only handled 'admin user create' and
'admin user list'. Add a 'change-password' handler that PATCHes the
user via the Forgejo admin API to clear must_change_password.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-25 11:54:41 +00:00
openhands
e411eb224c fix: Forgejo 11.x ignores --must-change-password=false — token creation fails with password change required (#665)
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-25 11:50:08 +00:00
johba
d13f1a6997 Merge pull request 'fix: feat: end-to-end disinto init smoke test in CI (#668)' (#675) from fix/issue-668 into main 2026-03-25 12:47:55 +01:00
openhands
14b2abd9cd fix: use real BusyBox crontab instead of mock for cron verification (#668)
The mock crontab file was not being created despite PATH precedence
working correctly. Replace the mock with the real BusyBox crontab
already available in the Forgejo Alpine image. Verify cron entries
via 'crontab -l' output instead of checking a mock state file.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-25 11:23:41 +00:00
openhands
39aa638b6f fix: PATCH all mock users to disable must_change_password (#668)
Forgejo's admin API POST /admin/users may not honor
must_change_password:false in the request body. Previously only admin
users got a PATCH (to set admin:true), which incidentally cleared
must_change_password. Bot users had no PATCH, so basic auth for token
creation returned 401.

Now every mock-created user gets a PATCH to explicitly set
must_change_password:false, fixing bot token creation.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-25 11:13:31 +00:00
openhands
c643cf16dc fix: use basic auth for bot token creation — Forgejo rejects token auth (#668)
POST /api/v1/users/{username}/tokens requires basic auth (reqBasicOrRevProxyAuth)
in Forgejo 11.x. The previous code used admin token auth which returns 401.

Fix: authenticate as the bot user with -u "${bot_user}:${bot_pass}" instead of
-H "Authorization: token ${admin_token}". The bot_pass is available in scope
from the user creation step.

Bug caught by the new smoke-init end-to-end test.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-25 11:06:01 +00:00
openhands
55a22912d3 fix: run Forgejo as git user — refuses to run as root (#668)
Forgejo 11.0 refuses to run as root with a fatal error. Use su-exec
to run all forgejo commands as the 'git' user (pre-created in the
Forgejo Docker image). chown /data to git:git before starting.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-25 10:19:31 +00:00
openhands
78e478e69d fix: use Forgejo image as step container for CLI access (#668)
The install endpoint POST returned 404 because FORGEJO__database__DB_TYPE
env var auto-configured Forgejo, bypassing install mode.

Fix: run the Forgejo image as the step container instead of a service.
This gives CLI access to `forgejo admin user create` for bootstrap
admin setup — no install endpoint needed.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-25 09:58:47 +00:00
openhands
9c2a5634ff fix: feat: end-to-end disinto init smoke test in CI (#668)
Add tests/smoke-init.sh — an end-to-end smoke test that runs
disinto init --bare --yes against a real Forgejo instance
(started as a Woodpecker service container).

The test validates:
- Forgejo API responds after init
- Admin and bot users created with tokens
- Repo created with labels on Forgejo
- Project TOML generated correctly
- .env written with FORGE_TOKEN and FORGE_REVIEW_TOKEN
- Cron entries installed (dev-poll, review-poll, gardener)

Uses mock binaries for docker (routes user creation to Forgejo
admin API), claude, tmux, and crontab to run in CI without
Docker-in-Docker.

Wired into CI via .woodpecker/smoke-init.yml (separate pipeline
with Forgejo service, runs on push and pull_request).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-25 09:37:36 +00:00
johba
b2dd42df40 Merge pull request 'fix: fix: supervisor should clean up stale PHASE:escalate files for closed issues (#664)' (#674) from fix/issue-664 into main 2026-03-25 10:09:21 +01:00
openhands
af0795da88 fix: use _found_stale flag matching established preflight pattern (#664)
Rename _cleaned_any to _found_stale and set it on any match (not just
deletion), so "None" only prints when no stale files exist. Prevents
contradictory output when grace-period entries are present.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-25 09:00:33 +00:00
openhands
b60811f0a1 fix: supervisor should clean up stale PHASE:escalate files for closed issues (#664)
Add auto-cleanup to supervisor/preflight.sh: PHASE:escalate files whose
parent issue/PR is confirmed closed (via Forge API) are deleted after a
24h grace period. Cleanup results appear in the preflight output for
journal logging by the supervisor formula.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-25 08:34:22 +00:00
johba
eb373bb961 Merge pull request 'fix: fix: check_active guard should log to stderr when skipping — silent agent dropout on missing state file (#663)' (#673) from fix/issue-663 into main 2026-03-25 09:27:10 +01:00
openhands
ae27ae3e38 chore: re-trigger CI
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-25 08:19:49 +00:00
openhands
176131ec95 chore: re-trigger CI
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-25 08:14:52 +00:00
openhands
425f4b2d9a chore: re-trigger CI (attempt 3)
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-25 08:11:17 +00:00
openhands
f1f43aa3d2 chore: re-trigger CI
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-25 08:03:36 +00:00
openhands
ab8f88303c fix: fix: check_active guard should log to stderr when skipping — silent agent dropout on missing state file (#663)
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-25 08:00:29 +00:00
johba
4f47f90c12 Merge pull request 'fix: fix: Woodpecker CI not wired during disinto init — OAuth2 app never created, no CI runs (#661)' (#672) from fix/issue-661 into main 2026-03-25 08:54:07 +01:00
openhands
a9c4394f39 chore: re-trigger CI 2026-03-25 07:48:24 +00:00
openhands
c02a0b29d2 fix: fix: Woodpecker CI not wired during disinto init — OAuth2 app never created, no CI runs (#661)
Split setup_woodpecker() into create_woodpecker_oauth() (pre-compose) and
activate_woodpecker_repo() (post-compose) so OAuth2 creds are in .env before
Woodpecker starts, and repo activation happens after the stack is up.

- Add ports: ["8000:8000"] to Woodpecker service in generate_compose()
- Fix .env var names: WP_FORGEJO_CLIENT/SECRET to match compose references
- Reorder disinto_init(): OAuth2 creation before compose up, repo activation after
- activate_woodpecker_repo() polls Woodpecker readiness with retry loop

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-25 07:43:59 +00:00
johba
8dd9024204 Merge pull request 'chore: planner run — prerequisite tree update' (#669) from chore/planner-20260325-0722 into main 2026-03-25 08:34:09 +01:00
johba
7af70e9099 Merge pull request 'fix: fix: agents container cannot reach Forgejo — lib/env.sh overrides compose FORGE_URL with .env localhost (#660)' (#662) from fix/issue-660 into main 2026-03-25 08:33:41 +01:00
openhands
b7976fcce4 chore: planner run 2026-03-25
- Triaged 6 predictions: 2 promoted (#663, #664), 1 watched, 3 dismissed
- Updated prerequisite tree: #568 DONE, #466 ESCALATED, added operational reliability objective
- Filed 3 issues: #663 (guard logging), #664 (stale phase cleanup), #668 (init smoke test)
- Prioritized top 5 constraints: #466, #661, #663, #664, #668
2026-03-25 07:22:42 +00:00
openhands
709217af33 fix: agents container cannot reach Forgejo — lib/env.sh overrides compose FORGE_URL with .env localhost (#660)
Skip sourcing .env/.env.enc when DISINTO_CONTAINER=1 since compose
already injects the correct env vars via env_file + environment
overrides.  Re-sourcing .env was clobbering compose-level values
like FORGE_URL=http://forgejo:3000 with the localhost default.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-25 07:10:55 +00:00
johba
47fd876813 Merge pull request 'chore: gardener housekeeping' (#654) from chore/gardener-20260325-0606 into main 2026-03-25 08:04:07 +01:00
johba
b41929df19 Merge pull request 'fix: fix: setup_forge silently fails to create users and tokens — .env has no FORGE_TOKEN after init (#658)' (#659) from fix/issue-658 into main 2026-03-25 07:59:51 +01:00
openhands
b361eba2bb fix: setup_forge silently fails to create users and tokens — .env has no FORGE_TOKEN after init (#658)
Add database readiness check (retry loop on `forgejo admin user list`) after
API becomes reachable to avoid the race where HTTP is up but SQLite isn't
accepting writes yet.

Remove `2>/dev/null || true` from user creation commands so failures are
logged with the actual error message. Verify each user exists via API after
creation. Fail init with a clear error if admin token, bot user creation,
or bot token creation fails — instead of silently writing an incomplete .env.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-25 06:51:47 +00:00
johba
55bed9dc6f Merge pull request 'fix: fix: dev-agent worktree pushes to origin (Codeberg) instead of forgejo (local) — PR creation fails (#653)' (#657) from fix/issue-653 into main 2026-03-25 07:38:40 +01:00
openhands
ac5448323b fix: dev-agent worktree pushes to origin (Codeberg) instead of forgejo (local) — PR creation fails (#653)
Detect which git remote matches FORGE_URL by comparing the host portion
of FORGE_URL against remote push URLs.  Store the result in FORGE_REMOTE
(defaults to "origin" when no match — preserving existing behavior for
Codeberg-direct setups).

Replace every hardcoded "origin" in fetch, push, worktree-add, and
prompt-injection commands across:
- dev/dev-agent.sh (worktree setup, phase protocol prompt)
- dev/phase-handler.sh (CI retrigger, review feedback, rebase instructions)
- review/review-poll.sh (review feedback injection)
- action/action-agent.sh (worktree setup, push instructions)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-25 06:17:34 +00:00
openhands
40093e92e2 chore: gardener housekeeping 2026-03-25 2026-03-25 06:06:48 +00:00
johba
0e5090bd51 Merge pull request 'fix: bind-mount host Claude credentials instead of empty Docker volume' (#651) from fix/claude-auth-bind-mount into main 2026-03-25 06:49:02 +01:00
johba
632508e18e fix: bind-mount host Claude credentials instead of empty Docker volume
Replace the claude-auth named Docker volume with bind mounts to the host
user's ~/.claude/ and ~/.claude.json. The named volume creates an empty
directory, so the agents container cannot authenticate with Claude CLI.

Bind-mounting from ${HOME} ensures the container picks up existing
credentials without manual intervention.

Closes codeberg.org/johba/disinto/issues/633

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-25 05:42:50 +00:00
johba
c63c6a4e6e Merge pull request 'fix: Add Dendrite to docker-compose stack (#619)' (#650) from fix/issue-619 into main 2026-03-25 01:39:03 +01:00
openhands
a0cdf87a21 fix: move setup_matrix after compose up, use Python for .env writes
- Critical: setup_matrix now runs after docker compose up -d so Dendrite
  is actually running when provisioning is attempted
- Minor: replace sed with Python for .env credential writes to avoid
  delimiter collisions with opaque Matrix access tokens
- Info: update matrix_listener.sh header to mention container mode

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-25 00:35:20 +00:00
openhands
b86edd7e5d fix: Add Dendrite to docker-compose stack (#619)
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-25 00:28:04 +00:00
johba
df640af7c1 Merge pull request 'chore: gardener housekeeping' (#649) from chore/gardener-20260325-0007 into main 2026-03-25 01:14:46 +01:00
openhands
b8dc01b06f chore: gardener housekeeping 2026-03-25 2026-03-25 00:07:52 +00:00
johba
6afc7f183f Merge pull request 'fix: fix: disinto init fails on minimal Debian — crontab command not found (#638)' (#648) from fix/issue-638 into main 2026-03-24 23:44:02 +01:00
openhands
bc2df1a2c7 fix: disinto init fails on minimal Debian — crontab command not found (#638)
In compose mode, skip host cron installation entirely since the agents
container runs cron internally via entrypoint.sh. In bare mode, check
for crontab before attempting to install entries and produce a clear
error with install instructions if missing.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-24 22:40:35 +00:00
johba
ac2a41a097 Merge pull request 'fix: fix: agents Dockerfile fails to build — cli.anthropic.com DNS does not resolve (#637)' (#647) from fix/issue-637 into main 2026-03-24 23:34:02 +01:00
openhands
7844b29a37 fix: agents Dockerfile fails to build — cli.anthropic.com DNS does not resolve (#637)
- Remove curl|sh Claude CLI download from Dockerfile (no internet needed)
- Mount host Claude CLI binary into container via docker-compose volume
- generate_compose() resolves host claude path at init time
- entrypoint.sh fails fast with clear error if claude CLI is missing

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-24 22:26:26 +00:00
johba
d7d2d1e12f Merge pull request 'fix: fix: setup_forge runs forgejo admin commands as root — Forgejo refuses to execute (#636)' (#646) from fix/issue-636 into main 2026-03-24 23:19:02 +01:00
openhands
f30c56769a fix: setup_forge runs forgejo admin commands as root — Forgejo refuses to execute (#636)
Add -u git to docker exec and docker compose exec calls in _forgejo_exec()
so Forgejo admin commands run as the git user instead of root.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-24 22:15:00 +00:00