From fe00a99875845b5c793aa22a1eedef1346bd1448 Mon Sep 17 00:00:00 2001 From: Dandaedre Date: Tue, 17 Nov 2026 12:32:49 +0100 Subject: [PATCH] Recognize all standalone Aquilon models and warn on unvalidated firmware --- Cargo.lock | 2 +- Cargo.toml | 2 +- crates/canvas-pilot/src/device.rs | 5 +- crates/canvas-pilot/src/device/profile.rs | 39 +++++++++---- crates/canvas-pilot/src/device/state.rs | 48 +++++++++++++++- crates/canvas-pilot/tests/aquilon.rs | 57 ++++++++++++++++++- crates/canvas-pilot/tests/device.rs | 10 ++-- .../tests/fixtures/aquilon-6.2.README.md | 6 ++ .../tests/fixtures/aquilon-models.json | 50 ++++++++++++++++ docs/canvas-pilot/aquilon-compatibility.md | 19 +++++-- docs/canvas-pilot/changelog.md | 13 +++++ docs/canvas-pilot/guide/device.md | 9 ++- docs/canvas-pilot/plan.md | 5 +- docs/interfaces/device-adapters.md | 22 +++++-- 14 files changed, 255 insertions(+), 32 deletions(-) create mode 100644 crates/canvas-pilot/tests/fixtures/aquilon-models.json diff --git a/Cargo.lock b/Cargo.lock index 811efbd..bf9faf1 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -548,7 +548,7 @@ dependencies = [ [[package]] name = "canvas-pilot" -version = "0.9.17" +version = "0.9.18" dependencies = [ "base64", "craft-dwg", diff --git a/Cargo.toml b/Cargo.toml index e2af0a5..0291b68 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -4,7 +4,7 @@ default-members = ["crates/canvas-pilot"] resolver = "3" [workspace.package] -version = "0.9.17" +version = "0.9.18" edition = "2024" license = "MIT" repository = "https://proxy.dandaedre.com/gitea/idle-org/canvas-pilot" diff --git a/crates/canvas-pilot/src/device.rs b/crates/canvas-pilot/src/device.rs index 91dd3b6..8a1506e 100644 --- a/crates/canvas-pilot/src/device.rs +++ b/crates/canvas-pilot/src/device.rs @@ -200,7 +200,7 @@ pub(crate) fn fetch_with_awj_port( &format!("http://{authority}/api/tpp/v1/system"), cancelled, )?; - let (profile, _) = Profile::detect(&identity)?; + let (profile, label) = Profile::detect(&identity)?; let state = match profile { Profile::Midra4k => read_json( &client, @@ -211,7 +211,8 @@ pub(crate) fn fetch_with_awj_port( SocketAddr::new(authority.ip(), awj_port), &identity, cancelled, - )?, + ) + .map_err(|error| format!("{label}: Aquilon compatibility/read check failed: {error}"))?, }; Snapshot::parse(&identity, &state) } diff --git a/crates/canvas-pilot/src/device/profile.rs b/crates/canvas-pilot/src/device/profile.rs index e46ff1a..1c9f4c5 100644 --- a/crates/canvas-pilot/src/device/profile.rs +++ b/crates/canvas-pilot/src/device/profile.rs @@ -25,6 +25,25 @@ pub enum Profile { Midra4k, Aquilon6, } +// Model identifiers documented by Analog Way's AWJ guide V6.2, section 2.1. +// Keep exact matches: an unknown AQL product must not inherit this adapter. +pub(super) fn aquilon_model(kind: &str) -> Option<&'static str> { + Some(match kind { + "AQL RS alpha" | "AQL RS Alpha" => "NLC_RSALPHA", + "AQL RS1" => "NLC_RS1", + "AQL RS2" => "NLC_RS2", + "AQL RS3" => "NLC_RS3", + "AQL RS4" => "NLC_RS4", + "AQL RS5" => "NLC_RS5", + "AQL RS6" => "NLC_RS6", + "AQL Cmini" => "NLC_CMINI", + "AQL C" => "NLC_C", + "AQL C+" => "NLC_CPLUS", + "AQL Cmax" => "NLC_CMAX", + _ => return None, + }) +} + impl Profile { pub fn family(self) -> Family { match self { @@ -48,23 +67,23 @@ impl Profile { ) { Self::Midra4k } else if kind.starts_with("AQL") { - if kind != "AQL Cmax" - || version[..2] != [6, 2] + if aquilon_model(&kind).is_none() || identity.get("isLinked").and_then(Value::as_bool) != Some(false) { - return Err("Unsupported Aquilon profile. Currently verified: standalone AQL Cmax firmware 6.2.x; linked systems and other firmware/models require adapter validation.".into()); + return Err("Unsupported Aquilon model or linked system. Select a standalone Aquilon RS alpha, RS1–RS6, Cmini, C, C+ or Cmax.".into()); } Self::Aquilon6 } else { return Err(format!("Unsupported device {kind}; no compatible adapter.")); }; - Ok(( - profile, - format!( - "{kind} · firmware {}.{}.{}", - version[0], version[1], version[2] - ), - )) + let mut label = format!( + "{kind} · firmware {}.{}.{}", + version[0], version[1], version[2] + ); + if profile == Self::Aquilon6 && version[..2] != [6, 2] { + label.push_str(" · Warning: firmware outside validated 6.2.x; backward compatibility is not guaranteed. Transfers require compatible protocol fields."); + } + Ok((profile, label)) } pub(crate) fn screen_context_paths(self, screen: &str) -> [String; 2] { match self { diff --git a/crates/canvas-pilot/src/device/state.rs b/crates/canvas-pilot/src/device/state.rs index abed3bf..fee60c4 100644 --- a/crates/canvas-pilot/src/device/state.rs +++ b/crates/canvas-pilot/src/device/state.rs @@ -232,7 +232,9 @@ fn collect(reader: &mut impl Reader, identity: &Value) -> Result "{}.{}.{}", identity["version"]["major"], identity["version"]["minor"], identity["version"]["patch"] ); - if text(&state.raw, "/device/system/deviceList/items/1/pp/dev")? != "NLC_CMAX" + let expected_model = + profile::aquilon_model(&text(identity, "/type")?).ok_or("Unsupported Aquilon model")?; + if text(&state.raw, "/device/system/deviceList/items/1/pp/dev")? != expected_model || text( &state.raw, "/device/system/deviceList/items/1/version/pp/updater", @@ -504,6 +506,50 @@ mod tests { ); } #[test] + fn every_model_checks_exact_awj_identity_and_firmware() { + let models: Vec<(String, String)> = + serde_json::from_str(include_str!("../../tests/fixtures/aquilon-models.json")).unwrap(); + for (http, awj) in models { + for version in [(6, 2, 79), (4, 0, 1), (7, 1, 0)] { + let mut id = identity(); + id["type"] = json!(http); + id["version"] = json!({"major":version.0,"minor":version.1,"patch":version.2}); + let mut raw = fixture(); + set( + &mut raw, + "/device/system/deviceList/items/1/pp/dev", + json!(awj), + ); + set( + &mut raw, + "/device/system/deviceList/items/1/version/pp/updater", + json!(format!("{}.{}.{}", version.0, version.1, version.2)), + ); + let collected = collect(&mut memory(raw.clone()), &id).unwrap(); + assert_eq!( + Snapshot::parse(&id, &collected).unwrap().screens[0] + .layers + .len(), + 7 + ); + set( + &mut raw, + "/device/system/deviceList/items/1/pp/dev", + json!(if awj == "NLC_CMAX" { + "NLC_C" + } else { + "NLC_CMAX" + }), + ); + assert!( + collect(&mut memory(raw), &id) + .unwrap_err() + .contains("does not match") + ); + } + } + } + #[test] fn malformed_topology_and_mismatched_endpoint_fail() { for (path, bad) in [ ("/device/system/deviceList/items/1/pp/dev", json!("OTHER")), diff --git a/crates/canvas-pilot/tests/aquilon.rs b/crates/canvas-pilot/tests/aquilon.rs index 29d797e..0e1d827 100644 --- a/crates/canvas-pilot/tests/aquilon.rs +++ b/crates/canvas-pilot/tests/aquilon.rs @@ -96,7 +96,7 @@ fn invalid_profiles_transitions_allocations_and_missing_fields_fail() { id["isLinked"] = json!(true); assert!(Snapshot::parse(&id, &raw()).is_err()); id = identity(); - id["version"]["major"] = json!(7); + id["version"]["major"] = json!("7"); assert!(Snapshot::parse(&id, &raw()).is_err()); let mut r = raw(); r["device"]["screenAuxGroupList"]["items"]["S1"]["control"]["pp"]["presetUp"] = json!("A"); @@ -356,3 +356,58 @@ fn masked_editor_layers_are_rejected_before_aquilon_send() { .contains("masking") ); } + +#[test] +fn all_models_and_firmware_versions_use_checked_geometry_with_compatibility_warning() { + for model in [ + "RS alpha", "RS Alpha", "RS1", "RS2", "RS3", "RS4", "RS5", "RS6", "Cmini", "C", "C+", + "Cmax", + ] { + for (major, minor) in [ + (1, 0), + (2, 2), + (3, 0), + (4, 0), + (5, 0), + (6, 0), + (6, 2), + (7, 0), + ] { + let mut id = identity(); + id["type"] = json!(format!("AQL {model}")); + id["version"]["major"] = json!(major); + id["version"]["minor"] = json!(minor); + let snapshot = Snapshot::parse(&id, &routed()).unwrap(); + assert_eq!( + snapshot + .identity + .contains("backward compatibility is not guaranteed"), + (major, minor) != (6, 2) + ); + let layout = Layout::default(); + for target in [Target::Preview, Target::Program] { + let plan = Plan::prepare( + &snapshot, + &layout, + 0, + &[(layout.layer_info(0).id, "1".into())], + target, + Sizing::OutputBox, + ) + .unwrap(); + assert_eq!(plan.profile, Profile::Aquilon6); + assert!(plan.changes.iter().all(|change| { + !change + .path + .iter() + .any(|part| part == "source" || part == "inputList") + })); + } + } + } + for model in ["AQL Unknown", "AQL Cmax extra", "AQL"] { + let mut id = identity(); + id["type"] = json!(model); + assert!(Snapshot::parse(&id, &raw()).is_err()); + } +} diff --git a/crates/canvas-pilot/tests/device.rs b/crates/canvas-pilot/tests/device.rs index 63452ab..5eae476 100644 --- a/crates/canvas-pilot/tests/device.rs +++ b/crates/canvas-pilot/tests/device.rs @@ -311,7 +311,7 @@ fn fractional_device_content_rounds_with_a_nonblocking_warning() { } #[test] -fn unsupported_aquilon_profile_is_rejected_before_requesting_large_state() { +fn linked_aquilon_is_rejected_before_requesting_state() { use std::io::{BufRead, BufReader, Write}; let listener = std::net::TcpListener::bind("127.0.0.1:0").unwrap(); let host = listener.local_addr().unwrap().to_string(); @@ -329,7 +329,7 @@ fn unsupported_aquilon_profile_is_rejected_before_requesting_large_state() { } } let body = - r#"{"type":"AQL Cmax","isLinked":false,"version":{"major":5,"minor":2,"patch":79}}"#; + r#"{"type":"AQL Cmax","isLinked":true,"version":{"major":5,"minor":2,"patch":79}}"#; write!( stream, "HTTP/1.1 200 OK\r\nContent-Length: {}\r\nConnection: close\r\n\r\n{body}", @@ -340,8 +340,10 @@ fn unsupported_aquilon_profile_is_rejected_before_requesting_large_state() { }); let error = canvas_pilot::device::fetch(&host).unwrap_err(); let listener = server.join().unwrap(); - assert!(error.contains("Unsupported Aquilon profile"), "{error}"); - assert!(error.contains("6.2.x"), "{error}"); + assert!( + error.contains("Unsupported Aquilon model or linked system"), + "{error}" + ); listener.set_nonblocking(true).unwrap(); assert_eq!( listener.accept().unwrap_err().kind(), diff --git a/crates/canvas-pilot/tests/fixtures/aquilon-6.2.README.md b/crates/canvas-pilot/tests/fixtures/aquilon-6.2.README.md index 3e09065..bc6ce39 100644 --- a/crates/canvas-pilot/tests/fixtures/aquilon-6.2.README.md +++ b/crates/canvas-pilot/tests/fixtures/aquilon-6.2.README.md @@ -11,3 +11,9 @@ for active auxiliaries, canvas changes, bank swaps and malformed fields. The full 118 MiB response remains a private temporary artifact. The targeted-read collector and parser exercise this fixture; test helpers add collection keys and identity fields for the mock AWJ endpoint; live write/restore diagnostics are separate examples, never CI tests. + +`aquilon-models.json` pairs HTTP names with the eleven model codes documented in +Analog Way's AWJ V6.2 guide, section 2.1 (including the RS Alpha spelling alias). +Tests substitute these identities and firmware versions into the Cmax fixture. +These synthetic cases exercise identity matching and the common adapter; they +are not captures or acceptance evidence for those models/firmware releases. diff --git a/crates/canvas-pilot/tests/fixtures/aquilon-models.json b/crates/canvas-pilot/tests/fixtures/aquilon-models.json new file mode 100644 index 0000000..be9e44d --- /dev/null +++ b/crates/canvas-pilot/tests/fixtures/aquilon-models.json @@ -0,0 +1,50 @@ +[ + [ + "AQL RS alpha", + "NLC_RSALPHA" + ], + [ + "AQL RS Alpha", + "NLC_RSALPHA" + ], + [ + "AQL RS1", + "NLC_RS1" + ], + [ + "AQL RS2", + "NLC_RS2" + ], + [ + "AQL RS3", + "NLC_RS3" + ], + [ + "AQL RS4", + "NLC_RS4" + ], + [ + "AQL RS5", + "NLC_RS5" + ], + [ + "AQL RS6", + "NLC_RS6" + ], + [ + "AQL Cmini", + "NLC_CMINI" + ], + [ + "AQL C", + "NLC_C" + ], + [ + "AQL C+", + "NLC_CPLUS" + ], + [ + "AQL Cmax", + "NLC_CMAX" + ] +] diff --git a/docs/canvas-pilot/aquilon-compatibility.md b/docs/canvas-pilot/aquilon-compatibility.md index 3f82222..c4d08e7 100644 --- a/docs/canvas-pilot/aquilon-compatibility.md +++ b/docs/canvas-pilot/aquilon-compatibility.md @@ -3,12 +3,23 @@ [Canvas Pilot plan](plan.md) · [Device workflows](guide/device.md) · [Completed implementation](aquilon_support.task.md) Implemented and tested 2026-11-15. **Aquilon is a first-class supported adapter** -for standalone AQL Cmax firmware 6.2.x; the tested emulator is **6.2.79** at the +initially for standalone AQL Cmax firmware 6.2.x; the tested emulator is **6.2.79** at the configured custom port. See the [current adapter contract](../interfaces/device-adapters.md). -The supported profile is complete for its documented scope. Physical-output -acceptance remains outstanding; other models, linked units and unsupported -framing modes require separate validation or implementation. +Physical-output acceptance remains outstanding. The later model/firmware expansion +below retains explicit validation and unsupported-framing errors. + +## Model and firmware expansion — 2026-11-17 + +All eleven standalone models are now recognized using the model identifiers in +Analog Way's AWJ V6.2 guide, section 2.1. Every numeric firmware version is allowed +through identity detection, with a backward-compatibility warning outside 6.2.x. +Connection and send still require the existing protocol fields and validation; +legacy protocols are not implemented by relaxing the version gate. See the +[current contract](../interfaces/device-adapters.md) for exact scope. +Synthetic tests cover model identity agreement, cross-model rejection, firmware +warnings and Preview/Program send planning. These do not establish actual older +firmware compatibility or extend the Cmax emulator evidence below to other models. ## Current acceptance diff --git a/docs/canvas-pilot/changelog.md b/docs/canvas-pilot/changelog.md index 13ef5e2..0e768eb 100644 --- a/docs/canvas-pilot/changelog.md +++ b/docs/canvas-pilot/changelog.md @@ -4,6 +4,19 @@ ## Unreleased +### v0.9.18 + +- Recognize all eleven standalone Aquilon models with exact HTTP/AWJ model checks + and dynamically discovered capacities. Accept all numeric firmware versions, + showing a backward-compatibility warning outside validated 6.2.x in connection + and transfer review. Incompatible protocol fields still stop transfers explicitly; + legacy protocol implementations and linked systems are outside this change. +- Added synthetic model/firmware, mismatch and Preview/Program planning regressions. + Cmax 6.2.79 remains the only model/firmware with recorded emulator acceptance; + physical-output acceptance remains outstanding. +- Default/restricted Rust suites, formatting, Clippy, rustdoc and pinned manual + build passed; whole-application line coverage is 91.70%. + ### v0.9.17 - Added isolated feature-recording recipes, a shot-by-shot capture guide and a diff --git a/docs/canvas-pilot/guide/device.md b/docs/canvas-pilot/guide/device.md index 69407f1..23461d2 100644 --- a/docs/canvas-pilot/guide/device.md +++ b/docs/canvas-pilot/guide/device.md @@ -161,8 +161,13 @@ undoable; they do not change physical input routing. ## Aquilon / LivePremier -Aquilon is a first-class supported adapter for standalone AQL Cmax firmware 6.2.x, -verified on the 6.2.79 emulator; physical-output acceptance remains outstanding. +Aquilon recognizes all standalone models: RS alpha, RS1–RS6, Cmini, C, C+ and +Cmax. All firmware versions may connect; versions outside 6.2.x display a warning +that backward compatibility is not guaranteed. The adapter requires compatible +protocol fields and stops with an explicit error when they differ. Older firmware, +especially before 4.x, may therefore fail to connect. Linked systems remain unsupported. +Cmax 6.2.79 is verified on the emulator; other models/firmware have synthetic test +coverage, and physical-output acceptance remains outstanding. Connect using the same Device connection window. The device identifies its family automatically. Screens use `S1`, `S2`, …; auxiliaries use `A1`, `A2`, … and stay distinct in saved mappings. Only enabled diff --git a/docs/canvas-pilot/plan.md b/docs/canvas-pilot/plan.md index 4604539..2128168 100644 --- a/docs/canvas-pilot/plan.md +++ b/docs/canvas-pilot/plan.md @@ -74,14 +74,15 @@ checks and stretch goals below remain open; the tag does not mark them complete. - [x] **Export/workflow cleanup.** Shared transfer scopes, mapping review and direct linked send/load are implemented. Manually reviewed and marked solved on 2026-11-15. -- [x] **Aquilon / LivePremier: first-class supported (standalone AQL Cmax 6.2.x).** Device-neutral snapshots, family-aware v13 links, bounded targeted AWJ reads, geometry/crop import, mapped Preview/Program sends and pooled input previews. See [adapter contract](../interfaces/device-adapters.md) and [emulator acceptance](aquilon-compatibility.md). Linked units, other models/firmware, shared input corrections and non-centered/masked import remain explicitly unsupported. +- [x] **Aquilon / LivePremier: standalone model range recognized; Cmax 6.2.x emulator verified.** Device-neutral snapshots, family-aware v13 links, bounded targeted AWJ reads, geometry/crop import, mapped Preview/Program sends and pooled input previews. See [adapter contract](../interfaces/device-adapters.md) and [emulator acceptance](aquilon-compatibility.md). All firmware versions are attempted with a compatibility warning outside 6.2.x; incompatible schemas fail explicitly. Linked units, shared input corrections and non-centered/masked import remain unsupported. ## To-do list - [ ] **Broaden coverage to every Aquilon and Midra model.** Requested 2026-11-17: inventory both product ranges and their firmware/link modes; validate identity, bounded reads, geometry/crop/mask conversion, input previews and reviewed writes - per model. Start with the AQL C+ simulator encountered during showcase recording. + per model. All Aquilon model identities now have synthetic coverage; actual + firmware/device acceptance remains pending, starting with AQL C+. Preserve explicit unsupported-mode errors until each adapter path is validated; emulator coverage and physical-output acceptance remain separate. diff --git a/docs/interfaces/device-adapters.md b/docs/interfaces/device-adapters.md index 64af1f0..9ee9cb6 100644 --- a/docs/interfaces/device-adapters.md +++ b/docs/interfaces/device-adapters.md @@ -20,10 +20,24 @@ adapters must explicitly implement or reject each mode. ## Aquilon profile and reads -Supported profile: standalone **AQL Cmax, firmware 6.2.x**, exercised on the -**6.2.79 emulator**. This is a first-class adapter; physical-output acceptance -remains outstanding. -Other firmware/models are rejected before reading geometry. `/api/tpp/v1/system` +Recognized standalone models: **RS alpha, RS1–RS6, Cmini, C, C+ and Cmax**. +The adapter accepts every numeric firmware version and attempts the bounded +LivePremier 6.2 protocol reads. Outside **6.2.x**, connection and transfer review +show: **backward compatibility is not guaranteed**. This is best-effort compatibility, +not an implementation of every historical protocol: missing or incompatible fields +fail explicitly before a send can be planned. In particular, firmware before 4.x +uses a different screen/group schema and may not connect. No legacy path guessing +or full-store fallback is performed. Linked systems and unknown models remain rejected. + +Model codes follow the manufacturer's AWJ V6.2 guide, section 2.1: +`NLC_RSALPHA`, `NLC_RS1`–`NLC_RS6`, `NLC_CMINI`, `NLC_C`, `NLC_CPLUS`, +`NLC_CMAX`. HTTP names use the `AQL ` prefix and model spelling above; RS alpha +also accepts `RS Alpha`. The HTTP model must match the exact AWJ model, not just +another member of the Aquilon family. Capacities still come from discovered state. +Only **Cmax 6.2.79** has recorded emulator acceptance. Other models and firmware +have synthetic regression coverage; physical-output acceptance remains outstanding. + +`/api/tpp/v1/system` on the configured HTTP port supplies identity. Aquilon geometry uses **AWJ TCP 10606 on the same IP**, independently of the HTTP/WebSocket port. AWJ model and firmware are checked against the HTTP identity. A blocked/disabled AWJ port is an