IF Commons GitHub

trust/view

Written to: 1 requirement: 1 proved, 0 partly, 0 failing, 0 with no test recorded. 0001-quality-evidence FR-052

The Trust page's content (commons 0001-quality-evidence FR-052 to FR-056, FR-057 to FR-059): everything the page and its JSON say, as one typed value made from the evidence, redacted for one audience, with the count of what was redacted. The HTML (html.ts) and the JSON are two renderings of this value, so that they cannot say two things.

  • Failures first. Each failed case, each case that did not run, each open nonconformance with its age and each open CAPA is kept, sorted and never dropped to improve a figure (FR-054); a nonconformance closed yesterday is still shown, as closed with its CAPA.
  • Evidence, never a verdict. The harness's own words (its name, its scope note, what the page does not cover) are refused where they state that a harness conforms to, is certified to or complies with a standard, a regulation or a control (FR-055).
  • Stale is said. Where the newest evidence is older than the harness's cadence for a run, the page says that it is stale and by how long (FR-056).
  • Redaction counts. What an audience may not see is replaced or withheld and counted, so that a redaction is never silent (FR-058).

Pure: no clock (generated is a day the caller gives, the day of the newest evidence), no file, no Git. A figure of the page is figures (assessor/verify-pack.ts computes it from the files), the grade, freshness and objectives come from the ladder and the index, and none of them passes through redaction.

Source: commons/quality/src/trust/view.ts

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

TrustRequirementtypeno test imports it
type TrustRequirement = { readonly id: string; readonly grade: Grade; /** `Fresh`, `Due`, `Stale` or `None` where … (509 characters)
type TrustRequirement = {
  readonly id: string;
  readonly grade: Grade;
  /** `Fresh`, `Due`, `Stale` or `None` where nothing proves it. */
  readonly freshness: string;
  readonly required: Grade;
  readonly proved: boolean;
  readonly day?: string;
  readonly run?: string;
  /** The strength of its proof in a thousandth, where a mutation run measured it (0001-quality-evidence FR-043), and the grade it leaves the proof. */
  readonly strengthPermille?: number;
  readonly gradeAfterStrength?: Grade;
};

A requirement as the page shows it (FR-053).

