Commit Graph
33 Commits
Author SHA1 Message Date
jackos1998andClaude Opus 5.5 e80b5b60fc policy: Check the fields rules match
CI / Check (push) Successful in 4m57s
Each operation lists the scope fields its rules can match, so a rule
that names any other field, which never matched and so was silently
ignored, is refused: by the module's typed `match` options at
evaluation, and by `Config::validate`. The design doc now shows a
policy's per-operation settings and each operation's fields.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-24 23:12:37 +00:00
jackos1998andClaude Opus 5.5 c26a74565c docs: Say each fact in one of design and architecture
CI / Check (push) Successful in 4m59s
The design keeps behaviour and rationale, and the architecture the code.
The SSH options and the builder approval's rules are only in the design
now, and the message encoding only in the architecture. The modules'
details link to the design, and the tests move to the architecture,
without the commands that `AGENTS.md` lists.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-24 22:57:12 +00:00
jackos1998andClaude Opus 5.5 552b175ebf docs: Nest the demo's repository bullets
Also extend the writing rules: long bullets and steps get nested
bullets, and the design and architecture docs each own their half.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-24 22:55:49 +00:00
jackos1998andClaude Opus 5.5 d1b6147878 ops: Name operations with an enum
Policies were keyed by any string, so a mistyped operation was silently
denied. `OpName` makes the broker refuse it when loading the config,
and the module's `ops` names each operation, so evaluation fails
first.

`Parsed::new` fills in the defaults, so each operation sets only what
it uses; what's found before approval moves to `Parsed::prepared`, and
whether an operation is built in follows from its name.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-24 22:54:47 +00:00
jackos1998andClaude Opus 5.5 f844ab7264 deploy: Move the comparison script into its own file
A file of its own reads as a script, says what its output looks like
and is checked by a new `shellcheck` lint.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-24 22:50:45 +00:00
jackos1998 5485af2d58 slop-broker: Tidy main and the config struct 2026-11-24 22:49:00 +00:00
jackos1998andClaude Opus 5.5 cd9cb27544 docs: Break up the long sections
CI / Check (push) Successful in 4m50s
Turn the architecture's policy, execution, approver and NixOS sections
and the design doc's long bullets and steps into short nested bullets
and tables.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-24 22:15:35 +00:00
jackos1998andClaude Opus 5.5 7f25910094 docs: Draw the demo's parts
Also say the demo's targets are the repository's deploy-rs nodes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-24 22:15:35 +00:00
jackos1998andClaude Opus 5.5 1d68596b86 demo: Log the agent in on the serial console only
The agents' VM also logged `agent` in on `tty1`, which nobody sees,
and both login shells cloned the repository into `~/repo` at once.
One could remove the directory while the other was still copying Git's
hook templates into it, which failed with "cannot copy ... No such
file or directory".

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-24 22:15:35 +00:00
jackos1998andClaude Opus 5.5 4e4c68cb83 docs: Describe the builder on its own
CI / Check (push) Successful in 4m52s
The builder runs separately from the broker, and which of its requests
need an approval first depends on whose code each one evaluates. A
diagram shows its state, and a table what each request runs, whose code
and whether it waits for an approval.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-24 20:27:16 +00:00
jackos1998andClaude Opus 5.5 3fe20acc65 docs: Show the broker's parts and each request's steps
CI / Check (push) Successful in 4m53s
The overview puts the builder on its own box, which can be the
broker's, and a second diagram shows the parts inside the broker. The
request lifecycle keeps the steps every request takes, with nested
details, and then describes each kind on its own: queries and SSH,
secrets, deploys (with the sequence diagram) and builds.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-24 19:31:57 +00:00
jackos1998andClaude Opus 5.5 0293cfac65 ssh: Take targets only from the main branch
`ssh.targets` duplicated what the main branch's deploy-rs nodes
already say, and a configured target could drift from them. The
nodes are now the only targets, so SSH needs `deploy`, whose builder
reads them.

