No description
Find a file
bob-boat ba6db7c82f Collector milestone 3: HTTP webhook source + /health
internal/source/webhook routes inbound POSTs to inbox events via a
configured table. Each route specifies recipient, type, priority, and
a Go text/template payload renderer that consumes the request body
decoded as JSON.

v1 binds loopback only — New() rejects non-loopback addresses at
construction. Caddy + bearer-token reverse-proxy is the v2 upgrade
path per spec §4.

Behavior:
- POST + matched route + valid JSON body → render template, emit, 202
- Missing route → 404
- Wrong method → 405
- Bad JSON → 400
- Template render failure → 500
- Emit failure → 500 (caller responsible for retry; HTTP source has no
  durable staging)
- Empty body → empty data map for template (lets fixed-string templates
  work without sending {})
- 1 MiB request body cap

GET /health returns JSON Stats{received, emitted, errors, uptime_sec}
on the same listener for journalctl correlation per spec §3.5.

10 tests passing — non-loopback rejection, bad type/template
rejection, route+template happy path, priority defaulting, empty body,
404/400/405/500, health endpoint counters.

31 tests across the three internal packages, all passing.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-06 16:17:01 -04:00
docs/channels Add Channels reference docs snapshot for Layer 2 implementation 2026-05-06 16:04:32 -04:00
internal Collector milestone 3: HTTP webhook source + /health 2026-05-06 16:17:01 -04:00
spec Initial: README, spec/agent-watcher.md v1 (signed off by Bob 2026-05-06), .gitignore 2026-05-06 14:36:45 -04:00
.gitignore Initial: README, spec/agent-watcher.md v1 (signed off by Bob 2026-05-06), .gitignore 2026-05-06 14:36:45 -04:00
go.mod Collector milestone 2: source interface + drop-folder source 2026-05-06 16:14:03 -04:00
go.sum Collector milestone 2: source interface + drop-folder source 2026-05-06 16:14:03 -04:00
README.md Initial: README, spec/agent-watcher.md v1 (signed off by Bob 2026-05-06), .gitignore 2026-05-06 14:36:45 -04:00

agent-watcher

Push-delivery layer for agent-ping. The "secondary nervous system" for Claude Code agents on this network.

agent-ping queues messages in inbox files; agent-watcher notices them (and other external events) and wakes the recipient agent without a human in the loop.

Two layers:

  • Collector — small Go daemon, systemd --user, always on, brain-blind. Converts external events (HTTP webhooks, drop-folder file arrivals) into ping inbox writes. Runs whether or not any agent is alive.
  • MCP Watcher — Claude Code MCP subprocess, declared in each agent's mcp.json. Watches the agent's inbox via inotify and surfaces events into the live session via Channels (research preview). Provides reply tools (ack, respond, mark_handled).

Filesystem is the queue. OpenBrain is not involved.

Spec

spec/agent-watcher.md. Read that for architecture, decisions, scope.

Status

v1 spec signed off by Bob (VPS) 2026-05-06. Implementation pending.

Install

Per CLAUDE.md rule #2, Angus runs the install commands — agents do not modify their own configuration. Install script will land alongside INSTALL.md once the binaries are built.