strictcli v0.39.0 /typescript/src/checks/framework
On this page

Check framework core: sealed outcomes, reporters, definitions, checks.toml parsing, and the registration/double-entry machinery.

#typescript/src/checks/framework

#typescript/src/checks/framework

Check framework core: sealed outcomes, reporters, definitions, checks.toml parsing, and the registration/double-entry machinery.

Parity sources: go/strictcli/check.go (structure and templates) with python/strictcli/__init__.py (~1145-1283, ~2312-2600, ~3025-3100) as the divergence ground truth. The scope field is PARSE-ONLY (matching Go): it is carried on definitions and emitted in schema/list output, but never consulted at run time -- there is no scope adapter and no SkipCheck in TS.

#CheckContext

TS typescript
export interface CheckContext

Minimal interface that tool-specific check contexts must satisfy.

#CheckSeverity

TS typescript
export type CheckSeverity = "error" | "warn"

Check severity level: "error" causes hard failures, "warn" is non-fatal unless --ignore-warnings is absent.

#CheckProblem

TS typescript
export interface CheckProblem

A single minted finding: text plus severity ("error" or "warn").

#CheckOutcome

TS typescript
export class CheckOutcome

The ceiling-typed result of a check implementation. Sealed by construction: a valid outcome is obtained ONLY through reporter methods (passed/skipped/found) or the runner's internal skip mint, both of which pass the module-private mint token. Direct construction throws.

#mintSkip

TS typescript
export function mintSkip(message: string): CheckOutcome

Runner-internal mint for cascade-skip outcomes (not part of the public API).

#orderedProblems

TS typescript
export function orderedProblems(o: CheckOutcome): readonly CheckProblem[]

Problems grouped by severity: all error-severity problems first, then all warn-severity problems. Insertion order is preserved within each group.

#deriveStatus

TS typescript
export function deriveStatus(o: CheckOutcome): CheckStatus

Maps a minted CheckOutcome to a display/verdict label. found + any error-severity problem => "fail"; found + only warns => "warn"; passed => "pass"; skipped => "skip".

#CheckStatus

TS typescript
export type CheckStatus = "pass" | "fail" | "warn" | "skip"

Derived check verdict label: "pass", "fail", "warn", or "skip".

#WarnReporter

TS typescript
export class WarnReporter extends ReporterCore

Reporter handed to warn-severity check impls. It can mint warn-severity problems and terminal outcomes but structurally LACKS error-minting: there is no error method in its surface, so a warn check cannot produce an error-severity problem and can never cascade.

#ErrorReporter

TS typescript
export class ErrorReporter extends ReporterCore

Reporter handed to error-severity check impls. Everything WarnReporter has PLUS error() (mints an error-severity problem).

#CheckRunResult

TS typescript
export class CheckRunResult

A named check outcome returned by app.runChecks(). The verdict is derived from the minted outcome; the runner's exit/cascade logic and the formatters all consume these same accessors (one source of truth).

#CheckImpl

TS typescript
export type CheckImpl = (

A check impl wrapped with its reporter, installed at registration time.

#CheckDef

TS typescript
export interface CheckDef

Internal definition of a single check loaded from checks.toml.

#ChecksState

TS typescript
export interface ChecksState

Per-app check-system state, held by AppImpl.

#newChecksState

TS typescript
export function newChecksState(): ChecksState

#addCheckDef

TS typescript
export function addCheckDef(state: ChecksState, def: CheckDef): void

Single internal insertion point for check definitions. Rejects duplicate names as a hard error. TOML loading and provider materialization both route through here.

#sortedCheckNames

TS typescript
export function sortedCheckNames(state: ChecksState): string[]

Check names in sorted order, for deterministic listing.

#registerCheckImpl

TS typescript
export function registerCheckImpl(

Single registration chokepoint shared by app.errorCheck and app.warnCheck. Enforces the double-entry contract (declared vs registered) and cross-checks the registration FORM against the TOML-declared severity so that app.errorCheck on a severity="warn" definition is a hard error.

#validateCheckRegistrations

TS typescript
export function validateCheckRegistrations(

Validates that all declared checks have registered implementations. Returns an error message listing unregistered checks, or undefined. (Inline string in both siblings, so it stays inline here too.)

#CHECK_IDENTIFIER_RE

TS typescript
export const CHECK_IDENTIFIER_RE = /^[a-z][a-z0-9-]*$/

Validates identifier names (check names, tag names).

#ParsedChecksToml

TS typescript
export interface ParsedChecksToml

#parseChecksToml

TS typescript
export function parseChecksToml(text: string): ParsedChecksToml

Parses and validates checks TOML text, returning the app name, validated check definitions, and names in declaration order. Throws RegistrationError (the ValueError analog) on any schema violation or invalid TOML. Validation order follows Python (_parse_checks_toml).

Search