Skip to main content

Classification

Enum Classification 

Source
pub enum Classification {
    Failure {
        label: String,
        output: String,
    },
    Passthrough {
        output: String,
    },
    Success {
        label: String,
        summary: String,
    },
    Large {
        label: String,
        output: String,
        size: usize,
    },
}
Expand description

Command output classification result.

Represents the outcome of analyzing a command’s exit code and output. Each variant determines how the output should be presented to the AI agent.

§Variants

  • Failure: Command exited non-zero. Contains filtered error output.
  • Passthrough: Command succeeded with small output. Contains verbatim output.
  • Success: Command succeeded with large output and pattern match. Contains compressed summary.
  • Large: Command succeeded with large output and no pattern. Output is indexed for recall.

The classification is produced by the classify function.

Variants§

§

Failure

Exit ≠ 0. Filtered failure output.

§Fields

  • label - Short label derived from the command (e.g., “cargo”, “pytest”).
  • output - Filtered error output, truncated if large.

Fields

§label: String

Short label derived from the command (e.g., “cargo”, “pytest”).

§output: String

Filtered error output, truncated if large.

§

Passthrough

Exit 0, output ≤ threshold. Verbatim.

§Fields

  • output - The full command output (merged stdout and stderr).

Fields

§output: String

The full command output (merged stdout and stderr).

§

Success

Exit 0, output > threshold, pattern matched with summary.

§Fields

  • label - Short label derived from the command (e.g., “cargo”, “pytest”).
  • summary - Compressed summary extracted using the pattern’s template.

Fields

§label: String

Short label derived from the command (e.g., “cargo”, “pytest”).

§summary: String

Compressed summary extracted using the pattern’s template.

§

Large

Exit 0, output > threshold, no pattern. Content needs indexing.

§Fields

  • label - Short label derived from the command (e.g., “git”, “gh”).
  • output - The full command output to be indexed for recall.
  • size - Size of the output in bytes.

Fields

§label: String

Short label derived from the command (e.g., “git”, “gh”).

§output: String

The full command output to be indexed for recall.

§size: usize

Size of the output in bytes.

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, 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, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.