Skip to main content

Module check

Module check 

Source
Expand description

Check records — the engine-recorded act of verification (agent-trust plan 14).

A check is an agent recording “entity E checked, verdict ok | failed, via method M”. It is engine state, never entity content: absent from markdown and content_hash, and it produces no mem commit — checking-touches-nothing is what makes check-staleness computable. Records are append-only JSONL under the workspace store (.memstead/state/checks/checks.jsonl); a newer check supersedes older ones for state derivation but never erases them.

Unlike the friction ledger next door, recording here is NOT best-effort: a check the ledger failed to persist must refuse — the caller believes the act was recorded, and a silently dropped check is exactly the self-report dishonesty this tier exists to end. For the same reason there is no rotation cap: check history is the substrate process state derives from, not disposable telemetry.

Each record carries plan-13 provenance (actor, client, declared role) plus the entity’s content_hash at check time. State derivation compares that hash against the current one:

  • no record → never_checked
  • hash matches, ok → checked_ok
  • hash matches, failed → check_failed
  • hash differs → check_stale (whatever the verdict was, it no longer speaks to the current content — stated, never silently carried forward)

Structs§

CheckLedger
Append/read handle for a workspace’s check ledger.
CheckRecord
One recorded check — the full ledger line.

Enums§

CheckState
Derived per-entity check state.
Verdict
A check verdict from the closed vocabulary.

Constants§

VERDICTS
The closed verdict vocabulary. Nuance goes in the method note or in process-mem entities — never in new verdict values.

Functions§

check_ledger_path
The ledger file path for a workspace.
derive_state
Derive the state from the newest record (if any) and the entity’s current content_hash.