.NET API
LoopCriterion
Tracon.Abstractions.dllOne declarative stop criterion of the harness loop (see LoopSettings).
public sealed record LoopCriterion : IEquatable<LoopCriterion>- Inheritance
- object ← LoopCriterion
- Implements
- IEquatable<LoopCriterion>
- Inherited Members
- object.GetType(), object.ToString(), object.Equals(object?), object.Equals(object?, object?), object.ReferenceEquals(object?, object?), object.GetHashCode()
Remarks
Section titled “Remarks”A criterion carries data only, never code. That is the same
boundary tools and eval checks live behind: a definition can arrive from the
management API, and an interface-authored definition must never be able to
define behavior. A criterion whose logic is written in code is registered
with ITraconBuilder.AddLoopEvaluator(kind, evaluator) and is
referenced here by its registered Kind name alone.
Five kinds are built in. Each reads only the fields listed for it, and ignores the rest:
| Kind | Fields it reads |
|---|---|
| `completionMarker` | `Marker` (required). The loop stops once the agent's answer contains that text. |
| `todoCompletion` | `Modes` (optional). The loop stops once the agent's todo list has no open item left. |
| `aiJudge` | `JudgeCriteria` (required) and `JudgeInstructions` (optional). A judge model decides whether the work is finished. |
| `backgroundTaskCompletion` | None. The loop stops once no background task is still running. |
| `agentReview` | `ReviewerAgent` (required) and `ReviewerAgentVersion` (optional). Another agent of the catalog reads the draft and approves it or sends feedback back. It runs as a child run of the run being evaluated. |
An unknown Kind is rejected when the agent is
built, with TraconCompilationException; it is never ignored.
A silently ignored stop criterion is a loop with no stop criterion.
Constructors
Section titled “Constructors”LoopCriterion()
Section titled “ LoopCriterion()”public LoopCriterion()Properties
Section titled “Properties”JudgeCriteria
Section titled “ JudgeCriteria”Gets the criteria the judge model scores the answer against. Read by
aiJudge only, where at least one entry is required.
public IReadOnlyList<string> JudgeCriteria { get; init; }Property Value
Section titled “Property Value”JudgeInstructions
Section titled “ JudgeInstructions”Gets the extra instructions handed to the judge model. Read by
aiJudge only.
public string? JudgeInstructions { get; init; }Property Value
Section titled “Property Value”Gets the criterion kind: completionMarker, todoCompletion,
aiJudge, backgroundTaskCompletion, agentReview, or a kind
registered in code with AddLoopEvaluator.
public required string Kind { get; init; }Property Value
Section titled “Property Value”Marker
Section titled “ Marker”Gets the completion marker text. Read by completionMarker only,
where it is required.
public string? Marker { get; init; }Property Value
Section titled “Property Value”Gets the agent modes the criterion applies to. Read by
todoCompletion only.
public IReadOnlyList<string> Modes { get; init; }Property Value
Section titled “Property Value”Remarks
Section titled “Remarks”Tracon does not configure the harness mode provider today, so a definition has no mode names of its own to match. Leave this empty unless the agent’s own instructions establish the modes.
ReviewerAgent
Section titled “ ReviewerAgent”Gets the name of the reviewer agent. Read by agentReview only, where it is required.
public string? ReviewerAgent { get; init; }Property Value
Section titled “Property Value”Remarks
Section titled “Remarks”The reviewer is an agent of the catalog, resolved on every iteration. It answers with a
JSON object, {"approved": true|false, "feedback": "..."}; give the reviewer that
answer shape as its own response format.
ReviewerAgentVersion
Section titled “ ReviewerAgentVersion”Gets the version of the reviewer agent. Read by agentReview only;
null runs the reviewer’s current version.
public int? ReviewerAgentVersion { get; init; }Property Value
Section titled “Property Value”int?
Remarks
Section titled “Remarks”The same meaning as WorkflowNodeReference.AgentVersion: a number of 1 or more. An agent
defined in code keeps no version history, so a version for one is refused.
Methods
Section titled “Methods”Equals(object?)
Section titled “ Equals(object?)”public override bool Equals(object? obj)Parameters
Section titled “Parameters”obj object?
Returns
Section titled “Returns”Equals(LoopCriterion?)
Section titled “ Equals(LoopCriterion?)”public bool Equals(LoopCriterion? other)Parameters
Section titled “Parameters”other LoopCriterion?
Returns
Section titled “Returns”GetHashCode()
Section titled “ GetHashCode()”public override int GetHashCode()Returns
Section titled “Returns”ToString()
Section titled “ ToString()”public override string ToString()Returns
Section titled “Returns”Operators
Section titled “Operators”operator ==(LoopCriterion?, LoopCriterion?)
Section titled “ operator ==(LoopCriterion?, LoopCriterion?)”public static bool operator ==(LoopCriterion? left, LoopCriterion? right)Parameters
Section titled “Parameters”left LoopCriterion?
right LoopCriterion?
Returns
Section titled “Returns”operator !=(LoopCriterion?, LoopCriterion?)
Section titled “ operator !=(LoopCriterion?, LoopCriterion?)”public static bool operator !=(LoopCriterion? left, LoopCriterion? right)Parameters
Section titled “Parameters”left LoopCriterion?
right LoopCriterion?