harn-stdlib 0.10.182

Embedded Harn standard library source catalog
Documentation
import { CommandResult } from "std/command/results"

/** Host-owned identities of every input surface read by a verification check. */
pub type VerificationInputState = {
  revision: int,
  workspace: string,
  source: string,
  dependencies: string,
  environment: string,
}

/** Reuse is scoped to one check in one run; unknown inputs always execute. */
pub type VerificationReuse = {
  scope: string,
  inputs: fn() -> VerificationInputState?,
  accept: fn(CommandResult) -> bool,
}

/** The supplied invocation and complete inputs observed around execution. */
pub type VerificationCheckBinding = {invocation: string, inputs: VerificationInputState}

pub type VerificationFileHashSnapshotEntry = {
  path: string,
  known: bool,
  readable: bool,
  hash: string?,
  hash_source: "indexed" | "disk" | "missing",
  size: int?,
  mtime_ms: int?,
  indexed_hash: string?,
  indexed_mtime_ms: int?,
  last_edit_seq: int,
}

pub type VerificationFileHashSnapshot = {
  seq: int,
  captured_at_ms: int,
  algorithm: string,
  snapshot: dict,
  missing: list<string>,
  files: list<VerificationFileHashSnapshotEntry>,
}

pub type VerificationCheckObservation = {
  durationMs?: int,
  warm: bool,
  at?: string,
  exit?: int,
  failureSignature?: string,
  snapshot?: dict,
}

pub type VerificationRecordedCheck = {
  result: CommandResult,
  observation: VerificationCheckObservation,
  row: dict?,
  snapshot: VerificationFileHashSnapshot?,
  execution: "executed" | "reused" | "observed",
  binding: VerificationCheckBinding?,
}

pub type VerificationStartedCheck = {
  row_id: string,
  started: CommandResult,
  observation_options: dict,
  snapshot: VerificationFileHashSnapshot?,
}

pub type VerificationToolchainFact = {
  id: string,
  name: string,
  available: bool,
  version?: string,
  raw_version: string,
  cache_identity: dict,
  probe: dict,
}

pub type VerificationWarmStateFact = {
  id: string,
  name: string,
  configured: bool,
  available: bool,
  ready: bool,
  warm: bool,
  timing_kind: string,
  mode: string,
  expected_warm_delta_ms?: int,
  warm_ms?: int,
  cold_ms?: int,
  cache_identity: dict,
  probe: dict,
}

pub type VerificationWarmStateLifecycleReceipt = dict

pub type VerificationAffectedTarget = dict

pub type VerificationAffectedAdapterFact = {
  id: string,
  parser_id: string,
  status: string,
  ok: bool,
  target_count: int,
  exit?: int,
  error?: string,
}

pub type VerificationAffectedTargetsFact = {
  changed_paths: list<string>,
  targets: list<VerificationAffectedTarget>,
  adapters: list<VerificationAffectedAdapterFact>,
  fallback: dict,
}

pub type VerificationProfileMatch = {row: dict, specificity: int, index: int}

pub type VerificationLadderPlanEntry = dict

pub type VerificationLadderPlan = {
  schema: string,
  query: dict,
  matches: list<VerificationProfileMatch>,
  selected: list<VerificationLadderPlanEntry>,
  skipped: list<dict>,
  fallback: bool,
  reason: string,
}

pub type VerificationDiagnosticDelta = dict

pub type VerificationGateInput = dict