feat(call): initialize alknet-call crate skeleton (task: call/crate-init)

Create crates/alknet-call with Cargo.toml, lib.rs, and module skeletons
for the registry (spec, context, registration, env, discovery) and
protocol (wire, pending, connection, adapter, abort) subsystems. Add the
crate to the workspace members list. Depends on alknet-core (workspace
path), irpc (workspace dep), tokio, serde, serde_json, async-trait,
tracing, thiserror, uuid, and futures. Implements ProtocolHandler on
ALPN alknet/call per docs/architecture/crates/call.
This commit is contained in:
2026-06-23 13:45:14 +00:00
parent 968e3a09ee
commit e13a150d9f
16 changed files with 536 additions and 28 deletions

View File

@@ -0,0 +1,25 @@
[package]
name = "alknet-call"
version.workspace = true
edition.workspace = true
license.workspace = true
description = "Structured RPC over QUIC on ALPN `alknet/call`: operations, streaming subscriptions, service discovery"
repository.workspace = true
[lib]
name = "alknet_call"
[features]
default = []
[dependencies]
alknet-core = { path = "../alknet-core" }
irpc = { workspace = true }
tokio = { version = "1", features = ["full"] }
serde = { version = "1", features = ["derive"] }
serde_json = "1"
async-trait = "0.1"
tracing = "0.1"
thiserror = "2"
uuid = { version = "1", features = ["v4"] }
futures = "0.3"

View File

@@ -0,0 +1,10 @@
//! alknet-call: Structured RPC over QUIC — operations, streaming, service discovery.
//!
//! Implements [`alknet_core::types::ProtocolHandler`] on ALPN `alknet/call`.
//!
//! The crate has two subsystems:
//! - [`registry`] — operation specs, context, dispatch, and the operation registry.
//! - [`protocol`] — wire format, streams, and the call adapter.
pub mod protocol;
pub mod registry;

View File

@@ -0,0 +1,7 @@
//! Abort cascade logic for nested calls (ADR-016).
//!
//! When `call.aborted` arrives for a parent request, the protocol cascades
//! the abort to all non-terminal descendants in the call tree. Default
//! policy is `abort-dependents`; `continue-running` is an opt-in.
// TODO: implement

View File

@@ -0,0 +1,8 @@
//! `CallAdapter`: implements `ProtocolHandler` for ALPN `alknet/call`.
//!
//! Accepts bidirectional streams, reads `EventEnvelope` frames, and
//! dispatches `call.requested` events to the operation registry. See
//! `docs/architecture/crates/call/call-protocol.md` for the full
//! specification.
// TODO: implement

View File

@@ -0,0 +1,8 @@
//! `CallConnection`: an established `alknet/call` connection (either
//! direction — accepted or opened). Holds the connection's Layer 2 overlay
//! (imported ops).
//!
//! See `docs/architecture/crates/call/call-protocol.md` for the full
//! specification.
// TODO: implement

View File

@@ -0,0 +1,11 @@
//! Call protocol: wire format, streams, and the call adapter.
//!
//! Implements `ProtocolHandler` for ALPN `alknet/call` on top of the
//! operation registry. See `docs/architecture/crates/call/call-protocol.md`
//! for the full specification.
pub mod abort;
pub mod adapter;
pub mod connection;
pub mod pending;
pub mod wire;

View File

@@ -0,0 +1,7 @@
//! Pending request tracking: `PendingRequestMap` and `PendingEntry`.
//!
//! Correlates `call.responded` events back to the original `call.requested`
//! by request ID. See `docs/architecture/crates/call/call-protocol.md` for
//! the full specification.
// TODO: implement

View File

@@ -0,0 +1,7 @@
//! Wire format: `EventEnvelope`, `ResponseEnvelope`, `CallError`, and
//! length-prefixed JSON framing.
//!
//! See `docs/architecture/crates/call/call-protocol.md` for the full
//! specification.
// TODO: implement

View File

@@ -0,0 +1,7 @@
//! Operation context: `OperationContext`, `AbortPolicy`,
//! `CompositionAuthority`, and `ScopedOperationEnv`.
//!
//! See `docs/architecture/crates/call/operation-registry.md` for the full
//! specification.
// TODO: implement

View File

@@ -0,0 +1,6 @@
//! Service discovery handlers: `services/list` and `services/schema`.
//!
//! See `docs/architecture/crates/call/operation-registry.md` for the full
//! specification.
// TODO: implement

View File

@@ -0,0 +1,8 @@
//! Operation environment: the `OperationEnv` trait, `LocalOperationEnv`, and
//! `CompositeOperationEnv`.
//!
//! The composition dispatch trait — handlers compose child operations through
//! `OperationContext.env`. See
//! `docs/architecture/crates/call/operation-registry.md` and ADR-024.
// TODO: implement

View File

@@ -0,0 +1,12 @@
//! Operation registry: specs, handlers, access control, service discovery.
//!
//! Maps operation names to specs and handlers, enforces access control, and
//! dispatches `call.requested` events to local handlers. The registry is
//! layered by trust boundary (ADR-024): a curated layer (immutable after
//! startup) plus dynamic session and connection overlays.
pub mod context;
pub mod discovery;
pub mod env;
pub mod registration;
pub mod spec;

View File

@@ -0,0 +1,8 @@
//! Handler registration: `Handler`, `HandlerRegistration`,
//! `OperationProvenance`, `OperationRegistry`, and
//! `OperationRegistryBuilder`.
//!
//! See `docs/architecture/crates/call/operation-registry.md` for the full
//! specification.
// TODO: implement

View File

@@ -0,0 +1,7 @@
//! Operation specifications: `OperationSpec`, `OperationType`, `Visibility`,
//! `ErrorDefinition`, and `AccessControl`.
//!
//! See `docs/architecture/crates/call/operation-registry.md` for the full
//! specification.
// TODO: implement