From 2381bbe75aaf05540a0fd848e4ae551659287aa2 Mon Sep 17 00:00:00 2001 From: Steven Enamakel Date: Sun, 15 Nov 2026 05:47:41 +0000 Subject: [PATCH 1/2] docs(tinycomputer-bus): bump contract version to 3.3 Update the versioning guide to reflect CONTRACT_VERSION (3, 3) and adjust the compatibility examples accordingly. Add a case showing that a (3, 2) module is now rejected because it lacks the `surplus` provider. Auto-committed-on: cuttlefish Co-authored-by: Medulla --- docs/crates/tinycomputer-bus/versioning.md | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/docs/crates/tinycomputer-bus/versioning.md b/docs/crates/tinycomputer-bus/versioning.md index d1aabd296..130e0d2e0 100644 --- a/docs/crates/tinycomputer-bus/versioning.md +++ b/docs/crates/tinycomputer-bus/versioning.md @@ -9,7 +9,7 @@ code, so this page exists mostly to keep them apart. ## `CONTRACT_VERSION`: does this host understand this module ```rust,ignore -pub const CONTRACT_VERSION: (u32, u32) = (3, 2); +pub const CONTRACT_VERSION: (u32, u32) = (3, 3); ``` This describes the *vocabulary*: the member set and the payload shapes, @@ -60,14 +60,15 @@ Two conditions, both necessary: relies on changed shape or disappeared, so a mismatched major is refused outright, in either direction. 2. **The module must be at least as new, minor-wise, as the host.** A host - built against `(3, 2)` expects at least the members and fields that - existed at `(3, 2)`. A newer module with the same major is accepted. On + built against `(3, 3)` expects at least the members and fields that + existed at `(3, 3)`. A newer module with the same major is accepted. On the 2.x line, for example, a 2.29 host rejected a `(2, 28)` module, which lacked the typed `ComputerConfig` and versioned response extraction. ```rust,ignore -assert!(is_compatible(CONTRACT_VERSION)); // (3, 2), the exact version this crate ships -assert!(is_compatible((3, 2))); // a newer, still-compatible module +assert!(is_compatible(CONTRACT_VERSION)); // (3, 3), the exact version this crate ships +assert!(is_compatible((3, 3))); // a newer, still-compatible module +assert!(!is_compatible((3, 2))); // an older minor: no `surplus` provider assert!(!is_compatible((2, 29))); // a different major: plain BrowserReadOutput assert!(!is_compatible((1, 10))); // a different major, all bets off ``` From dbb397a77c1b80875b3bc0eb5177de9b16567f74 Mon Sep 17 00:00:00 2001 From: Steven Enamakel Date: Sun, 15 Nov 2026 05:48:06 +0000 Subject: [PATCH 2/2] test(config): cover surplus model describe over a real bus Add an async test that sets up the module with a surplus JEV configuration on an in-memory bus and asserts that describe reports the expected provider and model, exercising the configuration path end to end. Auto-committed-on: cuttlefish Co-authored-by: Medulla --- .../tinybus_module_tests/config_tests.rs | 27 +++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/crates/tinycomputer/src/tinybus_module/tinybus_module_tests/config_tests.rs b/crates/tinycomputer/src/tinybus_module/tinybus_module_tests/config_tests.rs index 4b9605898..620808a8e 100644 --- a/crates/tinycomputer/src/tinybus_module/tinybus_module_tests/config_tests.rs +++ b/crates/tinycomputer/src/tinybus_module/tinybus_module_tests/config_tests.rs @@ -191,6 +191,33 @@ fn each_decision_model_is_selected_from_private_configuration() { } } +#[tokio::test] +async fn a_surplus_configuration_reaches_describe_over_a_real_bus() -> tinybus::Result<()> { + use crate::tinybus_module::setup; + use tinybus::Connection; + use tinybus::broker::Broker; + use tinybus::transport::memory::MemoryBus; + use tinycomputer_bus::agent::Capabilities; + use tinycomputer_bus::{JevProvider, names}; + + let bus = MemoryBus::new(); + Broker::new().spawn(bus.clone()); + let service = Connection::connect(bus.connect().await?).await?; + setup( + service.clone(), + json!({"jev": {"api_key": "k", "provider": "surplus"}}), + ) + .await?; + let client = Connection::connect(bus.connect().await?).await?; + let proxy = client.proxy(names::INTERFACE, names::OBJECT_PATH, names::INTERFACE)?; + + let described: Capabilities = proxy.call(names::methods::DESCRIBE, json!([])).await?; + let model = described.decision_model.expect("a configured model"); + assert_eq!(model.provider, JevProvider::Surplus); + assert_eq!(model.model, "jev-1.14"); + Ok(()) +} + #[test] fn the_browser_configuration_is_read_or_refused() { use crate::tinybus_module::config::BrowserDefaults;