Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
144 commits
Select commit Hold shift + click to select a range
0ed63a8
busbar-plane-streaming: the plane's door, the tool-call relay, the on…
MattJackson Oct 2, 2026
dc9c253
busbar-plane-streaming: one live session as the driver serves it, its…
MattJackson Oct 2, 2026
fef12b5
busbar-plane-streaming: the plane answers each loop step through the …
MattJackson Oct 2, 2026
edf60f2
busbar-plane-streaming: the door both-ways proof in tests/conformance…
MattJackson Oct 2, 2026
72094f0
busbar-plane-streaming: one request unit as the route pump drives it;…
MattJackson Oct 2, 2026
8b5a201
busbar-voice and busbar-plane-streaming: one import group, ClientRela…
MattJackson Oct 2, 2026
5b4b0d5
busbar-plane-streaming door: published on P1's SDK, loaded through P1…
MattJackson Oct 2, 2026
8ac0cff
door-only: busbar-voice names no busbar_plane_streaming item outside …
MattJackson Oct 2, 2026
0d2b01e
rustfmt (voice mount.rs import indent, echo.rs import order) and Carg…
MattJackson Oct 2, 2026
7b9d769
busbar-voice mount: the realtime protected-resource handler is protec…
MattJackson Oct 2, 2026
27d43f0
busbar-plane-streaming door: the one-request doors (mint, SDP offer, …
MattJackson Oct 2, 2026
3d61a79
streaming fold: the streaming plane's door is linked on the plane-doo…
MattJackson Oct 2, 2026
efd763a
streaming fold: the piece answer stays the streaming door's own (no c…
MattJackson Oct 3, 2026
f46a956
QUESTIONS: PIECE-HOME struck (ARCHITECT): line count is no CI check (…
MattJackson Oct 3, 2026
6317345
busbar-plane-streaming: a request unit's plane state is opened (Reque…
MattJackson Oct 3, 2026
5d3d46e
busbar-voice: the protected-resource route's unreachable 500 names th…
MattJackson Oct 3, 2026
74df4c5
$ streaming telephony: the caller speaks the carrier's envelope, so i…
MattJackson Oct 3, 2026
6d548dc
TODO STREAMING: the telephony finding is fixed by this lane's $ commi…
MattJackson Oct 3, 2026
5e302a5
streaming fold ported onto p3-serve-hookstage: the door's needs state…
MattJackson Oct 4, 2026
b470534
streaming door: a live session is answered through the door in the dr…
MattJackson Oct 3, 2026
7dc241a
busbar-plane-streaming door: the per-session fee unit, the route the …
MattJackson Oct 4, 2026
5e56468
packaging: the ws framer's door is opened on the one Connector (trans…
MattJackson Oct 4, 2026
c6eeac1
Merge remote-tracking branch 'origin/predev' into p3-flip-streaming
MattJackson Oct 4, 2026
d4d5660
Merge remote-tracking branch 'origin/p3-plane-seam' into p3-flip-stre…
MattJackson Oct 4, 2026
dc22414
busbar-plane-streaming door on SEAM-ABI: DialectAuth.params absent (t…
MattJackson Oct 4, 2026
02c5666
busbar-transport-ws pinned at 5f0b51273a (GetBusbar/busbar-transport-…
MattJackson Oct 4, 2026
5258535
busbar-transport-ws pinned at 9050227f89 (GetBusbar/busbar-transport-…
MattJackson Oct 4, 2026
38729e4
ROUTE (ARCHITECT Q-L5B-ROUTE 2026-10-03; lane-dg-streaming 5b8f14583d…
MattJackson Oct 4, 2026
680dd93
Merge remote-tracking branch 'origin/predev' into p3-flip-streaming
MattJackson Oct 4, 2026
4e4e1c1
Merge origin/p3-plane-seam (SEAM-KERNEL 66caaff6ae) into p3-flip-stre…
MattJackson Oct 4, 2026
4a1e4d3
busbar-plane-streaming door: providers is a consumed section, not a r…
MattJackson Oct 4, 2026
748ac2b
Merge remote-tracking branch 'origin/p3-plane-seam' into p3-flip-stre…
MattJackson Oct 4, 2026
11e2e90
busbar-plane-streaming door: outbound needs in the provider egress cl…
MattJackson Oct 4, 2026
350c5e4
Merge remote-tracking branch 'origin/p3-plane-seam' into p3-flip-stre…
MattJackson Oct 4, 2026
13a056b
Merge remote-tracking branch 'origin/p3-serve-hookstage' into p3-flip…
MattJackson Oct 4, 2026
e49e803
Merge remote-tracking branch 'origin/predev' into p3-flip-streaming
MattJackson Oct 5, 2026
80e44f3
the streaming fold's switch swaps the legacy row out (linked-swaps): …
MattJackson Oct 5, 2026
c10f563
busbar-plane-streaming door: the protected-resource metadata path is …
MattJackson Oct 5, 2026
cda00b9
root registry test: the session wire is linked with a session plane, …
MattJackson Oct 5, 2026
0976068
Merge remote-tracking branch 'origin/p3-plane-seam' into p3-flip-stre…
MattJackson Oct 5, 2026
72c07d7
conformance (transport script): a dial names its target and may open …
MattJackson Oct 5, 2026
de34fe4
conformance (transport script): the emit's YIELD_MORE re-call complet…
MattJackson Oct 5, 2026
31c8e6d
conformance (transport script): a dial's far bytes may close it (dial…
MattJackson Oct 5, 2026
2d9c3cc
busbar-transport-ws pinned at acf3011931 (GetBusbar/busbar-transport-…
MattJackson Oct 5, 2026
4f839b9
Merge remote-tracking branch 'origin/p3-plane-seam' into p3-flip-stre…
MattJackson Oct 5, 2026
c1c1c56
Merge remote-tracking branch 'origin/p3-plane-seam' into p3-flip-stre…
MattJackson Oct 5, 2026
30fe659
busbar-plane-streaming door: a one-request door's answer is whole and…
MattJackson Oct 5, 2026
6b9ca18
Merge remote-tracking branch 'origin/p3-plane-seam' into p3-flip-stre…
MattJackson Oct 5, 2026
deb114d
Merge remote-tracking branch 'origin/p3-plane-seam' into p3-flip-stre…
MattJackson Oct 5, 2026
b3523ee
Merge remote-tracking branch 'origin/p3-plane-seam' into p3-flip-stre…
MattJackson Oct 5, 2026
a4131f2
Merge remote-tracking branch 'origin/p3-seam-ledger' into p3-flip-str…
MattJackson Oct 5, 2026
c853959
Merge remote-tracking branch 'origin/p3-plane-seam' into p3-flip-stre…
MattJackson Oct 5, 2026
56fc984
busbar-transport-ws pinned at a6787c0245 (GetBusbar/busbar-transport-…
MattJackson Oct 5, 2026
d7e283a
Merge remote-tracking branch 'origin/p3-plane-seam' into p3-flip-stre…
MattJackson Oct 5, 2026
0feee14
Merge remote-tracking branch 'origin/p3-plane-seam' into p3-flip-stre…
MattJackson Oct 5, 2026
5a9e151
Merge remote-tracking branch 'origin/p3-plane-seam' into p3-flip-stre…
MattJackson Oct 5, 2026
e02c9ae
Merge remote-tracking branch 'origin/p3-seam-ledger' into p3-flip-str…
MattJackson Oct 5, 2026
e861cb2
FLIP-STREAMING: plane-streaming is the streaming door's plane-door ro…
MattJackson Oct 5, 2026
da09e91
Merge remote-tracking branch 'origin/p3-seam-ledger' into p3-flip-str…
MattJackson Oct 5, 2026
d545f2c
Merge remote-tracking branch 'origin/p3-plane-seam' into p3-flip-stre…
MattJackson Oct 5, 2026
244d2b6
FLIP-STREAMING: the legacy busbar-voice crate is deleted, and the str…
MattJackson Oct 5, 2026
52070db
FLIP-STREAMING: the session pump's test module imports Bytes itself; …
MattJackson Oct 5, 2026
8b4e717
Merge remote-tracking branch 'origin/p3-seam-ledger' into p3-flip-str…
MattJackson Oct 5, 2026
c3bc2a2
FLIP-STREAMING: the streaming door's cancel slot states PlaneCancelIn…
MattJackson Oct 5, 2026
91bf9be
FLIP-STREAMING: the gates' legacy-plane rosters strike busbar-voice, …
MattJackson Oct 5, 2026
f896f64
FLIP-STREAMING: rulings Q3/Q4/Q7 — the census floor drops by ledgered…
MattJackson Oct 5, 2026
1b51c7a
FLIP-STREAMING: Q5 — a plane door's Statement DECLARING section feeds…
MattJackson Oct 5, 2026
286f308
FLIP-STREAMING: Q1 — the root-voice leg is the streaming door served …
MattJackson Oct 5, 2026
d2da888
Merge remote-tracking branch 'origin/p3-seam-ledger' into p3-flip-str…
MattJackson Oct 5, 2026
f21c099
FLIP-STREAMING: Q8 — ws composes over nothing and is entered by adopt…
MattJackson Oct 5, 2026
899f59f
FLIP-STREAMING: the streaming door's root cells use the key's data-pl…
MattJackson Oct 5, 2026
6c6f82c
FLIP-STREAMING: the root's session-door cells find the door by the au…
MattJackson Oct 5, 2026
3e99851
WIP: voice conformance harness re-homed onto the streaming plane's do…
MattJackson Oct 5, 2026
05c5ced
voice conformance rig: legs re-homed onto the streaming plane's door …
MattJackson Oct 5, 2026
acff2f4
Merge remote-tracking branch 'origin/predev' into p3-flip-streaming
MattJackson Oct 5, 2026
7a51e4e
FLIP-STREAMING: serve_door is carried wherever the node axis is (no u…
MattJackson Oct 5, 2026
48b36ae
config-schema snapshot: the decisions door's declared section is fing…
MattJackson Oct 5, 2026
a292646
serve_door: the session-door finder answers the bound Plugin<Plane>
MattJackson Oct 5, 2026
faf5fb6
Merge remote-tracking branch 'origin/p3-reach-door' into p3-flip-stre…
MattJackson Oct 5, 2026
9bd2a58
reachability: the streaming roster row is the door plane busbar-plane…
MattJackson Oct 5, 2026
a9ceac7
voice_conform: clippy (auto-deref, contains); xtask infra test: the p…
MattJackson Oct 5, 2026
af8a6ec
Merge remote-tracking branch 'origin/p3-fs-rig' into p3-flip-streaming
MattJackson Oct 5, 2026
e46935b
ws battery: a dialled connection is read for its life (attach_reader)…
MattJackson Oct 5, 2026
7265da9
busbar-transport-ws pinned at 119ef7af47 (transport-ws#13 head: the f…
MattJackson Oct 5, 2026
9d76175
Merge origin/predev (08802be123) into p3-flip-streaming
MattJackson Oct 6, 2026
b88ca40
RELEASE_REF and the oracle pin move to busbar-release 30d072960a (#16…
MattJackson Oct 6, 2026
553fc18
export conformance test host: dest_judge takes the flags word (the la…
MattJackson Oct 6, 2026
0456742
merge fallout: the late-attach record-store test opens the build's li…
MattJackson Oct 6, 2026
0466268
Merge origin/p3-seam-ledger (9ac6031e6c) into p3-flip-streaming: SEAM…
MattJackson Oct 6, 2026
2f01831
voice conformance harness: its own testkit crate (testing/voice-confo…
MattJackson Oct 6, 2026
8fc138c
Merge origin/predev (6e463893cc, #481 p3-suite-ext) into p3-flip-stre…
MattJackson Oct 6, 2026
2b4c8c8
single-plane legs: the registration scan's non-vacuity floor is four …
MattJackson Oct 6, 2026
5a39958
Merge origin/predev (ca9ce1ac4f, #495 p3-breaker-fact) into p3-flip-s…
MattJackson Oct 6, 2026
5897c63
streaming door validate reads the stage-3g deal: {streams: <section>}…
MattJackson Oct 6, 2026
e0eb1a8
golden/1.6.0-pre: the two streams cells whose far-end request leads w…
MattJackson Oct 6, 2026
5a7f77f
RELEASE_REF and the oracle pin move to busbar-release dev 1869c0032e …
MattJackson Oct 6, 2026
01a5977
Merge origin/predev (d985405c71) into p3-flip-streaming: CHANGELOG ke…
MattJackson Oct 6, 2026
4862e7e
Merge origin/predev (15b3f7e84c, #475 SEAM ledger) into p3-flip-strea…
MattJackson Oct 6, 2026
9afb185
FLIP-STREAMING selftests: the include! dual-compile plant names a pla…
MattJackson Oct 7, 2026
be08f1d
Merge origin/predev (214678af59) before the push
MattJackson Oct 7, 2026
b9374f6
Merge origin/predev (ad3cae9731) before the push
MattJackson Oct 7, 2026
ec78eef
Merge origin/predev (dc60715e83) into p3-flip-streaming: busbar-voice…
MattJackson Oct 7, 2026
fbb3d66
Merge origin/predev (70776f1d36: #517, #497 FLIP-DECISIONS, #467, #51…
MattJackson Oct 7, 2026
a9eebf9
root leg: the streaming door's root cells live in root/tests/serve_te…
MattJackson Oct 7, 2026
472a7a7
Merge origin/predev (2bbe362dbd, the Plane trait states no approve an…
MattJackson Oct 7, 2026
4dd50b5
Merge origin/predev (e107253904, #484 P5 extract-pinned and #537) int…
MattJackson Oct 7, 2026
ed6ee60
Merge origin/predev (39374ec00e) into p3-flip-streaming: busbar-voice…
MattJackson Oct 9, 2026
8d5bb02
Merge remote-tracking branch 'origin/predev' into p3-flip-streaming
MattJackson Oct 9, 2026
3be9ad8
pre-flight: fmt / lock / abi header
MattJackson Oct 9, 2026
51e1dae
streaming door: state no stream ceiling (stream_ceiling_secs: 0) in i…
MattJackson Oct 10, 2026
b1a1b57
Merge remote-tracking branch 'origin/predev' into p3-flip-streaming
MattJackson Oct 10, 2026
08fe75a
FLIP-STREAMING CI fixes: merge seams with predev's census, door-secti…
MattJackson Oct 10, 2026
1c628b0
Merge remote-tracking branch 'origin/predev' into p3-flip-streaming
MattJackson Oct 10, 2026
9bec273
pre-flight: fmt / lock / abi header
MattJackson Oct 10, 2026
16963ef
FLIP-STREAMING CI fixes: refusal-collapse scan reads the streaming do…
MattJackson Oct 10, 2026
57efdee
Merge remote-tracking branch 'origin/predev' into p3-flip-streaming
MattJackson Oct 10, 2026
fc78123
Merge origin/predev into p3-flip-streaming: keep busbar-voice deleted
MattJackson Oct 10, 2026
48b5cbc
Merge branch 'predev' into p3-flip-streaming
MattJackson Oct 10, 2026
809d672
FLIP-STREAMING reds: the root names no streaming vocabulary, the puri…
MattJackson Oct 10, 2026
4ee6919
Merge branch 'predev' into p3-flip-streaming
MattJackson Oct 10, 2026
b2897a2
Merge origin/predev into p3-flip-streaming: keep busbar-voice deleted
MattJackson Oct 10, 2026
f5e1d6e
FLIP-STREAMING reds: scan floors re-measured after busbar-voice's del…
MattJackson Oct 10, 2026
e96945c
Merge origin/predev into p3-flip-streaming: tracing SCAN_FLOOR keeps …
MattJackson Oct 10, 2026
d4c414f
Merge branch 'predev' into p3-flip-streaming
MattJackson Oct 11, 2026
1eefecc
Merge branch 'predev' into p3-flip-streaming
MattJackson Oct 11, 2026
c1f2b54
Merge branch 'predev' into p3-flip-streaming
MattJackson Oct 11, 2026
bce41f5
busbar tests: DoorReach gets catalog: None; provider_routes takes the…
MattJackson Oct 12, 2026
2bc6a9e
Merge origin/predev (1617e9f019) into p3-flip-streaming: busbar-voice…
MattJackson Oct 12, 2026
4dc7c00
kind-isolation: the kernel names no deleted plane crate; standing low…
MattJackson Oct 12, 2026
d034e7f
streaming door: an authentication refusal reads in the dialects' vend…
MattJackson Oct 12, 2026
60859b1
Merge origin/predev (62fdbdf3bc) into p3-flip-streaming
MattJackson Oct 12, 2026
7bb3dae
root tests: the session door's cells are a cfg on the build, never a …
MattJackson Oct 12, 2026
19c6180
root tests: the session door's cells sit under one cfg each file (sec…
MattJackson Oct 12, 2026
15cf97e
kind-isolation: busbar x plane pinned at the merged tree's 808 (805 +…
MattJackson Oct 12, 2026
4bc361d
merge predev into p3-flip-streaming
MattJackson Oct 13, 2026
fa62d8e
merge predev into p3-flip-streaming
MattJackson Oct 13, 2026
d8967ff
merge predev into p3-flip-streaming
MattJackson Oct 13, 2026
5db9e15
merge predev into p3-flip-streaming
MattJackson Oct 13, 2026
adbbdaf
Merge remote-tracking branch 'origin/predev' into HEAD
MattJackson Oct 13, 2026
a85c402
session door consumers read predev's three-field dialect_auth (dialec…
MattJackson Oct 13, 2026
fb719ed
Merge origin/predev (235e1a3f28) into p3-flip-streaming: qa/kind-isol…
MattJackson Oct 13, 2026
6bd5d1b
Merge origin/predev 05cad81f8c into p3-flip-streaming
MattJackson Oct 13, 2026
51520b5
Merge predev 6d5642b2bb into p3-flip-streaming (#503)
MattJackson Oct 14, 2026
f05708d
planes: streaming joins the kind-only roster, so a vanished streaming…
MattJackson Oct 14, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -405,6 +405,11 @@ Each of these is an owner-accepted difference from 1.5.5: additive, or strictly
series by their labels; a histogram's or summary's lines stay together in their usual order
(buckets ascending, then `_sum`, then `_count`). Every name, label and value is unchanged, and
the order served is one 1.5.5 could already print.
- **The streaming plane serves the protected-resource metadata its challenge points at.** A caller
refused at a realtime door is pointed at
`<public_url>/.well-known/oauth-protected-resource/v1/realtime`, and nothing served that path. It
now answers the RFC 9728 document: the plane's audience as `resource` and
`bearer_methods_supported: ["header"]`, the same document the MCP route serves.
- **A wedged hook comes back.** A hook that wedged is no longer lost until restart: it is
quarantined, backed off from 1 s doubling to 30 s, and then given one trial call on a fresh
instance, and a successful trial returns it to service. 1.5.5 had no quarantine to exit.
Expand Down
38 changes: 13 additions & 25 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ members = [
"crates/busbar-core-oauth2",
"crates/busbar-llm",
"crates/busbar-a2a",
"crates/busbar-voice",
"crates/busbar-contract",
"crates/busbar-kernel",
"crates/busbar-kernel-identity",
Expand All @@ -26,6 +25,7 @@ members = [
"crates/busbar-transport-stdio",
"crates/busbar-transport-webrtc",
"testing/ws-conformance/subject",
"testing/voice-conformance/harness",
"xtask",
]

Expand Down
13 changes: 6 additions & 7 deletions crates/busbar-kernel/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -190,13 +190,12 @@ plane-mcp = ["egress-seam", "jsonrpc-ingress", "dispatch"]
# other relocated `#[cfg(feature = "plane-a2a")]` sites now live in substrate, so this must turn the
# substrate marker on with it.
plane-a2a = ["egress-seam", "egress-stream", "card-signing", "jsonrpc-ingress", "relay"]
# THE NEUTRAL INBOUND WS-ACCEPT CAPABILITY — arms the core-side `mount_ws_arrivals` seam (router.rs)
# that mounts a plane's gauntlet-gated inbound-WebSocket arrivals. NAMES NO PLANE: any duplex plane
# (streaming today, a future telephony/stream plane tomorrow) turns on the same capability. Forwards to
# substrate's neutral `runtime` (which arms `axum/ws` + the `duplex_ws` acceptor and the `WsArrival`
# newtype/registry). OFF by default and pulled ONLY by the binary's `plane-streaming`, so the default/shipped
# money-path build carries no `axum/ws` edge (no tokio-tungstenite/sha1/base64) and this seam is
# compiled out entirely — byte-identical assembly, strong-form deletable.
# THE NEUTRAL INBOUND WS CAPABILITY — arms the core-side duplex session mount (router.rs,
# `mount_plane_session`) that answers a door plane's session upgrade. NAMES NO PLANE: any duplex
# plane turns on the same capability. Forwards to the neutral `runtime` (which arms `axum/ws` and the
# `duplex_ws` acceptor). OFF by default and pulled ONLY by the binary's `plane-streaming`, so the
# default/shipped money-path build carries no `axum/ws` edge (no tokio-tungstenite/sha1/base64) and
# this capability is compiled out entirely — byte-identical assembly, strong-form deletable.
duplex-ws = ["runtime"]
# The neutral capability markers. `dispatch`/`relay` gate the `#[cfg]`/dead-code-allowance sites in
# this crate's engine source; `runtime` arms the full-duplex WS transport (client handshake +
Expand Down
4 changes: 4 additions & 0 deletions crates/busbar-kernel/src/config/config-schema.snapshot.json
Original file line number Diff line number Diff line change
Expand Up @@ -433,6 +433,10 @@
"optional": true,
"type": "ConfigMgmtCfg"
},
"decisions": {
"optional": true,
"type": "DeclaredSections"
},
"export": {
"optional": true,
"type": "ExportDefs"
Expand Down
42 changes: 1 addition & 41 deletions crates/busbar-kernel/src/egress/tests/duplex_ws_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -578,7 +578,7 @@ async fn dial_refuses_unpinned_and_guard_failing_targets() {
);
}

// ── THE INBOUND WS-ACCEPT ARRIVAL SEAM (WsArrival newtype + accept_gauntlet + registry) ──────────
// ── THE GAUNTLET-GATED WS ACCEPT (accept_gauntlet) ───────────────────────────────────────────────

use std::sync::atomic::{AtomicUsize, Ordering};

Expand Down Expand Up @@ -664,46 +664,6 @@ async fn accept_gauntlet_refuse_returns_refusal_and_spawns_zero_socket_tasks() {
);
}

/// THE WS-ARRIVAL SPEC + PROCESS REGISTRY round-trip: a plane declares a `WsArrivalSpec` (the neutral,
/// single-compiled seam carrying the substrate-owned `WsArrival` newtype BY VALUE — never `Box<dyn
/// Any>`), the composition root installs it, and the core router drains it VERBATIM. Witnesses the R1
/// seam shape (spec is constructible with a by-value accept fn) and the install/take registry.
#[test]
fn ws_arrival_spec_installs_and_drains_verbatim() {
use crate::ingress::duplex_ws::{
install_ws_arrivals, take_ws_arrivals, WsArrival, WsArrivalSpec,
};
use busbar_contract::abi::mechanism::route::RouteAuth;

let spec = WsArrivalSpec {
path: "/v1/duplex/{id}".to_string(),
auth: RouteAuth::Key,
slot_key: "test-duplex-plane",
// The accept fn takes the newtype BY VALUE — the single-compiled `WsArrival`, never a box — and
// is ASYNC (returns a `WsAcceptFuture`) so a plane runs its pre-upgrade hooks before the upgrade.
accept: std::sync::Arc::new(|_a: WsArrival| {
Box::pin(async move {
axum::response::Response::builder()
.status(axum::http::StatusCode::NOT_IMPLEMENTED)
.body(axum::body::Body::empty())
.expect("response builds")
}) as crate::ingress::duplex_ws::WsAcceptFuture
}),
};
install_ws_arrivals(vec![spec]);
let drained = take_ws_arrivals();
assert_eq!(drained.len(), 1, "the installed arrival drains verbatim");
assert_eq!(drained[0].path, "/v1/duplex/{id}");
assert_eq!(drained[0].slot_key, "test-duplex-plane");
assert!(matches!(drained[0].auth, RouteAuth::Key));
// Read-many: a second drain still yields the same installed set (the router may build twice).
assert_eq!(
take_ws_arrivals().len(),
1,
"take is read-many, not destructive"
);
}

// ── THE DIAL CREDENTIAL: on the upgrade request only, in no error ─────────────────────────────────

use crate::egress::duplex_ws::{CredentialPlacement, DialCredential, DialTarget};
Expand Down
101 changes: 0 additions & 101 deletions crates/busbar-kernel/src/ingress/duplex_ws.rs
Original file line number Diff line number Diff line change
Expand Up @@ -255,104 +255,3 @@ where
serve_messages(stream, sink, plane).await;
})
}

// ─────────────────────────────────────────────────────────────────────────────────────────────
// THE INBOUND WS-ACCEPT ARRIVAL SEAM — the neutral, substrate-owned vocabulary a plane DECLARES an
// inbound gauntlet-gated WS-accept route through, and the process registry the composition root
// installs those declarations into for the core router to drain. The plane names only this neutral
// seam; the CORE-side `mount_ws_arrivals` (behind `duplex-ws`) mounts a real WS-accept route per
// spec and hands the plane's accept fn a [`WsArrival`] by value. NONE of this is a `PlaneReqCtx` /
// `PlaneRouteSpec` field, so the always-compiled request path names no WS type (money-path byte-
// identity), and the upgrade is a substrate-owned newtype carried BY VALUE (never `Box<dyn Any>`), so
// there is no dual-compile `TypeId` trap.
// ─────────────────────────────────────────────────────────────────────────────────────────────

/// THE SUBSTRATE-OWNED NEWTYPE the WS upgrade rides on across the accept boundary — NEVER
/// `Box<dyn Any>`. Single-compiled in substrate, so its type identity is the same in both dual-
/// compiled core instances (no downcast, no `TypeId` to diverge). Carries the upgrade BY VALUE plus
/// the verbatim per-request facts the plane's accept fn needs to build its `GauntletRequest` and open
/// its session — sourced from the SAME extractors the non-WS adapter reads, but assembled by the WS-
/// aware core mount. The only type-erased field is `slot`, the already-proven-safe plane-slot crossing
/// the non-WS `PlaneReqCtx::slot` already uses.
pub struct WsArrival {
/// The axum WS-upgrade extractor the route received. The ONLY way to consume it into a live socket
/// is [`serve_gauntlet`] / [`accept_gauntlet`]; a plane's accept fn never calls a bare `on_upgrade`.
pub upgrade: WebSocketUpgrade,
/// The middleware-resolved governance request context (`None` on a `RouteAuth::None` route).
pub gov: Option<busbar_contract::records::PlaneRequestCtx>,
/// The middleware-resolved auth principal (`None` on a `RouteAuth::None` route).
pub principal: Option<busbar_contract::auth::AuthPrincipal>,
/// The resolved caller principal id, lifted from `gov` — the identity a plane binds session state to.
pub caller_principal: Option<String>,
/// The request path this route was matched at.
pub path: String,
/// The full request URI (path + query).
pub uri: axum::http::Uri,
/// The request headers.
pub headers: axum::http::HeaderMap,
/// Any path-template captures (`{name}` → value), in match order.
pub path_params: Vec<(String, String)>,
/// The neutral engine host, minted core-side over the request's live engine snapshot.
pub host: Arc<dyn crate::plane_host::EngineHost>,
/// The plane's own per-generation runtime slot (the same `Arc<dyn Any>` the plane's `build` produced),
/// captured by the core mount from the router's `plane_slots` and cloned into every arrival.
pub slot: Arc<dyn std::any::Any + Send + Sync>,
}

/// The finished-`Response` FUTURE a [`WsAcceptFn`] returns — ASYNC (the mirror of the data-plane
/// `PlaneRouteFuture`), so a plane's accept fn can run its `async` operator hooks (gate/tap) BEFORE the
/// upgrade, exactly as the one-shot request path does, and still return the 101 (or a pre-upgrade
/// refusal) as its resolved value.
pub type WsAcceptFuture = std::pin::Pin<Box<dyn std::future::Future<Output = Response> + Send>>;

/// ONE PLANE'S WS-ACCEPT HANDLER: a neutral fn that receives a [`WsArrival`] BY VALUE and returns a
/// finished axum [`Response`] (as a [`WsAcceptFuture`]). It MUST reach [`serve_gauntlet`] /
/// [`accept_gauntlet`] internally (the only path that consumes the upgrade into a live socket); it never
/// sees a bare `on_upgrade`. `Arc` so the core mount clones it into the per-request axum closure it
/// wires. ASYNC so the plane runs its pre-upgrade admission (operator hooks + the destination gauntlet)
/// before any socket binds — a hook/gauntlet refusal resolves to a pre-upgrade refusal Response.
pub type WsAcceptFn = Arc<dyn Fn(WsArrival) -> WsAcceptFuture + Send + Sync>;

/// ONE WS-ACCEPT ARRIVAL a plane DECLARES: the exact path, the admission bar recorded VERBATIM in the
/// `CoreRouteTable` (identical shape to `PlaneRouteSpec::auth`, so the auth middleware enforces it
/// BEFORE the accept fn), the neutral accept fn, and the plane's registry `slot_key` so the core mount
/// resolves the live per-generation slot to carry on each [`WsArrival`] (exactly as the non-WS adapter
/// resolves it from `plane_slots`). Names only `axum`, `busbar_contract` and this crate —
/// no plane token, so adding a duplex plane is a new-crate-only diff.
#[derive(Clone)]
pub struct WsArrivalSpec {
/// The exact axum path pattern this WS-accept route is mounted at.
pub path: String,
/// The admission bar the core auth middleware enforces BEFORE the accept fn runs.
pub auth: busbar_contract::abi::mechanism::route::RouteAuth,
/// The plane's registry decl key — the core mount looks the live runtime slot up under it and,
/// when absent (the plane is unconfigured this generation), mounts nothing, exactly as the non-WS
/// route loop skips a plane with no slot.
pub slot_key: &'static str,
/// The neutral accept fn the core mount hands a [`WsArrival`], returning the finished response.
pub accept: WsAcceptFn,
}

/// THE PROCESS-WIDE INSTALLED WS ARRIVALS — set once by the composition root
/// ([`install_ws_arrivals`]), read (cloned) by the core router at build ([`take_ws_arrivals`]). A
/// `OnceLock<Vec<_>>`, mirroring `ingress::arrival::install_path_ingress`: the composition root
/// ASSEMBLES it from whichever duplex-plane crates are linked, install-once + read-many so a test that
/// builds several routers each mounts the same arrivals.
static INSTALLED_WS_ARRIVALS: std::sync::OnceLock<Vec<WsArrivalSpec>> = std::sync::OnceLock::new();

/// INSTALL THE INBOUND WS-ACCEPT ARRIVALS — the composition root's one write, mirroring
/// [`crate::ingress::arrival::install_path_ingress`]. First-writer-wins (idempotent): a second call is
/// ignored rather than panicking, so a test harness that composes twice does not abort. Only the
/// composition root (or a test) calls this; a build with no duplex plane never does, and
/// [`take_ws_arrivals`] then yields nothing.
pub fn install_ws_arrivals(arrivals: Vec<WsArrivalSpec>) {
let _ = INSTALLED_WS_ARRIVALS.set(arrivals);
}

/// DRAIN (by clone) THE INSTALLED WS-ACCEPT ARRIVALS — the core router's one read at build. Returns an
/// empty vec when no duplex plane installed any, so the router mounts no WS-accept route (byte-
/// identical assembly). Cloning (not taking) keeps it read-many so repeated router builds are stable.
#[must_use]
pub fn take_ws_arrivals() -> Vec<WsArrivalSpec> {
INSTALLED_WS_ARRIVALS.get().cloned().unwrap_or_default()
}
4 changes: 2 additions & 2 deletions crates/busbar-kernel/src/plane_host/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2920,8 +2920,8 @@ pub trait ContainerGateSink: PlaneSlots {
}

// ─────────────────────────────────────────────────────────────────────────────────────────────
// D3 WITNESS — the gauntlet siblings COEXIST and share ONE `admit_open` gate. (That `begin_session`
// actually CALLS `run_gauntlet_session` at its call site is pinned in busbar-voice's topology tests.)
// D3 WITNESS — the gauntlet siblings COEXIST and share ONE `admit_open` gate. (That a session
// open actually CALLS `run_gauntlet_session` at its call site is the serving door's to pin.)
// ─────────────────────────────────────────────────────────────────────────────────────────────
#[cfg(test)]
#[path = "tests/gauntlet_session_tests.rs"]
Expand Down
7 changes: 4 additions & 3 deletions crates/busbar-kernel/src/plane_host/tests/mod_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -660,9 +660,10 @@ fn stale_host_ctx_through_a_real_vtable_slot_fails_closed() {
/// 1. It admits ANY JSON object as the replacement. It does not know, and cannot check, the TYPE the
/// receiving plane will decode into. For MCP and A2A the target is `serde_json::Value`, so bytes
/// core commits always parse and their "output I cannot read back" arms are unreachable through
/// this host. For `busbar-voice` the target is `SessionConfig`, which rejects `{"voice": 7}` as a
/// type mismatch — so THAT plane's arm is genuinely reachable through core's real host, and its
/// refusal (`busbar_voice::mount::committed_session_config`) is a live fix, not a dormant one.
/// this host. For a session plane the target is a typed session configuration, which rejects
/// `{"voice": 7}` as a type mismatch — so THAT plane's arm is genuinely reachable through
/// core's real host, and its refusal (its door's `committed_session_config`) is a live fix,
/// not a dormant one.
/// 2. The commit is a WHOLESALE REPLACEMENT, not a merge. A hook that names one field produces
/// `arguments` carrying ONLY that field — every other key the caller (or the plane's own lock)
/// had is gone from the committed bytes. A plane whose target type defaults its absent fields
Expand Down
Loading