The VM test gets a real builder and a repository with the nodes, and
the demo's targets move into its repository's flake.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-24 19:31:57 +00:00
jackos1998andClaude Opus 5.5 5fffc796df docs: Add diagrams, requests by kind and protocol types
CI / Check (push) Successful in 4m41s
The architecture gets an overview of the parts and a deploy's sequence,
the request lifecycle splits the steps every request takes from those
of each kind, and the protocol is shown as its types and fields. The
design starts with what happens to each kind of request.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-24 10:18:32 +00:00
jackos1998andClaude Opus 5.5 5e25159fa4 ssh: Find deploy targets on the main branch
With `ssh.branchNodes`, every deploy-rs node on the main branch is a
target too, so adding a box takes a commit there rather than a new
broker config. The builder evaluates the branch's `deploy` output
(hostname, SSH user and options, `sudo`), cached per commit, and the
broker looks it up again when stale or when a request names a node it
doesn't know. Only the protected branch's Nix is evaluated, as for
secrets; configured targets win.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-24 10:17:50 +00:00
jackos1998andClaude Opus 5.5 2af7c55a17 ha: Remove Home Assistant notifications
CI / Check (push) Successful in 4m56s
The web app's Web Push notifications replace them: they are encrypted
end to end, and the page holds every pending request, so a dismissed
notification loses nothing. Drops `src/ha.rs`, the
`services.slop-broker.homeAssistant` options and `tokio-tungstenite`.
A config that still has `home_assistant` is refused.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-24 08:39:53 +00:00
jackos1998andClaude Opus 5.5 9d54664f5c demo: Deploy to the box VM
The demo repository's flake gets a deploy-rs node, `box`, with a small
custom profile whose activation writes its version, using nixpkgs'
deploy-rs so builds are quick, and its nixpkgs locked to this
repository's. The box VM lets `box` use `sudo` and copy unsigned
paths, and the broker's policy covers the builder and deploys, so a
pushed branch can be deployed and its package changes approved.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-24 02:01:35 +00:00
jackos1998andClaude Opus 5.5 ddee51d092 demo: Add a repository, a builder and secrets
`devenv up` seeds a bare repository with an agenix rules file and two
secrets, encrypted to the demo person and the broker; a pre-receive
hook protects `master`, and `demo-merge` moves it. The agents' VM
clones it over a QEMU guestfwd to `git daemon`, and the broker reaches
`slop-broker builder` through an `ssh` wrapper, so secret requests
work as in a real deployment.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-24 01:42:48 +00:00
jackos1998andClaude Opus 5.5 63b256c21b detail: Structure what approvers see
Request details become fields, then tables, lists and text, with a
tone on fields and rows. The web app shows them as a grid and tables
like the audit log; everything else, the audit log and passkey
fingerprints use the text rendering, with headline fields first in
notifications. Deploys get a packages table per profile, secrets a
recipients table.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-24 01:28:47 +00:00
jackos1998andClaude Opus 5.5 005e3d32df ops: Add age secrets
`slop secret keys|set|generate|rekey|read` work with an agenix secret
in the requester's checkout: it sends the ciphertext, and the broker
decrypts it with its own age identity and returns new ciphertext.
Field edits work on env and JSON secrets.

The path and recipients are the requester's, so before approval the
builder reads the protected main branch: it looks the ciphertext's
blob up there, so approvers see which file it really is, and
evaluates that branch's rules file to compare the recipients.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-24 00:56:17 +00:00
jackos1998andClaude Opus 5.5 f94ad9ab9e web: Brand the app as Slopprovals
CI / Check (push) Successful in 4m28s
The icon gains Noto Emoji's thinking face in front of the tick, kept
as vector art; its Apache-2.0 credit is in the SVG.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-23 14:16:51 +00:00
jackos1998andClaude Opus 5.5 f1a1532e6c web: Give form controls one consistent style
CI / Check (push) Successful in 4m30s
Selects and text fields kept the browser's own look, so they didn't
line up with the buttons or each other. They now share the buttons'
padding, border and radius; filter labels sit above their controls and
wrap into rows on a phone, and the notification toggle lines up with
its text.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-23 14:12:18 +00:00
jackos1998andClaude Opus 5.5 40a8be0da4 web: Scroll the audit log sideways on phones
The table shrank to the screen's width, squeezing its columns. A
minimum width makes its .scroll wrapper scroll instead, the headings
and the short columns (time, requester, approver) stay on one line,
and the log page isn't held to the request cards' width.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-23 14:12:18 +00:00
jackos1998andClaude Opus 5.5 652e80961a web: Ask for the passkey on every sign-in
Signing out only ended the app's session: the next sign-in went
through the provider's still-valid session without a prompt, so
signing out seemed to do nothing. Sign-ins now ask the provider to
authenticate afresh and check the token's auth_time, as passkey
confirmations already do.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-23 12:31:23 +00:00
jackos1998andClaude Opus 5.5 538a288182 ci: Add a Gitea Actions workflow
CI / Check (push) Successful in 4m44s
Every push runs `nix flake check`: the package with its tests, new
`clippy` (warnings as errors) and `fmt` checks, and the VM test.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-23 00:39:37 +00:00
jackos1998andClaude Opus 5.5 1f834df326 docs: Add the design, architecture and agent rules
The design and architecture docs come from nixfiles'
`docs/slop-broker.md` and its working notes, rewritten to describe the
broker rather than one deployment: roles such as the agents' VM and
the broker's box replace box names, and the rollout plan and
deployment's agent setup stay in nixfiles. `AGENTS.md` carries over
the general rules from nixfiles plus this repository's commands.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-23 00:39:37 +00:00
jackos1998andClaude Opus 5.5 313c028ad9 nix: Add a demo
A setup for trying the broker by hand, laid out like a deployment.
`devenv up` runs the broker from the checkout with its web app, Pocket
ID for approvers to sign in with, and a box VM for the SSH targets; a
setup task creates the approver, their group and the broker's OIDC
client through Pocket ID's API. `demo` boots the agents' VM on the
terminal, which reaches the broker only over vsock.

