You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fleet(#1376): FleetPlane generalization + resolver wiring in dispatch() and handleUpgrade() #1378
Problem — FleetPlane holds a single hub upstream and dispatch() branches on the binary shouldProxyAmicodeToHost. The D3 three-way resolver (resolveAmicodeTarget) is built and unit-tested but has zero production callers — attach flips a pointer nothing reads. Approach — Generalize FleetPlane with optional attached and keeper upstream slots; wire resolveAmicodeTarget into dispatch() and handleUpgrade() as a peer-only branch that leaves the client→hub path byte-intact. Scope — in: FleetPlane interface change, resolver call in dispatch() peer branch, resolver call in handleUpgrade() SSE path, empty-pointer→local fail-safe. out: attach/detach lifecycle (Slice 2), peer-unreachable posture (Slice 3), serving advertisement (Slice 4), e2e test (Slice 5).
dispatch() calls resolveAmicodeTarget for engine-armed (!client) machines in fleet mode; routes "local" → local engine, "keeper" → keeper upstream, "attached" → attached upstream
The client→hub branch (incl. #1261 hub-down 503) is byte-unchanged
handleUpgrade() applies the same resolver decision for SSE/WebSocket
Empty/corrupt pointer defaults to local engine (the resolver's fail-safe)
Existing fleet_client_relay and amicode_service_attachment_pointer test suites still pass
Testing Decisions
Extend fleet_client_relay.test.ts with a peer-branch test: mock an engine-armed, fleet-mode machine with an attached upstream set; assert dispatch() routes /amicode/roster to keeper and other /amicode/* to attached. Verify the client-branch tests remain byte-unchanged. Reuse the existing resolveAmicodeTarget unit tests (they already cover the D3 decision table).
Key Decisions
Dual-path dispatch. The resolver governs a NEW peer branch; the never-fork client→hub path is preserved byte-intact. The branch activates on !client && routingMode === "fleet" && attached.
Single slot, not N-keyed.attached is one optional HubProxy, not a Map — YAGNI for H1's singular pointer.
Constraints & Invariants
shouldProxyAmicodeToHost and the client branch remain byte-unchanged.
The #1346 additive-invariants gate passes.
/amicode/fleet/* never proxies (resolver guarantees local for that path).
Prior Art
The D3 resolver and its unit tests in attachment_pointer.ts.
The FleetPlane interface and dispatch() in server.ts.
The fleet_client_relay.test.ts suite.
Source
Part of #1376. References #1342 (multiplexing resolver) as the original slice.
Activity
fleet(#1378): FleetPlane attached/keeper slots + resolver wiring in d…
fleet(#1378): wire resolver into handleUpgrade() for peer-branch SSE/…
fleet(#1378): FleetPlane generalization + resolver wiring in dispatch…
fleet(#1378): FleetPlane generalization + resolver wiring in dispatch…
Fleet Studio #1485: production boundary parity + headless peer boot (#…