feat: complete dual-seat whole-vehicle orchestration

This commit is contained in:
vee
2026-08-12 15:12:40 +08:00
parent 32379a1573
commit 9ce64b3a01
62 changed files with 9741 additions and 3950 deletions
@@ -166,18 +166,35 @@ class FrontendVehicleStateSyncContractTests(unittest.TestCase):
{"climate": state["climate"]},
)
def test_ch1_mode_never_polls_the_legacy_ch0_seat_endpoint(self) -> None:
sync_source = function_source(
def test_dual_channel_runtime_polls_each_seat_without_aliasing(self) -> None:
passenger_source = function_source(
self.app_source,
"async function synchronizePassengerSeatState() {",
"\nasync function synchronizeDriverSeatState()",
)
driver_source = function_source(
self.app_source,
"async function synchronizeDriverSeatState() {",
"\nasync function synchronizePhysicalSeatState()",
)
combined_source = function_source(
self.app_source,
"async function synchronizePhysicalSeatState() {",
"\nasync function loadAuthStatus()",
)
guard = sync_source.index(
'target_policy === "ch1_body_can_driver_only"'
self.assertIn("state.runtime?.hardware?.configured", passenger_source)
self.assertIn("/api/hardware/seat-state", passenger_source)
self.assertIn("/api/hardware/vehicle-state", driver_source)
self.assertLess(
combined_source.index("synchronizePassengerSeatState()"),
combined_source.index("synchronizeDriverSeatState()"),
)
legacy_request = sync_source.index("/api/hardware/seat-state")
self.assertLess(guard, legacy_request)
self.assertIn("return false", sync_source[guard:legacy_request])
render_source = function_source(
self.app_source,
"function renderSeatState(actuatorState) {",
"\nfunction renderDomainState",
)
self.assertNotIn("passenger: mergedActuatorState.driver", render_source)
def test_vehicle_selection_cannot_replay_unfiltered_state_in_ch1_mode(self) -> None:
select_source = function_source(