4.4 KiB
id, name, status, depends_on, scope, risk, impact, level
| id | name | status | depends_on | scope | risk | impact | level | |
|---|---|---|---|---|---|---|---|---|
| call/crate-init | Initialize alknet-call crate with Cargo.toml, dependencies, and module skeleton | completed |
|
moderate | low | project | implementation |
Description
Initialize the alknet-call crate from scratch. This crate implements the call
protocol (structured RPC over QUIC) on ALPN alknet/call. It depends on
alknet-core (for ProtocolHandler, Connection, AuthContext, Capabilities,
IdentityProvider) and irpc (for framing).
Crate setup
Create crates/alknet-call/ with:
Cargo.toml— package metadata, dependenciessrc/lib.rs— crate root with module declarations and re-exports- Module skeleton files for:
src/registry/mod.rs— registry module rootsrc/registry/spec.rs— OperationSpec, OperationType, Visibility, ErrorDefinition, AccessControlsrc/registry/context.rs— OperationContext, AbortPolicy, CompositionAuthority, ScopedOperationEnvsrc/registry/registration.rs— Handler, HandlerRegistration, OperationProvenance, OperationRegistry, OperationRegistryBuildersrc/registry/env.rs— OperationEnv trait, LocalOperationEnv, CompositeOperationEnvsrc/registry/discovery.rs— services/list, services/schema handlerssrc/protocol/mod.rs— protocol module rootsrc/protocol/wire.rs— EventEnvelope, ResponseEnvelope, CallError, framingsrc/protocol/pending.rs— PendingRequestMap, PendingEntrysrc/protocol/connection.rs— CallConnectionsrc/protocol/adapter.rs— CallAdapter (ProtocolHandler impl)src/protocol/abort.rs— abort cascade logic
Dependencies
| Crate | Purpose |
|---|---|
alknet-core |
ProtocolHandler, Connection, AuthContext, Capabilities, IdentityProvider, Identity, HandlerError (workspace path) |
irpc |
Framing, service dispatch (workspace dep) |
tokio 1 (full) |
Async runtime, sync primitives (oneshot, mpsc, watch) |
serde 1 |
Serialization for wire types |
serde_json 1 |
JSON wire format, JSON Schema values |
async-trait 0.1 |
OperationEnv trait (async fn in trait) |
tracing 0.1 |
Structured logging |
thiserror 2 |
Error enums |
uuid 1 |
Request ID generation (UUID v4) |
futures |
Stream trait for subscribe |
Workspace Cargo.toml
Add crates/alknet-call to the workspace members list in the root
Cargo.toml.
Module skeleton
// src/lib.rs
//! alknet-call: Structured RPC over QUIC — operations, streaming, service discovery.
//! Implements ProtocolHandler on ALPN `alknet/call`.
pub mod registry;
pub mod protocol;
// Re-exports (filled in by subsequent tasks)
Each module file gets a doc comment and // TODO: implement marker.
Acceptance Criteria
crates/alknet-call/Cargo.tomlexists with all dependenciescrates/alknet-call/src/lib.rsexists with module declarations- All module skeleton files exist (registry/, protocol/)
- Root
Cargo.tomlmemberslist includescrates/alknet-call cargo check -p alknet-callsucceedscargo clippy -p alknet-callsucceeds with no warnings- Dual licensing:
MIT OR Apache-2.0(workspace-inherited) - alknet-core dependency uses workspace path (
path = "../alknet-core")
References
- docs/architecture/crates/call/README.md — crate index
- docs/architecture/crates/call/call-protocol.md — CallAdapter, wire format
- docs/architecture/crates/call/operation-registry.md — registry, OperationEnv
- docs/architecture/decisions/003-crate-decomposition.md — ADR-003
- docs/architecture/decisions/005-irpc-as-call-protocol-foundation.md — ADR-005
Notes
alknet-call depends on alknet-core (for ProtocolHandler, Connection, AuthContext, Capabilities, IdentityProvider) and irpc (for framing). The crate has two subsystems: registry (operation specs, context, dispatch) and protocol (wire format, streams, adapter). The module structure reflects this split.
Summary
Created crates/alknet-call/ with Cargo.toml (deps: alknet-core path, irpc
workspace, tokio, serde, serde_json, async-trait, tracing, thiserror, uuid v4,
futures), src/lib.rs with pub mod registry / pub mod protocol, and 11
module skeleton files (registry: spec, context, registration, env, discovery;
protocol: wire, pending, connection, adapter, abort) with doc comments and TODO
markers. Added to workspace members. cargo check/clippy/fmt clean.
Merged to develop.