pub struct CorePolicy {
pub write: GovernanceLevel,
pub promote: GovernanceLevel,
pub delete: GovernanceLevel,
pub approver: ApproverType,
pub inherit: bool,
pub max_reflection_depth: Option<u32>,
}Expand description
#880 — access-control + inheritance + reflection-depth sub-struct
of GovernancePolicy. Every field is flattened back into the
parent on the wire so metadata.governance JSON / TOML configs
remain byte-identical to the pre-#880 flat layout.
Fields§
§write: GovernanceLevel§promote: GovernanceLevel§delete: GovernanceLevel§approver: ApproverType§inherit: boolv0.6.3.1 (P4, G1): when true (default), missing policy at a
child namespace falls through to the parent in the chain. When
false, the walk stops at this level — child operations are
gated by THIS policy and parents are not consulted. Backfilled
to true on existing rows by migration 0012_governance_inherit
to preserve the architecturally-promised semantics.
max_reflection_depth: Option<u32>v0.7.0 recursive-learning Task 2/8 (issue #655): per-namespace
substrate-side cap on Memory::reflection_depth at the
memory_reflect MCP write path (enforcement lands in Task 5/8).
None → no override, fall back to the compiled default exposed
by GovernancePolicy::effective_max_reflection_depth.
Some(0) is the disable-all-reflections sentinel (see accessor
doc-comment). Persisted inside the existing namespace standard’s
metadata.governance JSON blob; no SQL schema migration is
required because the column is already a TEXT/JSONB
payload on both SQLite and Postgres. Pre-v0.7.0 rows that
omit this key deserialize as None via #[serde(default)],
and skip_serializing_if keeps the absent shape on the wire
for fresh policies — matching how NamespaceMetaEntry::parent_namespace
stays absent on the wire to keep replication / federation
payloads byte-identical for legacy peers.
Trait Implementations§
Source§impl Clone for CorePolicy
impl Clone for CorePolicy
Source§fn clone(&self) -> CorePolicy
fn clone(&self) -> CorePolicy
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for CorePolicy
impl Debug for CorePolicy
Source§impl Default for CorePolicy
impl Default for CorePolicy
Source§impl<'de> Deserialize<'de> for CorePolicy
impl<'de> Deserialize<'de> for CorePolicy
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
impl Eq for CorePolicy
Source§impl PartialEq for CorePolicy
impl PartialEq for CorePolicy
Source§fn eq(&self, other: &CorePolicy) -> bool
fn eq(&self, other: &CorePolicy) -> bool
self and other values to be equal, and is used by ==.Source§impl Serialize for CorePolicy
impl Serialize for CorePolicy
impl StructuralPartialEq for CorePolicy
Auto Trait Implementations§
impl Freeze for CorePolicy
impl RefUnwindSafe for CorePolicy
impl Send for CorePolicy
impl Sync for CorePolicy
impl Unpin for CorePolicy
impl UnsafeUnpin for CorePolicy
impl UnwindSafe for CorePolicy
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.impl<T> ErasedDestructor for Twhere
T: 'static,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more