TrustFailuretypeno test imports it
type TrustFailure = { readonly run: string; readonly day: string; readonly requirements: readonly string[]; read… (423 characters)
type TrustFailure = {
  readonly run: string;
  readonly day: string;
  readonly requirements: readonly string[];
  readonly name: string;
  readonly outcome: "fail" | "not_run";
  /** Why: for a case that did not run its reason; for a failed one, that it failed. */
  readonly reason: string;
  /** What the failure said, and where: not for the public (FR-058). */
  readonly message?: string;
  readonly file?: string;
};

A case that failed or did not run, as the page lists it (FR-054).

TrustNonconformancetypeno test imports it
type TrustNonconformance = { readonly id: string; /** The requirement's identifier (`NNNN-slug FR-nnn`): a name, nev… (959 characters)
type TrustNonconformance = {
  readonly id: string;
  /** The requirement's identifier (`NNNN-slug FR-nnn`): a name, never its text on the public page (FR-068). */
  readonly requirement: string;
  /** What the requirement says at the tested revision: for the Assessor and Internal audiences only (FR-068). */
  readonly requirementText?: string;
  /** A code from a closed list (`failed`, `stale`, `probe-failed`, `budget-spent`), never text (FR-068). */
  readonly cause: Nonconformance["cause"];
  readonly state: "NonconformanceOpen" | "NonconformanceClosed";
  readonly openedOn: string;
  readonly closedOn?: string;
  /** Days open: from the day it was opened to the day it closed, or to `generated`. */
  readonly ageDays: number;
  /** Why it was opened, in words: for the Assessor and Internal audiences only; the Public page names the nonconformance by its identifier (FR-068). */
  readonly reason?: string;
  readonly capas: readonly string[];
};

A nonconformance and where it stands, with its age in days (FR-054).

TrustCapatypeno test imports it
type TrustCapa = { readonly id: string; readonly nonconformance: string; readonly state: "CapaOpen" | "CapaVerifie… (416 characters)
type TrustCapa = {
  readonly id: string;
  readonly nonconformance: string;
  readonly state: "CapaOpen" | "CapaVerified" | "CapaClosed";
  readonly openedOn: string;
  /** The corrective action in words: for the Assessor and Internal audiences only; the Public page withholds it (0022 FR-068). */
  readonly action?: string;
  readonly test: string;
  readonly verifiedOn?: string;
  readonly closedOn?: string;
};

A CAPA and where it stands (FR-054).

TrustObjectivetypeno test imports it
type TrustObjective = {
  readonly id: string;
  readonly metric: string;
  readonly comparator: string;
  readonly target: number;
  readonly unit: string;
  readonly value: number | null;
  readonly state: string;
  readonly budget: number;
  readonly remaining: number | null;
  readonly windowDays: number;
};

A quality objective with its target and what remains of its error budget (FR-053).

TrustPeopletypeno test imports it
type TrustPeople = {
  readonly plans: number;
  readonly samplesDrawn: number;
  readonly samplesAttested: number;
  readonly mutationRuns: number;
  readonly agentReviews: number;
  readonly agentReviewsSampled: number;
};

What the people and plans of Tier 2 have recorded (0001-quality-evidence FR-041 to FR-041), as counts.

TrustInputtype
type TrustInput = { readonly harness: string; readonly revision: string; /** The day the page is made as of: the d… (1714 characters)
type TrustInput = {
  readonly harness: string;
  readonly revision: string;
  /** The day the page is made as of: the day of the newest evidence (no clock). */
  readonly generated: string;
  /** The span of evidence it covers, the first and last day of a run kept; none where there is none. */
  readonly span?: { readonly from: string; readonly to: string };
  /** The digest of the last evidence file, the head of the chain, where there is one. */
  readonly head?: string;
  /** What the harness says its scope is, and what the page does not cover (FR-055). */
  readonly scopeNote?: string;
  readonly notCovered: readonly string[];
  readonly figures: Figures;
  /** The count of proved requirements, shown only with its grade and the review debt beside it (0001-quality-evidence FR-014). */
  readonly proof: {
    readonly count: string;
    readonly proved: number;
    readonly requirements: number;
    readonly reviewDebt: number;
    /** The review debt apart: what rests on an agent and what on a person (0001-quality-evidence FR-051). */
    readonly reviewDebtByAgent: number;
    readonly reviewDebtByPerson: number;
    readonly byGrade: Readonly<Record<string, number>>;
  };
  readonly requirements: readonly TrustRequirement[];
  readonly failures: readonly TrustFailure[];
  readonly nonconformances: readonly TrustNonconformance[];
  readonly capas: readonly TrustCapa[];
  readonly objectives: readonly TrustObjective[];
  /** The days the newest run is old and the cadence it is held to, where the evidence is older than the cadence (FR-056). */
  readonly stale?: { readonly newest: string; readonly cadenceDays: number; readonly overdueDays: number };
  readonly people: TrustPeople;
};

What the page is made from: the evidence of a harness at a revision, before redaction.

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

TrustViewtypeno test imports it
type TrustView = Omit<TrustInput, "scopeNote"> & { readonly schema: "ifqs-trust/1"; readonly audience: Audience; r… (470 characters)
type TrustView = Omit<TrustInput, "scopeNote"> & {
  readonly schema: "ifqs-trust/1";
  readonly audience: Audience;
  readonly scope: string;
  /** How many values were redacted or withheld to make this rendering (FR-058). */
  readonly redactions: number;
  /** Open failures first (FR-054): the counts the page opens with. */
  readonly open: { readonly failedCases: number; readonly notRunCases: number; readonly nonconformances: number; readonly capas: number };
};

The page's content for one audience.

conformityClaimfunction
function conformityClaim(text: string): string | undefined

The first phrase of a text that states conformity, certification or compliance, or none (FR-055): nonconformance and non-conformance are the quality system's own words and are not one.

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

DEFAULT_SCOPEconst
const DEFAULT_SCOPE: string

The scope the page states where the harness gives none: the page's own words, which state no conformity.

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

trustViewOffunction
function trustViewOf(input: TrustInput, audience: Audience, rules: RedactionRules, requirementText?: RequirementText): Result<TrustView, string>

The content of the page for an audience (FR-052 to FR-056, FR-057 to FR-059), or why the page is refused: a statement of conformity in what the harness wrote (FR-055). The same input, audience and rules give the same view.

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

trustJsonfunctionno test imports it
function trustJson(view: TrustView): string

The view as JSON: sorted keys, two spaces and a final newline, so that the same evidence gives the same bytes (FR-059).

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