Class: ClaudeMemory::Audit::Finding

Inherits:
Data
  • Object
show all
Defined in:
lib/claude_memory/audit/finding.rb

Overview

A single audit finding. Immutable value object emitted by checks (see Audit::Checks) and aggregated by Audit::Runner.

Severity levels:

- :error — a contract violation; CI/automation should fail
- :warn  — likely problem requiring attention but not blocking
- :info  — observation; suggests an optimization or cleanup

Each finding embeds the suggested remediation command(s) as plain strings so the audit output is directly actionable. The skill ‘/audit-memory` reads these and offers to run them for the user.

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#detailObject (readonly)

Returns the value of attribute detail

Returns:

  • (Object)

    the current value of detail



16
17
18
# File 'lib/claude_memory/audit/finding.rb', line 16

def detail
  @detail
end

#fact_idsObject (readonly)

Returns the value of attribute fact_ids

Returns:

  • (Object)

    the current value of fact_ids



16
17
18
# File 'lib/claude_memory/audit/finding.rb', line 16

def fact_ids
  @fact_ids
end

#idObject (readonly)

Returns the value of attribute id

Returns:

  • (Object)

    the current value of id



16
17
18
# File 'lib/claude_memory/audit/finding.rb', line 16

def id
  @id
end

#severityObject (readonly)

Returns the value of attribute severity

Returns:

  • (Object)

    the current value of severity



16
17
18
# File 'lib/claude_memory/audit/finding.rb', line 16

def severity
  @severity
end

#suggestionObject (readonly)

Returns the value of attribute suggestion

Returns:

  • (Object)

    the current value of suggestion



16
17
18
# File 'lib/claude_memory/audit/finding.rb', line 16

def suggestion
  @suggestion
end

#titleObject (readonly)

Returns the value of attribute title

Returns:

  • (Object)

    the current value of title



16
17
18
# File 'lib/claude_memory/audit/finding.rb', line 16

def title
  @title
end

Instance Method Details

#error?Boolean

Returns:

  • (Boolean)


17
# File 'lib/claude_memory/audit/finding.rb', line 17

def error? = severity == :error

#info?Boolean

Returns:

  • (Boolean)


19
# File 'lib/claude_memory/audit/finding.rb', line 19

def info? = severity == :info

#to_hObject



21
22
23
24
25
26
27
28
29
30
# File 'lib/claude_memory/audit/finding.rb', line 21

def to_h
  {
    id: id,
    severity: severity,
    title: title,
    detail: detail,
    suggestion: suggestion,
    fact_ids: fact_ids
  }
end

#warn?Boolean

Returns:

  • (Boolean)


18
# File 'lib/claude_memory/audit/finding.rb', line 18

def warn? = severity == :warn