Skip to main content

Module patterns

Module patterns 

Source
Expand description

Command classification patterns for identifying compilation commands.

Implements the 5-tier classification system:

  • Tier 0: Instant reject (non-Bash, empty)
  • Tier 1: Structure analysis (pipes, redirects, background)
  • Tier 2: SIMD keyword filter
  • Tier 3: Negative pattern check
  • Tier 4: Full classification with confidence

Structs§

Classification
Result of command classification.
ClassificationDetails
Detailed classification results with per-tier decisions.
ClassificationTier
Detailed result for a single classification tier.

Enums§

CompilationKind
Kind of compilation command detected.
TierDecision
Decision outcome for a classification tier.

Statics§

COMPILATION_KEYWORDS
Keywords that indicate a potential compilation command. Used for SIMD-accelerated quick filtering (Tier 2).
NEVER_INTERCEPT
Commands that should NEVER be intercepted, even if they contain compilation keywords. These either modify local state or have dependencies on local execution.

Functions§

classify_command
Classify a shell command.
classify_command_detailed
Classify a shell command with detailed tier decisions for diagnostics.
normalize_command
Normalize a command by stripping common wrappers (sudo, time, env, etc.)
split_shell_commands
Split a shell command string on unquoted ;, &&, and || operators.