nixos/slop-cannon: Reach Gitea as the bot user
Agents pushed with a write-enabled deploy key, added to each repo by hand, and had no way to open pull requests. The bot user's token now does both: Git uses HTTPS with a credential helper that sends it, and `tea` is wrapped to log in with it. Only Dev pushes and merges to `master`. A new `my.agents.rules` option gives every agent extra instructions. `slop-cannon`'s make a pull request the default way to finish work, unless a repository's own instructions allow more. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
cb4937f230
commit
51c26fbcec
7 files changed
+98
-52
No files matched your search
@@ -43,7 +43,7 @@ See the consolidated [network assignments](../../networking.md#box-assignments)
|
||||
`untrusted`.
|
||||
- The routers keep `untrusted` to the Internet (see
|
||||
[Untrusted clients](../../networking.md#untrusted-clients)). `git.nul.ie` and
|
||||
`paseo-relay.nul.ie` resolve to colony IPv6 addresses, which are rejected, so Gitea SSH and the
|
||||
`paseo-relay.nul.ie` resolve to colony IPv6 addresses, which are rejected, so Gitea and the
|
||||
Paseo relay fall back to IPv4 immediately.
|
||||
- SSH from `hi` and `lo` works through the routers. The VM shares layer 2 with other clients
|
||||
on the `untrusted` VLAN.
|
||||
@@ -70,7 +70,7 @@ See the consolidated [network assignments](../../networking.md#box-assignments)
|
||||
- No `user-passwd.txt` (`my.user.passwordSecret = null`): root belongs to the agents, so the box
|
||||
gets no shared secrets. Recovery is through the installer ISO.
|
||||
- The VM's SSH host key is the age identity for `slop-cannon/paseo.env` and
|
||||
`slop-cannon/gitea-key`. Agents can read the host key and decrypt anything encrypted to it.
|
||||
`slop-cannon/gitea-token`. Agents can read the host key and decrypt anything encrypted to it.
|
||||
|
||||
## Paseo
|
||||
|
||||
@@ -179,20 +179,35 @@ the `slop` command (`my.agents.slop.enable`). It connects over vsock (CID 3; see
|
||||
logged in. For recovery, use the [VM serial console](../../deployment.md#vm-consoles) for
|
||||
`slop-cannon` on `palace`.
|
||||
|
||||
The VM uses a Gitea deploy key from the age secret
|
||||
`slop-cannon/gitea-key`. As `slop-cannon`, run
|
||||
`ssh-keygen -y -f /run/secrets/slop-cannon/gitea-key` to get its public key. Add that public key
|
||||
in Gitea as a write-enabled deploy key on each repo agents may use. Commits are authored as Dev
|
||||
through the shared Git config.
|
||||
|
||||
To set up provider logins and repos on a fresh agent home, connect with `ssh slop-cannon`:
|
||||
|
||||
1. `claude auth login` (a full login; `setup-token` tokens are not enough for every feature).
|
||||
2. `codex login --device-auth`.
|
||||
3. [Pair a Paseo client](#pair-a-paseo-client).
|
||||
4. `slop-clone <owner>/<repo>` for each repo. It clones a colocated jj repo into `~/src/<repo>`,
|
||||
registers it with Paseo as a local workspace, and prints the box's public key if Gitea refuses
|
||||
the clone.
|
||||
4. `slop-clone <owner>/<repo>` for each repo. It clones a colocated jj repo over HTTPS into
|
||||
`~/src/<repo>` and registers it with Paseo as a local workspace.
|
||||
|
||||
## Gitea
|
||||
|
||||
Agents reach Gitea as a bot user, with its access token (age secret `slop-cannon/gitea-token`,
|
||||
scopes `write:repository` and `write:issue`).
|
||||
|
||||
- **Git** uses HTTPS: a credential helper for `git.nul.ie` sends the token. Commits are still
|
||||
authored as Dev through the shared Git config; the pushes are the bot's.
|
||||
- **`tea`**, Gitea's CLI, is wrapped to log in with the same token, so agents can open and update
|
||||
pull requests.
|
||||
- **Pull requests:** a rule for every agent (`my.agents.rules.gitea`: a Claude rule, and part of
|
||||
Codex's `AGENTS.md`) makes a pull request from a branch of its own the default way to finish a
|
||||
piece of work, and says how with jj and `tea`. A repository's own `AGENTS.md` can allow more,
|
||||
such as pushing to its main branch.
|
||||
- **Access per repo:** where agents should only propose changes (`dev/nixfiles`, `slop-broker`),
|
||||
protect the main branch so only Dev pushes and merges. Elsewhere the bot's Write access is
|
||||
enough to push directly.
|
||||
- **Access:** the bot is a collaborator with Write on each repo agents may use. `master` on
|
||||
`dev/nixfiles` only takes pushes and merges from Dev (see
|
||||
[`slop-broker`](../../slop-broker.md#master-is-protected)).
|
||||
- **Replacing the token:** make a new one for the bot and put it in the secret with
|
||||
`ragenix -e secrets/slop-cannon/gitea-token.age`, then deploy `slop-cannon`.
|
||||
|
||||
## Pair a Paseo client
|
||||
|
||||
|
||||
+2
-2
@@ -74,8 +74,8 @@ collects garbage in that store on every run, which the roots survive until they
|
||||
### `master` is protected
|
||||
|
||||
Deploy approvals ("on the branch", the diff since `master`) and secret approvals both trust
|
||||
`master`, so only Dev may push to it: branch protection on `dev/nixfiles` in Gitea refuses pushes
|
||||
from deploy keys, including `slop-cannon`'s.
|
||||
`master`, so only Dev may push to it or merge into it: branch protection on `dev/nixfiles` in Gitea
|
||||
refuses everyone else, including the bot user that agents on `slop-cannon` push as.
|
||||
|
||||
## Approvals web app
|
||||
|
||||
|
||||
Reference in new issue
Block a user