Huginn/crates/huginn-daemon/src/lib.rs
Eureka e35181b296 Desk door part A: the unix-socket door, peer uid checked before a byte is read, joined to the one serve loop
desk_door.rs owns who may speak, the socket's life and the frame bounds; Daemon::handle_desk owns which Mind method answers (Answer via desk_answer, the replay flag gating index.committed; Forks and Fork refused Unavailable until desk-door-reads). startup returns Started; run takes the door; its five callers pass it or None. desk_wire::answer_ref is the one spelling of a stored answer's ref.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-10 20:56:51 +00:00

31 lines
1.3 KiB
Rust

//! `huginn-daemon`: one process that serves one mind over CultNet.
//!
//! The crate owns four things and no rule. `startup` owns "may this process
//! serve this mind", by delegating to `Mind::open` and refusing before
//! anything listens. `index` owns when the mind's documents are embedded and
//! written to the vector store, off the serving path. `Daemon::handle` owns "which `Mind` method answers this
//! request": it dispatches, it asks `Mind::require_instance` for every read
//! that names an instance, and it compares nothing itself. `serve` owns "which
//! session gets which reply" and whether an answer is delivered whole, deferred or refused; `bodies`
//! owns how long and how much of a deferred answer is held.
//!
//! Every admission rule, the instance check, the receipt, the derived status
//! and the wire vocabulary are `huginn-mind`'s. The leaf and the store type
//! are reached through `huginn_mind`, so one crate pins one revision of each.
pub mod bodies;
pub mod daemon;
pub mod desk_door;
pub mod index;
pub mod serve;
pub mod sources;
#[cfg(test)]
mod desk_door_tests;
#[cfg(test)]
mod semantic_tests;
pub use daemon::{Daemon, Found, Handled, Hits, IndexSink, Search, SearchTicket, runtime_id};
pub use desk_door::DeskDoor;
pub use serve::{Options, ServeOptions, Started, parse_options, run, startup};