@@ -27,8 +27,8 @@ use openshell_core::proto::{
2727 NetworkPolicyRule , ProcessPolicy , SandboxPolicy , UiClipboardAccess , UiPolicy ,
2828} ;
2929use openshell_driver_mxc:: {
30- EmbeddedPolicyMapper , MapCtx , MapError , MxcMappingOptions , PolicyMapper , map_to_mxc ,
31- split_policy,
30+ DEFAULT_COARSE_MXC_VERSION , DEFAULT_MXC_VERSION , EmbeddedPolicyMapper , MapCtx , MapError ,
31+ MxcMappingOptions , PolicyMapper , map_to_mxc , split_policy,
3232} ;
3333use openshell_policy:: { serialize_sandbox_policy, validate_sandbox_policy} ;
3434use serde_json:: Value ;
@@ -132,6 +132,26 @@ fn assert_single_loss(
132132
133133// ─── QUADRANT A: mappable fields, assert exact MXC output ───────────────────
134134
135+ /// The standalone coarse mapper and live governed-egress path intentionally
136+ /// target different schema shapes. Keep the compatibility constant scoped to
137+ /// the coarse artifact and prevent either side from silently drifting.
138+ #[ test]
139+ fn a_schema_versions_match_their_distinct_network_shapes ( ) {
140+ let policy = SandboxPolicy :: default ( ) ;
141+ let coarse = map_to_mxc ( & policy, & default_opts ( ) ) . config ;
142+ assert_eq ! ( DEFAULT_MXC_VERSION , DEFAULT_COARSE_MXC_VERSION ) ;
143+ assert_eq ! ( coarse[ "version" ] , DEFAULT_COARSE_MXC_VERSION ) ;
144+ assert ! ( coarse[ "network" ] . get( "allowedHosts" ) . is_some( ) ) ;
145+ assert ! ( coarse[ "network" ] . get( "egress" ) . is_none( ) ) ;
146+
147+ let governed = split_policy ( & policy, & pc_split_opts ( ) )
148+ . expect ( "governed split must exist when a proxy redirect is configured" )
149+ . mxc_config ;
150+ assert_eq ! ( governed[ "version" ] , "0.8.0-alpha" ) ;
151+ assert ! ( governed[ "network" ] . get( "allowedHosts" ) . is_none( ) ) ;
152+ assert ! ( governed[ "network" ] . get( "egress" ) . is_some( ) ) ;
153+ }
154+
135155/// filesystem.read_write → readwritePaths verbatim, order preserved.
136156#[ test]
137157fn a_rw_paths_verbatim ( ) {
0 commit comments