PropertyDamage.FailureIntelligence.Fingerprint (PropertyDamage v0.2.0)

View Source

Extracts comparable features from failures for similarity analysis.

A fingerprint captures the essential characteristics of a failure that can be used to compare it with other failures. This enables pattern detection and clustering of similar failures.

Summary

Functions

Extracts a fingerprint from a FailureReport.

Extracts a fingerprint from a raw failure result (not yet a FailureReport).

Returns a hash of the fingerprint for quick comparison.

Returns a short hash for display purposes.

Types

t()

@type t() :: %PropertyDamage.FailureIntelligence.Fingerprint{
  check_name: atom() | nil,
  command_shape: map(),
  command_type: atom() | nil,
  error_category: atom(),
  error_origin: atom() | nil,
  error_origin_reason: String.t() | nil,
  error_pattern: String.t() | nil,
  event_count: non_neg_integer(),
  event_types: [atom()],
  failure_type: atom(),
  sequence_length: non_neg_integer(),
  sequence_shape: [atom()],
  state_keys: [atom()]
}

Functions

from_failure_report(report)

@spec from_failure_report(PropertyDamage.FailureReport.t()) :: t()

Extracts a fingerprint from a FailureReport.

The fingerprint captures structural and semantic features that can be compared across different failures.

from_raw_failure(failure)

@spec from_raw_failure(map()) :: t()

Extracts a fingerprint from a raw failure result (not yet a FailureReport).

hash(fp)

@spec hash(t()) :: binary()

Returns a hash of the fingerprint for quick comparison.

Two fingerprints with the same hash are likely (but not guaranteed) to be similar.

short_hash(fp)

@spec short_hash(t()) :: String.t()

Returns a short hash for display purposes.