Migrated from monorepo during Forgejo registry consolidation 2026-05-07
Find a file
Viktor Barzin 2ef0db9a96 afk: add the autonomous issue-implementer loop (SHIPS DISABLED)
Adds app/afk/ — the "away-from-keyboard" control plane that watches the
issue tracker for ready-for-agent issues, dispatches each to a fresh
full-access T3 thread (with the issue-implementer preamble prepended,
because T3 does not honour ~/.claude/CLAUDE.md), and drives the resulting
run through its lifecycle: tests-red -> green -> pushed -> CI -> deployed,
escalating or fix-forwarding via a small pure state machine.

The loop is split into pure cores (no I/O, exhaustively unit-tested) and
thin injected adapters (the only edges that ever touch T3, the tracker,
CI, or Slack — faked in every test, so nothing here talks to a real
server, GitHub/Forgejo, or the cluster):

  pure:     types, dispatch_policy, run_state_machine, phase_checklist,
            config, issue_implementer_prompt
  adapters: t3_client (two-POST dispatch + snapshot), tracker, ci_watcher,
            notifier
  loops:    poller  — CronJob tick #1: list_ready -> select_dispatchable
                      -> dispatch + stamp the in-progress lock (label only
                      AFTER a successful dispatch, so a failed dispatch
                      never leaves a phantom lock). Per-repo lock derived
                      from the ready set, since the CronJob is stateless
                      between ticks.
            watcher — CronJob tick #2: assemble RunState from snapshot +
                      CI -> next_action -> act (close on success; relabel
                      ready-for-human + ring the doorbell on the two
                      escalations; dispatch a corrective turn on
                      fix-forward; refresh the progress checklist).

SHIPS DISABLED, on purpose: Config defaults to kill_switch=True AND an
empty allowlist, so a freshly-loaded config dispatches nothing and does
zero I/O. The package is not imported by the running service and has no
auto-enable path. Arming it is a deliberate, later, manual step requiring
BOTH gates (clear the kill switch AND enrol the exact repos) so one
fat-fingered env var can't arm every repo.

Test-first throughout: 412 tests pass (poller + watcher add integration
tests wiring the real pure cores to in-memory fakes). mypy clean.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-15 21:15:11 +00:00
.github/workflows ci: move image build off-infra to GHA -> ghcr (ADR-0002) 2026-06-13 01:45:36 +00:00
.woodpecker ci: move image build off-infra to GHA -> ghcr (ADR-0002) 2026-06-13 01:45:36 +00:00
agents breakglass: in-cluster emergency-recovery UI for the devvm 2026-06-12 21:36:05 +00:00
app afk: add the autonomous issue-implementer loop (SHIPS DISABLED) 2026-06-15 21:15:11 +00:00
beads Initial extraction from monorepo 2026-05-07 17:07:12 +00:00
docs docs: capture AFK implementation pipeline design + ADRs 0002-0004 2026-06-14 19:09:12 +00:00
frontend breakglass UI v2: attachable sessions (tmux model) + mobile-first redesign 2026-06-14 19:19:03 +00:00
tests afk: add the autonomous issue-implementer loop (SHIPS DISABLED) 2026-06-15 21:15:11 +00:00
.dockerignore Initial extraction from monorepo 2026-05-07 17:07:12 +00:00
.gitignore breakglass: in-cluster emergency-recovery UI for the devvm 2026-06-12 21:36:05 +00:00
CONTEXT.md docs: capture breakglass design (CONTEXT glossary + ADR 0001) 2026-06-12 20:59:13 +00:00
docker-entrypoint-breakglass.sh breakglass: in-cluster emergency-recovery UI for the devvm 2026-06-12 21:36:05 +00:00
Dockerfile breakglass: in-cluster emergency-recovery UI for the devvm 2026-06-12 21:36:05 +00:00
LICENSE.txt Initial extraction from monorepo 2026-05-07 17:07:12 +00:00
requirements-dev.txt Initial extraction from monorepo 2026-05-07 17:07:12 +00:00
requirements.txt Initial extraction from monorepo 2026-05-07 17:07:12 +00:00