Skip to content

Evaluator: add debug-level tracing for skipped rules #172

@unclesp1d3r

Description

@unclesp1d3r

Summary

Add debug-level trace output when evaluate_rules skips a rule due to an expected evaluation error (BufferOverrun, InvalidOffset, TypeReadError).

Context

In src/evaluator/engine/mod.rs, the evaluate_rules function gracefully skips individual rules that fail with expected evaluation errors (line ~200). This is correct behavior -- one rule's buffer overrun should not abort evaluation of all remaining rules.

However, when a rule is skipped, there is no diagnostic output. Users cannot distinguish between "rule didn't match the file" and "rule failed internally." This makes debugging magic file rules difficult.

Acceptance Criteria

  • Emit a debug-level trace when a rule is skipped due to evaluation error
  • Include the rule message and error details in the trace
  • No output at default log level (debug only)
  • Same treatment for child rule evaluation errors (line ~250)

Impact

LOW -- Developer/debugging experience improvement. No functional impact.

Files to Modify

  • src/evaluator/engine/mod.rs -- Add tracing::debug! or log::debug! calls at skip points

References

  • TODO comment at src/evaluator/engine/mod.rs:201

Metadata

Metadata

Assignees

Labels

enhancementNew feature or requestevaluatorRule evaluation engine and logicpriority:lowNice to have, can defer

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions