Class DefaultFailureMiner

java.lang.Object
com.tnsai.evaluation.autoharness.DefaultFailureMiner
All Implemented Interfaces:
FailureMiner

public final class DefaultFailureMiner extends Object implements FailureMiner
Thread-safe FailureMiner that collects failures reported via record(FailureRecord).

Designed to be wired as a listener on EvalHook onError events. Callers push failures in; mine() returns the accumulated buffer.

Since:
0.1.0
  • Constructor Details

    • DefaultFailureMiner

      public DefaultFailureMiner()
  • Method Details

    • record

      public void record(FailureRecord failure)
      Records a failure into the mining buffer.
    • record

      public void record(String agentId, String phase, Throwable error)
      Records a failure from raw error information.
    • record

      public void record(String agentId, String phase, String errorType, String message, Map<String,String> context)
      Records a failure from raw error information with context.
    • mine

      public List<FailureRecord> mine()
      Description copied from interface: FailureMiner
      Mines failures accumulated since the last call (or since construction).
      Specified by:
      mine in interface FailureMiner
      Returns:
      unmodifiable list of mined failure records
    • clear

      public void clear()
      Description copied from interface: FailureMiner
      Clears the internal failure buffer. Called after successful processing.
      Specified by:
      clear in interface FailureMiner
    • size

      public int size()
      Returns the current buffer size without copying.