feat: add generated scene skill platform hardening
This commit is contained in:
121
tests/post_g7_boundary_decision_roadmap_test.rs
Normal file
121
tests/post_g7_boundary_decision_roadmap_test.rs
Normal file
@@ -0,0 +1,121 @@
|
||||
use std::fs;
|
||||
|
||||
use serde::Deserialize;
|
||||
|
||||
#[derive(Debug, Deserialize)]
|
||||
struct PostG7BoundaryDecision {
|
||||
#[serde(rename = "decisionDate")]
|
||||
decision_date: String,
|
||||
scope: String,
|
||||
#[serde(rename = "startingState")]
|
||||
starting_state: StartingState,
|
||||
#[serde(rename = "comparisonMatrix")]
|
||||
comparison_matrix: Vec<ComparisonEntry>,
|
||||
#[serde(rename = "selectedDirection")]
|
||||
selected_direction: SelectedDirection,
|
||||
#[serde(rename = "holdReasons")]
|
||||
hold_reasons: Vec<String>,
|
||||
notes: Vec<String>,
|
||||
}
|
||||
|
||||
#[derive(Debug, Deserialize)]
|
||||
struct StartingState {
|
||||
#[serde(rename = "mainlineClosed")]
|
||||
mainline_closed: Vec<String>,
|
||||
#[serde(rename = "boundaryClosed")]
|
||||
boundary_closed: Vec<String>,
|
||||
#[serde(rename = "boundaryHeld")]
|
||||
boundary_held: Vec<String>,
|
||||
#[serde(rename = "deferredOutOfScope")]
|
||||
deferred_out_of_scope: Vec<String>,
|
||||
}
|
||||
|
||||
#[derive(Debug, Deserialize)]
|
||||
struct ComparisonEntry {
|
||||
direction: String,
|
||||
#[serde(rename = "entryCondition")]
|
||||
entry_condition: String,
|
||||
#[serde(rename = "smallestNewCapability")]
|
||||
smallest_new_capability: String,
|
||||
#[serde(rename = "entryCost")]
|
||||
entry_cost: String,
|
||||
decision: String,
|
||||
reason: String,
|
||||
}
|
||||
|
||||
#[derive(Debug, Deserialize)]
|
||||
struct SelectedDirection {
|
||||
direction: String,
|
||||
#[serde(rename = "nextDesign")]
|
||||
next_design: String,
|
||||
#[serde(rename = "nextPlan")]
|
||||
next_plan: String,
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn post_g7_boundary_decision_roadmap_emits_one_bounded_direction() {
|
||||
let decision: PostG7BoundaryDecision = serde_json::from_str(
|
||||
&fs::read_to_string(
|
||||
"tests/fixtures/generated_scene/post_g7_boundary_decision_2026-04-19.json",
|
||||
)
|
||||
.unwrap(),
|
||||
)
|
||||
.unwrap();
|
||||
|
||||
assert_eq!(decision.decision_date, "2026-04-19");
|
||||
assert_eq!(decision.scope, "post-g7-boundary-decision-roadmap");
|
||||
assert_eq!(
|
||||
decision.starting_state.mainline_closed,
|
||||
vec!["G1-E", "G2", "G3"]
|
||||
);
|
||||
assert_eq!(decision.starting_state.boundary_closed, vec!["G7"]);
|
||||
assert_eq!(decision.starting_state.boundary_held, vec!["G6", "G8"]);
|
||||
assert_eq!(
|
||||
decision.starting_state.deferred_out_of_scope,
|
||||
vec!["G4", "G5"]
|
||||
);
|
||||
|
||||
assert_eq!(decision.comparison_matrix.len(), 3);
|
||||
assert_eq!(
|
||||
decision
|
||||
.comparison_matrix
|
||||
.iter()
|
||||
.filter(|entry| entry.decision == "selected")
|
||||
.count(),
|
||||
1
|
||||
);
|
||||
assert!(decision
|
||||
.comparison_matrix
|
||||
.iter()
|
||||
.any(|entry| entry.direction == "G6"
|
||||
&& entry.decision == "hold"
|
||||
&& entry.entry_cost == "high"));
|
||||
assert!(decision
|
||||
.comparison_matrix
|
||||
.iter()
|
||||
.any(|entry| entry.direction == "G8"
|
||||
&& entry.decision == "hold"
|
||||
&& entry.entry_cost == "high"));
|
||||
assert!(decision
|
||||
.comparison_matrix
|
||||
.iter()
|
||||
.any(|entry| entry.direction == "prerequisites-only-hold"
|
||||
&& entry.decision == "selected"
|
||||
&& entry.entry_cost == "medium"));
|
||||
|
||||
assert_eq!(
|
||||
decision.selected_direction.direction,
|
||||
"prerequisites-only-hold"
|
||||
);
|
||||
assert!(decision
|
||||
.selected_direction
|
||||
.next_design
|
||||
.ends_with("2026-04-19-boundary-runtime-prerequisites-roadmap-design.md"));
|
||||
assert!(decision
|
||||
.selected_direction
|
||||
.next_plan
|
||||
.ends_with("2026-04-19-boundary-runtime-prerequisites-roadmap-plan.md"));
|
||||
|
||||
assert_eq!(decision.hold_reasons.len(), 2);
|
||||
assert!(!decision.notes.is_empty());
|
||||
}
|
||||
Reference in New Issue
Block a user