Run a Rule with a Resource Profile

Choose the decision or full Native evaluator, set preparation and evaluation values, and inspect the portable core that binds the rule, input, resources, and result.

Choose the evaluator

lispex embed runs the decision profile lispex/r7rs-rule-embedded-core/1. lispex embed full runs all 205 primitive rows in lispex/r7rs-rule-current-profile-bounded/1. Both create a fresh instance for every operation and use separate preparation and evaluation resources.

The full workflow uses the same command shape.

SH
lispex embed full prepare --source policy.lspx --limits prepare-limits.json --out policy.lpxfull
lispex embed full evaluate --prepared policy.lpxfull --input input.lpxvalue --limits evaluation-limits.json --out result.lpxfull
lispex embed full inspect --artifact result.lpxfull
lispex embed full verify --artifact result.lpxfull
lispex embed full replay --artifact result.lpxfull

1. Prepare the rule

Create prepare-limits.json.

JSON
{
  "raw_source_bytes": 4096,
  "prepare_work": 1000000,
  "logical_allocation": 1000000,
  "syntax_depth": 64
}

Prepare the source.

SH
lispex embed prepare \
  --source policy.lspx \
  --limits prepare-limits.json \
  --out policy.lpxembed

Preparation reads UTF-8, normalizes the program, builds and verifies canonical bytecode, checks the selected profile, and records the source, semantic rule, feature set, bytecode, evaluator, and resource identities.

2. Evaluate the prepared rule

The input is one canonical lispex.embed-value/v1 value. Create evaluation-limits.json.

JSON
{
  "canonical_input_bytes": 4096,
  "eval_work": 1000000,
  "logical_allocation": 1000000,
  "semantic_frames": 1000,
  "traversal_depth": 256,
  "output_bytes": 1000000,
  "diagnostic_bytes": 1000000,
  "transcript_bytes": 1000000,
  "transcript_events": 100,
  "result_bytes": 1000000
}

Evaluate the prepared artifact.

SH
lispex embed evaluate \
  --prepared policy.lpxembed \
  --input input.lpxvalue \
  --limits evaluation-limits.json \
  --out result.lpxembed

The result keeps preparation and evaluation usage separate. Its portable core binds the rule, input, selected resources, evaluator artifact, transcript, and result.

3. Inspect, verify, and replay

SH
lispex embed inspect --artifact result.lpxembed
lispex embed verify --artifact result.lpxembed
lispex embed replay --artifact result.lpxembed

inspect prints a stable JSON projection. verify recomputes the envelope, hashes, category, values, and portable core. replay evaluates the recorded request in a fresh instance and matches the result and portable core.

Product roles

The embed artifact records deterministic semantic outcomes, request refusals, and engine status. Decision exchange adds issuer envelopes and recipient policy. Vouch authenticates signed evidence and evaluates the local decision gate. The host application owns network access and business actions.

Keep going

Read the exact identities and terminal classes in the Resource-Controlled Evaluator Contract.

Run a Rule with a Resource Profile · Lispex