Record Class AiCacheEntry

java.lang.Object
java.lang.Record
org.egothor.methodatlas.AiCacheEntry
Record Components:
contentHash - SHA-256 fingerprint of the class source; never null
promptSignature - catalogue signature that produced this answer, or null for a legacy CSV-sourced entry
suggestion - the cached AI answer (classifications and, when present, credential verdicts); never null

public record AiCacheEntry(String contentHash, String promptSignature, org.egothor.methodatlas.ai.AiClassSuggestion suggestion) extends Record
One entry of the unified AI result cache: the complete AI answer for a single test class, keyed by the class content hash and tagged with the prompt-catalogue signature that produced it.

The suggestion carries both the method classifications (AiClassSuggestion.methods()) and any credential-triage verdicts (AiClassSuggestion.secrets()), so a single cached entry can answer a later classification-only run, a later credential run, or a combined run — without re-querying the model — as long as promptSignature() matches the current run's PromptTemplateSet.signature().

A null promptSignature denotes a legacy entry (loaded from a pre-unified CSV cache): its classifications may still be reused by content hash, but it carries no credential verdicts and cannot satisfy a credential query.

Since:
4.1.0
  • Constructor Details

    • AiCacheEntry

      public AiCacheEntry(String contentHash, String promptSignature, org.egothor.methodatlas.ai.AiClassSuggestion suggestion)
      Creates an instance of a AiCacheEntry record class.
      Parameters:
      contentHash - the value for the contentHash record component
      promptSignature - the value for the promptSignature record component
      suggestion - the value for the suggestion record component
  • Method Details

    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared with Objects::equals(Object,Object).
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • contentHash

      public String contentHash()
      Returns the value of the contentHash record component.
      Returns:
      the value of the contentHash record component
    • promptSignature

      public String promptSignature()
      Returns the value of the promptSignature record component.
      Returns:
      the value of the promptSignature record component
    • suggestion

      public org.egothor.methodatlas.ai.AiClassSuggestion suggestion()
      Returns the value of the suggestion record component.
      Returns:
      the value of the suggestion record component