Commit Graph
12 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 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
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 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 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 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 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