modules: split services and the ircd link into external crates

nickserv, chanserv and the InspIRCd protocol move out of the binary into their
own workspace crates (fedserv-nickserv, fedserv-chanserv, fedserv-inspircd),
each depending only on fedserv-api. human_time and the branded account emails
move into the SDK crate so a module needs nothing from core; the engine keeps
its own inherent methods and builds emails via fedserv-api too. The bin now
constructs each module from its crate instead of an in-tree #[path] include.
Proves the SDK is self-sufficient: a third-party module is the same shape.
This commit is contained in:
Jean Chevronnet 2026-07-13 01:33:56 +00:00
parent 8ed1a9ab70
commit 596630df53
No known key found for this signature in database
52 changed files with 197 additions and 162 deletions

View file

@ -7,19 +7,25 @@ derived from any project's source.
## Design
The core lives in `src/`; the pluggable parts live in `modules/` (see
`modules/README.md`).
The core lives in `src/`. The pluggable parts are separate crates in a Cargo
workspace, each depending only on the `fedserv-api` SDK crate.
- **`api/`** (`fedserv-api`) the module SDK: the `Service`, `Protocol`, `Store`
and `NetView` traits a module implements or is handed, plus the normalized
`NetEvent`/`NetAction` vocabulary and the read views. It has no storage or
runtime dependencies, so a third-party module builds against it alone.
- **`src/engine/`** the services engine: live network `state`, the account store,
and the `Service` trait. The store is event-sourced: every change is an `Event`
appended to a per-node log, and state is a fold over that log.
and the log. The store is event-sourced: every change is an `Event` appended to
a per-node log, and state is a fold over that log. A service touches it only
through the `Store`/`NetView` traits, so the log, gossip and credential material
stay out of a module's reach.
- **`src/gossip.rs`** node-to-node replication over the logs.
- **`modules/protocol/`** the ircd link layer. A `Protocol` trait maps raw
server-to-server lines to and from a normalized `NetEvent`/`NetAction` model, so
the engine never touches a raw line and a new ircd is one new module. InspIRCd is
the first.
- **`modules/nickserv/`, `modules/chanserv/`** the pseudo-clients, one directory
each. OperServ and others follow the same shape.
- **`inspircd/`** (`fedserv-inspircd`) the ircd link layer. A `Protocol` impl maps
raw server-to-server lines to and from the normalized model, so the engine never
touches a raw line and a new ircd is one new crate.
- **`nickserv/`, `chanserv/`** (`fedserv-nickserv`, `fedserv-chanserv`) the
pseudo-clients, each a crate implementing `Service`. OperServ and others follow
the same shape.
## Replication