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
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
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
Gaps
Any gaps identified.
public IReadOnlyList<string> Gaps { get; }
Property Value
LastValidated
When the assessment happened, or null when it never did.
public DateTimeOffset? LastValidated { get; }
Property Value
Outcome
Whether the criterion was assessed, and what was concluded.
public CriterionOutcome Outcome { get; }
Property Value
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
criterionTrustServicesCriterionThe criterion assessed.
metboolWhether the assessed controls were found effective.
effectivenessScoreintMean control effectiveness, 0-100.
lastValidatedDateTimeOffsetWhen the assessment happened.
controlsAssessedintHow many controls the score was computed over.
evidenceCountintEvidence items collected.
gapsIReadOnlyList<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
criterionTrustServicesCriterionThe criterion that was not assessed.
reasonstringWhy 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.