feat: per-session fork registry, connect-side serving loop, op/register (review 004 Units 1-3)
Remediates all six findings of review 004 (per-connection dispatch
resolution and client-side op serving). All claims re-verified in
source before remediation; F-02's member list gains ScopedPeerEnv
(also Clone — fork surface simpler than estimated).
- OperationRegistry: interior mutability (parking_lot RwLock on both
maps); register takes &self; registration/list_operations return
owned clones; fork() deep-copies registrations + cached publish-schema
validators (F-02/F-03); OperationRegistryBuilder::from_registry.
- install_bootstrap_discovery: services/list, services/list-peers,
services/schema registered closed over the fork itself, so
per-session openables are discoverable and services/schema answers
from the fork (F-06).
- Dispatcher::serve_single_stream: full-duplex single-stream loop —
call.requested dispatches inbound; responded/completed/error resolve
outbound pendings; aborted tries both tables (in-flight sink aborts
+ pending cascade); published routes inbound sinks (F-04).
- ChannelClient::from_connection_with_serving(connection,
Option<ServingConfig>): opt-in serving; from_connection keeps the
pure-consumer default.
- registry::op_register: OpRegisterRequest wire DTO (spec in
services/schema JSON + replace flag), op_register_spec,
op_register_handler (rebuild -> forwarding stub -> register_imported,
forced Internal/FromCall), announce_op; CallError::already_exists;
spec_to_json_pub; from_call's rebuild_spec_for + forwarding-handler
constructors crate-shared (F-05).
- ADR-047 §4 amendment #2: per-session fork is the dispatch-registry
mechanism; overlay stays nested-invocation/peer-announced landing
zone (F-01/F-02).
- ADR-022 amendment 2026-09-03: bootstrap-op set (services/list,
services/schema, op/register), opt-in connect-side serving, op/register
wire shape (F-04/F-05).
- alkhttp ADR-048 reconciliation note + OQ-05 re-pointed at the alkcall
ADRs (Unit 1b).
- Review 004 status -> remediated; remediation log with gates.
Verification:
- cargo test: 581 passed, 0 failed (565 baseline + 16 new)
- cargo test --all-features: 598 passed, 0 failed
- cargo clippy --all-targets -- -D warnings: clean
- cargo clippy --all-features --all-targets -- -D warnings: clean
- cargo clippy --target wasm32-unknown-unknown -- -D warnings: clean
- cargo fmt --check: clean
- cargo doc --no-deps: clean
Gates: fork_registry_open_op_resolves_and_is_discoverable (open op via
fork + services/list shows openable + services/schema validates),
serving_loop_hub_to_consumer_call_resolves (hub->consumer call through
consumer's serving loop, consumer->hub still resolves),
op_register_announce_then_hub_call_routes_back_to_consumer (announce ->
overlay -> hub call -> forwarding stub -> consumer serves).