Package com.tnsai.quality.sandbox
Record Class SandboxExecutionEvent
java.lang.Object
java.lang.Record
com.tnsai.quality.sandbox.SandboxExecutionEvent
- Record Components:
eventId- unique id, helpful for log correlationtimestamp- when the execution startedsandboxId- stable id of the sandbox (factory id + instance counter); same instance reused across executes carries the same idbackend- sandbox backend that ran the command (e.g."process","container")image- image / runtime identifier fromSandboxSpec.image(); empty for backends that don't use imagesargv- executed argvexitCode- fromSandboxResulttimedOut- fromSandboxResultresourceUsage- fromSandboxResultnetworkPolicy- class name of the policy that was in effect ("DenyAll","Inherit","AllowList") — string so consumers don't have to depend on the sealed-interface hierarchy
public record SandboxExecutionEvent(String eventId, Instant timestamp, String sandboxId, String backend, String image, List<String> argv, int exitCode, boolean timedOut, ResourceUsage resourceUsage, String networkPolicy)
extends Record
Per-execute observability event for the sandbox layer (TNS-296).
Emitted to a
SandboxExecutionListener when one is wired
onto a Sandbox; carries enough information for downstream
audit / metrics / billing pipelines to attribute resource cost
back to the policy that authorised it.
Pairs with TnsAI accountability (TNS-298): the correlationId
the sandbox event carries can be the same id stamped on the
AgentLiabilityRecord that triggered the dispatch — a single
audit timeline for "agent X attempted action Y inside sandbox Z".
- Since:
- 0.10.0 (TNS-296)
-
Constructor Summary
ConstructorsConstructorDescriptionSandboxExecutionEvent(String eventId, Instant timestamp, String sandboxId, String backend, String image, List<String> argv, int exitCode, boolean timedOut, ResourceUsage resourceUsage, String networkPolicy) Creates an instance of aSandboxExecutionEventrecord class. -
Method Summary
Modifier and TypeMethodDescriptionargv()Returns the value of theargvrecord component.backend()Returns the value of thebackendrecord component.final booleanIndicates whether some other object is "equal to" this one.eventId()Returns the value of theeventIdrecord component.intexitCode()Returns the value of theexitCoderecord component.final inthashCode()Returns a hash code value for this object.image()Returns the value of theimagerecord component.Returns the value of thenetworkPolicyrecord component.Returns the value of theresourceUsagerecord component.Returns the value of thesandboxIdrecord component.booleantimedOut()Returns the value of thetimedOutrecord component.Returns the value of thetimestamprecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
SandboxExecutionEvent
public SandboxExecutionEvent(String eventId, Instant timestamp, String sandboxId, String backend, String image, List<String> argv, int exitCode, boolean timedOut, ResourceUsage resourceUsage, String networkPolicy) Creates an instance of aSandboxExecutionEventrecord class.- Parameters:
eventId- the value for theeventIdrecord componenttimestamp- the value for thetimestamprecord componentsandboxId- the value for thesandboxIdrecord componentbackend- the value for thebackendrecord componentimage- the value for theimagerecord componentargv- the value for theargvrecord componentexitCode- the value for theexitCoderecord componenttimedOut- the value for thetimedOutrecord componentresourceUsage- the value for theresourceUsagerecord componentnetworkPolicy- the value for thenetworkPolicyrecord component
-
-
Method Details
-
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 '=='. -
eventId
Returns the value of theeventIdrecord component.- Returns:
- the value of the
eventIdrecord component
-
timestamp
Returns the value of thetimestamprecord component.- Returns:
- the value of the
timestamprecord component
-
sandboxId
Returns the value of thesandboxIdrecord component.- Returns:
- the value of the
sandboxIdrecord component
-
backend
Returns the value of thebackendrecord component.- Returns:
- the value of the
backendrecord component
-
image
Returns the value of theimagerecord component.- Returns:
- the value of the
imagerecord component
-
argv
Returns the value of theargvrecord component.- Returns:
- the value of the
argvrecord component
-
exitCode
public int exitCode()Returns the value of theexitCoderecord component.- Returns:
- the value of the
exitCoderecord component
-
timedOut
public boolean timedOut()Returns the value of thetimedOutrecord component.- Returns:
- the value of the
timedOutrecord component
-
resourceUsage
Returns the value of theresourceUsagerecord component.- Returns:
- the value of the
resourceUsagerecord component
-
networkPolicy
Returns the value of thenetworkPolicyrecord component.- Returns:
- the value of the
networkPolicyrecord component
-