Skip to main content

MergeGatePolicy

Struct MergeGatePolicy 

Source
pub struct MergeGatePolicy {
    pub sandbox: SandboxConfig,
    pub mission_dir: PathBuf,
}
Expand description

What the merge-gate path needs to wrap its gates (ticket engine-gates-sandbox-wrapped): the MERGED mission’s worker.sandbox config (the gates execute that mission’s worker-authored test/build code, so the worker role’s posture is the right one — the same choice the sandbox preflight makes for contract-command probes) and the mission dir the metadata write-denies / authority read-denies derive from. The server builds one per merge from the folded event state; the gate cwd is only known per command, so the profile resolution itself happens per command inside run_bounded_gate_command_sandboxed.

Fields§

§sandbox: SandboxConfig§mission_dir: PathBuf

Implementations§

Source§

impl MergeGatePolicy

Source

pub fn disabled() -> Self

The no-enforcement policy: gates run exactly as before the wrap.

Source

pub fn enforces_on_this_host(&self) -> bool

Whether resolution on THIS host yields an enforced wrap — the cheap pre-check callers use to choose between the sandboxed runner and their pre-existing executor seam. false only for enforce: off (the byte-identical pre-wrap path). Every requested enforcement returns true — the process provider on any platform (platform_support decides the wrap shape), the container provider with or without a detected runtime (ticket container-gate-wrapper: a runtime wraps the gate in the mission container; none FAILS CLOSED at resolve), and the fail-closed postures (a platform crate::sandbox::platform_support cannot honor, linux WITHOUT bwrap) — those route INTO the sandboxed runner so they error loudly at resolve rather than running unsandboxed (13th-pass review, P1).

Source

pub fn degradation_note(&self) -> Option<String>

The operator-visible note when this policy CANNOT wrap gates despite enforce != off: provider: container with no container runtime on PATH (ticket container-gate-wrapper). The merge gates themselves then FAIL CLOSED at resolve — the server’s merge path has no event log and MUST log this note so the refusal reads as the operator’s config problem it is, not a flaky gate. None for enforce: off (nothing to refuse), for the process provider (which wraps, or fails closed loudly at resolve — an unsupported platform or linux without bwrap needs no note because it errors), and for a container policy WITH a runtime (the gates wrap in the mission container — nothing degraded).

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more