Watch
0
0
Fork
You've already forked hyperhive
0
Commit graph

7,072 commits

Author SHA1 Message Date
atlas
4a7df3f804 swarm-controller: agent permissions and inference take the settings sub-state 2026-11-30 18:16:28 +01:00
maia
8717e68021 swarm-nats-auth: the responder refuses to start under a server callout timeout its lookup bound does not fit 2026-11-30 17:32:51 +01:00
maia
31274ebf7f swarm-nats-auth: fix four doc comments, and record why the request goes unchecked
- request.rs pointed at module docs on main.rs for why the request signature
  is not verified; they said nothing. It now says why, here and in
  docs/4-implementation/swarm/credentials.md ("What authenticates a callout
  request"), and so do xkey::open and main.rs's module docs: only the
  responder's own key can publish to the request subject, a forger with a
  valid bearer gets what a normal connect gets, and nats-server makes a new
  xkey at each start and has no option to set it, so there is no key to pin.
  The guard is the module-eval case "the callout account has exactly one member
  and no system account is configured"; the docs say to revisit this if that
  changes.
- request.rs said base64url is written out rather than pulled in; it calls
  data_encoding, a direct dependency.
- respond.rs said `now` is injected into sign(); sign() takes no clock.
- oidc_secret.rs named swarm-bao.nix for natsAuthReaders; it is in
  swarm-bao-readers.nix.
2026-11-30 17:09:20 +01:00
maia
fd1761f105 swarm-authelia-bridge: refuse an EnsureAgentIdentity name the roster would drop
`handle` checked the store's username charset, which is wider than an agent
name's (it holds humans too: uppercase, `.`, `_`). The roster (`list`) keeps
only subjects that parse as an `Ident`, so `EnsureAgentIdentity("Atlas")`
wrote a user the roster then skipped for good.

Parse the name as an `Ident` first and refuse anything else, before the store
is touched. The refusal goes out the existing error path.
2026-11-30 17:09:06 +01:00
maia
61636cfcc2 swarm-metrics-auth: remember a "no bearer stored" answer for the cache TTL
When the store answered that it holds no usable bearer, the cache was reset
to its default, which forgot that the answer had just been asked for. Every
request after that started its own bao login and read, one at a time (up to
5 s each), so anyone sending `Bearer <64 hex>` before Grafana's bearer exists
queued Grafana's real requests behind those lookups, on a route with no rate
limit because the responder was said to read the store at most once per TTL.

Remember the answer for the TTL, as a stored bearer is, and deny without a
lookup until it passes (`empty_until`). A bearer that arrives ends it. The
"at most once per cache TTL" comments in swarm-victorialogs.nix and
swarm-victoriametrics.nix now also say the failure case, one lookup per few
seconds while the store does not answer.
2026-11-30 17:08:38 +01:00
maia
c815e0d59b swarm-logs-auth: one store login serves the credential and the grant
An uncached request read the agent's queue credential (swarm_agent_verify::
verify through Store::lookup) and then its permission grant
(Store::read_optional), and each read did its own bao cert login, so a cold
bearer cost two logins.

Add swarm_agent_verify::Store::connect, which logs in once and returns a
Connection that implements CredentialSource and reads any path. swarm-logs-auth
connects once per uncached request, bounded by the lookup timeout, and uses the
connection for both reads. A login that fails or times out denies the request
and reads nothing. Store's own per-read login stays for swarm-nats-auth.
2026-11-30 17:08:20 +01:00
maia
564842d332 swarm-victorialogs, swarm-victoriametrics: the four responders' socket directories admit only the service and nginx 2026-11-30 17:06:32 +01:00
maia
17057e4258 swarm-nats-auth: a callout lookup is cut off at the request's exp 2026-11-30 17:06:02 +01:00
maia
72d1e181e3 swarm-nats-auth: refuse a credential that is already over by our clock
The user JWT's exp is min(credential exp, now + 1h) with no floor at now.
When this responder's clock is ahead of the identity provider's, a token the
provider calls active can already be over here: the minted JWT then has
exp <= iat, the server refuses the client, and the log says granted=true.

