@@ -73,15 +73,25 @@ pub enum CausalPosture {
7373#[ deprecated( note = "Use CausalPosture" ) ]
7474pub type RevelationPosture = CausalPosture ;
7575
76+ mod posture_state_seal {
77+ pub trait Sealed { }
78+ }
79+
7680/// Trait representing compile-time typestate for causal posture.
77- pub trait CausalPostureState : Clone + std:: fmt:: Debug + PartialEq + Eq {
81+ ///
82+ /// This trait is sealed to Echo's marker types. Runtime posture validation
83+ /// remains the authority for settlement admission.
84+ pub trait CausalPostureState :
85+ Clone + std:: fmt:: Debug + PartialEq + Eq + posture_state_seal:: Sealed
86+ {
7887 /// Returns the runtime CausalPosture value for this typestate, or None if dynamic.
7988 fn causal_posture ( ) -> Option < CausalPosture > ;
8089}
8190
8291/// Marker struct representing the Shared causal posture.
8392#[ derive( Clone , Copy , Debug , PartialEq , Eq ) ]
8493pub struct Shared ;
94+ impl posture_state_seal:: Sealed for Shared { }
8595impl CausalPostureState for Shared {
8696 fn causal_posture ( ) -> Option < CausalPosture > {
8797 Some ( CausalPosture :: Shared )
@@ -91,6 +101,7 @@ impl CausalPostureState for Shared {
91101/// Marker struct representing the AuthorOnly causal posture.
92102#[ derive( Clone , Copy , Debug , PartialEq , Eq ) ]
93103pub struct AuthorOnly ;
104+ impl posture_state_seal:: Sealed for AuthorOnly { }
94105impl CausalPostureState for AuthorOnly {
95106 fn causal_posture ( ) -> Option < CausalPosture > {
96107 Some ( CausalPosture :: AuthorOnly )
@@ -100,6 +111,7 @@ impl CausalPostureState for AuthorOnly {
100111/// Marker struct representing the Scratch causal posture.
101112#[ derive( Clone , Copy , Debug , PartialEq , Eq ) ]
102113pub struct Scratch ;
114+ impl posture_state_seal:: Sealed for Scratch { }
103115impl CausalPostureState for Scratch {
104116 fn causal_posture ( ) -> Option < CausalPosture > {
105117 Some ( CausalPosture :: Scratch )
@@ -109,6 +121,7 @@ impl CausalPostureState for Scratch {
109121/// Representation of causal posture whose type is dynamic/erased at compile-time.
110122#[ derive( Clone , Copy , Debug , PartialEq , Eq ) ]
111123pub struct DynamicPosture ;
124+ impl posture_state_seal:: Sealed for DynamicPosture { }
112125impl CausalPostureState for DynamicPosture {
113126 fn causal_posture ( ) -> Option < CausalPosture > {
114127 None
0 commit comments