.NET API
RunScoreRules
Tracon.Abstractions.dllThe shared rules a RunScore must satisfy before it is stored.
public static class RunScoreRulesInheritance
Section titled “Inheritance”Inherited Members
Section titled “Inherited Members”object.GetType(), object.MemberwiseClone(), object.ToString(), object.Equals(object?), object.Equals(object?, object?), object.ReferenceEquals(object?, object?), object.GetHashCode()
Remarks
Section titled “Remarks”Public because IRunScoreStore is an extension point: a consumer’s own store must enforce the same invariants, and the shipped store contract tests hold it to them. Writing the rule a second time by hand would produce a second validation path that drifts.
The Tracon HTTP endpoint calls RunScoreRules.IsValidName and the
RunScoreKind.Categorical invariant itself so it can answer
400 instead of letting the store throw.
Fields
Section titled “Fields”DefaultName
Section titled “ DefaultName”The name written when a caller supplies none.
public const string DefaultName = "overall"Field Value
Section titled “Field Value”Remarks
Section titled “Remarks”Also the name the migration gives every human score row written before scores had names.
MaxNameLength
Section titled “ MaxNameLength”The greatest allowed RunScore.Name length.
public const int MaxNameLength = 64Field Value
Section titled “Field Value”MaxTextValueLength
Section titled “ MaxTextValueLength”The greatest allowed RunScore.TextValue length.
public const int MaxTextValueLength = 256Field Value
Section titled “Field Value”NameDescription
Section titled “ NameDescription”The human-readable name rule, used in error messages.
public const string NameDescription = "A run score name must match [A-Za-z0-9._-]{1,64}."Field Value
Section titled “Field Value”Methods
Section titled “Methods”IsValidName(string?)
Section titled “ IsValidName(string?)”Reports whether name is a legal score name.
public static bool IsValidName(string? name)Parameters
Section titled “Parameters”name string?
The candidate name.
Returns
Section titled “Returns”true if the name matches [A-Za-z0-9._-]{1,64}.
Validate(RunScore)
Section titled “ Validate(RunScore)”Throws when score breaks a stored invariant.
public static void Validate(RunScore score)Parameters
Section titled “Parameters”score RunScore
The score about to be written.
Remarks
Section titled “Remarks”The value-shape invariant: a RunScoreKind.Categorical score carries RunScore.TextValue and no RunScore.Value; every other kind carries RunScore.Value and no RunScore.TextValue. A null RunScore.Value stays legal on the other kinds — it records that no measurement was made.
Exceptions
Section titled “Exceptions”score is null.
The name breaks RunScoreRules.NameDescription, or the value shape does not match RunScore.Kind.