examples/ is meant as a learning path — run npm run <script> from the examples/ directory for any of the ten, per examples/package.json and examples/README.md. Each example has its own README.md with a Goal, Learn, and Run section.
Walkthroughs
01 — Hello World
Goal (per its README): create the smallest validBusinessTransaction. run.ts builds a plain object inline and prints it — it never calls a policy engine, the runtime, or the API:
npm run hello. See examples/01-hello-world/README.md and run.ts. As Guides → Basic Execution notes, this object is missing several fields the canonical BusinessTransaction type requires (authority.authorityType, intent.target, etc.) — it’s illustrative, not a template.
02 — Policy Evaluation
Constructs aPolicyEngine and calls evaluate() directly against an inline policy and signals object. Run with npm run policy. See examples/02-policy-evaluation/README.md and run.ts.
03 — Runtime Execution
Constructs aRuntimeEngine directly with an empty RuntimePipeline([]) and calls runtime.execute(transaction as any), printing the result. Run with npm run runtime. See examples/03-runtime-execution/README.md and run.ts. This exercises the lower-level RuntimeEngine API from runtime with zero pipeline stages configured — not the ExecutionTrustApplication/RuntimeFactory path that POST /execute actually uses.
08 — Vendor Payment
Per its README, the intended goal is “Complete vendor payment workflow,” coveringBusinessTransaction, Runtime, Verification, and Replay together — the closest thing in this directory to an end-to-end scenario. In this snapshot, though, run.ts is one of the unimplemented stubs (console.log("Parmana Example 08 - Vendor Payment")), and its policy.json/transaction.json fixture files are empty. There’s a real vendor-payment policy shipped at the monorepo root (policies/vendor-payment/1.0.0/policy.json and 2.0.0/), used throughout REST API and Guides examples in this documentation — but the 08-vendor-payment example directory itself doesn’t yet wire it into a runnable script. See examples/08-vendor-payment/README.md.
The rest
04 — Execution Trust Record
Goal: generate an
ExecutionTrustRecord. Learn: Trust Record, Evidence, Receipt. Run: npm run trust-record. Stub — see warning above.05 — Verification
Goal: verify an
ExecutionTrustRecord. Learn: VerificationService, Verification. Run: npm run verification. Stub.06 — Replay
Goal: replay a recorded decision deterministically.
Learn: ReplayEngine, Determinism, Policy Replay. Run: npm run replay. Stub.07 — Human Approval
Goal: demonstrate human-in-the-loop approval.
Learn: Override, Human Approval. Run: npm run human-approval. Stub — see Guides → Human Override for why there’s no reachable code path for this yet regardless.09 — Expense Approval
Goal: an approval workflow example (no
Learn section in its README). Run: npm run expense-approval. Stub.10 — Purchase Order
Goal: a purchase order execution workflow (no
Learn section in its README). Run: npm run purchase-order. Stub.Related
Basic Execution
The real path examples 01 and 03 partially illustrate.
policy package
The condition schema example 02 gets wrong.
Human Override
Why example 07 can’t demonstrate its stated goal today even if implemented.
Getting Started
A working path independent of these examples.