feat/server-admin-channel #65

Merged
xavier merged 8 commits from feat/server-admin-channel into dev 2026-11-20 10:54:09 +01:00
Owner
No description provided.
ADR-032's channel: internal/server/adminchannel — the listener (unix at <data-root>/admin.sock by default, stale-socket unlink, mode 0600; the TCP form), the op surface (issue|list|remove|rotate|ping, one JSON request per connection, answers in the shared envelope discipline — the machine codes verbatim, no new codes; unknown op/version typed with the remedy rendered; ping echoes version + data root), and the client half (Call, Ping). Server.Serve gains the admin leg: the handler calls the machineregistry + auditlog in-process (serve the single writer), drained before the stores close. serveComposition brings the channel up beside the wire and announces it.

Co-Authored-By: Xavier's assistant <assistant@gijoe88.com>
The four machines verbs probe the channel first (ping-gated): dial answered ⇒ hot, serve does the writing, the notice 'via the admin channel (serve running)'; dial refused (absent or stale) ⇒ the direct open, the restore cadence, 'direct (restore cadence, no serve)' — automatic, never silent. ping's echo consumed: a channel answering from a foreign data root is the typed mispointed refusal (E_ADMIN_MISMATCH, composition-root code per the E_ONBOARDING precedent); a typed skew answer renders its remedy, never a fallback; post-connect failures are loud and final (the act may have landed). --admin-channel on serve and the verbs alike, one flag both sides. Hot rows identical to cold (actor operator, machines/<subject>) — serve appends them in-process. The lock refusals' remedies retitled to the restore cadence; the live probes reworked to ADR-032's truth (the superseded lock-refusal pins now pin the hot path), Phase F's census carries the hot-issued machine.

Co-Authored-By: Xavier's assistant <assistant@gijoe88.com>
Unit pins (internal/server/adminchannel): the machine codes ride verbatim (E_MACHINE_NAME/E_DUPLICATE_MACHINE/E_UNKNOWN_MACHINE, kind domain — no new codes), unknown op/version typed E_MALFORMED_REQUEST with the remedy rendered, ping echoes version + data root verbatim, the hot rows land identical to cold (actor operator, machines/<subject>, list appends nothing), the audit gap keeps the answer and names audit.db, the unix lifecycle (0600, stale unlink, non-socket clobber guard, close unlinks), Resolve's grammar, a live Call round-trip, Serve drains and unlinks on cancel. Live probes (cmd/skuld, the acceptance floor): the FIRST machine against a RUNNING fresh server — no stop — the fresh token serving over the wire; rotate/remove hot (created_at intact, the second removal E_UNKNOWN_MACHINE verbatim); a SIGKILL crash's stale socket taking the restore cadence with the notice; ping's surface and the skew answers raw; the mispointed channel refused E_ADMIN_MISMATCH naming both roots; the second serve still refused fast on the lock (what keeps the stale-unlink honest); envelopeRejection's mapping. Found and fixed on the way: the hot helpers wrapped Call's typed rejection as a transport failure — callOp unwraps EnvelopeError at the seam, codes render exit-1 verbatim.

Co-Authored-By: Xavier's assistant <assistant@gijoe88.com>
Co-Authored-By: Xavier's assistant <assistant@gijoe88.com>
Listen stored the pre-bind spec, so an ephemeral --admin-channel tcp://127.0.0.1:0 announced an unusable port-0 address; the listener now records net.Listen's bound address as its truth — the announce and the notices name the real port. (Tester finding 2, verified hot end to end.)

Co-Authored-By: Xavier's assistant <assistant@gijoe88.com>
The drain sat in a defer that ran after the four store closes: an in-flight verb completed against closed bbolt and answered E_INTERNAL 'database not open' (tester's RED, live-reproduced). The drain is now straight-line after the select, before closeEngines on every return path — the graceful signal and a wire failure while the channel lives — so in-flight verbs complete or fail whole against live stores, only then the files close. Pins: the unit pin holds a gated op across cancellation (the answer rides whole, Serve returns only after it) and the live pin reproduces the tester's shape — a request held mid-decode across SIGTERM, completed inside the drain window: ok with the fix, the not-open leak against the old ordering (verified RED before landing). Also the TCP-announce live probe: serve --admin-channel tcp://127.0.0.1:0 announces the real bound port and ping to it answers the data root.

Co-Authored-By: Xavier's assistant <assistant@gijoe88.com>
Co-Authored-By: Xavier's assistant <assistant@gijoe88.com>
server-admin-channel: the socket is born 0600 — the umask wraps the bind; the TCP refusal leg always asserts
All checks were successful
/ secrets-scan (gitleaks 8.28.0, all refs, redacted) (pull_request) Successful in 6s
/ test (linux/amd64, full suite) (pull_request) Successful in 1m53s
/ alias (re-point latest, main pushes only) (pull_request) Has been skipped
/ build linux/amd64 (pull_request) Successful in 1m10s
/ build darwin/amd64 (pull_request) Successful in 1m12s
/ build windows/amd64 (pull_request) Successful in 1m15s
/ build darwin/arm64 (pull_request) Successful in 1m17s
/ build linux/arm64 (pull_request) Successful in 1m9s
/ build windows/arm64 (pull_request) Successful in 1m8s
/ release (six binaries + checksums.txt, tag pushes only) (pull_request) Has been skipped
/ image (the release container, tag pushes only) (pull_request) Has been skipped
aa489abc13
Reviewer folds. (1) The umask window is closed the sshd way: the process umask is tightened to 0o177 around the bind (build-split unix/windows/other per the filestore lock precedent), so the socket is BORN 0600 — the chmod-after window ceases to exist, and the masking chmod is gone with it; Windows keeps the DACL inheritance as the born posture (ADR-032 point 7). Pin: TestUnixSocketBornMode — under a permissive umask 022 the socket must stat 0600 immediately after Listen and the process umask must be left as found. RED-verified honestly: on the pre-fix shape the pin fails 'socket born -rwxr-xr-x under umask 022' (the parent's chmod-after masked the window from after-the-fact assertion; the scratch exposed the window's actual mode — the shape a local process could connect through). (2) TestTCPForm's taken-bind leg no longer races an ephemeral release: a live listener HOLDS its bound port and the second Listen on that exact address must refuse loudly, naming it — the leg always asserts.

Co-Authored-By: Xavier's assistant <assistant@gijoe88.com>
xavier deleted branch feat/server-admin-channel 2026-11-20 10:54:09 +01:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
assistant/skuld!65
No description provided.