Check respond::outlives(now, expires) before granting. A credential that is
over at now gets the same denial as an inactive token, and the refusal is
logged with the credential's expiry and now (granted=false on the request
line). grant() takes the now the check used, so the JWT it mints and the
check can't disagree.
2026-11-30 15:59:53 +01:00
maia
4dc0d57954 swarm-authelia-bridge-sock: say that every verb is controller-only
The ListOperators doc said every other verb admits any active token and this
one is refused to other callers. The bridge's classify admits only the
controller's client id, for all three verbs, and answers any other active
token 403, as the README says. The doc understated the restriction.
2026-11-30 15:59:26 +01:00
maia
071e4b1717 swarm-logs-auth, swarm-metrics-auth: say which requests each one is sent
swarm-logs-auth's module doc said nginx sends it every /select/logsql/
request. The log store's nginx map sends it only `Bearer swarm-agent.`
requests; Grafana's 64-hex bearer goes to swarm-metrics-auth and everything
else to authelia. swarm-metrics-auth's said it was the metrics store's
responder for Grafana, but the same binary also guards the log store. Both
docs now describe the routing the nginx maps in swarm-victorialogs.nix and
swarm-victoriametrics.nix do.
2026-11-30 15:59:04 +01:00
atlas
c79c894ebe swarm-controller: set_agent_state takes the placement sub-state and the forge 2026-11-30 14:09:06 +01:00
atlas
00e143fe7b swarm-controller: agent schedules and limits take a settings-only sub-state 2026-11-30 13:56:40 +01:00
atlas
5616b221b8 swarm-controller: the agents status handler takes two narrow sub-states 2026-11-30 13:56:00 +01:00
iris
c0f6118c78 swarm-ui: an open agent's details close with a cross in the identity card
The "← agents" button sat on a row of its own above the card and read as a
stray control, and "back" was the wrong word beside a visible list. The card's
top line now ends in a close cross (the shared Badge with the close icon, as in
the group page's panes), at every width. A name the roster doesn't have keeps
the "← agents" button, since there is no card to carry the cross.
2026-11-30 12:45:37 +01:00
atlas
9b19fbe398 swarm-controller: placement sub-state for create_agent, get_hive_wanted, post_agent_custom 2026-11-30 12:41:11 +01:00
atlas
78a59f1e79 swarm-controller: agent I/O and reader handlers take narrow sub-states 2026-11-30 12:40:34 +01:00
maia
5079eb58d0 swarm-secret-client: name the store-answer mappings and test them
Each optional read, listing, delete, SSH CA read, alias lookup and versioned
read in SecretStore decided what a 404 (or a 400, or an empty 204) means
inline, next to the vaultrs call. Move those decisions into small functions
(none_when_absent, empty_when_absent, done_when_absent, ssh_ca_key,
entity_from_lookup, versioned) and the cert-role policy write's request into
set_cert_role_policies_request. Behaviour is unchanged.

Test them with constructed ClientError values: 404 is nothing there, every
other status (400, 403, 429, 500, 503) stays the store's error with the
status in the message, a blank SSH CA key is none, an empty alias answer is
a miss and any other parse failure is not, a versioned read keeps the number
and time and a wrong-shaped object is an error. Also pin the cert-role read
structs and the paths the grant names.

The vaultrs call lines themselves stay unit-uncovered by design; the VM tests
drive them against a real bao.
2026-11-30 12:40:17 +01:00
atlas
1d19836cd6 swarm-controller: the review handlers take a review-only sub-state 2026-11-30 11:20:52 +01:00
flake-bot
8eed02ab92 nix flake update 2026-11-30 10:27:32 +01:00
atlas
98341e24a6 swarm-controller: the forge webhook takes two narrow sub-states 2026-11-30 03:46:26 +01:00
atlas
0fd9847363 swarm-controller: the notify handlers take a status-only sub-state 2026-11-30 02:43:19 +01:00
atlas
52bfca85ad swarm-controller: git_forge read handlers take a forge-only sub-state 2026-11-29 14:02:12 +01:00
atlas
b184f4e096 swarm-controller: secrets handlers take their own sub-state via FromRef 2026-11-29 14:01:44 +01:00
atlas
c3773828c9 swarm-controller: builder-runs handlers take their own sub-state via FromRef 2026-11-29 12:51:29 +01:00
atlas
a8c1c0f5c2 swarm-controller: ssh-connection handlers take their own sub-state via FromRef 2026-11-29 12:37:33 +01:00
atlas
c43c35e05b swarm-controller: archetypes handler takes its own sub-state via FromRef 2026-11-29 12:37:11 +01:00
atlas
de78daf6dd swarm-controller: hives handlers take their own sub-state via FromRef 2026-11-29 12:36:51 +01:00
atlas
871438afcc swarm-controller: forge-admin handlers take their own sub-state via FromRef 2026-11-29 12:36:21 +01:00
atlas
53382d9c78 swarm-controller: config-pr handlers take their own sub-state via FromRef 2026-11-29 06:26:15 +01:00
atlas
37ba403992 swarm-controller: bash-task handler takes its own sub-state via FromRef 2026-11-29 06:18:28 +01:00
flake-bot
04a2dbf13a nix flake update 2026-11-29 06:16:04 +01:00
maia
93ccd11bf3 hive-matrix: tuwunel's database open logs RocksDB's own messages
tuwunel hands RocksDB's log to its own logger at `rocksdb_log_level = "error"`,
so the recovery and flush lines of a database open never reached the journal:
a replay that has run for hours looked the same as a wedged open. The module
sets `rocksdb_log_level = "info"` and `rocksdb_log_stderr = true`, which writes
them to stderr, past tracing's filter.

The comment on the unit's start limit said the 30 minutes bound the open.
They don't: tuwunel sends `EXTEND_TIMEOUT_USEC` every 15 s whether or not the
open advanced, so only a stop ends a wedged one. The comment and the handbook
say so.

Refs #6885
Closes #6981
2026-11-28 17:08:09 +01:00
atlas
b9687c54f2 swarm-controller: alerts and jobq-graph handlers take their own sub-state via FromRef 2026-11-28 09:50:47 +01:00
flake-bot
b7650259c9 nix flake update 2026-11-28 09:49:02 +01:00
maia
c12e231d32 fix(matrix): the deferred starter logs the state its boot ended in
A degraded guest still starts the services, and now the journal says so next
to the start. The VM test pins the line.
2026-11-28 09:48:50 +01:00
maia
3919de6358 fix(matrix): queue tuwunel's start after the guest's boot is over
The deferred starter was a oneshot that ran `systemctl start --no-block
tuwunel` inside the boot transaction. A --no-block start still queues a
start job, so the guest's job queue stayed non-empty for as long as
tuwunel's start took, and the container (Type=notify, --notify-ready=yes,
one minute) never reported ready and was killed at its limit.

