Watch a repo for commits pushed by anyone but me

The bot only ever saw pull requests, so a collaborator with write access
who pushes straight to master was invisible: 18 of the last 50 commits on
ten31-brand's master arrived that way, unreviewed and unannounced.

Opt-in per repo (watch_pushes + [gitea] my_emails). Each poll cycle it
pages commits newer than a stored cursor across every branch except ones
with an open PR, keeps the commits whose git email isn't mine, posts a
notice naming author, branch, commits and files, records them, and only
then runs a claude -p assessment threaded under it. Identity comes from
the git email because these commits aren't linked to Gitea accounts.

The notice is deterministic Gitea data and the "outside the expected
area" flag is computed from globs, so the thing you actually need never
depends on a model call. Recording before the assessment is what stops a
crash in those minutes from reposting the whole notice.

Both prompts now put every attacker-authored field — titles, commit
subjects, filenames, the diff — inside a nonce-tagged fence, so a forged
terminator can't reach the instruction region.

Folds in the ROADMAP item to bound two unbounded awaits and exit if the
poll task dies, and adds the repo's first test: the watch policy against
a real-shaped Gitea fixture, with 17 mutations confirmed to fail it.
This commit is contained in:
Keysat
2026-08-21 10:46:03 -05:00
parent 6060ea57a1
commit 7ac1267dd0
7 changed files with 2577 additions and 51 deletions
+14 -1
View File
@@ -20,11 +20,24 @@ api_base = "https://<gitea-host-or-IP>:<port>/api/v1" # use the LAN IP if only
# (a slim container can't resolve mDNS .local)
owner = "grant" # repos are <owner>/<roomname>
verify_tls = false # StartOS Gitea serves a self-signed cert on the LAN
# Commit emails that are MINE. Required by the per-repo push watch below: it notifies on commits
# authored by anyone NOT on this list, so an unrecognised email notifies rather than slips through.
my_emails = ["you@example.com"]
[defaults]
poll_interval_seconds = 60
review_timeout_seconds = 600 # a `claude -p` review (with subagents) can take minutes
watch_timeout_seconds = 480 # a push assessment: tighter, so one push can't park the poll
# Optional per-repo overrides (auto-deploy is OFF unless set here). Keyed by repo/room name.
# Optional per-repo overrides (all OFF unless set here). Keyed by repo/room name.
# [repo.ten31-site]
# deploy_on_merge = true
# Push watch: notify in the room whenever someone who isn't me pushes commits, with a `claude -p`
# assessment of what they did. Any branch, except branches with an open PR (that PR's review already
# covers those commits). Needs [gitea] my_emails set.
# [repo.ten31-brand]
# watch_pushes = true
# # The collaborator's expected territory. Files outside it are flagged in the notice and called out
# # to the assessor. fnmatch-style globs where `*` crosses `/`. Omit for no path policy.
# expected_paths = ["design/deck/interactive/**"]