pub enum OutputPolicy {
Passthrough,
Verbatim,
Compressible,
}Expand description
Central command output classification.
Every shell command flows through classify before any compression
decision is made. This is the SINGLE source of truth — no other
code path may bypass it.
Priority (first match wins):
- User
excluded_commandsconfig → Passthrough BUILTIN_PASSTHROUGH+ dev scripts → Passthrough- Verbatim data commands → Verbatim
- Everything else → Compressible (pattern engine decides specific vs generic later)
Variants§
Passthrough
Auth flows, dev servers, interactive, streaming, installs.
Output is passed through with ZERO modification, even when
LEAN_CTX_COMPRESS=1 (force_compress) is set.
Verbatim
API data, file content, structured queries, HTTP responses. Output is preserved as-is. Only a hard size-cap is applied when the output exceeds the context window limit.
Compressible
Build, test, lint, package manager, git action output. Domain-specific pattern compression is applied, then generic fallback if no pattern matches.
Implementations§
Source§impl OutputPolicy
impl OutputPolicy
Sourcepub fn is_protected(&self) -> bool
pub fn is_protected(&self) -> bool
Returns true if the output MUST NOT be compressed under any circumstances (not even truncated, except for catastrophic size).
Trait Implementations§
Source§impl Clone for OutputPolicy
impl Clone for OutputPolicy
Source§fn clone(&self) -> OutputPolicy
fn clone(&self) -> OutputPolicy
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 OutputPolicy
impl Debug for OutputPolicy
Source§impl PartialEq for OutputPolicy
impl PartialEq for OutputPolicy
Source§fn eq(&self, other: &OutputPolicy) -> bool
fn eq(&self, other: &OutputPolicy) -> bool
self and other values to be equal, and is used by ==.impl Copy for OutputPolicy
impl Eq for OutputPolicy
impl StructuralPartialEq for OutputPolicy
Auto Trait Implementations§
impl Freeze for OutputPolicy
impl RefUnwindSafe for OutputPolicy
impl Send for OutputPolicy
impl Sync for OutputPolicy
impl Unpin for OutputPolicy
impl UnsafeUnpin for OutputPolicy
impl UnwindSafe for OutputPolicy
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,
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.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
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