build.rs builds the string (git, or SLINUXM_* env for builds without .git)
and the lib exposes it as VERSION. --version, /healthz, /api/v1/ping, MCP
server info and OTel service.version use it; OpenAPI info.version stays on
the semver so docs/openapi.json does not change per commit. The flake passes
the commit date and short rev to the package.
Export the span through a capturing exporter and require SpanKind::Client,
so the contract is checked where a backend sees it, not only in the field
that carries it.
Validation runs at startup and on every reload, so the transport no longer
repeats the warning per peer on its first request; the helper is named for
the peer it reports.
Require the child's own listening line for the probed port before it is
signalled; a 200 from /healthz proves liveness only, since another slinuxm
answers it too. Retry a lost bind race instead of signalling a dead child,
and add a squatter that answers 200.
Log entry for the round and the hook-check port noted in the dated
Handoff, so the orchestrator knows why four files outside the F list
changed and what is left for the fold.
docs/consolidator.md: the Testing section described the pre-feature test
(no tests/peers.rs, the old tests.<system>.peers attribute, a note about
assertions failing by design) and is rewritten for both layers, the
module's eval check included. A shutdown subsection backs the README's
promise, the agenix examples say why a consolidator would bind 0.0.0.0
(remote callers; peers need no inbound port), and the VM test asserts
the chained-request status is exactly 400 as documented. README: token
rotation on NixOS also needs a reload for the LoadCredential copy.
Peer::spawn and Consolidator::start repeated the bind, pool, migrate,
mint and serve_listener sequence; serve(config, tls, prepare) does it
once and returns the handle, the token and whatever the caller prepared,
so the registry is installed before the router is built. The local
TempDir copy is gone in favour of peers::testing::TempDir, which already
does unique scratch dirs and mode-controlled writes.
The redirect test waited on a fixed sleep and a status that starts false;
it now waits for the health loop's own http_302 verdict before asserting
the Location target saw no connection. The peer cap asserts the message
rather than the bare number, and a chunked response (no Content-Length to
precheck) proves the byte count refuses an oversize body end to end.
The hand-written listener now distinguishes a complete reply, SSE headers
followed by a held socket and headers followed by one body byte every
300 ms. shutdown_ends_a_proxied_follow uses the held socket instead of a
real peer, so only shutdown can end the stream, and a new trickle case
proves the request deadline ends a slow-loris peer (503 timeout) rather
than the peer's goodwill. The silent-peer bound drops from 10 s to 4 s so
a missed 1 s deadline cannot hide inside it.
After F2 moved the peers test into checks, vm-steps still resolved peers
to tests.<system>.peers, so the documented command built nothing. Both
VM names now resolve under checks, the peers one renamed to vm-peers,
and a new self-check fails if a vm name stops pointing at .#checks.
nu dev/dev-test.nu self-check: ok.
The rebase dropped it, so the five hook/lint rust and shell checks that
main builds were silently missing from nix flake check. Merge them back
under the F2 additions (package, vm, vm-peers, module-peers).
A peer whose name resolves to both families but which listens on only one
of them was reported unreachable, which the documented 0.0.0.0 binding
produces on a dual-stack LAN and in the NixOS test network.
resolve_target now returns the whole address set (still refusing the name
if any address is denied), the HTTP client pins it with
resolve_to_addrs so the connector falls through to the next address, and
tcp_check tries each address in order with a per-attempt share of the
remaining deadline. ClientKey keys on the set.
Regression cover: a client test that resolves localhost against a
single-family listener, a tests/peers.rs case declaring the peer as
http://localhost:<port>, and the VM test's TLS peer gamma now binds
0.0.0.0 (IPv4 only) while alpha and beta stay dual stack. Docs and the
contracts section 10 address note describe the new behaviour.
The proxy validated the route without its API prefix and handed the
transport "/systemd/units", which a peer answered with 404. Validation
still works on the bare route; the transport now gets
"/api/v1/systemd/units". Un-ignoring the two acceptance tests
(a_plain_peer_serves_its_own_data_through_the_proxy and
shutdown_ends_a_proxied_follow) is the check for that fix; the unit
tests in api/, mcp/ and the registry script their fakes on the peer's
real paths again.
README peers section, docs/consolidator.md (threat model, tokens, firewall,
worked agenix example, reload/restart), the MCP tool count in both tables,
and config.example.toml commentary.
Real registry and transport against in-process peers and hand-written
listeners: plain, TLS with an rcgen CA, a wrong CA, redirects, oversize
bodies, a silent peer, the 64-peer cap and shutdown mid-follow. Two proxy
cases are ignored: the proxied path is missing its /api/v1 prefix.
The test nodes declare peers through the first-class module options, so
LoadCredential and RefreshOnReload come from the module. Every node binds
:: because the test network resolves node names to IPv6 first. poll()
raises with the last observed status JSON.
The config file now always stays a reload trigger, and the restart trigger
is the settings reduced to the keys the service cannot apply on SIGHUP, so
a peer edit reloads while a port, auth or limit change still restarts. The
first-class peers options win over the freeform bags, and the assertions
cover enabled peers, the 64-peer cap and LoadCredential-safe token paths.
The peer follow stream had no byte cap and kept a whole unterminated
frame in memory, and the MCP surface carried its own peer status table
that already disagreed with REST for peer 400.
- mcp::peers::fetch now returns proxy::PreparedResponse, so the status
comes from proxy::classify_status and the body from
proxy::prepare_response (peer byte cap, deadline, shutdown), the same
two steps REST uses. status_error, body_bytes and the local 2xx check
are gone.
- tail_journal consumes that prepared stream; a Frames cursor keeps a
partial frame from being rescanned from byte 0 on every chunk, the
entry cap truncates the result, and the end of the stream maps to the
note (entry cap, shutdown, byte cap, deadline or close).
- Prompts resolve the peer argument against the registry (unknown or
disabled peer is refused); list_peers returns the error registry()
produced; one wording for an unknown peer name.
- Tests: byte cap on an unterminated frame, entry cap, buffered body,
follow 404/500, deadline with an open stream, shutdown, frame cursor,
REST/MCP parity for peer 400/404/401/5xx, and a full golden snapshot of
the peers-off tool table. Peer scripts use the stripped path form C2
forwards.
Server instructions and the eight tool descriptions mention peers and the
untrusted-data rule only while a registry is configured. peers://status
returns the list_peers JSON and is advertised only then. diagnose_unit and
container_health_report take an optional validated peer argument.
The two status tools and the optional peer argument exist only when a
registry is configured. rmcp's disable_route hides the tools; the eight
shared schemas lose the optional peer property, and the two list tools also
lose the derived $schema key, so the peers-off list and schemas match a
build without the feature byte for byte. Both snapshot variants and the
wire-level tool list are asserted.
Peers resolve through PeerRegistry::get, the same entry point REST uses,
so the hop marker, allowlist and error mapping stay in one place. Log
tools keep the local {entries, truncated, note} shape; tail_journal
consumes the peer SSE stream. Tests cover every tool, path encoding,
error mapping and the integration path through the assembled router.
AGENTS.md said the same command works in an interactive shell, which only
holds inside devenv shell or direnv (the script is on PATH there).
docs/consolidator.md now says the filter cache sits at the repo root and that
a failing check raises a catchable error instead of closing the session.
source-mtime-key globbed src/**/*.rs from the cwd and the cache path was
relative, so completion started in a subdirectory (src/) failed the globs,
keyed the entry "unknown" and wrote <subdir>/target/... under a key that
never goes stale.
The globs (via glob, since ls only expands literal patterns) and the cache
path are anchored on the script's repo root, and an unusable key (unknown or
none) is neither read nor written. check-filter-cache now proves the key and
path are the same from src/ as from the root, and that an unknown key leaves
no file behind.
run-steps and self-check ended with exit 1. With use dev/dev-test.nu * in a
Nushell config, exit ends the caller's session and cannot be caught, so any
red dev-test unit|all|ci closed the terminal right after the summary.
run-steps and self-check now raise a catchable error; only the script-mode
entry point (main) exits, after printing the reason. check-module-mode guards
that: it rejects exit outside main, rejects (exit ...) interpolated into a
message (a subexpression that ends the process; the cargo-tree message had
one), catches a real failing step in module mode and requires script mode to
still exit non-zero.
Proxied journal/unit values now use the local unit-name helper instead of a
second, stricter check, so escaped units pass through as text, %5C or %5c.
The peer status table is one function shared with the transport, and the
segment/encoding cases left untested get allowlist and rejection cases.
Unit names go through the local route's validation, so escaped and
dash-rooted units work through the proxy; backslashes stay legal only
there. Response preparation (status classification, content-type check,
size/stream bounds) moves into proxy.rs for REST and MCP to share.
x-slinuxm-peer is only set for configured peers, proxied SSE is no-cache,
and the unreachable handler fallbacks are gone.