Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
10 changes: 5 additions & 5 deletions crates/agent-spec/src/profile.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ pub const AGENT_GOAL_SCHEME: &str = "dev.schickling.agent-goal";
/// Maximum resolver module bytes admitted by both catalog transactions and the wasm runtime.
pub const DEFAULT_MODULE_LIMIT_BYTES: usize = 16 * 1024 * 1024;
/// Descriptor ABI implemented by this host.
pub const PROFILE_DESCRIPTOR_ABI_VERSION: u32 = 2;
pub const PROFILE_DESCRIPTOR_ABI_VERSION: u32 = 3;
/// Maximum canonical compact JSON bytes accepted for one binding selector.
pub const DEFAULT_SELECTOR_LIMIT_BYTES: usize = 16 * 1024;

Expand Down Expand Up @@ -1091,7 +1091,7 @@ mod tests {
use super::*;

const VALID_DESCRIPTOR_JSON: &str = r#"{
"abiVersion": 2,
"abiVersion": 3,
"capabilities": ["resolve", "read", "observe"],
"selectorSchema": {
"type": "object",
Expand Down Expand Up @@ -1157,7 +1157,7 @@ mod tests {
}

#[test]
fn valid_v2_descriptor_and_nested_selector_validate() {
fn valid_v3_descriptor_and_nested_selector_validate() {
let descriptor = valid_descriptor();
assert_eq!(descriptor.abi_version, PROFILE_DESCRIPTOR_ABI_VERSION);
assert_eq!(descriptor.runtime.topology, RuntimeTopology::Shared);
Expand All @@ -1171,7 +1171,7 @@ mod tests {

#[test]
fn descriptor_rejects_unknown_abi_capability_and_fields() {
let unknown_abi = VALID_DESCRIPTOR_JSON.replace("\"abiVersion\": 2", "\"abiVersion\": 9");
let unknown_abi = VALID_DESCRIPTOR_JSON.replace("\"abiVersion\": 3", "\"abiVersion\": 9");
assert!(
ProfileDescriptor::from_json(unknown_abi.as_bytes())
.unwrap_err()
Expand All @@ -1187,7 +1187,7 @@ mod tests {
);

let unknown_field =
VALID_DESCRIPTOR_JSON.replace("\"abiVersion\": 2,", "\"abiVersion\": 2, \"extra\": true,");
VALID_DESCRIPTOR_JSON.replace("\"abiVersion\": 3,", "\"abiVersion\": 3, \"extra\": true,");
assert!(
ProfileDescriptor::from_json(unknown_field.as_bytes())
.unwrap_err()
Expand Down
1 change: 0 additions & 1 deletion crates/agent-spec/src/spec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -363,7 +363,6 @@ impl AgentSpec {
.or_else(|| self.driver.as_ref().map(Driver::session_driver))
}
}

fn deserialize_optional_selector<'de, D>(
deserializer: D,
) -> Result<Option<serde_json::Value>, D::Error>
Expand Down
6 changes: 3 additions & 3 deletions crates/agent-spec/tests/profile_wasm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ fn descriptor_module(payload: &[u8], reported_len: usize) -> WasmResolver {
}

const VALID_DESCRIPTOR: &str = r#"{
"abiVersion": 2,
"abiVersion": 3,
"capabilities": ["resolve", "read", "observe"],
"selectorSchema": {
"type": "object",
Expand Down Expand Up @@ -112,12 +112,12 @@ fn current_rss_bytes() -> u64 {
}

#[test]
fn valid_v2_descriptor_executes_and_resolve_only_module_stays_passive() {
fn valid_v3_descriptor_executes_and_resolve_only_module_stays_passive() {
let descriptor = descriptor_module(VALID_DESCRIPTOR.as_bytes(), VALID_DESCRIPTOR.len())
.describe_once()
.expect("describe call succeeds")
.expect("descriptor is present");
assert_eq!(descriptor.abi_version, 2);
assert_eq!(descriptor.abi_version, 3);

assert!(
WasmResolver::load(Path::new(DEMO_WASM_PATH))
Expand Down
Loading
Loading