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>

objectLoopCriterion

IEquatable<LoopCriterion>

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.

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

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

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