pub enum IssueCode {
Show 16 variants
UndefinedCommand,
MissingRequiredArg,
UnknownFlag,
InvalidArgType,
SeqZeroIncrement,
InvalidRegex,
BreakOutsideLoop,
ReturnOutsideFunction,
PossiblyUndefinedVariable,
ForLoopScalarVar,
ScatterWithoutGather,
LastResultFieldAccess,
DiffNeedsTwoFiles,
InvalidSedExpr,
InvalidJqFilter,
PosixTestCommand,
}Expand description
Categorizes validation issues for filtering and tooling.
Variants§
UndefinedCommand
Command not found in registry or user tools.
MissingRequiredArg
Required parameter not provided.
UnknownFlag
Flag not defined in tool schema.
InvalidArgType
Argument type doesn’t match schema.
SeqZeroIncrement
seq increment is zero (infinite loop).
InvalidRegex
Regex pattern is invalid.
BreakOutsideLoop
break/continue outside of a loop.
ReturnOutsideFunction
return outside of a function.
PossiblyUndefinedVariable
Variable may be undefined.
ForLoopScalarVar
Bare scalar variable in for loop (no word splitting in kaish).
ScatterWithoutGather
scatter without gather — parallel results would be lost.
LastResultFieldAccess
Field access on $? (e.g. ${?.data}, ${?.ok}) was removed.
$? is the POSIX exit code; use kaish-last for structured data.
DiffNeedsTwoFiles
diff was given other than two file operands.
InvalidSedExpr
sed expression is syntactically invalid.
InvalidJqFilter
jq filter expression is syntactically invalid.
PosixTestCommand
A POSIX test / [ … ] conditional was used. kaish has no such command
(it would resolve to an external binary that bypasses the VFS); use
[[ … ]], which the validator checks before runtime.
Implementations§
Source§impl IssueCode
impl IssueCode
Sourcepub fn code(&self) -> &'static str
pub fn code(&self) -> &'static str
Returns a short code string for the issue.
Code numbers are stable identifiers, not contiguous. E010 and W003/W004/W005 remain retired. E006 (InvalidSedExpr), E007 (InvalidJqFilter), and E011 (DiffNeedsTwoFiles) were wired up with real emitters in 2026-06-14.
Sourcepub fn surfaces_to_agent(&self) -> bool
pub fn surfaces_to_agent(&self) -> bool
Whether a warning carrying this code should be surfaced to the agent (appended to the result’s stderr) rather than only trace-logged.
Most warnings stay trace-only — UndefinedCommand fires on every
external command (grep, cargo), so surfacing them all would be
noise. Opt a code in here only when its guidance is worth interrupting
for. This is the surfacing seam for the “did-you-mean” guidance pass.
Sourcepub fn default_severity(&self) -> Severity
pub fn default_severity(&self) -> Severity
Default severity for this issue code.
Trait Implementations§
impl Copy for IssueCode
impl Eq for IssueCode
impl StructuralPartialEq for IssueCode
Auto Trait Implementations§
impl Freeze for IssueCode
impl RefUnwindSafe for IssueCode
impl Send for IssueCode
impl Sync for IssueCode
impl Unpin for IssueCode
impl UnsafeUnpin for IssueCode
impl UnwindSafe for IssueCode
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§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.