IF Commons GitHub

logical/gate

Written to: 5 requirements: 5 proved, 0 partly, 0 failing, 0 with no test recorded. 0002-policy-gate FR-002, 0002-policy-gate FR-003, 0002-policy-gate FR-004, 0002-policy-gate FR-005, 0002-policy-gate FR-007

Evaluating a change against rules (0002-policy-gate FR-002 to FR-005, FR-007): only the subjects a change adds or alters are checked (one that is removed or untouched is not), each rule applies to the kinds it names, a violation that has a live waiver for its rule and subject does not block and is listed as waived, a waiver that has expired does not count, and the verdict passes only where nothing blocks. A rule that throws is a violation of its own, never a silent pass. Everything is a pure function of the change, the rules, the waivers and the instant.

import { evaluate } from "./gate.ts";
evaluate({ before: [], after: [] }, [], [], "2026-11-21T00:00:00Z").pass; // true

Source: commons/gate/src/logical/gate.ts

3 of 6 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.touchedfunctionno test imports it
function touched(change: Change): readonly Subject[]

The subjects a change adds or alters: those in after that before does not have, or has with other attributes.

logical.waiverProblemsfunctionno test imports it
function waiverProblems(w: readonly Waiver[]): readonly string[]

The rules a waiver list problems are refused for: a waiver needs a reason, a person, and an end after which it does not count.

logical.evaluatefunctionno test imports it
function evaluate(change: Change, rules: readonly Rule[], waivers: readonly Waiver[], now: string): Verdict

The verdict of a change against rules and waivers at an instant.

touchedfunction
function touched(change: Change): readonly Subject[]

The subjects a change adds or alters: those in after that before does not have, or has with other attributes.

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

waiverProblemsfunction
function waiverProblems(w: readonly Waiver[]): readonly string[]

The rules a waiver list problems are refused for: a waiver needs a reason, a person, and an end after which it does not count.

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

evaluatefunction
function evaluate(change: Change, rules: readonly Rule[], waivers: readonly Waiver[], now: string): Verdict

The verdict of a change against rules and waivers at an instant.

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

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