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.
44 lines
2.3 KiB
TOML
44 lines
2.3 KiB
TOML
# gitea-review-bot — deployment config (EXAMPLE). Copy to config.toml (gitignored) and fill in.
|
|
# Credentials live in the gitignored .env, NOT here.
|
|
|
|
[homeserver]
|
|
url = "https://<your-synapse-host>"
|
|
user = "@reviewer:<your-domain>" # the bot's OWN Matrix account (not matrix-bridge's @agent)
|
|
|
|
# How the bot reaches the Mac (reuses matrix-bridge's Spark→Mac seam + wrappers).
|
|
[mac]
|
|
ssh_alias = "mac-bridge"
|
|
# The review runs `claude -p` in the repo — matrix-bridge's ask-claude.sh does exactly that.
|
|
review_launcher = "/Users/macpro/Projects/matrix-bridge/scripts/ask-claude.sh"
|
|
# Post-merge publish (per-repo, opt-in) — matrix-bridge's deploy-site.sh (ff-pull master + deploy).
|
|
deploy_launcher = "/Users/macpro/Projects/matrix-bridge/scripts/deploy-site.sh"
|
|
hostname = "10.59.211.5" # the Mac over WireGuard (container generates ~/.ssh/config)
|
|
user = "macpro"
|
|
|
|
[gitea]
|
|
api_base = "https://<gitea-host-or-IP>:<port>/api/v1" # use the LAN IP if only a .local name exists
|
|
# (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 (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/**"]
|