Package com.tnsai.reliability
Record Class RunConfig
java.lang.Object
java.lang.Record
com.tnsai.reliability.RunConfig
- Record Components:
maxDuration- hard wall-clock cap; the orchestrator aborts withAbortReason.MAX_DURATION_EXCEEDEDwhen crossedcostCeilingUSD- optional spend cap in USD; empty disables runtime cost-ceiling checks (the run still participates in any external budget enforcement, just not at the loop level)checkpointInterval- minimum gap between forced checkpoints; the orchestrator may also checkpoint on every step boundary, but this caps the worst-case replay window after a crashmaxRetries- per-step retry budget before the orchestrator gives up and marks the run failedprogressTimeout- declare a run "stuck" when noProgressevent has been emitted within this window — orientation cue for operators
public record RunConfig(Duration maxDuration, Optional<BigDecimal> costCeilingUSD, Duration checkpointInterval, int maxRetries, Duration progressTimeout)
extends Record
Execution-time policy bundle for one run of a
ResumableRun
(TNS-299). Caps duration, cost, retry attempts, and checkpoint cadence
— every long-running agent execution should be bounded along these
axes, otherwise a runaway loop is indistinguishable from real work.
USD is the only currency the framework acknowledges today (matches
the cost-governance layer in tnsai-quality.cost). Currency
unification is explicitly out of scope for the framework primitives.
- Since:
- 0.10.0 (TNS-299)
-
Nested Class Summary
Nested Classes -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic RunConfig.Builderbuilder()Returns the value of thecheckpointIntervalrecord component.Returns the value of thecostCeilingUSDrecord component.static RunConfigdefaults()Sensible defaults for a multi-hour overnight run: 8h max, no cost ceiling (consumer wires cost-governance separately when needed), 5-minute checkpoint cap, 3 retries, 10-minute progress timeout.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.Returns the value of themaxDurationrecord component.intReturns the value of themaxRetriesrecord component.Returns the value of theprogressTimeoutrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
RunConfig
public RunConfig(Duration maxDuration, Optional<BigDecimal> costCeilingUSD, Duration checkpointInterval, int maxRetries, Duration progressTimeout) Creates an instance of aRunConfigrecord class.- Parameters:
maxDuration- the value for themaxDurationrecord componentcostCeilingUSD- the value for thecostCeilingUSDrecord componentcheckpointInterval- the value for thecheckpointIntervalrecord componentmaxRetries- the value for themaxRetriesrecord componentprogressTimeout- the value for theprogressTimeoutrecord component
-
-
Method Details
-
defaults
Sensible defaults for a multi-hour overnight run: 8h max, no cost ceiling (consumer wires cost-governance separately when needed), 5-minute checkpoint cap, 3 retries, 10-minute progress timeout. -
builder
-
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 '=='. -
maxDuration
Returns the value of themaxDurationrecord component.- Returns:
- the value of the
maxDurationrecord component
-
costCeilingUSD
Returns the value of thecostCeilingUSDrecord component.- Returns:
- the value of the
costCeilingUSDrecord component
-
checkpointInterval
Returns the value of thecheckpointIntervalrecord component.- Returns:
- the value of the
checkpointIntervalrecord component
-
maxRetries
public int maxRetries()Returns the value of themaxRetriesrecord component.- Returns:
- the value of the
maxRetriesrecord component
-
progressTimeout
Returns the value of theprogressTimeoutrecord component.- Returns:
- the value of the
progressTimeoutrecord component
-