With the egress intercept on, the forward chain rejects what `agent_allow`
does not hold, and `agent_allow` only held an agent's ssh connections. An
agent whose secret store, queue, logs or metrics endpoint is not on the
bridge was refused, so no agent started on a hive away from the swarm host.
hive-c0re's egress worker now also renders a `* <ipv4> <port>` line for each
endpoint URL it hands to agents (HIVE_AGENT_BAO_ADDR, HIVE_AGENT_LOGS_QUERY_URL,
HIVE_AGENT_METRICS_URL, HIVE_AGENT_NATS_URL), resolved like the ssh hosts.
`hive-priv egress-pin` expands a `*` line to the MAC of every agent port. An
older hive-priv skips the line, as it skips any unknown name.
Closes#6902
The container drop-in wrote MemorySwapMax=0 only next to a finite
MemoryMax=. A container with MemoryMax=infinity kept host swap, so a
container over its memory share paged out and every process that
touched a paged-out page slept in D, out of reach of a signal.
limits_dropin_body now writes MemorySwapMax=0 for every container. The
OOM killer inside the container's cgroup takes over: subagent runs
(+900) and bash tasks (+1000) die before the agent's own session
(-500), as before. Docs say so.
The editor stopped at 60em, and the claude login row packed the login and
the API key badges into one wrapping line. The width cap is gone, and the
API key has its own row beside the login's.
Part of the unification order in the UI sweep issue (step d, the rest).
The pull-request and issue reports (the repo list and the report), the review
try-out's repo list and classifier cap, and the classifier key move to the
shared read hook. A failed report still drops its rows, now by reading
'error ? null : loaded' instead of a handler that cleared them. The reads that
seed a draft, post, or are not a plain request stay as they were.
Part of the unification order in the UI sweep issue (steps e and f).
The terminal, turn-state and message feeds each opened an EventSource, tracked
connecting/open/reconnecting/closed, probed the session when the browser gave
up, and reconnected through an attempt counter. openStream (no Preact, source
injected, tested with a fake) and useEventStream now own that; each feed keeps
only what it does with a message.
A change confirmed itself three ways: a toast, inline, or nothing. The design
guide now says forms confirm inline, actions on a card in a refreshing list
confirm with a toast, and a change the page already shows says nothing. Fire
now, saving a schedule and removing an egress entry gain the toast they lacked.
Part of the unification order in the UI sweep issue (step d, first of three).
Twenty files hand-rolled the same effect: a cancelled flag, a fetch, the
problem body on a bad status, a catch that wraps the error. useResource does
it once on top of the poller's request discipline: it aborts the request in
flight when the inputs change or the page goes away, keeps the last good
answer under a failed read and clears the error on the next good one. The
agent details move to it (limits, linked accounts, ssh CA, permission
catalogue, allowed and denied domains). Hint drops its HintTone alias for the
shared Tone.
Part of the unification order in the UI sweep issue (step c).
The four header menus each kept their own open state, dismiss hook and a copy
of the popover CSS, and the copies had drifted (offset, padding, fade-in). A
shared HeaderMenu now owns the state, the dismiss rules and the popover look;
each menu supplies its button and its rows. The settings popover moves 0.15em
lower and the settings and alerts popovers gain the fade-in.
Part of the unification order in the UI sweep issue (step b).
A badge named its tones positive/warning/negative, a hint muted/warn/error/ok,
a banner info/warning/error and a toast info/ok/error. They now all take the
shared Tone: neutral, info, ok, warn, error (a badge adds accent for a selected
choice). Warn is amber everywhere (a hint used yellow), info is cyan everywhere
(a toast used purple). A test pins the list against each component's CSS.
z-index ran through eleven values (1 to 1100), border-radius through about
twenty and floating boxes had six different shadows, with no names, so each new
box picked its own. theme.css now defines --z-bar, --z-popover, --z-skip,
--z-modal, --z-toast, --radius-sm, --radius-md, --radius-pill and --shadow-pop,
and every stylesheet and the toast host use them. Corners and shadows move by
a pixel or two at most; the stacking order is unchanged. css-vars.md lists them.
Twenty save, link, create, send, run, load and log-in buttons changed their label to
"saving…" or similar while a request ran, so the button changed width under the
cursor. They now use Button's busy prop like the message box and the broadcast
dialog do: a spinner covers the label, which keeps its space. No behaviour
change; the buttons are disabled while busy as before.
A name or id that isn't valid percent-encoding (for example /agents/%E0%A4%A/terminal)
made decodeURIComponent throw while the page rendered, leaving a blank page. The
segment now stays as typed, as the agents page already did, so the page opens
(a terminal for that name, disconnected). A tested helper does the decoding.
Only a 404 means nothing is stored. Any other failed read used to leave an empty,
editable box with save enabled, so saving one line replaced a configuration that
was never read. The box now stays locked behind an error with a retry button.
The decision is a small tested function, and the swarm-ui doc describes it.
The page forwarded every key to the remote desktop and cancelled it, so F5 and
Ctrl+R could not reload, though the disconnect message tells the operator to
reload, and Enter or Space on the fit and debug buttons did nothing. F5, F12,
Ctrl/Cmd+R, Ctrl/Cmd+L and any key pressed on a button now go to the browser;
the rest still go to the remote desktop. The filter is a small module with a
test, bundled for the page as static/screen-keys.js, and the agent-page doc
describes it.
The dialog rendered its form even when closed, so every visit to the agents page
or the start page fetched the hive, permission and archetype lists, a half-filled
form was kept, and the hint to reopen the form for a fresh archetype list was
wrong. It now mounts per open. The summary lists the unrestricted internet box
like every other setting, and create another clears it with the rest. The
swarm-ui doc says both.
The shared tab-strip helper and its styles, the side-panel custom element, and the
dashboard's system-sections.css (rules for markup the job graph replaced) have no
importer or element left; AppShell took over the tab strip. Their package exports
and the two CSS imports go with them. The dashboard, agent and swarm-ui bundles
still build.
The alert read the per-hive degraded gauge, so it could not say which warning
raised it and sent the operator to a second alert. It now reads the critical
warning series, one instance per kind, and the summary names the kind. The
docs and the module-eval check follow. The message text is not in the alert,
only in the hive-c0re log.
Fire now was disabled on a paused schedule because the controller fires nothing
while it is paused. It is enabled now and, after a confirmation, sends the
schedule's message to its agents through the broadcast route, leaving the
schedule paused with its start unchanged. A toast says who got it, and the error
banner names the agents that did not.
A closed stream showed only a small red dot and a quiet badge in the top row, so
a terminal that had given up looked like a live one. The pill the operator types
in is now swapped for a red bar that says disconnected and holds the reconnect
button; the form stays mounted underneath so an unsent message survives. A
subagent terminal has no message box and keeps its reconnect badge.
The responder made one connect and ended on its first refusal. In a pod
the queue's own container starts beside it, and the responder's startup
(a store login and four key loads) can finish before the server listens,
so every new pod started with a crash and a restart that `RESTARTS`
could not tell from a real failure.
The client now connects in the background (retry_on_initial_connect),
with the library's own delays, and logs one warn line per failed
attempt, so a server that never comes up still shows in the log. The
health endpoint's /readyz already follows the connection state, so the
pod is not Ready until the responder is connected. The "connected" log
line moves to the connect event; the line after the subscribe says
"subscribed".
Closes#6841
The script test's stub gains the two remaining rows of bao's table: a
token with no access to the mount (403 on the preflight) and a store that
is not there. Both end with status 2 and an error on stderr, and both must
be errors, not an empty list.
swarm-archive-users and hive-archive-backup read "No value found" on
stderr to tell a prefix that holds nothing from an error. With
`kv list -format=json`, bao answers such a prefix with status 2, `{}` on
stdout and nothing on stderr, so on a swarm whose archive has no users
yet the unit failed every 30 seconds forever, and every switch reported
it.
store_list, in the shared store helper, prints the names as a JSON array
and `[]` for a prefix that holds nothing: failed, empty stderr, stdout
`{}`. It is not decided on status 2 alone, which a refused token, a
sealed store and an unreachable store end with as well (their error is on
stderr). The two scripts use it. The script test runs it against a stub
that answers as bao does, with controls for a refusal, a sealed store and
a warning beside an empty answer, and the archive VM test's stub no
longer prints the table format's message for a JSON list. full-setup
waits for the users file to be rendered on a fresh swarm.
Closes#6840
swarm-otel-sockets probes once at activation. On a fresh swarm the
collector opens its sockets only after authelia answers, which is after
the operator unseals the store, so the probe failed and stayed failed
after ingest worked: the only red unit on the swarm.
swarm-otel-sockets-recheck.timer now starts it again each minute, and
only while it is failed (an ExecCondition on systemctl is-failed), with
a restart that does not block. The check itself gets no Restart: a
oneshot's start job stays pending through an automatic restart, so a
switch would wait on it for as long as the collector is down, and the
failed check is what the switch reports. full-setup waits for the check
to be active after the collector has recovered, and the module-eval case
pins the timer, the condition and the absence of a Restart.
Closes#6836
The model list read swallowed every failure, so a swarm that timed out
answering /api/models looked the same as one with no models: the dropdown
held only the agent's own value and "other…", with nothing to say why.
The failure now shows as a warning with the controller's reason and a
retry button, and the answer is read through a parser that ignores any
shape but a list of names.
swarm-bao-agent-pki (the agent PKI mount, its root and role, and the
listener's trust in it, with the restart of openbao) and
swarm-bao-agent-ssh-policy (the agent SSH CA mount and its role) are
their own module, with the bindings only they use. The mount names, the
cached agent CA, the listener bundle and the unit timeouts the host
module also reads join lib/swarm-bao-shared.nix.
Refs #6820
main read the environment inline and held the per-repo pass, the
certificate gauges and the verdict, so none of it could run in a test.
Each is now a function with its inputs as arguments:
- Env::read takes a lookup closure in place of std::env (same read
order), var names a missing setting by its full variable.
- finish, skip_counts, wanted_repo, walk_done, trimmed and cert_gauges
hold the branches that were inline.
- A pass talks to the forge, the identity provider and the collector
through a Remote trait. Live is the daemon's HTTP implementation, and
the tests' stand-in answers from memory, so no test opens a socket.
- post_request builds the collector request and refused the refusal
text, so both are tested without a connection.
x509-cert becomes a dev-dependency (the workspace already pins it) for
the test certificate. Behaviour is the same.
Refs #6811
The 17 swarm-bao-*-policy units that write a service's own policy and
cert-auth role (Grafana, the collector, the queue and store responders,
the CI runner and poller, the classifier, the builder, the cache, the
archive, the claude login minter, the notification router, stt and the
forge publisher) are their own module, with the reader lists and the unit
shape they use. The stanzas, leaves and unit helpers the host module also
reads join lib/swarm-bao-shared.nix.
Refs #6820
swarm-bao.nix held 5,146 lines in one module. Move two pieces out, with
no change to what it renders:
- lib/swarm-bao-shared.nix: the bindings more than one concern reads
(the TLS directory, the granter's login and unit shape, the leaves
several grants name, the CLI wrapper). swarm-bao.nix and the sibling
modules import it and inherit what they use.
- swarm-bao-operator-viewer.nix: the store's browser-UI login (the
operator viewer policy, the oidc auth config and its role), gated as it
was on the store and its server certificate.
Refs #6820
GET /api/models listed the agent-inference bucket on every request with
keys(), which needs the nameless ephemeral consumer subject
CONSUMER.CREATE.KV_agent-inference. The controller's NATS grant had that
subject for the status, permissions and bash task buckets but not for
this one, so NATS refused the create and the client waited out its
timeout: the request hung every time.
The controller now follows the bucket with a watch that replays each
key's current value first, keeps each agent's models in memory beside the
reported ones, and answers the request from there without reading the
bucket. The grant adds the one create subject the watch needs, with a
policy test like the other buckets'.
main read the environment through closures built inline and held the
per-request admission and answer inside the receive loop, so none of it
could run in a test. Each is now a function:
- env_var and env_number read through a lookup closure in place of
std::env, and main wraps std::env::var.
- request_agent, admit and respond hold the admission and the answer of
one request; answer takes any Engine instead of Whisper.
- stored_value holds the check on the stored client secret.
Tests run settings, admission and answers against a fake engine.
Closes#6811
The inference section was one wrapping line of badges, with the CPU and
memory caps among them, and an edit button that opened the same fields in
a dialog. The editor is now the section itself: a line says what the
agent runs on now and where it comes from, and the fields sit in one row
where there is room, with save, reset and clear below. Unsaved edits are
kept per agent. The claude login and API key row stays below. The caps
are not inference settings, so they become a row of the access section.
On a busy agent the activity section grew long: the todos and bash tasks
ran to dozens of rows, and the subagents were one wrapping line of badges.
Each list now shows its first five rows with a "show all N" button;
expanded, the rows scroll in a bounded box. The subagents are one row each
(name, model and effort, state and age), running first and the rest dimmed,
as in the menu on the terminal page, and a picked subagent stays in view
when the list is folded.
The collector's and Grafana's OIDC delivery units exited 0 when the store
held no value, so systemd did not retry them. On a fresh swarm authelia's
mint writes the secret about 30 s after the first read, and only the
refresh timer, ten minutes on, read it again. Both units now exit 75, and
the store retry they already carry asks every 30 s until the mint lands.
Closes#6790