Record Class FileRecord
java.lang.Object
java.lang.Record
com.tnsai.quality.security.harness.FileRecord
- Record Components:
path- relative to the project rootcontentHash- SHA-256 of file bytes; bumping invalidates cached findings + agent runscandidateMatchers- ids of the matchers that fired during scanfindings- all findings, deduplicated byReviewFinding.id()runs- history ofReviewAgentSpiinvocations on this filemetadata- free-form key/values
public record FileRecord(Path path, String contentHash, Set<String> candidateMatchers, List<ReviewFinding> findings, List<AgentRun> runs, Map<String,String> metadata)
extends Record
Per-file canonical state in the code-review pipeline (TNS-291).
Owns three things:
- Identity — relative path + content hash. Two records for the same path with different content hashes are different entries; the state store keeps the latest.
- Candidate matchers — ids of the
MatcherSpis that fired duringscan; tells theprocessstage which agent prompts to use. - Aggregated findings + agent-run history — what the pipeline has discovered + how it discovered it.
- Since:
- 0.10.0 (TNS-291)
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of thecandidateMatchersrecord component.Returns the value of thecontentHashrecord component.final booleanIndicates whether some other object is "equal to" this one.findings()Returns the value of thefindingsrecord component.final inthashCode()Returns a hash code value for this object.metadata()Returns the value of themetadatarecord component.path()Returns the value of thepathrecord component.runs()Returns the value of therunsrecord component.static FileRecordEmpty record for a file that has been scanned but not yet processed.final StringtoString()Returns a string representation of this record class.withFinding(ReviewFinding finding) Add a finding; returns a new record (records are immutable).Append an agent run to history.
-
Constructor Details
-
FileRecord
public FileRecord(Path path, String contentHash, Set<String> candidateMatchers, List<ReviewFinding> findings, List<AgentRun> runs, Map<String, String> metadata) Creates an instance of aFileRecordrecord class.- Parameters:
path- the value for thepathrecord componentcontentHash- the value for thecontentHashrecord componentcandidateMatchers- the value for thecandidateMatchersrecord componentfindings- the value for thefindingsrecord componentruns- the value for therunsrecord componentmetadata- the value for themetadatarecord component
-
-
Method Details
-
scanned
Empty record for a file that has been scanned but not yet processed. The scan stage emits this shape; subsequent stages append to it. -
withFinding
Add a finding; returns a new record (records are immutable). -
withRun
Append an agent run to history. -
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. -
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. -
equals
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 withObjects::equals(Object,Object). -
path
Returns the value of thepathrecord component.- Returns:
- the value of the
pathrecord component
-
contentHash
Returns the value of thecontentHashrecord component.- Returns:
- the value of the
contentHashrecord component
-
candidateMatchers
Returns the value of thecandidateMatchersrecord component.- Returns:
- the value of the
candidateMatchersrecord component
-
findings
Returns the value of thefindingsrecord component.- Returns:
- the value of the
findingsrecord component
-
runs
Returns the value of therunsrecord component.- Returns:
- the value of the
runsrecord component
-
metadata
Returns the value of themetadatarecord component.- Returns:
- the value of the
metadatarecord component
-