Three ADRs addressing gaps surfaced by the first hub consumer (alkapi): - ADR-067: Aggregated peer-env wiring — Dispatcher::with_aggregated_env hook so compose_root_env reads a shared PeerCompositeEnv across all calls, not a fresh per-call one. The hub-defining gap (alkapi OQ-08 / G.1). - ADR-068: PeerCompositeEnv::peer_operations override — adds list_operation_names() to OperationEnv, overrides on OverlayOperationEnv and PeerCompositeEnv. Fixes services/list-peers returning empty operation lists for non-local peers (alkapi G.6). - ADR-069: from_call is a manual free function, not auto-wired — reverses the aspirational OQ-27 resolution to match the implementation. Cleans the 'v1 default' hedging language in ADR-017 and client-and-adapters.md (alkapi G.4). New crate spec: alknet-hub — reusable hub pattern (aggregated env, connection lifecycle, worker supervision with backoff, service discovery). Spec fixes: builder API drift (with_local/with_local_streaming separation), ScopedOperationEnv → ScopedPeerEnv type name, OQ count 51→54. Three new OQs: OQ-52 (wait_for_close), OQ-53 (backoff defaults), OQ-54 (inbound hook placement).
1.1 KiB
1.1 KiB
OQ-54: Inbound Worker on_worker_connected Hook Placement
- Origin: crates/hub/README.md
- Status: open
- Door type: Two-way
- Priority: low
- Resolution: Not yet decided.
When a worker connects inbound (via CallAdapter::handle), the hub needs to
call from_call, register the bundles, and attach_peer. Two options:
- (a) Explicit: The assembly layer calls
hub.on_worker_connected()afterCallAdapter::handleaccepts the connection. The hub provides the method; the assembly layer wires it. - (b) Wrapper: The hub provides a
HubCallAdapterwrapper that calls the hook automatically insidehandle(). The assembly layer uses the wrapper instead of the rawCallAdapter.
Option (a) is simpler and more flexible — the assembly layer controls when the hook fires and can add its own logic (authorization checks, logging) before discovery. Option (b) is more convenient but hides the hook from the assembly layer.
The explicit approach is the committed interim. A wrapper is additive.
- Cross-references: ADR-067, ADR-068, crates/hub/README.md