Skip to content

feat(reliability): wire FaultCategory enum path in native.rs Err branch for skill evolution #2224

@bug-ops

Description

@bug-ops

Context

PR for #2207/#2206 added From<FaultCategory> for FailureKind mapping (executor.rs → evolution.rs) but the enum-based path is not yet wired at the call sites. All 3 call sites still use FailureKind::from_error() string heuristic:

  • native.rs:1379: FailureKind::from_error(&output)
  • legacy.rs:560: FailureKind::from_error(&err_str)
  • legacy.rs:603: FailureKind::from_error(&output.summary)

Problem

In native.rs Err branch (lines 1325-1349), e: ToolError goes out of scope before the skill outcome recording at line 1379. The precise enum-based FaultCategory classification is lost — the heuristic then re-parses the formatted corrective signal text to recover the same information.

Fix

In the Err(e) arm of native.rs (around line 1349), capture e.fault_category() before e is consumed by to_corrective_signal() or Display, then pass FailureKind::from(fault_category) to the skill outcome recording at line 1379.

Same fix applicable to legacy.rs if ToolError is accessible there.

Impact

Enables precise, enum-based skill evolution signal for classified tool failures — PolicyBlocked → WrongApproach, InvalidArguments → BadInput, etc. — instead of relying on keyword matching in the formatted signal text.

References

Metadata

Metadata

Assignees

Labels

P3Research — medium-high complexityenhancementNew feature or requestskillszeph-skills crate

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions