Pages polled `/api/version` every three seconds, then fetched the
pending list and replaced it, or reloaded a request's page. Now each
page follows one stream from `/events`, whose `morph` events carry a
region of the page: the pending list, or the request, as a whole
element with its `id`, rendered by the page's own templates. The page
script morphs it into the page with idiomorph, vendored, so open
details, the focus and typing stay.
The stream starts with the current region, so a page catches up when
the browser reconnects, and it ends when the approver signs out.
`/api/version` and `/pending` are gone.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The broker read what the builder built from its own store, which only
works while they share a box. Read it from the builder's store
instead, which also works when they do.
- Deploys and `slop build` copy `--from ssh-ng://` the builder's user,
and closure sizes are read there.
- The builder key's forced command serves `nix-daemon --stdio` for it.
- The store URL carries the builder's port and the broker's key: one
`NIX_SSHOPTS` serves both ends of a copy, and Nix puts the URL's
`-p` after it. So the builder's SSH options can only set a port.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
`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>
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>
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>
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>
A requester leaving cancelled the request, so the audit log said
"cancelled" while the activation it had started finished on the box.
Deploys now outlive their requester: the broker logs `detached`,
keeps waiting for the activations, and logs how they finished.
If the broker itself goes away, the activations still finish, and
their units are now named after the request ID
(`slop-deploy-<id>-<profile>`), so the audit record leads to their
journals.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Activation runs in a transient unit, but its output still went
straight back over the connection, and `activate-rs` panics when a
write fails. Deploying `palace` and `slop-cannon` together stopped
the broker, which dropped the connection to `slop-cannon` and left
its switch half done. The output now goes through a `cat` that gives
way to one discarding it once the connection is gone.
Switching also no longer restarts the broker, so it can deploy its
own box and report the result; a new version or configuration takes
effect at the next restart.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
`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>
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>
- The architecture gets diagrams of the boxes, the broker's parts and
the builder, and a deploy's sequence. The request lifecycle has the
steps every request takes, then each kind on its own, and the
protocol is shown as its types and fields.
- The design starts with what happens to each kind of request.
- Long bullets and steps become short nested bullets and tables.
- Each fact has one home: the design keeps behaviour and rationale,
and the architecture the code. The tests move to the architecture.
- `AGENTS.md`'s writing rules say so.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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>
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>
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>
`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>
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>
`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>
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>
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>
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>