Expand description
POST /api/v1/github/push-scan: a container agent’s push, judged by the host’s publish guard.
A container’s pre-push hook (agentmux-bashwrap git-hook pre-push) collects what the push publishes with the
container’s own git (per ref: the commits’ messages, the added paths and the added lines) and posts it here as
data. srv gives it, on stdin, to the host’s gh-agent scan-push --repo OWNER/REPO and answers with its verdict.
The material is data: nothing here opens the container’s clone or runs git in it, and the request carries no path.
Whether the repository is public is decided by gh-agent asking GitHub about the owner/repo, never by a flag in
the request.
Callable with a container agent’s own token only. Every field is checked and capped before anything runs; the checks are the pure functions below.
Structs§
- Changeset 🔒
- Limiter 🔒
- A sliding window per agent.
- Part 🔒
- Push
Scan 🔒Request - What the container sends: one push, the same for every ref it updates.
Constants§
- MAX_
BODY_ 🔒BYTES - The most a request may carry, in bytes. The route’s body limit is this.
- MAX_
CHANGESETS 🔒 - MAX_
CHANGESET_ 🔒BYTES - MAX_
FIELD_ 🔒BYTES - MAX_
MATERIAL_ 🔒BYTES - The most the pushed material may weigh once read; a bigger push is refused with what to do about it.
- MAX_
PARTS 🔒 - MAX_
REF_ 🔒BYTES - MAX_
RUNNING 🔒 - Judgements running at once on this machine.
- RATE_
LIMIT 🔒 - Pushes one agent may ask to have judged in a window, and the window.
- RATE_
WINDOW 🔒
Functions§
- handle_
push_ 🔒scan POST /api/v1/github/push-scan- is_name 🔒
- A GitHub account or repository name: nothing that could be read as an option or a path.
- is_ref 🔒
- A ref name as git writes one: printable, no control characters, a bounded length.
- limiter 🔒
- no_
guard 🔒 - The answer when there is no guard to run here: the hook does nothing and says nothing.
- repo_
slug 🔒 owner/repoin lowercase, or why the request names no repository.- running 🔒
- validate 🔒
- Every field of the request checked and capped, or the first thing wrong with it.