Files
claw/tests/g6_host_bridge_entry_readiness_test.rs

104 lines
3.1 KiB
Rust

use std::fs;
use serde::Deserialize;
#[derive(Debug, Deserialize)]
struct G6HostBridgeEntryReadiness {
#[serde(rename = "decisionDate")]
decision_date: String,
scope: String,
#[serde(rename = "startingState")]
starting_state: StartingState,
#[serde(rename = "requiredCriteria")]
required_criteria: Vec<Criterion>,
#[serde(rename = "optionalCriteria")]
optional_criteria: Vec<Criterion>,
#[serde(rename = "minimalReadinessThreshold")]
minimal_readiness_threshold: ReadinessThreshold,
#[serde(rename = "selectedFollowup")]
selected_followup: SelectedFollowup,
notes: Vec<String>,
}
#[derive(Debug, Deserialize)]
struct StartingState {
#[serde(rename = "targetGroup")]
target_group: String,
#[serde(rename = "realExecutionOutOfScope")]
real_execution_out_of_scope: bool,
#[serde(rename = "implementationOutOfScope")]
implementation_out_of_scope: bool,
#[serde(rename = "heldGroups")]
held_groups: Vec<String>,
}
#[derive(Debug, Deserialize)]
struct Criterion {
name: String,
status: String,
reason: String,
}
#[derive(Debug, Deserialize)]
struct ReadinessThreshold {
level: String,
definition: String,
}
#[derive(Debug, Deserialize)]
struct SelectedFollowup {
design: String,
plan: String,
}
#[test]
fn g6_host_bridge_entry_readiness_stays_bounded() {
let asset: G6HostBridgeEntryReadiness = serde_json::from_str(
&fs::read_to_string(
"tests/fixtures/generated_scene/g6_host_bridge_entry_readiness_2026-04-19.json",
)
.unwrap(),
)
.unwrap();
assert_eq!(asset.decision_date, "2026-04-19");
assert_eq!(asset.scope, "g6-host-bridge-entry-readiness");
assert_eq!(asset.starting_state.target_group, "G6");
assert!(asset.starting_state.real_execution_out_of_scope);
assert!(asset.starting_state.implementation_out_of_scope);
assert_eq!(asset.starting_state.held_groups, vec!["G8"]);
assert!(asset
.required_criteria
.iter()
.any(|item| item.name == "host-bridge-action-invocation-defined"
&& item.status == "required"));
assert!(asset.required_criteria.iter().any(|item| item.name
== "callback-request-completion-defined"
&& item.status == "required"));
assert!(asset.required_criteria.iter().any(|item| item.name
== "callback-state-verification-targets-defined"
&& item.status == "required"));
assert!(asset
.optional_criteria
.iter()
.any(|item| item.name == "host-runtime-transport-implementation"
&& item.status == "optional-later"));
assert!(asset
.optional_criteria
.iter()
.any(|item| item.name == "real-sample-execution-proof" && item.status == "optional-later"));
assert_eq!(asset.minimal_readiness_threshold.level, "semantic-ready");
assert!(asset
.selected_followup
.design
.ends_with("2026-04-19-g6-host-bridge-entry-gate-design.md"));
assert!(asset
.selected_followup
.plan
.ends_with("2026-04-19-g6-host-bridge-entry-gate-plan.md"));
assert!(!asset.notes.is_empty());
}