Skip to content

feat(daemon): remote admin socket protocol (roadmap-v0.6 F.2)#85

Merged
RNT56 merged 3 commits into
mainfrom
claude/v06-f2-adminsock
Jun 29, 2026
Merged

feat(daemon): remote admin socket protocol (roadmap-v0.6 F.2)#85
RNT56 merged 3 commits into
mainfrom
claude/v06-f2-adminsock

Conversation

@RNT56

@RNT56 RNT56 commented Jun 29, 2026

Copy link
Copy Markdown
Owner

Summary

Roadmap-v0.6 F.2 — an authenticated loopback/Unix socket so an operator (or a paired supervising agent) can query status and cancel/kill tasks without Telegram. New module crustcore_daemon::admin — the pure protocol core:

  • parse_admin_commandstatus / detail <id> / cancel <id> / kill <id> (dep-free text grammar; no JSON serializer linked into the daemon core).
  • frame / try_deframe[len: u32 LE][payload], bounded by MAX_ADMIN_FRAME (a hostile length is rejected before allocating — invariant 11).
  • authenticate — constant-length nonce compare; the startup nonce (~/.crustcore/admin.nonce, 0600) must match before any command is honored.
  • dispatch_admin — feeds the same owner-scoped request_cancel/request_kill path as Telegram (invariant 12); status/detail render a bounded snapshot.

CI core vs live seam

  • CI core (6 tests): command parsing; framing round-trip + partial-buffer + hostile-length rejection; nonce auth (match/mismatch/empty); owner-scoped cancel (wrong operator → no-op, right operator → acts); bounded status snapshot; unknown-task kill is a no-op.
  • Live seam (#[ignore], TODO(daemon-admin-live)): the real UnixListener/TCP-loopback bind + framed socket round-trip — daemon_admin_live_socket_smoke, runbook §F.4.

Trust boundary

Operator-only, never model-facing (invariant 5 — the model has no admin socket). Cancel/kill are owner-scoped, the exact gate Telegram uses (invariant 12). Everything bounded (invariant 11).

Tests run

cargo xtask verifygreen (runbook-check: 29 ignored seams + 20 tags). Nano unchanged at 53.5% (daemon-only). Independent off main.

🤖 Generated with Claude Code

Adds crustcore_daemon::admin — an authenticated operator control plane
(status / detail / cancel / kill) over a length-prefixed framed socket.

Pure protocol core: parse_admin_command, frame/try_deframe (bounded; a
hostile length is rejected before allocating — invariant 11), authenticate
(constant-length nonce compare; the startup nonce gates every command), and
dispatch_admin which feeds the SAME owner-scoped request_cancel/request_kill
path as Telegram (invariant 12). Operator-only, never model-facing
(invariant 5).

The real UnixListener (0600) / TCP-loopback bind is the #[ignore]d
daemon_admin_live_socket_smoke (TODO(daemon-admin-live)), in runbook F.4.
6 new tests; daemon-only; zero nano impact. `cargo xtask verify` green.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
RNT56 and others added 2 commits June 29, 2026 12:20
Adds serve_admin_connection<R: Read, W: Write>: the transport-agnostic admin
serve step — read a framed nonce, authenticate, read a framed command,
dispatch (owner-scoped), write the framed response — plus read_frame /
write_frame (bounded, EOF-clean). CI-tested over in-memory Cursor/Vec
buffers (status round-trip + wrong-nonce drop).

Now the only #[ignore]d inch is the thin UnixListener/TCP accept loop that
wraps serve_admin_connection per connection. 2 new tests; daemon-only; zero
nano impact. `cargo xtask verify` green.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@RNT56 RNT56 merged commit 9d84836 into main Jun 29, 2026
3 checks passed
@RNT56 RNT56 deleted the claude/v06-f2-adminsock branch June 29, 2026 21:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant