Table of Contents

Class CriterionStatus

Namespace
Excalibur.Compliance
Assembly
Excalibur.Compliance.Abstractions.dll

Status for a specific criterion.

public sealed record CriterionStatus : IEquatable<CriterionStatus>
Inheritance
CriterionStatus
Implements
Inherited Members

Remarks

Construct through Assessed(TrustServicesCriterion, bool, int, DateTimeOffset, int, int, IReadOnlyList<string>?) or NotAssessed(TrustServicesCriterion, string). The two states carry different evidence and an object initialiser cannot enforce that: an unassessed criterion bearing a validation timestamp would compile, and a reader of the resulting attestation could not tell it from a real one.

A private constructor alone did not achieve that, and it was measured rather than assumed. It blocks new; it does not block with, whose copy constructor is compiler-generated and reachable wherever the members are settable. With public init accessors this compiled clean:

var honest = CriterionStatus.NotAssessed(criterion, "nobody looked");
var forged = honest with { Outcome = CriterionOutcome.Met, EffectivenessScore = 100 };

The accessors are therefore private init. The factories inside this type still build every legitimate value; the forgery above is now a compile error rather than a discouraged habit.

This type is read by an external auditor assessing the deploying organisation, so a value that reads as a measurement but was never measured is a finding against that organisation. That is why the absent cases are absent here rather than defaulted.

Properties

ControlsAssessed

How many controls supporting this criterion were assessed.

public int ControlsAssessed { get; }

Property Value

int

Remarks

Travels with EffectivenessScore deliberately: a mean over an unstated denominator is the same defect one layer out, a definite-looking number whose basis the reader cannot see.

Criterion

Criterion being evaluated.

public TrustServicesCriterion Criterion { get; }

Property Value

TrustServicesCriterion

EffectivenessScore

Control effectiveness (0-100), or null when the criterion was not assessed.

public int? EffectivenessScore { get; }

Property Value

int?

EvidenceCount

Evidence count for this criterion.

public int EvidenceCount { get; }

Property Value

int

Gaps

Any gaps identified.

public IReadOnlyList<string> Gaps { get; }

Property Value

IReadOnlyList<string>

LastValidated

When the assessment happened, or null when it never did.

public DateTimeOffset? LastValidated { get; }

Property Value

DateTimeOffset?

Outcome

Whether the criterion was assessed, and what was concluded.

public CriterionOutcome Outcome { get; }

Property Value

CriterionOutcome

Methods

Assessed(TrustServicesCriterion, bool, int, DateTimeOffset, int, int, IReadOnlyList<string>?)

Records the result of an assessment that actually took place.

public static CriterionStatus Assessed(TrustServicesCriterion criterion, bool met, int effectivenessScore, DateTimeOffset lastValidated, int controlsAssessed, int evidenceCount, IReadOnlyList<string>? gaps = null)

Parameters

criterion TrustServicesCriterion

The criterion assessed.

met bool

Whether the assessed controls were found effective.

effectivenessScore int

Mean control effectiveness, 0-100.

lastValidated DateTimeOffset

When the assessment happened.

controlsAssessed int

How many controls the score was computed over.

evidenceCount int

Evidence items collected.

gaps IReadOnlyList<string>

Gaps identified during the assessment.

Returns

CriterionStatus

An assessed criterion status.

NotAssessed(TrustServicesCriterion, string)

Records that a criterion was not assessed at all.

public static CriterionStatus NotAssessed(TrustServicesCriterion criterion, string reason)

Parameters

criterion TrustServicesCriterion

The criterion that was not assessed.

reason string

Why it was not assessed, for the reader of the attestation.

Returns

CriterionStatus

An unassessed criterion status, carrying no score and no timestamp.

Remarks

There is deliberately no parameter for a score or a timestamp. Neither exists, and a factory that accepted one would put the fabrication back within reach of the next author.