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.
- 01Reviewed rule
- 02Strict JSON input
- 03A decision of allow
- 04A record you can check
1. The rule
(let ((days (cdr (car input)))
(opened (cdr (car (cdr input)))))
(if (< days 15)
(if opened "deny" "allow")
"deny"))2. The input
{
"days": 14,
"opened": false
}3. One run under limits
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 decisionFor the day-14 unopened case kept with this page, the run returns allow.
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.
| Input | Decision | Why |
|---|---|---|
| day 14, unopened | allow | the order is still inside the window |
| day 15, unopened | deny | the order is outside the window |
| day 14, opened | deny | an opened item is not admitted |
Four local commands
| Command | Product behavior |
|---|---|
rule run | prepares the rule, evaluates strict JSON under configured resource values, and atomically writes a five-member decision directory |
rule inspect | reads and summarizes the directory |
rule verify | checks the exact member set, identities, hashes, and bindings |
rule replay | evaluates the recorded request in a fresh evaluator instance and matches the result and portable core |
The directory contains:
| Member | Role |
|---|---|
| prepared artifact | canonical executable rule material |
| canonical input | exact request value |
| result artifact | deterministic result and request binding |
| portable core | rule, input, resources, evaluator, transcript, and result identity |
| summary | human-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.jsonThe 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.