Commit Graph
7 Commits
Author SHA1 Message Date
paulandClaude Opus 5 99ebfcfb38 Run semprini-core's service desk every minute; --hold never shortens
The service desk (Semprini/service-desk) is fulfilled by semprini-core's
core_stack/scripts/service-desk.py. The daemon runs its poll between agent
runs, skips it during a hold, and posts to Stack Maintenance what needs a
person: an approval, a failure, an "Ask core" request, a finished request.

--hold from a shell no longer shortens a longer hold: sync-to-host.sh's
15 minutes on each deploy cut a 2-hour hold short on 2026-09-19.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-19 18:06:22 +12:00
paulandClaude Opus 5 4782849ce5 Add a time-boxed hold on autonomous work
Working on the live stack meant fighting the daemon: it triaged alerts a
deploy caused, and its own commits landed mid-session. Stopping the service
is the only lever today, and it is easy to leave stopped.

`hold 45m <why>` in Matrix, or `maintainer.py --hold 45m --reason …` from a
shell, pauses everything the daemon starts by itself — health cycles, alert
triage, weekly upgrades — for a bounded time. Operator messages still run,
and alerts still batch, so one triage run covers the whole hold. It says in
the room when the hold starts and when it runs out, `status` shows it, and
`resume` ends it early.

The hold lives in hold.json beside the state file: `--hold` from a shell has
to reach a daemon that rewrites its own state whenever it likes.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-16 11:15:54 +12:00
paulandClaude Opus 5 a725abbfbc Default the agent to Claude Sonnet 5
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-15 23:48:44 +12:00
paulandClaude Opus 5 b94a19147f Use an absolute path in the ssh token command
An unquoted ~ in `ssh host ~/path` expands on the local machine, so the
documented command looked for /home/paul/semprini-maintainer on the host.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-15 23:41:13 +12:00
paulandClaude Opus 5 556ffb6561 Run on the stack host, react to Matrix events, keep the repo current
The stack moved to AWS Lightsail, so the maintainer now runs on that host
as ubuntu and is triggered by events rather than polling:

- A long-poll /sync delivers operator messages and #stack-alerts within
  about a second. Follow-ups resume the Claude session, so the Stack
  Maintenance room works like a chat. status, cancel, new, upgrade and
  help are answered even while a run is in progress.
- FIRING alerts from the Alertmanager bridge are batched and triaged in a
  thread, with a per-fingerprint cooldown.
- Agent runs go one at a time from a persisted priority queue, so an
  unusable agent defers work instead of losing it.
- Health checks add host resources (disk, memory, OOM kills, restart
  loops, stale Kuma) and reboot detection; one cycle's findings share a run.
- The daily report and the weekly upgrade run at fixed UTC times; the
  upgrade covers every image on the host.
- Applied changes are committed to semprini-core main and pushed. The
  daemon fast-forwards before a run and pushes leftovers after it.
- The Claude credential comes from `claude setup-token` via
  --set-claude-token. Self-update runs hourly, gated by --check.
- install.sh renders the unit for the current user and configures the git
  credential helper.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-15 23:22:34 +12:00
paul 00195ee6d5 Add Gitea integration for agent to push branches and open pull requests
- Implemented `register-gitea-bot.sh` to provision Gitea access token.
- Updated `maintainer.py` to support Gitea API for push and PR operations.
- Modified `install.sh` to warn if Gitea token is not provisioned.
- Enhanced documentation in `README.md`, `CLAUDE.md`, and `architecture.md` to reflect new Gitea functionality.
- Added Gitea configuration to `config.example.json`.
2026-06-29 20:46:33 +12:00
paulandClaude Opus 4.8 e91b129841 Initial commit: autonomous maintenance agent for semprini stack
systemd-deployed daemon that drives the semprini-core stack-support agent
headless via Claude Code, monitors health via Uptime Kuma, applies safe
upgrades, and escalates to the operator over Matrix.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-21 17:20:06 +12:00