Approvers use `slop-approve` in the devenv shell, or the web app after
signing in with a link from `demo-sign-in`, so passkey approvals can
be tried without deploying anything.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-23 00:39:36 +00:00
jackos1998andClaude Opus 5.5 076f4959d9 web: Add approvals web app
A web app lists pending requests with full detail, leases and the
audit log grouped by request, and sends Web Push notifications that can
answer requests. Approvers sign in through an OpenID Connect provider;
policy can require a fresh passkey (`confirm = "passkey"`) to approve,
which only the web app can then give.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-23 00:39:36 +00:00
jackos1998andClaude Opus 5.5 5a4cdddd7f builder: Approve builder use before building
Before the builder evaluates anything, an approver sees the requester's
commits relative to the branch and their diff, and approves using the
builder. A lease from an earlier request can cover it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-23 00:39:37 +00:00
jackos1998andClaude Opus 5.5 eeaf22a7b5 ops: Add builds
`slop build <attr>…` builds flake attributes of a pushed commit on the
builder and, once approved, copies them to a binary cache's store and
roots them there. `services.slop-broker-cache` gives the cache store
owner's key a forced command that only allows the store protocol and
GC roots, and expires the roots.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-23 00:39:35 +00:00
jackos1998andClaude Opus 5.5 6305228e7e ops: Add deploys
`slop deploy <node>…` builds a pushed commit and, once approved,
activates it on every target at once. A builder, reached over SSH as
a user that only holds a read-only Git key, fetches the commit from
the Git server and evaluates and builds the deploy-rs profiles, so
agent-written Nix never runs in the broker. Before asking, the broker
copies the closures to the nodes and compares them there with a fixed
read-only script: package changes from `nix store diff-closures`, and
changed units and `/etc` files from the two `etc` trees.

Once approved, `activate-rs` runs on each node in a transient unit,
so it finishes even if the connection drops or the broker restarts.
Policy rules see one scope per target, and the strictest answer
applies. `services.slop-broker-builder` sets up the builder on any box.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-23 00:39:35 +00:00
jackos1998andClaude Opus 5.5 73deb0efb8 remote: Add SSH transport
Requesters and approvers on other boxes log in to the broker's box as
`slop`. Each key has a forced `slop-broker remote <role> <name>`, which
joins the session to the broker through a socket only `slop` can open,
so the broker trusts the name like it trusts a vsock CID. A key does
one job: the module refuses a key used for both roles.

`slop` and `slop-approve` take `ssh:<destination>` addresses, from
`SLOP_BROKER` and `SLOP_APPROVE` or else `~/.config/slop/config.toml`,
and an approver connection now carries many requests. The
`programs.slop` home-manager module installs both clients, a `Host`
entry per key and that config file.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-23 00:39:35 +00:00
jackos1998andClaude Opus 5.5 d71bbb04db ops: Add box queries
`slop status`, `slop logs` and `slop failed` run fixed read-only
commands that the broker builds and quotes from validated values, so a
policy can let them run without asking.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-23 00:39:35 +00:00
jackos1998andClaude Opus 5.5 67b11b0c61 broker: Add approval broker for coding agents
`slop-broker` runs privileged operations for coding agents under named
policies (auto, ask or deny per operation), which requesters can share,
with approvals from `slop-approve` or Home Assistant notifications and
optional leases. The broker and the `slop` client talk over vsock, so
a VM needs no network path to it. Messages are typed enums shared by
both, CBOR-encoded and framed with `LengthDelimitedCodec`; decoding
validates every value, and requests carry a protocol version.

The first operation is `slop ssh`. The `services.slop-broker` NixOS
module runs the broker as a hardened service from generated TOML, and
a VM test exercises it over vsock loopback. devenv provides the
development environment.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-23 00:39:36 +00:00