16 Commits
Author SHA1 Message Date
jackos1998andClaude Opus 5.5 4b2c32636e broker: Containers as targets
CI / Check (pull_request) Successful in 5m17s
CI / Check (push) Canceled after 0s
`slop status`, `logs`, `failed` and `ssh` take `node.container-<name>`,
the name `slop deploy` already takes, so agents can check a container
without asking for `slop ssh` on its host.

- The builder evaluates each node's profile names; its
  `container-<name>` profiles are the containers requests can name.
- Commands run on the node as root through its `sudo`:
  `systemctl --machine`, `journalctl --machine` and, for `ssh`,
  `systemd-run --machine --pipe --wait` with `/bin/sh -l`.
- A container's scope is its node as `target` plus `container`, so
  node rules apply to it while leases stay per target. Rules can
  match `container`.
- Remote commands are now quoted so `fish` reads them as POSIX shells
  do: it treats `\\` and `\'` as escapes inside single quotes.

`PROTOCOL_VERSION` 3.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-28 17:28:57 +00:00
jackos1998andClaude Opus 5.5 00d3c65cfd broker: Never block reading a requester's stdin
CI / Check (pull_request) Successful in 4m53s
CI / Check (push) Canceled after 3m47s
The reader passed stdin to the operation through a channel 16 deep and
waited when it was full, so a requester sending stdin to an operation
that doesn't read it stopped the reader, and the broker no longer saw
it disconnect: the operation kept running.

Buffer stdin without waiting, up to 1 MiB (a requester sending more is
treated as gone), and drop it for operations that don't read it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-28 17:28:51 +00:00
jackos1998andClaude Opus 5.5 ef53a39597 slop: Say how long approvers have to answer
CI / Check (pull_request) Successful in 4m58s
CI / Check (push) Successful in 4m36s
The agent guide said requests wait up to five minutes, the default,
but a broker can allow much longer, so agents gave up on requests that
were still waiting. The broker now says how long approvers have when a
request starts waiting, and the guide tells agents to wait that long.

Bumps to 0.2.2.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-27 19:18:39 +00:00
jackos1998andClaude Opus 5.5 0b2cdf4155 web: Show history details as approvals show them
CI / Check (push) Successful in 4m44s
The audit log kept a request's detail as text, so the web app's history
showed it as one preformatted block. Keep the structure instead, and
render it with the same fields, tables and coloured diffs as a pending
request. Older records' text still reads, as a text section.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-27 16:34:58 +00:00
jackos1998andClaude Opus 5.5 9d08b5cf8f secret: Name recipients by their comments in the rules
CI / Check (pull_request) Successful in 4m44s
CI / Check (push) Successful in 4m49s
Approvals could only name recipients listed in the broker's config, so
host keys showed abbreviated. The builder already evaluates the main
branch's rules; take names from the SSH keys' comments there too
(`ssh-ed25519 AAAA… shill`), which age ignores. Every path's keys
count, so a key added to a secret is named as well.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-27 14:28:10 +00:00
jackos1998andClaude Opus 5.5 2df7cd3dee ssh: Show approvers the stdin a command runs with
CI / Check (pull_request) Successful in 5m14s
CI / Check (push) Successful in 5m15s
`slop ssh` forwarded stdin only after approval, so a script piped to
`bash -s` reached the box without an approver or the audit log ever
seeing it. `slop` now reads all of stdin (unless it's a terminal)
and sends it with the request. Approvers see it in full, the audit
log keeps it, and the command gets exactly those bytes. Stdin that
isn't UTF-8, or a command and stdin too long to show whole, is
refused.

The command is shown as the line the remote shell runs (the words
joined with spaces, as `ssh` sends them) rather than shell-quoted,
which suggested quoting the remote shell never sees; multi-line
commands are shown as text.

`Operation::Ssh` gains `stdin`, so the protocol version goes to 2.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-25 00:51:12 +00:00
jackos1998andClaude Opus 5.5 21c2d4715e policy: Type operation names and the fields rules match
CI / Check (push) Successful in 4m58s
Policies were keyed by any string, and rules could match any field, so
a mistyped operation was silently denied and a mistyped field never
matched. `OpName` names the operations and the scope fields their rules
can match; the broker refuses anything else when loading its config,
and the module's typed `ops` and `match` options refuse it first, at
evaluation. The design doc shows a policy's per-operation settings and
each operation's fields.

`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 23:38:08 +00:00
jackos1998andClaude Opus 5.5 6933750dc5 ssh: Find deploy targets on the main branch
SSH targets are the deploy-rs nodes on the main branch, so adding a box
takes a commit there rather than a new broker config, and a target
can't drift from its node. 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. SSH therefore needs `deploy`.

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 23:38:08 +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 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 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