FreshnessStatetypeno test imports ittype FreshnessState = "Fresh" | "Due" | "Stale";The state of a proof's freshness, in the words of the ontology (ifqs:Fresh, ifqs:Due, ifqs:Stale).
The freshness of a proof (commons 0001-quality-evidence FR-030): Fresh, Due or Stale (ifqs:FreshnessState), judged by time, as 0007-grc FR-011 judges evidence against a cadence (kernel/assess.ts), and by change, being stale where a file in the requirement's trace chain (its text, term, code or test, 0020-ifccm FR-014) changed after the revision of the run, or where the run's revision is not at or after the last change of the chain. A stale proof does not count at its grade and opens a nonconformance (FR-015).
Pure: the day today and what changed are arguments. host/gather.ts finds what changed with real git; this file only judges. The cadences are the quality system's own defaults (FR-047): a run stays fresh for 30 days, a probe for 7, a statement for 90 and a review for a year; a harness passes its own.
import { DEFAULT_CADENCES, freshnessOf } from "./freshness.ts";
// freshnessOf({ kind: "run", at }, ["commons/quality/src/pure/ladder.ts"], now, DEFAULT_CADENCES).state === "Stale"FreshnessStatetypeno test imports ittype FreshnessState = "Fresh" | "Due" | "Stale";The state of a proof's freshness, in the words of the ontology (ifqs:Fresh, ifqs:Due, ifqs:Stale).
EvidenceKindtypeno test imports ittype EvidenceKind = "run" | "statement" | "review" | "probe";What kind of evidence is judged: each has its own cadence.
Cadencestypeno test imports ittype Cadences = { readonly [K in EvidenceKind]: Duration };The cadence each kind of evidence is held to (FR-047).
DEFAULT_CADENCESconstconst DEFAULT_CADENCES: CadencesThe default cadences (FR-047): the run's 30 days, the probe's 7, the statement's 90 and the review's year.
FreshnessVerdicttypeno test imports ittype FreshnessVerdict = {
readonly state: FreshnessState;
/** `change` where something in the chain changed after the evidence, else `time`. */
readonly by: "time" | "change";
readonly why: string;
/** When it falls due, where the cadence is a time. */
readonly dueAt?: Instant;
};How a proof was judged: its state, by which means, and what says so.
freshnessOffunctionfunction freshnessOf(evidence: { readonly kind: EvidenceKind; readonly at: Instant; }, changes: readonly string[], now: Instant, cadences?: Cadences): FreshnessVerdictThe freshness of one piece of evidence at now (FR-030). changes names what in the requirement's chain changed after the evidence's revision (files, or the requirement's text): where any did, the proof is Stale by change whatever its age; otherwise it is Fresh, Due (in the last tenth of its cadence) or Stale by time.
countsfunctionno test imports itfunction counts(state: FreshnessState): booleanWhether a proof counts at its grade: Fresh and Due do, Stale does not (FR-030).