docs: Draw the demo's parts

Also nest the repository section's bullets, and say the demo's targets
are the repository's deploy-rs nodes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
jackos1998andClaude Opus 5.5 committed 2026-11-24 23:38:08 +00:00
1 parent d25224c491
commit 58e064924d
1 file changed
+53 -18
+53 -18
View File
@@ -20,6 +20,38 @@ demo # the agents' VM, on this terminal
## What's in it
```mermaid
flowchart TB
subgraph agentvm["Agents' VM (demo)"]
slop["slop, as agent"]
clone["~/repo"]
end
browser["Browser"]
shell["devenv shell:<br>slop-approve, demo-merge"]
subgraph host["Host (devenv up)"]
pocket["Pocket ID<br>localhost:1411"]
broker["Broker, with the web app<br>localhost:8095"]
daemon["git daemon"]
builder["Builder"]
repo[("repo.git")]
end
subgraph boxvm["Box VM"]
sshd["sshd, as box<br>(nodes web, router, vault, box)"]
end
slop -- "vsock" --> broker
clone -- "git://, through guestfwd" --> daemon --> repo
browser -- "sign in" --> pocket
browser --> broker
shell -- "approve.sock" --> broker
shell -- "moves master" --> repo
broker -- "SSH, through a wrapper" --> builder -- "fetches" --> repo
broker -- "SSH, localhost:2222" --> sshd
```
| Part | Where | Runs |
|---|---|---|
| Broker, from this checkout (`cargo run`) | Host | `devenv up` (process `slop-broker`) |
@@ -39,8 +71,8 @@ CID are in [`settings.nix`](../nix/demo/settings.nix). The broker's configuratio
[the repository](#the-repository)).
- **Approvers:** members of your primary group, through `slop-approve` in the devenv shell, and the
Pocket ID user `demo` (in the group `slop-approvers`) through the web app.
- **Targets:** `box`, `web`, `router` and `vault` all reach the box VM; `box` is also the deploy
node.
- **Targets:** the repository's deploy-rs nodes on `master`, `box`, `web`, `router` and `vault`,
which all reach the box VM. Only `box` has a profile to deploy.
- **Policy:**
- The box queries (`slop status`, `slop logs`, `slop failed`) run without asking.
- `slop ssh web` asks, and offers leases of 5 minutes or an hour.
@@ -69,24 +101,27 @@ slop ssh web -- uptime </dev/null &
## The repository
`devenv up` seeds a bare repository once from [`nix/demo/repo`](../nix/demo/repo), committed to
`master` as Dev:
`devenv up` seeds a bare repository once, committed to `master` as Dev.
- `secrets.nix`, the agenix rules, and two secrets encrypted to the demo person's age key and the
broker's: `secrets/app.env.age` (`DB_USER` and `DB_PASSWORD`) and `secrets/wg.key.age` (a
WireGuard key, as a whole file). The keys are `dev-age.key` and `broker-age.key` in the state
directory; the broker's approvals call the first `dev`.
- A `pre-receive` hook refuses pushes to `master`, standing in for branch protection.
`demo-merge <branch>` in the devenv shell fast-forwards `master` to a branch, as a person
- **From [`nix/demo/repo`](../nix/demo/repo):** `flake.nix`, with the deploy-rs nodes and the
`demo` profile (see [Deploys](#deploys)).
- **Generated:** age keys for the demo person and the broker (`dev-age.key` and `broker-age.key`
in the state directory; the broker's approvals call the first `dev`), and secrets encrypted to
both:
- `secrets.nix`, the agenix rules;
- `secrets/app.env.age`, with `DB_USER` and `DB_PASSWORD`;
- `secrets/wg.key.age`, a WireGuard key, as a whole file.
- **Protected `master`:** a `pre-receive` hook refuses pushes to it, standing in for branch
protection. `demo-merge <branch>` in the devenv shell fast-forwards it to a branch, as a person
merging after review.
The agents' VM clones it to `~/repo` at login. The `demo` script forwards `10.0.2.100:9418`, an
address only the VM sees, to a `git daemon` on the host for each connection (QEMU's `guestfwd`),
so the VM can fetch and push over `git://` and reach nothing else.
The broker reaches its builder over SSH, as in a real deployment. Here its `ssh` is a wrapper that
runs `slop-broker builder` from this checkout's build when the host is `builder`, and the real
`ssh` otherwise. The builder fetches from the repository's path and evaluates with the host's Nix.
- **The agents' VM** clones it to `~/repo` at login, over `git://`.
- The `demo` script forwards `10.0.2.100:9418`, an address only the VM sees, to a `git daemon`
on the host for each connection (QEMU's `guestfwd`).
- So the VM can fetch and push, and reach nothing else.
- **The builder** is reached over SSH, as in a real deployment.
- The broker's `ssh` is a wrapper that runs `slop-broker builder` from this checkout's build
when the host is `builder`, and the real `ssh` otherwise.
- The builder fetches from the repository's path and evaluates with the host's Nix.
### Secrets