recife (TLA+/TLC) model-check adapter.
Stratified: pure promoters (trace->status, the violation rule-chain) ->
pure pipeline (normalize a raw recife result into a ModelCheckResult) ->
effectful boundary (check!, which runs a model through an INJECTED effect fn;
the default lazily resolves recife via requiring-resolve so this ns loads on
any classpath).
normalize maps recife's :trace discriminator to a status:
:trace :ok -> {:status :ok}
:trace [[idx state] ...] -> {:status :fail :details {:counterexample ...}}
:trace :error / other -> {:status :skip} (indeterminate; never :ok)
recife (TLA+/TLC) model-check adapter.
Stratified: pure promoters (trace->status, the violation rule-chain) ->
pure pipeline (normalize a raw recife result into a ModelCheckResult) ->
effectful boundary (`check!`, which runs a model through an INJECTED effect fn;
the default lazily resolves recife via requiring-resolve so this ns loads on
any classpath).
`normalize` maps recife's `:trace` discriminator to a status:
:trace :ok -> {:status :ok}
:trace [[idx state] ...] -> {:status :fail :details {:counterexample ...}}
:trace :error / other -> {:status :skip} (indeterminate; never :ok)recife spec of the verdict-handoff CAS/idempotence protocol as a safety + liveness model (a plan->commit handoff).
REQUIRES recife on the classpath — load it LAZILY (never require this ns from
hive-recife.core). safety-spec yields a hive-recife.schema/ModelSpec ready
for hive-recife.core/check!.
Protocol: a verdict is planned over a content-hash snapshot; files may DRIFT;
the verdict may EXPIRE; COMMIT is a compare-and-swap that applies the patch
ONLY when the verdict is still planned and the plan-hash still matches the
file-hash. The safety invariant never-apply-stale asserts a stale verdict is
never applied; commit freezes the observed hash into ::applied-hash so the CAS
precondition is inductively checkable.
recife spec of the verdict-handoff CAS/idempotence protocol as a safety + liveness model (a plan->commit handoff). REQUIRES recife on the classpath — load it LAZILY (never require this ns from hive-recife.core). `safety-spec` yields a hive-recife.schema/ModelSpec ready for hive-recife.core/check!. Protocol: a verdict is planned over a content-hash snapshot; files may DRIFT; the verdict may EXPIRE; COMMIT is a compare-and-swap that applies the patch ONLY when the verdict is still planned and the plan-hash still matches the file-hash. The safety invariant `never-apply-stale` asserts a stale verdict is never applied; commit freezes the observed hash into ::applied-hash so the CAS precondition is inductively checkable.
Malli value objects for the recife (TLA+/TLC) model-check adapter, registered into the hive-spi schema registry.
Registered keys (contributed to the schema registry):
:hive.recife/model-spec a ModelSpec descriptor
:hive.recife/raw-result a permissive model of recife get-result output
:hive.recife/counterexample a normalized violation trace
:hive.recife/result a normalized ModelCheckResult
ModelCheckResult contract: [:map {:closed true} [:status #{:ok :fail :skip}] [:details :map]]. :ok = no violation; :fail = a counterexample exists (in :details under :counterexample); :skip = indeterminate (recife/TLC absent, no spec, or a TLC error) — never conflate :skip with :ok.
Malli value objects for the recife (TLA+/TLC) model-check adapter, registered
into the hive-spi schema registry.
Registered keys (contributed to the schema registry):
:hive.recife/model-spec a ModelSpec descriptor
:hive.recife/raw-result a permissive model of recife `get-result` output
:hive.recife/counterexample a normalized violation trace
:hive.recife/result a normalized ModelCheckResult
ModelCheckResult contract: [:map {:closed true} [:status #{:ok :fail :skip}]
[:details :map]]. :ok = no violation; :fail = a counterexample exists (in
:details under :counterexample); :skip = indeterminate (recife/TLC absent, no
spec, or a TLC error) — never conflate :skip with :ok.cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |