IF Commons GitHub

logical/grade

Written to: 4 requirements: 4 proved, 0 partly, 0 failing, 0 with no test recorded. 0003-evidence-grading FR-001, 0003-evidence-grading FR-002, 0003-evidence-grading FR-003, 0003-evidence-grading FR-004

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"]

Source: commons/assessment/src/logical/grade.ts

4 of 16 exports are imported by a test of the run. A test that imports an export may not call it or check what it returns.

logical.GRADESconstno test imports it
const GRADES: readonly ["strong", "moderate", "weak", "expired", "none"]

The grades, best first.

logical.Gradetypeno test imports it
type Grade = (typeof GRADES)[number];

A grade.

logical.originOfconstno test imports it
const 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 it
const 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 it
function gradeOf(e: Evidence, now: string): "expired" | "moderate" | "none" | "strong" | "weak"

The grade of one record at an instant.

logical.ObjectiveGradetypeno test imports it
type 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 it
function 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 it
function 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 it
const GRADES: readonly ["strong", "moderate", "weak", "expired", "none"]

The grades, best first.

Gradetypeno test imports it
type Grade = (typeof GRADES)[number];

A grade.

originOfconst
const originOf: (e: Evidence) => "attestation" | "machine" | "screenshot" | "signed-record"

The origin of a record: what it says, or what its maker implies.

Imported by 3 tests of the run (3 passed, 0 failed): the library's results

FRESH_DAYSconstno test imports it
const 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.

gradeOffunction
function gradeOf(e: Evidence, now: string): "expired" | "moderate" | "none" | "strong" | "weak"

The grade of one record at an instant.

Imported by 3 tests of the run (3 passed, 0 failed): the library's results

ObjectiveGradetypeno test imports it
type 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.

gradeObjectivesfunction
function 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.

Imported by 3 tests of the run (3 passed, 0 failed): the library's results

countGradesfunction
function countGrades(grades: readonly ObjectiveGrade[]): Readonly<Record<"expired" | "moderate" | "none" | "strong" | "weak", number>>

The grades of the objectives of one requirement, counted: nothing is averaged.

Imported by 3 tests of the run (3 passed, 0 failed): the library's results

Titles, headings, exports, tables, columns and requirements. Esc closes.