github
PR webhook monitoring (opt-in)
For durable PR monitoring, observe github::pr::on-event, NOT
github::on-called. First observe it with args { watch_id } (a caller-chosen
ID; agents use harness::observe), then call github::pr::watch with that
same ID, pr_url OR repo + number, optional
events: [ci,comments,reviews,pr], stop_on: merged|closed (default merged),
and mandatory future RFC3339 expires_at. Read github::pr::watch-status
once after watch to close the initial race. Never interval-poll PRs.
Inspect status and health.last_error: preparing is not active ingress;
cleanup_pending is not successful cleanup. unwatch and manual recover
are mutations requiring approval. Internal github::webhooks::* functions
must not be called by an agent. Observer targets must dedupe event_id; the
observer's metadata reaches its target, and a target's error keeps the
notification in the durable queue for retry.
A single passing check is NOT aggregate CI success. Closed without merge
remains watched until expiry when stop_on is merged.