Run and Check Decision Records

Run a reviewed refund rule with strict JSON, keep its exact decision record, authenticate an issuer, and replay the request.

One run under limits, one record kept

Run the refund rule under exact limits. Keep what was checked.

Native lispex rule run prepares the reviewed rule, admits one strict JSON input, and evaluates it once on a separate engine that accounts for every unit of work and allocation inside the values you declare. The resulting decision directory has five members: the prepared rule artifact, the input in canonical form, the deterministic result with its exact request binding, the transferable record, and a derived summary. The authoring workspace retains the raw rule source.

  1. 01Reviewed rule
  2. 02Strict JSON input
  3. 03A decision of allow
  4. 04A record you can check

1. The rule

LISPEX
(let ((days (cdr (car input)))
      (opened (cdr (car (cdr input)))))
  (if (< days 15)
      (if opened "deny" "allow")
      "deny"))

2. The input

JSON
{
  "days": 14,
  "opened": false
}

3. One run under limits

SHELL
lispex rule run \
  --source refund-window.lspx \
  --input day-14-unopened.json \
  --prepare-limits prepare-limits.json \
  --eval-limits evaluation-limits.json \
  --out decision

lispex rule inspect --dir decision
lispex rule verify --dir decision
lispex rule replay --dir decision
4. The decision

For the day-14 unopened case kept with this page, the run returns allow.

5. The record, checked three ways

rule inspect summarizes the directory. rule verify checks the exact member set, identities, hashes, and bindings. rule replay evaluates the recorded request once in a fresh engine instance and requires the same result. The application remains the authority owner.

What the part you hand on ties together

It ties together the meaning of the rule, the input in its fixed written-down form, the exact limits, the exact program that ran the rule, and the deterministic outcome. The run transcript records consumed resources separately from the portable request identity.

Application-owned context

The application supplies executor identity, freshness policy, policy review, reuse prevention, and authority for actions outside the process.

Read the decision first

The rule asks how many days have passed and whether the item was opened. The application passes both values explicitly and owns the business meaning of allow and deny.

InputDecisionWhy
day 14, unopenedallowthe order is still inside the window
day 15, unopeneddenythe order is outside the window
day 14, openeddenyan opened item is not admitted

Four local commands

CommandProduct behavior
rule runprepares the rule, evaluates strict JSON under configured resource values, and atomically writes a five-member decision directory
rule inspectreads and summarizes the directory
rule verifychecks the exact member set, identities, hashes, and bindings
rule replayevaluates the recorded request in a fresh evaluator instance and matches the result and portable core

The directory contains:

MemberRole
prepared artifactcanonical executable rule material
canonical inputexact request value
result artifactdeterministic result and request binding
portable corerule, input, resources, evaluator, transcript, and result identity
summaryhuman-readable projection of the canonical members

The authoring workspace retains the source. New output paths preserve every completed record, and malformed or tampered members receive an explicit refusal.

Authenticate an issuer

The recipient creates policy for one reviewed public key. Native can sign the decision material and write a canonical .lpxdecision under the configured byte budget.

lispex rule issue --dir decision \
  --private-key issuer.pkcs8.der \
  --issuer-label "Refund desk A" \
  --out issuer-envelope.json

lispex rule policy create --dir decision \
  --public-key issuer.spki.der \
  --consumer-label "Refund receiver" \
  --out recipient-policy.json

lispex rule authenticate --dir decision \
  --envelope issuer-envelope.json \
  --policy recipient-policy.json

lispex decision issue --dir decision \
  --private-key issuer.pkcs8.der \
  --issuer-label "Refund desk A" \
  --out refund.lpxdecision

lispex decision inspect --bundle refund.lpxdecision
lispex decision authenticate --bundle refund.lpxdecision \
  --policy recipient-policy.json
lispex decision replay --bundle refund.lpxdecision \
  --policy recipient-policy.json

The bundle has seven canonical members: input, manifest, issuer envelope, prepared artifact, portable core, result artifact, and summary. Native issues, inspects, authenticates, and replays the bundle. npm inspects and authenticates it offline.

Product roles

Decision authentication records package integrity, issuer signature, recipient policy admission, and request binding. Replay adds a fresh evaluator result. Vouch adds its own signed complete transcripts, consumer-pinned request, current Native observation, and local decision gate. The host application owns freshness, replay prevention, business authorization, and the external action.

Keep going

Use Lispex Vouch · Application Handoff