logical.GRADESconstno test imports itconst GRADES: readonly ["strong", "moderate", "weak", "expired", "none"]The grades, best first.
The grade of evidence (0003-evidence-grading FR-001 to FR-004): how much a piece of evidence is worth from how it was obtained and how old it is, with no percentage. A record read from the system by a tool, or a signed record from a system, is strong; a person's attestation is moderate; a screenshot is weak. Age takes a step off: evidence older than the age its origin allows is one grade lower, and older than twice that is weak; evidence that has expired is expired. An objective is graded by the best of its live, passing evidence, and says which it is, so that a control resting only on screenshots is shown as the weak thing it is.
import { GRADES } from "./grade.ts";
GRADES; // ["strong", "moderate", "weak", "expired", "none"]logical.GRADESconstno test imports itconst GRADES: readonly ["strong", "moderate", "weak", "expired", "none"]The grades, best first.
logical.Gradetypeno test imports ittype Grade = (typeof GRADES)[number];A grade.
logical.originOfconstno test imports itconst originOf: (e: Evidence) => "attestation" | "machine" | "screenshot" | "signed-record"The origin of a record: what it says, or what its maker implies.
logical.FRESH_DAYSconstno test imports itconst FRESH_DAYS: Readonly<Record<"attestation" | "machine" | "screenshot" | "signed-record", number>>The days a piece of evidence of each origin keeps its grade before age takes a step off.
logical.gradeOffunctionno test imports itfunction gradeOf(e: Evidence, now: string): "expired" | "moderate" | "none" | "strong" | "weak"The grade of one record at an instant.
logical.ObjectiveGradetypeno test imports ittype ObjectiveGrade = { readonly objective: string; readonly grade: Grade; readonly basis?: string; readonly origin?: Origin; readonly ageDays?: number };The grade of an objective, with the record it rests on.
logical.gradeObjectivesfunctionno test imports itfunction gradeObjectives(objectives: readonly Objective[], evidence: readonly Evidence[], now: string): readonly ObjectiveGrade[]The grade of each objective from the latest of its records: the best live passing record counts; with only expired ones it is expired; with none it is none.
logical.countGradesfunctionno test imports itfunction countGrades(grades: readonly ObjectiveGrade[]): Readonly<Record<"expired" | "moderate" | "none" | "strong" | "weak", number>>The grades of the objectives of one requirement, counted: nothing is averaged.
GRADESconstno test imports itconst GRADES: readonly ["strong", "moderate", "weak", "expired", "none"]The grades, best first.
Gradetypeno test imports ittype Grade = (typeof GRADES)[number];A grade.
originOfconstconst originOf: (e: Evidence) => "attestation" | "machine" | "screenshot" | "signed-record"The origin of a record: what it says, or what its maker implies.
FRESH_DAYSconstno test imports itconst FRESH_DAYS: Readonly<Record<"attestation" | "machine" | "screenshot" | "signed-record", number>>The days a piece of evidence of each origin keeps its grade before age takes a step off.
gradeOffunctionfunction gradeOf(e: Evidence, now: string): "expired" | "moderate" | "none" | "strong" | "weak"The grade of one record at an instant.
ObjectiveGradetypeno test imports ittype ObjectiveGrade = { readonly objective: string; readonly grade: Grade; readonly basis?: string; readonly origin?: Origin; readonly ageDays?: number };The grade of an objective, with the record it rests on.
gradeObjectivesfunctionfunction gradeObjectives(objectives: readonly Objective[], evidence: readonly Evidence[], now: string): readonly ObjectiveGrade[]The grade of each objective from the latest of its records: the best live passing record counts; with only expired ones it is expired; with none it is none.
countGradesfunctionfunction countGrades(grades: readonly ObjectiveGrade[]): Readonly<Record<"expired" | "moderate" | "none" | "strong" | "weak", number>>The grades of the objectives of one requirement, counted: nothing is averaged.