The starter is now Type=simple, so its own start job ends at the fork. It
waits for `systemctl is-system-running --wait` and only then queues the
service. The VM test waits for the daemon to reach `activating` instead of
asserting it the moment the container's start ends.
2026-11-28 09:48:50 +01:00
atlas
19640f3bf8 container-deferred-start: assert the control unit's end state instead of reset-failed 2026-11-28 09:48:50 +01:00
atlas
ba0f9c6264 start tuwunel after the container is up, under its own 30 min limit 2026-11-28 09:48:50 +01:00
iris
7ae1b42fd9 swarm-ui: an agent icon loads when it scrolls into view
Every card fetched its icon on page load, so a roster of 80 made 80 requests
before the first scroll. The image is lazy now; the first screen's still load at
once.
2026-11-28 09:48:36 +01:00
iris
c1d182daa0 swarm-ui: the two retry buttons that said try again say retry
Eight failed reads offer a retry button; the claude login dialog and the
instructions editor worded the same action try again.
2026-11-28 09:48:24 +01:00
iris
f6a0bb4bb3 swarm-ui: the three toasts that didn't match read like the rest
Two toasts started with a capital and ended with a full stop (the stored login
dialog's and the login delete's), and the API key removal had no tone. They are
short lowercase phrases with the ok tone now, and the design guide says so.
2026-11-28 09:48:07 +01:00
iris
963ec65bbc swarm-ui: a toast waits while the pointer is on it
A toast left after four seconds (eight for an error) whether it had been read or
not. The countdown stops while the pointer rests on it and runs on for at least
1.5 seconds after the pointer leaves.
2026-11-28 09:47:54 +01:00
iris
868b8743d8 swarm-ui: the browser chrome takes the theme's background colour
The theme-color meta was a fixed mauve, so a phone's status bar and an installed
app's title bar stayed mauve under every theme, light ones included. The theme
effect sets it from the computed --bg after each change, and again when the OS
scheme changes under auto.
2026-11-28 09:47:36 +01:00
iris
bcb432caf4 swarm-ui: three press targets show a hover state
The selection bar's link buttons, an expandable card's head and a toast all take
the pointer cursor and gave no other sign. The links underline on hover and
focus, the head tints its title, and the toast darkens its border.
2026-11-28 09:47:13 +01:00
damocles
73ef63a5e5 matrix daemon: stay up when the primary account is down and say why in the tools 2026-11-28 09:46:56 +01:00
iris
9fdde2ec63 swarm-ui: menus, popovers, toasts and dialogs fade in, with one motion guard
Dialogs, toasts, popovers, dropdowns and the filter popover appeared with no
transition, and the header menu had a keyframe of its own. theme.css holds
--enter and --fade, off under reduced motion and the motion setting's reduce,
and each floating box uses them.
2026-11-28 09:46:32 +01:00
iris
fdeb95a61b shared: buttons answer hover, press and keyboard focus
.ui-button had a pointer cursor and nothing else: no hover, no pressed state and
no focus style of its own. Each variant gets a hover fill, a press nudge and a
purple focus ring, with the transition off under reduced motion.
2026-11-28 09:46:01 +01:00
iris
76d2c5e788 swarm-ui: a finished bash task and a stale subagent read in the muted colour
Both rows dimmed with opacity: 0.6, which took their muted id and age to 2.65:1
on the page. They use the muted colour now, which holds 4.7:1.
2026-11-28 09:45:37 +01:00
iris
c77904362d swarm-ui: an agent card is no longer a button around buttons
The card row had role=button and tabindex=0 and held the terminal button, the
wanted menu and the login button, which axe reports as nested interactive
controls and which a screen reader can't walk. The row is no control now; the
agent's name is a real button, so Tab, Enter and Space open the agent, and a
press anywhere on the card still does. Picking stays one checkbox per card.
2026-11-28 09:45:23 +01:00