Skip to content
Tracon

LoopCriterion

Namespace Tracon · Assembly Tracon.Abstractions.dll

One 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()

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:

KindFields 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.

public LoopCriterion()

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; }

IReadOnlyList<string>

Gets the extra instructions handed to the judge model. Read by aiJudge only.

public string? JudgeInstructions { get; init; }

string?

Gets the criterion kind: completionMarker, todoCompletion, aiJudge, backgroundTaskCompletion, agentReview, or a kind registered in code with AddLoopEvaluator.

public required string Kind { get; init; }

string

Gets the completion marker text. Read by completionMarker only, where it is required.

public string? Marker { get; init; }

string?

Gets the agent modes the criterion applies to. Read by todoCompletion only.

public IReadOnlyList<string> Modes { get; init; }

IReadOnlyList<string>

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.

Gets the name of the reviewer agent. Read by agentReview only, where it is required.

public string? ReviewerAgent { get; init; }

string?

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.

Gets the version of the reviewer agent. Read by agentReview only; null runs the reviewer’s current version.

public int? ReviewerAgentVersion { get; init; }

int?

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.

public override bool Equals(object? obj)

obj object?

bool

public bool Equals(LoopCriterion? other)

other LoopCriterion?

bool

public override int GetHashCode()

int

public override string ToString()

string

operator ==(LoopCriterion?, LoopCriterion?)

Section titled “ operator ==(LoopCriterion?, LoopCriterion?)”
public static bool operator ==(LoopCriterion? left, LoopCriterion? right)

left LoopCriterion?

right LoopCriterion?

bool

operator !=(LoopCriterion?, LoopCriterion?)

Section titled “ operator !=(LoopCriterion?, LoopCriterion?)”
public static bool operator !=(LoopCriterion? left, LoopCriterion? right)

left LoopCriterion?

right LoopCriterion?

bool