Record Class AgentRun
java.lang.Object
java.lang.Record
com.tnsai.quality.security.harness.AgentRun
- Record Components:
agentId- stable id of the agent backend ("claude-opus-4-7")agentVersion- agent backend version / model identifier; bumping this invalidates cached runsstartedAt- when the agent was invokedfinishedAt- when the run completed (or failed)findingCount- number of findings producedinputHash- hash of the input the agent saw (file content + prompt template); same hash + same agentVersion = cached run, skiperror- present when the run failed; absent on success
public record AgentRun(String agentId, String agentVersion, Instant startedAt, Instant finishedAt, int findingCount, String inputHash, Optional<String> error)
extends Record
History entry for one
ReviewAgentSpi invocation against a single
FileRecord (TNS-291).
Used by the PipelineStateStore to make agent runs idempotent
— a re-run sees the previous run's agentVersion +
inputHash and skips when nothing has changed.
- Since:
- 0.10.0 (TNS-291)
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionagentId()Returns the value of theagentIdrecord component.Returns the value of theagentVersionrecord component.longWall-clock duration of the run in milliseconds.final booleanIndicates whether some other object is "equal to" this one.error()Returns the value of theerrorrecord component.intReturns the value of thefindingCountrecord component.Returns the value of thefinishedAtrecord component.final inthashCode()Returns a hash code value for this object.Returns the value of theinputHashrecord component.Returns the value of thestartedAtrecord component.booleantruewhen the run completed without recording an error.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
AgentRun
public AgentRun(String agentId, String agentVersion, Instant startedAt, Instant finishedAt, int findingCount, String inputHash, Optional<String> error) Creates an instance of aAgentRunrecord class.- Parameters:
agentId- the value for theagentIdrecord componentagentVersion- the value for theagentVersionrecord componentstartedAt- the value for thestartedAtrecord componentfinishedAt- the value for thefinishedAtrecord componentfindingCount- the value for thefindingCountrecord componentinputHash- the value for theinputHashrecord componenterror- the value for theerrorrecord component
-
-
Method Details
-
durationMs
public long durationMs()Wall-clock duration of the run in milliseconds. -
succeeded
public boolean succeeded()truewhen the run completed without recording an error. -
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. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with '=='. -
agentId
Returns the value of theagentIdrecord component.- Returns:
- the value of the
agentIdrecord component
-
agentVersion
Returns the value of theagentVersionrecord component.- Returns:
- the value of the
agentVersionrecord component
-
startedAt
Returns the value of thestartedAtrecord component.- Returns:
- the value of the
startedAtrecord component
-
finishedAt
Returns the value of thefinishedAtrecord component.- Returns:
- the value of the
finishedAtrecord component
-
findingCount
public int findingCount()Returns the value of thefindingCountrecord component.- Returns:
- the value of the
findingCountrecord component
-
inputHash
Returns the value of theinputHashrecord component.- Returns:
- the value of the
inputHashrecord component
-
error
Returns the value of theerrorrecord component.- Returns:
- the value of the
errorrecord component
-