Build with the local Soterias SDK. Get started with Python and TypeScript.
SoteriasDocsBuild
Workflows

Control testing

Build an analysis team, then protect its final record through the native procedure, exact-operation review and SQLite broker. Use the team example first if you want a runnable local analysis without authority setup.

The six synthetic payment samples compare amounts, approval limits and recorded control evidence. This business-control assessment is verified separately from the native authority required to read evidence and write a finding.

Before you run

Your trusted operator supplies a provisioned AML teaching host, its custody and an existing empty private output directory. Set these process environment variables:

Setting Meaning
SOTERIAS_ROOT Host containing document-profile.json, workflow-checkpoint.json, the original requests and verifier policies
SOTERIAS_CUSTODY The separate trusted signing/credential custody directory
SOTERIAS_OUTPUT Empty private output directory, independent of the host and custody
SOTERIAS_CASE controls; also supports transactions, recalculation and controls with their matching host data

The public disposable unlock in this teaching program matches its UNIT host. Enrollment and authority creation are operator work; an application or agent must not invent missing authority. On Windows, the output directory needs the native owner/SYSTEM-only private ACL. The code asks for actual console confirmation for each exact pending operation.

Run the application

Create example.py and plans.py, or example.mts and plans.json, using the inline chunks below. With the operator settings supplied, run python example.py, or compile example.mts with the command in installation and run node example.mjs.

The program reads current engagement evidence through the broker, computes a finding, verifies it independently, pauses for exact review and records it through the approved SQLite route. It runs training, shadow, canary and compiled samples, then checks six actual rows and original receipt signatures. Altered signatures must be refused. Inspection and review happen before the corresponding target operation.

Install the matching API preview

These examples use the API 2 preview, not names promised by the public RC5 release. Existing RC5 entry points remain available. The Python wheel below is verified on Windows x64; it is not a cross-platform release.

shell
python -m pip install https://docs.soterias.io/downloads/api-preview/soterias_local-0.1.0rc5%2Bapi2-cp311-abi3-win_amd64.whl
shell
npm install https://docs.soterias.io/downloads/api-preview/soterias-core-0.1.0-rc.5-api.2.tgz
npm install --save-dev typescript@5.8.3 @types/node@24

Python imports soterias. TypeScript imports @soterias/core. Use Python 3.11+ for this wheel and Node 22.23.4+ for these examples. For a .mts file, compile with npx tsc example.mts --target ES2022 --module NodeNext --moduleResolution NodeNext --skipLibCheck, then run the emitted .mjs file.

Application walkthrough

Choose Python or TypeScript. Create example.py or example.mts and append that language's chunks in order. Each language forms one complete program; indentation and open blocks carry across chunks.

Import the packages

Import the SDK and standard-library helpers. These are the real package exports used by the executable program.

"""Real local native SDK example. Only the contributor UNIT setup can auto-confirm.

Run prepare_workflows first; this client program invokes no Rust compiler.
It reads current engagement evidence through the broker, verifies findings,
pauses for separately signed review, and writes only the configured SQLite workpaper.
"""

import os
from types import SimpleNamespace
from copy import deepcopy
import hashlib
import json
from pathlib import Path
import sqlite3
import time
from soterias import (
    Procedure,
    ProcedureMemory,
    Receipt,
    ReceiptVerifier,
    Executor, ExecutorConfig,
    Reviewer,
    canonicalize,
    canonical_digest,
    VerificationError,
)
from plans import make_graph, make_verifier

UNLOCK = b"disposable-native-sqlite-unit-unlock"

Encode the native documents

Rust owns canonical encoding and stable document digests.

# %% Encode the native documents
# Rust owns canonical encoding and stable document digests.
def encoded(value):
    return canonicalize(
        json.dumps(value, ensure_ascii=False, separators=(",", ":")).encode()
    )


def sha(value):
    return hashlib.sha256(value).hexdigest()

Open the operator-selected workflow

The environment selects existing authority and an independent output location.

# %% Open the operator-selected workflow
# The environment selects existing authority and an independent output location.
def main():
    args = SimpleNamespace(
        case=os.environ.get("SOTERIAS_CASE", "controls"),
        root=Path(os.environ["SOTERIAS_ROOT"]),
        custody=Path(os.environ["SOTERIAS_CUSTODY"]),
        output=Path(os.environ["SOTERIAS_OUTPUT"]),
        unit_confirm=False,
    )
    if args.case not in ("aml", "transactions", "recalculation", "controls"):
        raise ValueError("Choose an available workflow case")
    root, custody, output = args.root.resolve(), args.custody.resolve(), args.output.resolve()
    if not output.is_dir() or any(output.iterdir()):
        raise ValueError("Select an existing empty private output directory")
    read = lambda name: (root / name).read_bytes()
    profile = json.loads(read("document-profile.json"))
    checkpoint = read("workflow-checkpoint.json")
    pins = json.loads(checkpoint)
    env = {
        "policy": sha(encoded(profile["base"]["policy"])),
        "tools": sha(encoded(pins["tools"])),
        "credentials": sha(encoded(pins["credentials"])),
        "evidence": profile["document_routes"][0]["source"],
        "host_configuration": pins["configuration"],
    }
    graph = Procedure(make_graph(args.case, env), verifier=make_verifier(args.case))
    memory = ProcedureMemory.create(output / "memory")
    read_template = json.loads(read("allow-document-request.json"))
    write_template = json.loads(read("allow-request.json"))
    key = json.loads(read("operation-key.json"))
    trust = read("workflow-verifier-trust.json")
    anchor = encoded(json.loads(trust)["anchor"])
    verifiers = {
        role: ReceiptVerifier(
            trust,
            anchor,
            read(
                "workflow-verifier-policy.json"
                if role == "verifier"
                else role + "-policy.json"
            ),
        )
        for role in ("authorization", "broker", "verifier")
    }
    reviewed_requests = {}

    def opening(pin):
        owner = Executor(ExecutorConfig(
            root,
            custody=custody,
            configuration=read("document-profile.json"),
            checkpoint=pin,
            passphrase=UNLOCK,
        ))
        owner.verify_outcomes(read("workflow-verification-profile.json"))
        return owner

    def ledger():
        with sqlite3.connect(
            f"file:{(root / 'ledger.sqlite3').as_posix()}?mode=ro", uri=True
        ) as db:
            return db.execute(
                "SELECT operation_id,value FROM broker_effects ORDER BY operation_id"
            ).fetchall()

    def expected_ledger():
        return sha(
            b"".join(
                encoded({"operation_id": i, "value": v}) + b"\n" for i, v in ledger()
            )
        )

Review one exact pending operation

Close the execution owner before the separately privileged reviewer inspects the original selection.

    # %% Review one exact pending operation
    # Close the execution owner before the separately privileged reviewer inspects the original selection.
    def approval(host, run):
        original = run.pending_request
        assert original is not None
        action = json.loads(original)["payload"]["data"]
        reviewed_requests[action["operation_id"]] = original
        prepared = host.prepare(original)
        before = ledger()
        host.close()
        reviewer = Reviewer(ExecutorConfig(
            root,
            custody=custody,
            configuration=read("document-profile.json"),
            checkpoint=prepared.checkpoint,
            passphrase=UNLOCK),
            signing_key=key,
        )
        pending = reviewer.prepare(
            original, prepared, expires_at_ms=int(time.time() * 1000) + 300_000
        )
        print("Review exact request:", original.decode())
        print("Review selection:", pending.selection.decode())
        if (
            not args.unit_confirm
            and input("Type APPROVE to sign this exact operation: ") != "APPROVE"
        ):
            reviewer.close()
            raise RuntimeError("review declined; no automatic retry")
        signed = reviewer.approve(pending, confirmation=pending.confirmation_digest)
        assert ledger() == before
        return opening(prepared.checkpoint), signed

Run exploratory, shadow and compiled samples

Every protected target still goes through native policy, review and broker admission.

Python
    # %% Run exploratory, shadow and compiled samples
    # Every protected target still goes through native policy, review and broker admission.
    host = opening(checkpoint)
    results = []
    signatures = 0
    mutations = 0
    qualification = None
    try:
        for index in range(6):
            r, w = deepcopy(read_template), deepcopy(write_template)
            for prefix, request in (("read", r), ("write", w)):
                request["payload"]["data"][
                    "operation_id"
                ] = f"{args.case}-{prefix}-{index}"
                request["payload"]["data"]["evaluated_at_ms"] = str(
                    int(time.time() * 1000)
                )
            w["payload"]["data"]["arguments"]["expected"] = expected_ledger()
            inputs = {"read": r, "write": w, "index": str(index)}
            run = (
                graph.start(inputs, environment=env)
                if index < 5
                else qualification.start(inputs, environment=env)
            )
            state = host.run(run, environment=env)
            pauses = 0
            while state == "awaiting_approval":
                host, signed = approval(host, run)
                state = host.run(run, environment=env, approval=signed)
                pauses += 1
            (output / f"run-{index}-metrics.json").write_text(
                json.dumps(run.report, indent=2) + "\n"
            )
            (output / f"run-{index}-receipts.json").write_text(
                json.dumps([json.loads(r) for r in run.receipts], indent=2) + "\n"
            )
            assert state == "verified" and pauses == 2, (state, pauses, run.report)
            for raw in run.receipts:
                signed = json.loads(raw)
                kind = signed["claims"]["body"]["kind"]
                role = (
                    "verifier"
                    if kind == "verifier_result"
                    else (
                        "broker"
                        if kind in ("broker_dispatch", "effect_observation")
                        else "authorization"
                    )
                )
                binding = signed["claims"]["binding"]
                original = reviewed_requests[binding["operation_id"]]
                action = json.loads(original)["payload"]["data"]
                assert binding["request"] == canonical_digest(original)
                assert (
                    binding["tool_id"] == action["tool_id"]
                    and binding["action"] == action["action"]
                )
                assert binding["actor"]["principal_id"] == action["principal_id"]
                assert binding["arguments"] == sha(
                    b"soterias:attestation-arguments:1\0" + encoded(action["arguments"])
                )
                route = next(
                    r
                    for r in profile["base"]["routes"]
                    if r["tool_id"] == action["tool_id"]
                    and r["action"] == action["action"]
                )
                assert binding["resource"] == sha(
                    b"soterias:attestation-resource:1\0" + encoded(route["resource"])
                )
                # Select only the independently configured public signer-role policy.
                verified = verifiers[role].verify(Receipt(raw))
                assert verified.expected_binding_checked is False
                signatures += 1
                altered = deepcopy(signed)
                signature = altered["signature"]["signature"]
                altered["signature"]["signature"] = (
                    "0" if signature[0] != "0" else "1"
                ) + signature[1:]
                try:
                    verifiers[role].verify(Receipt(encoded(altered)))
                except VerificationError:
                    mutations += 1
                else:
                    raise AssertionError("mutated signature accepted")
                if kind == "verifier_result":
                    assert signed["claims"]["body"]["verdict"] == "success"
                    assert signed["claims"]["body"]["settlement"] is not None
            outcome = run.result
            # Independent application verifier uses original synthetic dataset facts.
            if args.case == "transactions":
                assert outcome == {
                    "sample": f"TX-{index}",
                    "matches": index not in (3, 4),
                }
            elif args.case == "recalculation":
                assert outcome == {
                    "sample": f"ASSET-{index}",
                    "annual_minor_units": str(((index + 1) * 120000 - 20000) // 5),
                }
            elif args.case == "aml":
                assert outcome == {
                    "sample": f"CASE-{index}",
                    "review_required": (index + 1) * 100000 > 250000,
                    "evidence_id": f"TRANSACTIONS-{index}",
                }
            else:
                assert outcome == {
                    "sample": f"PAY-{index}",
                    "effective": (index + 1) * 10000 <= 25000 or index % 2 == 0,
                    "evidence_id": f"APPROVAL-{index}",
                }
            assert len(ledger()) == index + 1
            assert json.loads(dict(ledger())[f"{args.case}-write-{index}"]) == outcome
            report = run.report
            assert report["independently_verified"] is True
            assert (
                report["broker_targets"] == "2"
                and report["model_calls"] == "0"
                and report["token_source"] == "no_model_invoked"
            )
            if index < 5:
                memory.observe(
                    run,
                    phase=(
                        "training"
                        if index < 3
                        else "shadow" if index == 3 else "canary"
                    ),
                )
            else:
                assert sum(n["reused_pure"] for n in report["trace"]) == 1
            results.append({"output": outcome, "metrics": report})
            if index == 4:
                memory = ProcedureMemory.open(output / "memory")
                qualification = memory.qualify(graph, environment=env)
        summary = {
            "status": "PASS_ACTUAL_LOCAL_GUARDED_WORKFLOW",
            "case": args.case,
            "runs": results,
            "signatures_verified": signatures,
            "signature_mutations_rejected": mutations,
            "qualification": qualification.report,
            "unit_confirmation": args.unit_confirm,
            "physical_human_presence_proven": False,
            "external_accounts": False,
            "model_token_savings_proven": False,
            "full_expected_binding_checked": False,
            "independently_checked_binding_fields": [
                "request",
                "operation_id",
                "tool_id",
                "action",
                "actor.principal_id",
                "arguments",
                "resource",
            ],
        }
        (output / "REPORT.json").write_text(json.dumps(summary, indent=2) + "\n")
        (output / "acknowledged-checkpoint.json").write_bytes(host.checkpoint())
        (output / "reviewed-requests.json").write_text(
            json.dumps(
                {k: json.loads(v) for k, v in reviewed_requests.items()}, indent=2
            )
            + "\n"
        )
        print(
            json.dumps(
                {
                    "status": summary["status"],
                    "case": args.case,
                    "runs": len(results),
                    "signatures_verified": signatures,
                }
            )
        )
    finally:
        host.close()


if __name__ == "__main__":
    main()

Recipe definitions

Python imports the fixed graph/verifier definitions from plans.py. TypeScript reads the equivalent plans.json. These are application-owned declarations consumed by the same native procedure engine. Preserve the complete environment binding and independent verifier when adapting a recipe.

plans.py

Create plans.py and append these chunks in order. Together they form one complete program; indentation carries across chunks.

Step 1

Import the SDK and standard-library helpers. These are the real package exports used by the executable program.

Python
"""Readable graph recipes. Rust validates and executes these data-only plans."""

from copy import deepcopy


def literal(value):
    return {"op": "literal", "value": value}


def slot(name, pointer=""):
    return {"op": "input", "name": name, "pointer": pointer}


def node(name, pointer=""):
    return {"op": "node", "id": name, "pointer": pointer}


def binary(op, left, right):
    return {"op": op, "left": left, "right": right}


def equal(left, right):
    return binary("equal", left, right)

Step 2

Build the next part of the local workflow. Values defined in earlier chunks remain in scope; concatenate the chunks in their displayed order.

Python

def conjunction(*items):
    return {"op": "and", "items": list(items)}


def obj(**fields):
    return {"op": "object", "fields": fields}


def step(name, kind, output, after=(), **fields):
    return {
        "id": name,
        "after": list(after),
        "output": output,
        "step": {"kind": kind, **fields},
    }

Step 3

Check the result against independent evidence and retain refusals. The assertion makes this example fail if native verification behaves differently.

Python
def make_graph(case, environment):
    """Use minor units, exact decimal strings and explicit floor division for finance."""
    selected = lambda path: node("sample", "/" + path)
    result = lambda path: node("calculate", "/" + path)
    if case == "transactions":
        checks = conjunction(
            equal(selected("invoice/units"), selected("purchase_order/units")),
            equal(selected("invoice/currency"), selected("purchase_order/currency")),
            equal(selected("invoice/po"), selected("purchase_order/id")),
            equal(selected("delivery/invoice"), selected("invoice/id")),
            equal(selected("delivery/received"), literal(True)),
        )
        calculation = obj(sample=selected("sample"), matches=checks)
        # Independent outcome verifier checks the inverse branch against each source fact.
        mismatch = {
            "op": "if",
            "condition": checks,
            "yes": literal(False),
            "no": literal(True),
        }
        verification = equal(equal(result("matches"), literal(False)), mismatch)
    elif case == "recalculation":
        base = binary("subtract", selected("cost"), selected("salvage"))
        annual = binary("divide", base, selected("years"))

Step 4

Check the result against independent evidence and retain refusals. The assertion makes this example fail if native verification behaves differently.

Python
        calculation = obj(sample=selected("sample"), annual_minor_units=annual)
        amount = result("annual_minor_units")
        # Independent floor-division invariant, rather than reusing cached calculation output.
        verification = conjunction(
            binary("less_equal", literal("0"), selected("cost")),
            binary("less_equal", literal("0"), selected("salvage")),
            binary("less_equal", literal("1"), selected("years")),
            binary("less_equal", selected("salvage"), selected("cost")),
            binary("less_equal", binary("multiply", amount, selected("years")), base),
            equal(
                binary(
                    "less_equal",
                    binary(
                        "multiply",
                        binary("add", amount, literal("1")),
                        selected("years"),
                    ),
                    base,
                ),
                literal(False),
            ),
        )
    elif case == "aml":
        flagged = equal(

Step 5

Review the original request and the native selection separately from the agent. The confirmation binds the signed approval to that selection.

Python
            binary("less_equal", selected("total_cents"), selected("threshold_cents")),
            literal(False),
        )
        calculation = obj(
            sample=selected("sample"),
            review_required=flagged,
            evidence_id=selected("evidence_id"),
        )
        verification = equal(result("review_required"), flagged)
    elif case == "controls":
        operating = {
            "op": "if",
            "condition": binary(
                "less_equal", selected("units"), selected("approval_limit")
            ),
            "yes": literal(True),
            "no": selected("approved"),
        }
        calculation = obj(
            sample=selected("sample"),
            effective=operating,
            evidence_id=selected("evidence_id"),
        )
        # Exceptions are valid findings. The verifier tests the finding, not universal success.

Step 6

Check the result against independent evidence and retain refusals. The assertion makes this example fail if native verification behaves differently.

Python
        verification = equal(result("effective"), operating)
    else:
        raise ValueError("unknown workflow")
    return {
        "version": 1,
        "id": "accounting-" + case,
        "inputs": {"read": "object", "write": "object", "index": "integer"},
        "environment": deepcopy(environment),
        "terminal": "finished",
        "nodes": [
            step("evidence", "read", "object", request=slot("read")),
            step(
                "source",
                "pure",
                "object",
                value={
                    "op": "parse_json",
                    "value": node("evidence", "/response/content"),
                },
            ),
            step(
                "scope",
                "policy",
                "boolean",

Step 7

Check the result against independent evidence and retain refusals. The assertion makes this example fail if native verification behaves differently.

Python
                condition=equal(node("source", "/engagement"), literal("ENG-ALPHA")),
            ),
            step(
                "sample",
                "pure",
                "object",
                after=("scope",),
                value={
                    "op": "index",
                    "value": node("source", "/samples"),
                    "index": slot("index"),
                },
            ),
            step("calculate", "pure", "object", value=calculation),
            # A deliberately repeated pure fragment demonstrates actual compiled common-expression reuse.
            step("duplicate", "pure", "object", value=deepcopy(calculation)),
            step(
                "verified",
                "verify",
                "object",
                after=("duplicate",),
                condition=verification,
                value=node("calculate"),
            ),

Step 8

Keep the exact acknowledged checkpoint. Reopening with an older pin is an error; do not silently discover and adopt newer state.

Python
            step("checkpoint", "checkpoint", "object", after=("verified",)),
            step(
                "review",
                "approval",
                "object",
                after=("checkpoint",),
                operation="workpaper",
            ),
            step(
                "workpaper",
                "effect",
                "object",
                after=("review",),
                request={
                    "op": "set",
                    "value": slot("write"),
                    "pointer": "/payload/data/arguments/value",
                    "replacement": {"op": "json_text", "value": node("verified")},
                },
            ),
            step(
                "finished",
                "verify",
                "object",

Step 9

Check the result against independent evidence and retain refusals. The assertion makes this example fail if native verification behaves differently.

Python
                after=("workpaper",),
                condition=equal(
                    node("workpaper", "/status"), literal("effect_returned")
                ),
                value=node("verified"),
            ),
        ],
    }


def make_verifier(case):
    """Trusted rule, supplied separately from the candidate graph and pinned at qualification.

    Rust captures operations directly from the broker. Candidate graph node values
    cannot replace this context. Check the proposed workpaper before dispatch and
    both the actual write request and final result at completion.
    """
    context = lambda pointer: slot("context", pointer)
    source = {"op": "parse_json", "value": context("/operations/0/response/content")}
    selected = {
        "op": "index",
        "value": {"op": "get", "value": source, "pointer": "/samples"},
        "index": context("/inputs/index"),
    }

Step 10

Build the next part of the local workflow. Values defined in earlier chunks remain in scope; concatenate the chunks in their displayed order.

Python
    fact = lambda path: {"op": "get", "value": selected, "pointer": "/" + path}
    if case == "transactions":
        expected = obj(
            sample=fact("sample"),
            matches=conjunction(
                equal(fact("invoice/units"), fact("purchase_order/units")),
                equal(fact("invoice/currency"), fact("purchase_order/currency")),
                equal(fact("invoice/po"), fact("purchase_order/id")),
                equal(fact("delivery/invoice"), fact("invoice/id")),
                equal(fact("delivery/received"), literal(True)),
            ),
        )
    elif case == "recalculation":
        expected = obj(
            sample=fact("sample"),
            annual_minor_units=binary(
                "divide",
                binary("subtract", fact("cost"), fact("salvage")),
                fact("years"),
            ),
        )
    elif case == "controls":
        expected = obj(
            sample=fact("sample"),

Step 11

Review the original request and the native selection separately from the agent. The confirmation binds the signed approval to that selection.

Python
            effective={
                "op": "if",
                "condition": binary(
                    "less_equal", fact("units"), fact("approval_limit")
                ),
                "yes": literal(True),
                "no": fact("approved"),
            },
            evidence_id=fact("evidence_id"),
        )
    elif case == "aml":
        expected = obj(
            sample=fact("sample"),
            review_required=equal(
                binary("less_equal", fact("total_cents"), fact("threshold_cents")),
                literal(False),
            ),
            evidence_id=fact("evidence_id"),
        )
    else:
        raise ValueError("unknown workflow")
    actual_write = {
        "op": "parse_json",
        "value": context("/operations/1/request/payload/data/arguments/value"),

Step 12

Build the next part of the local workflow. Values defined in earlier chunks remain in scope; concatenate the chunks in their displayed order.

Python
    }
    candidate = {
        "op": "parse_json",
        "value": context("/candidate/payload/data/arguments/value"),
    }
    return conjunction(
        equal(context("/read_count"), literal("1")),
        equal(
            {"op": "get", "value": source, "pointer": "/engagement"},
            literal("ENG-ALPHA"),
        ),
        equal({"op": "get", "value": source, "pointer": "/workflow"}, literal(case)),
        {
            "op": "if",
            "condition": equal(context("/phase"), literal("before_effect")),
            "yes": conjunction(
                equal(context("/effect_count"), literal("0")),
                equal(candidate, expected),
            ),
            "no": conjunction(
                equal(context("/phase"), literal("complete")),
                equal(context("/effect_count"), literal("1")),
                equal(actual_write, expected),
                equal(context("/result"), expected),

Step 13

Check the result against independent evidence and retain refusals. The assertion makes this example fail if native verification behaves differently.

Python
            ),
        },
    )


if __name__ == "__main__":
    import json
    import sys
    from pathlib import Path

    e = dict(
        policy="1" * 64,
        tools="2" * 64,
        credentials="3" * 64,
        evidence="4" * 64,
        host_configuration=None,
    )
    Path(sys.argv[1]).write_text(
        json.dumps(
            {
                case: {"graph": make_graph(case, e), "verifier": make_verifier(case)}
                for case in ("transactions", "recalculation", "controls", "aml")
            },
            indent=2,

Step 14

Build the next part of the local workflow. Values defined in earlier chunks remain in scope; concatenate the chunks in their displayed order.

Python
        )
        + "\n"
    )

plans.json

Create plans.json and append these chunks in order. Together they form one complete program; indentation carries across chunks.

Step 1

Import the SDK and standard-library helpers. These are the real package exports used by the executable program.

JSON
{
  "transactions": {
    "graph": {
      "version": 1,
      "id": "accounting-transactions",
      "inputs": {
        "read": "object",
        "write": "object",
        "index": "integer"
      },
      "environment": {
        "policy": "1111111111111111111111111111111111111111111111111111111111111111",
        "tools": "2222222222222222222222222222222222222222222222222222222222222222",
        "credentials": "3333333333333333333333333333333333333333333333333333333333333333",
        "evidence": "4444444444444444444444444444444444444444444444444444444444444444",
        "host_configuration": null
      },
      "terminal": "finished",
      "nodes": [
        {
          "id": "evidence",
          "after": [],
          "output": "object",
          "step": {

Step 2

Keep this calculation pure, version its meaning and check every reused result independently. The counters show whether work was reused.

JSON
            "kind": "read",
            "request": {
              "op": "input",
              "name": "read",
              "pointer": ""
            }
          }
        },
        {
          "id": "source",
          "after": [],
          "output": "object",
          "step": {
            "kind": "pure",
            "value": {
              "op": "parse_json",
              "value": {
                "op": "node",
                "id": "evidence",
                "pointer": "/response/content"
              }
            }
          }
        },

Step 3

Build the next part of the local workflow. Values defined in earlier chunks remain in scope; concatenate the chunks in their displayed order.

JSON
        {
          "id": "scope",
          "after": [],
          "output": "boolean",
          "step": {
            "kind": "policy",
            "condition": {
              "op": "equal",
              "left": {
                "op": "node",
                "id": "source",
                "pointer": "/engagement"
              },
              "right": {
                "op": "literal",
                "value": "ENG-ALPHA"
              }
            }
          }
        },
        {
          "id": "sample",
          "after": [
            "scope"

Step 4

Keep this calculation pure, version its meaning and check every reused result independently. The counters show whether work was reused.

JSON
          ],
          "output": "object",
          "step": {
            "kind": "pure",
            "value": {
              "op": "index",
              "value": {
                "op": "node",
                "id": "source",
                "pointer": "/samples"
              },
              "index": {
                "op": "input",
                "name": "index",
                "pointer": ""
              }
            }
          }
        },
        {
          "id": "calculate",
          "after": [],
          "output": "object",
          "step": {

Step 5

Keep this calculation pure, version its meaning and check every reused result independently. The counters show whether work was reused.

JSON
            "kind": "pure",
            "value": {
              "op": "object",
              "fields": {
                "sample": {
                  "op": "node",
                  "id": "sample",
                  "pointer": "/sample"
                },
                "matches": {
                  "op": "and",
                  "items": [
                    {
                      "op": "equal",
                      "left": {
                        "op": "node",
                        "id": "sample",
                        "pointer": "/invoice/units"
                      },
                      "right": {
                        "op": "node",
                        "id": "sample",
                        "pointer": "/purchase_order/units"
                      }

Step 6

Build the next part of the local workflow. Values defined in earlier chunks remain in scope; concatenate the chunks in their displayed order.

JSON
                    },
                    {
                      "op": "equal",
                      "left": {
                        "op": "node",
                        "id": "sample",
                        "pointer": "/invoice/currency"
                      },
                      "right": {
                        "op": "node",
                        "id": "sample",
                        "pointer": "/purchase_order/currency"
                      }
                    },
                    {
                      "op": "equal",
                      "left": {
                        "op": "node",
                        "id": "sample",
                        "pointer": "/invoice/po"
                      },
                      "right": {
                        "op": "node",
                        "id": "sample",

Step 7

Build the next part of the local workflow. Values defined in earlier chunks remain in scope; concatenate the chunks in their displayed order.

JSON
                        "pointer": "/purchase_order/id"
                      }
                    },
                    {
                      "op": "equal",
                      "left": {
                        "op": "node",
                        "id": "sample",
                        "pointer": "/delivery/invoice"
                      },
                      "right": {
                        "op": "node",
                        "id": "sample",
                        "pointer": "/invoice/id"
                      }
                    },
                    {
                      "op": "equal",
                      "left": {
                        "op": "node",
                        "id": "sample",
                        "pointer": "/delivery/received"
                      },
                      "right": {

Step 8

Keep this calculation pure, version its meaning and check every reused result independently. The counters show whether work was reused.

JSON
                        "op": "literal",
                        "value": true
                      }
                    }
                  ]
                }
              }
            }
          }
        },
        {
          "id": "duplicate",
          "after": [],
          "output": "object",
          "step": {
            "kind": "pure",
            "value": {
              "op": "object",
              "fields": {
                "sample": {
                  "op": "node",
                  "id": "sample",
                  "pointer": "/sample"
                },

Step 9

Build the next part of the local workflow. Values defined in earlier chunks remain in scope; concatenate the chunks in their displayed order.

JSON
                "matches": {
                  "op": "and",
                  "items": [
                    {
                      "op": "equal",
                      "left": {
                        "op": "node",
                        "id": "sample",
                        "pointer": "/invoice/units"
                      },
                      "right": {
                        "op": "node",
                        "id": "sample",
                        "pointer": "/purchase_order/units"
                      }
                    },
                    {
                      "op": "equal",
                      "left": {
                        "op": "node",
                        "id": "sample",
                        "pointer": "/invoice/currency"
                      },
                      "right": {

Step 10

Build the next part of the local workflow. Values defined in earlier chunks remain in scope; concatenate the chunks in their displayed order.

JSON
                        "op": "node",
                        "id": "sample",
                        "pointer": "/purchase_order/currency"
                      }
                    },
                    {
                      "op": "equal",
                      "left": {
                        "op": "node",
                        "id": "sample",
                        "pointer": "/invoice/po"
                      },
                      "right": {
                        "op": "node",
                        "id": "sample",
                        "pointer": "/purchase_order/id"
                      }
                    },
                    {
                      "op": "equal",
                      "left": {
                        "op": "node",
                        "id": "sample",
                        "pointer": "/delivery/invoice"

Step 11

Build the next part of the local workflow. Values defined in earlier chunks remain in scope; concatenate the chunks in their displayed order.

JSON
                      },
                      "right": {
                        "op": "node",
                        "id": "sample",
                        "pointer": "/invoice/id"
                      }
                    },
                    {
                      "op": "equal",
                      "left": {
                        "op": "node",
                        "id": "sample",
                        "pointer": "/delivery/received"
                      },
                      "right": {
                        "op": "literal",
                        "value": true
                      }
                    }
                  ]
                }
              }
            }
          }

Step 12

Check the result against independent evidence and retain refusals. The assertion makes this example fail if native verification behaves differently.

JSON
        },
        {
          "id": "verified",
          "after": [
            "duplicate"
          ],
          "output": "object",
          "step": {
            "kind": "verify",
            "condition": {
              "op": "equal",
              "left": {
                "op": "equal",
                "left": {
                  "op": "node",
                  "id": "calculate",
                  "pointer": "/matches"
                },
                "right": {
                  "op": "literal",
                  "value": false
                }
              },
              "right": {

Step 13

Build the next part of the local workflow. Values defined in earlier chunks remain in scope; concatenate the chunks in their displayed order.

JSON
                "op": "if",
                "condition": {
                  "op": "and",
                  "items": [
                    {
                      "op": "equal",
                      "left": {
                        "op": "node",
                        "id": "sample",
                        "pointer": "/invoice/units"
                      },
                      "right": {
                        "op": "node",
                        "id": "sample",
                        "pointer": "/purchase_order/units"
                      }
                    },
                    {
                      "op": "equal",
                      "left": {
                        "op": "node",
                        "id": "sample",
                        "pointer": "/invoice/currency"
                      },

Step 14

Build the next part of the local workflow. Values defined in earlier chunks remain in scope; concatenate the chunks in their displayed order.

JSON
                      "right": {
                        "op": "node",
                        "id": "sample",
                        "pointer": "/purchase_order/currency"
                      }
                    },
                    {
                      "op": "equal",
                      "left": {
                        "op": "node",
                        "id": "sample",
                        "pointer": "/invoice/po"
                      },
                      "right": {
                        "op": "node",
                        "id": "sample",
                        "pointer": "/purchase_order/id"
                      }
                    },
                    {
                      "op": "equal",
                      "left": {
                        "op": "node",
                        "id": "sample",

Step 15

Build the next part of the local workflow. Values defined in earlier chunks remain in scope; concatenate the chunks in their displayed order.

JSON
                        "pointer": "/delivery/invoice"
                      },
                      "right": {
                        "op": "node",
                        "id": "sample",
                        "pointer": "/invoice/id"
                      }
                    },
                    {
                      "op": "equal",
                      "left": {
                        "op": "node",
                        "id": "sample",
                        "pointer": "/delivery/received"
                      },
                      "right": {
                        "op": "literal",
                        "value": true
                      }
                    }
                  ]
                },
                "yes": {
                  "op": "literal",

Step 16

Keep the exact acknowledged checkpoint. Reopening with an older pin is an error; do not silently discover and adopt newer state.

JSON
                  "value": false
                },
                "no": {
                  "op": "literal",
                  "value": true
                }
              }
            },
            "value": {
              "op": "node",
              "id": "calculate",
              "pointer": ""
            }
          }
        },
        {
          "id": "checkpoint",
          "after": [
            "verified"
          ],
          "output": "object",
          "step": {
            "kind": "checkpoint"
          }

Step 17

Keep the exact acknowledged checkpoint. Reopening with an older pin is an error; do not silently discover and adopt newer state.

JSON
        },
        {
          "id": "review",
          "after": [
            "checkpoint"
          ],
          "output": "object",
          "step": {
            "kind": "approval",
            "operation": "workpaper"
          }
        },
        {
          "id": "workpaper",
          "after": [
            "review"
          ],
          "output": "object",
          "step": {
            "kind": "effect",
            "request": {
              "op": "set",
              "value": {
                "op": "input",

Step 18

Check the result against independent evidence and retain refusals. The assertion makes this example fail if native verification behaves differently.

JSON
                "name": "write",
                "pointer": ""
              },
              "pointer": "/payload/data/arguments/value",
              "replacement": {
                "op": "json_text",
                "value": {
                  "op": "node",
                  "id": "verified",
                  "pointer": ""
                }
              }
            }
          }
        },
        {
          "id": "finished",
          "after": [
            "workpaper"
          ],
          "output": "object",
          "step": {
            "kind": "verify",
            "condition": {

Step 19

Check the result against independent evidence and retain refusals. The assertion makes this example fail if native verification behaves differently.

JSON
              "op": "equal",
              "left": {
                "op": "node",
                "id": "workpaper",
                "pointer": "/status"
              },
              "right": {
                "op": "literal",
                "value": "effect_returned"
              }
            },
            "value": {
              "op": "node",
              "id": "verified",
              "pointer": ""
            }
          }
        }
      ]
    },
    "verifier": {
      "op": "and",
      "items": [
        {

Step 20

Build the next part of the local workflow. Values defined in earlier chunks remain in scope; concatenate the chunks in their displayed order.

JSON
          "op": "equal",
          "left": {
            "op": "input",
            "name": "context",
            "pointer": "/read_count"
          },
          "right": {
            "op": "literal",
            "value": "1"
          }
        },
        {
          "op": "equal",
          "left": {
            "op": "get",
            "value": {
              "op": "parse_json",
              "value": {
                "op": "input",
                "name": "context",
                "pointer": "/operations/0/response/content"
              }
            },
            "pointer": "/engagement"

Step 21

Build the next part of the local workflow. Values defined in earlier chunks remain in scope; concatenate the chunks in their displayed order.

JSON
          },
          "right": {
            "op": "literal",
            "value": "ENG-ALPHA"
          }
        },
        {
          "op": "equal",
          "left": {
            "op": "get",
            "value": {
              "op": "parse_json",
              "value": {
                "op": "input",
                "name": "context",
                "pointer": "/operations/0/response/content"
              }
            },
            "pointer": "/workflow"
          },
          "right": {
            "op": "literal",
            "value": "transactions"
          }

Step 22

Build the next part of the local workflow. Values defined in earlier chunks remain in scope; concatenate the chunks in their displayed order.

JSON
        },
        {
          "op": "if",
          "condition": {
            "op": "equal",
            "left": {
              "op": "input",
              "name": "context",
              "pointer": "/phase"
            },
            "right": {
              "op": "literal",
              "value": "before_effect"
            }
          },
          "yes": {
            "op": "and",
            "items": [
              {
                "op": "equal",
                "left": {
                  "op": "input",
                  "name": "context",
                  "pointer": "/effect_count"

Step 23

Build the next part of the local workflow. Values defined in earlier chunks remain in scope; concatenate the chunks in their displayed order.

JSON
                },
                "right": {
                  "op": "literal",
                  "value": "0"
                }
              },
              {
                "op": "equal",
                "left": {
                  "op": "parse_json",
                  "value": {
                    "op": "input",
                    "name": "context",
                    "pointer": "/candidate/payload/data/arguments/value"
                  }
                },
                "right": {
                  "op": "object",
                  "fields": {
                    "sample": {
                      "op": "get",
                      "value": {
                        "op": "index",
                        "value": {

Step 24

Build the next part of the local workflow. Values defined in earlier chunks remain in scope; concatenate the chunks in their displayed order.

JSON
                          "op": "get",
                          "value": {
                            "op": "parse_json",
                            "value": {
                              "op": "input",
                              "name": "context",
                              "pointer": "/operations/0/response/content"
                            }
                          },
                          "pointer": "/samples"
                        },
                        "index": {
                          "op": "input",
                          "name": "context",
                          "pointer": "/inputs/index"
                        }
                      },
                      "pointer": "/sample"
                    },
                    "matches": {
                      "op": "and",
                      "items": [
                        {
                          "op": "equal",

Step 25

Build the next part of the local workflow. Values defined in earlier chunks remain in scope; concatenate the chunks in their displayed order.

JSON
                          "left": {
                            "op": "get",
                            "value": {
                              "op": "index",
                              "value": {
                                "op": "get",
                                "value": {
                                  "op": "parse_json",
                                  "value": {
                                    "op": "input",
                                    "name": "context",
                                    "pointer": "/operations/0/response/content"
                                  }
                                },
                                "pointer": "/samples"
                              },
                              "index": {
                                "op": "input",
                                "name": "context",
                                "pointer": "/inputs/index"
                              }
                            },
                            "pointer": "/invoice/units"
                          },

Step 26

Build the next part of the local workflow. Values defined in earlier chunks remain in scope; concatenate the chunks in their displayed order.

JSON
                          "right": {
                            "op": "get",
                            "value": {
                              "op": "index",
                              "value": {
                                "op": "get",
                                "value": {
                                  "op": "parse_json",
                                  "value": {
                                    "op": "input",
                                    "name": "context",
                                    "pointer": "/operations/0/response/content"
                                  }
                                },
                                "pointer": "/samples"
                              },
                              "index": {
                                "op": "input",
                                "name": "context",
                                "pointer": "/inputs/index"
                              }
                            },
                            "pointer": "/purchase_order/units"
                          }

Step 27

Build the next part of the local workflow. Values defined in earlier chunks remain in scope; concatenate the chunks in their displayed order.

JSON
                        },
                        {
                          "op": "equal",
                          "left": {
                            "op": "get",
                            "value": {
                              "op": "index",
                              "value": {
                                "op": "get",
                                "value": {
                                  "op": "parse_json",
                                  "value": {
                                    "op": "input",
                                    "name": "context",
                                    "pointer": "/operations/0/response/content"
                                  }
                                },
                                "pointer": "/samples"
                              },
                              "index": {
                                "op": "input",
                                "name": "context",
                                "pointer": "/inputs/index"
                              }

Step 28

Build the next part of the local workflow. Values defined in earlier chunks remain in scope; concatenate the chunks in their displayed order.

JSON
                            },
                            "pointer": "/invoice/currency"
                          },
                          "right": {
                            "op": "get",
                            "value": {
                              "op": "index",
                              "value": {
                                "op": "get",
                                "value": {
                                  "op": "parse_json",
                                  "value": {
                                    "op": "input",
                                    "name": "context",
                                    "pointer": "/operations/0/response/content"
                                  }
                                },
                                "pointer": "/samples"
                              },
                              "index": {
                                "op": "input",
                                "name": "context",
                                "pointer": "/inputs/index"
                              }

Step 29

Build the next part of the local workflow. Values defined in earlier chunks remain in scope; concatenate the chunks in their displayed order.

JSON
                            },
                            "pointer": "/purchase_order/currency"
                          }
                        },
                        {
                          "op": "equal",
                          "left": {
                            "op": "get",
                            "value": {
                              "op": "index",
                              "value": {
                                "op": "get",
                                "value": {
                                  "op": "parse_json",
                                  "value": {
                                    "op": "input",
                                    "name": "context",
                                    "pointer": "/operations/0/response/content"
                                  }
                                },
                                "pointer": "/samples"
                              },
                              "index": {
                                "op": "input",

Step 30

Build the next part of the local workflow. Values defined in earlier chunks remain in scope; concatenate the chunks in their displayed order.

JSON
                                "name": "context",
                                "pointer": "/inputs/index"
                              }
                            },
                            "pointer": "/invoice/po"
                          },
                          "right": {
                            "op": "get",
                            "value": {
                              "op": "index",
                              "value": {
                                "op": "get",
                                "value": {
                                  "op": "parse_json",
                                  "value": {
                                    "op": "input",
                                    "name": "context",
                                    "pointer": "/operations/0/response/content"
                                  }
                                },
                                "pointer": "/samples"
                              },
                              "index": {
                                "op": "input",

Step 31

Build the next part of the local workflow. Values defined in earlier chunks remain in scope; concatenate the chunks in their displayed order.

JSON
                                "name": "context",
                                "pointer": "/inputs/index"
                              }
                            },
                            "pointer": "/purchase_order/id"
                          }
                        },
                        {
                          "op": "equal",
                          "left": {
                            "op": "get",
                            "value": {
                              "op": "index",
                              "value": {
                                "op": "get",
                                "value": {
                                  "op": "parse_json",
                                  "value": {
                                    "op": "input",
                                    "name": "context",
                                    "pointer": "/operations/0/response/content"
                                  }
                                },
                                "pointer": "/samples"

Step 32

Build the next part of the local workflow. Values defined in earlier chunks remain in scope; concatenate the chunks in their displayed order.

JSON
                              },
                              "index": {
                                "op": "input",
                                "name": "context",
                                "pointer": "/inputs/index"
                              }
                            },
                            "pointer": "/delivery/invoice"
                          },
                          "right": {
                            "op": "get",
                            "value": {
                              "op": "index",
                              "value": {
                                "op": "get",
                                "value": {
                                  "op": "parse_json",
                                  "value": {
                                    "op": "input",
                                    "name": "context",
                                    "pointer": "/operations/0/response/content"
                                  }
                                },
                                "pointer": "/samples"

Step 33

Build the next part of the local workflow. Values defined in earlier chunks remain in scope; concatenate the chunks in their displayed order.

JSON
                              },
                              "index": {
                                "op": "input",
                                "name": "context",
                                "pointer": "/inputs/index"
                              }
                            },
                            "pointer": "/invoice/id"
                          }
                        },
                        {
                          "op": "equal",
                          "left": {
                            "op": "get",
                            "value": {
                              "op": "index",
                              "value": {
                                "op": "get",
                                "value": {
                                  "op": "parse_json",
                                  "value": {
                                    "op": "input",
                                    "name": "context",
                                    "pointer": "/operations/0/response/content"

Step 34

Build the next part of the local workflow. Values defined in earlier chunks remain in scope; concatenate the chunks in their displayed order.

JSON
                                  }
                                },
                                "pointer": "/samples"
                              },
                              "index": {
                                "op": "input",
                                "name": "context",
                                "pointer": "/inputs/index"
                              }
                            },
                            "pointer": "/delivery/received"
                          },
                          "right": {
                            "op": "literal",
                            "value": true
                          }
                        }
                      ]
                    }
                  }
                }
              }
            ]
          },

Step 35

Build the next part of the local workflow. Values defined in earlier chunks remain in scope; concatenate the chunks in their displayed order.

JSON
          "no": {
            "op": "and",
            "items": [
              {
                "op": "equal",
                "left": {
                  "op": "input",
                  "name": "context",
                  "pointer": "/phase"
                },
                "right": {
                  "op": "literal",
                  "value": "complete"
                }
              },
              {
                "op": "equal",
                "left": {
                  "op": "input",
                  "name": "context",
                  "pointer": "/effect_count"
                },
                "right": {
                  "op": "literal",

Step 36

Build the next part of the local workflow. Values defined in earlier chunks remain in scope; concatenate the chunks in their displayed order.

JSON
                  "value": "1"
                }
              },
              {
                "op": "equal",
                "left": {
                  "op": "parse_json",
                  "value": {
                    "op": "input",
                    "name": "context",
                    "pointer": "/operations/1/request/payload/data/arguments/value"
                  }
                },
                "right": {
                  "op": "object",
                  "fields": {
                    "sample": {
                      "op": "get",
                      "value": {
                        "op": "index",
                        "value": {
                          "op": "get",
                          "value": {
                            "op": "parse_json",

Step 37

Build the next part of the local workflow. Values defined in earlier chunks remain in scope; concatenate the chunks in their displayed order.

JSON
                            "value": {
                              "op": "input",
                              "name": "context",
                              "pointer": "/operations/0/response/content"
                            }
                          },
                          "pointer": "/samples"
                        },
                        "index": {
                          "op": "input",
                          "name": "context",
                          "pointer": "/inputs/index"
                        }
                      },
                      "pointer": "/sample"
                    },
                    "matches": {
                      "op": "and",
                      "items": [
                        {
                          "op": "equal",
                          "left": {
                            "op": "get",
                            "value": {

Step 38

Build the next part of the local workflow. Values defined in earlier chunks remain in scope; concatenate the chunks in their displayed order.

JSON
                              "op": "index",
                              "value": {
                                "op": "get",
                                "value": {
                                  "op": "parse_json",
                                  "value": {
                                    "op": "input",
                                    "name": "context",
                                    "pointer": "/operations/0/response/content"
                                  }
                                },
                                "pointer": "/samples"
                              },
                              "index": {
                                "op": "input",
                                "name": "context",
                                "pointer": "/inputs/index"
                              }
                            },
                            "pointer": "/invoice/units"
                          },
                          "right": {
                            "op": "get",
                            "value": {

Step 39

Build the next part of the local workflow. Values defined in earlier chunks remain in scope; concatenate the chunks in their displayed order.

JSON
                              "op": "index",
                              "value": {
                                "op": "get",
                                "value": {
                                  "op": "parse_json",
                                  "value": {
                                    "op": "input",
                                    "name": "context",
                                    "pointer": "/operations/0/response/content"
                                  }
                                },
                                "pointer": "/samples"
                              },
                              "index": {
                                "op": "input",
                                "name": "context",
                                "pointer": "/inputs/index"
                              }
                            },
                            "pointer": "/purchase_order/units"
                          }
                        },
                        {
                          "op": "equal",

Step 40

Build the next part of the local workflow. Values defined in earlier chunks remain in scope; concatenate the chunks in their displayed order.

JSON
                          "left": {
                            "op": "get",
                            "value": {
                              "op": "index",
                              "value": {
                                "op": "get",
                                "value": {
                                  "op": "parse_json",
                                  "value": {
                                    "op": "input",
                                    "name": "context",
                                    "pointer": "/operations/0/response/content"
                                  }
                                },
                                "pointer": "/samples"
                              },
                              "index": {
                                "op": "input",
                                "name": "context",
                                "pointer": "/inputs/index"
                              }
                            },
                            "pointer": "/invoice/currency"
                          },

Step 41

Build the next part of the local workflow. Values defined in earlier chunks remain in scope; concatenate the chunks in their displayed order.

JSON
                          "right": {
                            "op": "get",
                            "value": {
                              "op": "index",
                              "value": {
                                "op": "get",
                                "value": {
                                  "op": "parse_json",
                                  "value": {
                                    "op": "input",
                                    "name": "context",
                                    "pointer": "/operations/0/response/content"
                                  }
                                },
                                "pointer": "/samples"
                              },
                              "index": {
                                "op": "input",
                                "name": "context",
                                "pointer": "/inputs/index"
                              }
                            },
                            "pointer": "/purchase_order/currency"
                          }

Step 42

Build the next part of the local workflow. Values defined in earlier chunks remain in scope; concatenate the chunks in their displayed order.

JSON
                        },
                        {
                          "op": "equal",
                          "left": {
                            "op": "get",
                            "value": {
                              "op": "index",
                              "value": {
                                "op": "get",
                                "value": {
                                  "op": "parse_json",
                                  "value": {
                                    "op": "input",
                                    "name": "context",
                                    "pointer": "/operations/0/response/content"
                                  }
                                },
                                "pointer": "/samples"
                              },
                              "index": {
                                "op": "input",
                                "name": "context",
                                "pointer": "/inputs/index"
                              }

Step 43

Build the next part of the local workflow. Values defined in earlier chunks remain in scope; concatenate the chunks in their displayed order.

JSON
                            },
                            "pointer": "/invoice/po"
                          },
                          "right": {
                            "op": "get",
                            "value": {
                              "op": "index",
                              "value": {
                                "op": "get",
                                "value": {
                                  "op": "parse_json",
                                  "value": {
                                    "op": "input",
                                    "name": "context",
                                    "pointer": "/operations/0/response/content"
                                  }
                                },
                                "pointer": "/samples"
                              },
                              "index": {
                                "op": "input",
                                "name": "context",
                                "pointer": "/inputs/index"
                              }

Step 44

Build the next part of the local workflow. Values defined in earlier chunks remain in scope; concatenate the chunks in their displayed order.

JSON
                            },
                            "pointer": "/purchase_order/id"
                          }
                        },
                        {
                          "op": "equal",
                          "left": {
                            "op": "get",
                            "value": {
                              "op": "index",
                              "value": {
                                "op": "get",
                                "value": {
                                  "op": "parse_json",
                                  "value": {
                                    "op": "input",
                                    "name": "context",
                                    "pointer": "/operations/0/response/content"
                                  }
                                },
                                "pointer": "/samples"
                              },
                              "index": {
                                "op": "input",

Step 45

Build the next part of the local workflow. Values defined in earlier chunks remain in scope; concatenate the chunks in their displayed order.

JSON
                                "name": "context",
                                "pointer": "/inputs/index"
                              }
                            },
                            "pointer": "/delivery/invoice"
                          },
                          "right": {
                            "op": "get",
                            "value": {
                              "op": "index",
                              "value": {
                                "op": "get",
                                "value": {
                                  "op": "parse_json",
                                  "value": {
                                    "op": "input",
                                    "name": "context",
                                    "pointer": "/operations/0/response/content"
                                  }
                                },
                                "pointer": "/samples"
                              },
                              "index": {
                                "op": "input",

Step 46

Build the next part of the local workflow. Values defined in earlier chunks remain in scope; concatenate the chunks in their displayed order.

JSON
                                "name": "context",
                                "pointer": "/inputs/index"
                              }
                            },
                            "pointer": "/invoice/id"
                          }
                        },
                        {
                          "op": "equal",
                          "left": {
                            "op": "get",
                            "value": {
                              "op": "index",
                              "value": {
                                "op": "get",
                                "value": {
                                  "op": "parse_json",
                                  "value": {
                                    "op": "input",
                                    "name": "context",
                                    "pointer": "/operations/0/response/content"
                                  }
                                },
                                "pointer": "/samples"

Step 47

Build the next part of the local workflow. Values defined in earlier chunks remain in scope; concatenate the chunks in their displayed order.

JSON
                              },
                              "index": {
                                "op": "input",
                                "name": "context",
                                "pointer": "/inputs/index"
                              }
                            },
                            "pointer": "/delivery/received"
                          },
                          "right": {
                            "op": "literal",
                            "value": true
                          }
                        }
                      ]
                    }
                  }
                }
              },
              {
                "op": "equal",
                "left": {
                  "op": "input",
                  "name": "context",

Step 48

Build the next part of the local workflow. Values defined in earlier chunks remain in scope; concatenate the chunks in their displayed order.

JSON
                  "pointer": "/result"
                },
                "right": {
                  "op": "object",
                  "fields": {
                    "sample": {
                      "op": "get",
                      "value": {
                        "op": "index",
                        "value": {
                          "op": "get",
                          "value": {
                            "op": "parse_json",
                            "value": {
                              "op": "input",
                              "name": "context",
                              "pointer": "/operations/0/response/content"
                            }
                          },
                          "pointer": "/samples"
                        },
                        "index": {
                          "op": "input",
                          "name": "context",

Step 49

Build the next part of the local workflow. Values defined in earlier chunks remain in scope; concatenate the chunks in their displayed order.

JSON
                          "pointer": "/inputs/index"
                        }
                      },
                      "pointer": "/sample"
                    },
                    "matches": {
                      "op": "and",
                      "items": [
                        {
                          "op": "equal",
                          "left": {
                            "op": "get",
                            "value": {
                              "op": "index",
                              "value": {
                                "op": "get",
                                "value": {
                                  "op": "parse_json",
                                  "value": {
                                    "op": "input",
                                    "name": "context",
                                    "pointer": "/operations/0/response/content"
                                  }
                                },

Step 50

Build the next part of the local workflow. Values defined in earlier chunks remain in scope; concatenate the chunks in their displayed order.

JSON
                                "pointer": "/samples"
                              },
                              "index": {
                                "op": "input",
                                "name": "context",
                                "pointer": "/inputs/index"
                              }
                            },
                            "pointer": "/invoice/units"
                          },
                          "right": {
                            "op": "get",
                            "value": {
                              "op": "index",
                              "value": {
                                "op": "get",
                                "value": {
                                  "op": "parse_json",
                                  "value": {
                                    "op": "input",
                                    "name": "context",
                                    "pointer": "/operations/0/response/content"
                                  }
                                },

Step 51

Build the next part of the local workflow. Values defined in earlier chunks remain in scope; concatenate the chunks in their displayed order.

JSON
                                "pointer": "/samples"
                              },
                              "index": {
                                "op": "input",
                                "name": "context",
                                "pointer": "/inputs/index"
                              }
                            },
                            "pointer": "/purchase_order/units"
                          }
                        },
                        {
                          "op": "equal",
                          "left": {
                            "op": "get",
                            "value": {
                              "op": "index",
                              "value": {
                                "op": "get",
                                "value": {
                                  "op": "parse_json",
                                  "value": {
                                    "op": "input",
                                    "name": "context",

Step 52

Build the next part of the local workflow. Values defined in earlier chunks remain in scope; concatenate the chunks in their displayed order.

JSON
                                    "pointer": "/operations/0/response/content"
                                  }
                                },
                                "pointer": "/samples"
                              },
                              "index": {
                                "op": "input",
                                "name": "context",
                                "pointer": "/inputs/index"
                              }
                            },
                            "pointer": "/invoice/currency"
                          },
                          "right": {
                            "op": "get",
                            "value": {
                              "op": "index",
                              "value": {
                                "op": "get",
                                "value": {
                                  "op": "parse_json",
                                  "value": {
                                    "op": "input",
                                    "name": "context",

Step 53

Build the next part of the local workflow. Values defined in earlier chunks remain in scope; concatenate the chunks in their displayed order.

JSON
                                    "pointer": "/operations/0/response/content"
                                  }
                                },
                                "pointer": "/samples"
                              },
                              "index": {
                                "op": "input",
                                "name": "context",
                                "pointer": "/inputs/index"
                              }
                            },
                            "pointer": "/purchase_order/currency"
                          }
                        },
                        {
                          "op": "equal",
                          "left": {
                            "op": "get",
                            "value": {
                              "op": "index",
                              "value": {
                                "op": "get",
                                "value": {
                                  "op": "parse_json",

Step 54

Build the next part of the local workflow. Values defined in earlier chunks remain in scope; concatenate the chunks in their displayed order.

JSON
                                  "value": {
                                    "op": "input",
                                    "name": "context",
                                    "pointer": "/operations/0/response/content"
                                  }
                                },
                                "pointer": "/samples"
                              },
                              "index": {
                                "op": "input",
                                "name": "context",
                                "pointer": "/inputs/index"
                              }
                            },
                            "pointer": "/invoice/po"
                          },
                          "right": {
                            "op": "get",
                            "value": {
                              "op": "index",
                              "value": {
                                "op": "get",
                                "value": {
                                  "op": "parse_json",

Step 55

Build the next part of the local workflow. Values defined in earlier chunks remain in scope; concatenate the chunks in their displayed order.

JSON
                                  "value": {
                                    "op": "input",
                                    "name": "context",
                                    "pointer": "/operations/0/response/content"
                                  }
                                },
                                "pointer": "/samples"
                              },
                              "index": {
                                "op": "input",
                                "name": "context",
                                "pointer": "/inputs/index"
                              }
                            },
                            "pointer": "/purchase_order/id"
                          }
                        },
                        {
                          "op": "equal",
                          "left": {
                            "op": "get",
                            "value": {
                              "op": "index",
                              "value": {

Step 56

Build the next part of the local workflow. Values defined in earlier chunks remain in scope; concatenate the chunks in their displayed order.

JSON
                                "op": "get",
                                "value": {
                                  "op": "parse_json",
                                  "value": {
                                    "op": "input",
                                    "name": "context",
                                    "pointer": "/operations/0/response/content"
                                  }
                                },
                                "pointer": "/samples"
                              },
                              "index": {
                                "op": "input",
                                "name": "context",
                                "pointer": "/inputs/index"
                              }
                            },
                            "pointer": "/delivery/invoice"
                          },
                          "right": {
                            "op": "get",
                            "value": {
                              "op": "index",
                              "value": {

Step 57

Build the next part of the local workflow. Values defined in earlier chunks remain in scope; concatenate the chunks in their displayed order.

JSON
                                "op": "get",
                                "value": {
                                  "op": "parse_json",
                                  "value": {
                                    "op": "input",
                                    "name": "context",
                                    "pointer": "/operations/0/response/content"
                                  }
                                },
                                "pointer": "/samples"
                              },
                              "index": {
                                "op": "input",
                                "name": "context",
                                "pointer": "/inputs/index"
                              }
                            },
                            "pointer": "/invoice/id"
                          }
                        },
                        {
                          "op": "equal",
                          "left": {
                            "op": "get",

Step 58

Build the next part of the local workflow. Values defined in earlier chunks remain in scope; concatenate the chunks in their displayed order.

JSON
                            "value": {
                              "op": "index",
                              "value": {
                                "op": "get",
                                "value": {
                                  "op": "parse_json",
                                  "value": {
                                    "op": "input",
                                    "name": "context",
                                    "pointer": "/operations/0/response/content"
                                  }
                                },
                                "pointer": "/samples"
                              },
                              "index": {
                                "op": "input",
                                "name": "context",
                                "pointer": "/inputs/index"
                              }
                            },
                            "pointer": "/delivery/received"
                          },
                          "right": {
                            "op": "literal",

Step 59

Build the next part of the local workflow. Values defined in earlier chunks remain in scope; concatenate the chunks in their displayed order.

JSON
                            "value": true
                          }
                        }
                      ]
                    }
                  }
                }
              }
            ]
          }
        }
      ]
    }
  },
  "recalculation": {
    "graph": {
      "version": 1,
      "id": "accounting-recalculation",
      "inputs": {
        "read": "object",
        "write": "object",
        "index": "integer"
      },
      "environment": {

Step 60

Build the next part of the local workflow. Values defined in earlier chunks remain in scope; concatenate the chunks in their displayed order.

JSON
        "policy": "1111111111111111111111111111111111111111111111111111111111111111",
        "tools": "2222222222222222222222222222222222222222222222222222222222222222",
        "credentials": "3333333333333333333333333333333333333333333333333333333333333333",
        "evidence": "4444444444444444444444444444444444444444444444444444444444444444",
        "host_configuration": null
      },
      "terminal": "finished",
      "nodes": [
        {
          "id": "evidence",
          "after": [],
          "output": "object",
          "step": {
            "kind": "read",
            "request": {
              "op": "input",
              "name": "read",
              "pointer": ""
            }
          }
        },
        {
          "id": "source",
          "after": [],

Step 61

Keep this calculation pure, version its meaning and check every reused result independently. The counters show whether work was reused.

JSON
          "output": "object",
          "step": {
            "kind": "pure",
            "value": {
              "op": "parse_json",
              "value": {
                "op": "node",
                "id": "evidence",
                "pointer": "/response/content"
              }
            }
          }
        },
        {
          "id": "scope",
          "after": [],
          "output": "boolean",
          "step": {
            "kind": "policy",
            "condition": {
              "op": "equal",
              "left": {
                "op": "node",
                "id": "source",

Step 62

Keep this calculation pure, version its meaning and check every reused result independently. The counters show whether work was reused.

JSON
                "pointer": "/engagement"
              },
              "right": {
                "op": "literal",
                "value": "ENG-ALPHA"
              }
            }
          }
        },
        {
          "id": "sample",
          "after": [
            "scope"
          ],
          "output": "object",
          "step": {
            "kind": "pure",
            "value": {
              "op": "index",
              "value": {
                "op": "node",
                "id": "source",
                "pointer": "/samples"
              },

Step 63

Keep this calculation pure, version its meaning and check every reused result independently. The counters show whether work was reused.

JSON
              "index": {
                "op": "input",
                "name": "index",
                "pointer": ""
              }
            }
          }
        },
        {
          "id": "calculate",
          "after": [],
          "output": "object",
          "step": {
            "kind": "pure",
            "value": {
              "op": "object",
              "fields": {
                "sample": {
                  "op": "node",
                  "id": "sample",
                  "pointer": "/sample"
                },
                "annual_minor_units": {
                  "op": "divide",

Step 64

Build the next part of the local workflow. Values defined in earlier chunks remain in scope; concatenate the chunks in their displayed order.

JSON
                  "left": {
                    "op": "subtract",
                    "left": {
                      "op": "node",
                      "id": "sample",
                      "pointer": "/cost"
                    },
                    "right": {
                      "op": "node",
                      "id": "sample",
                      "pointer": "/salvage"
                    }
                  },
                  "right": {
                    "op": "node",
                    "id": "sample",
                    "pointer": "/years"
                  }
                }
              }
            }
          }
        },
        {

Step 65

Keep this calculation pure, version its meaning and check every reused result independently. The counters show whether work was reused.

JSON
          "id": "duplicate",
          "after": [],
          "output": "object",
          "step": {
            "kind": "pure",
            "value": {
              "op": "object",
              "fields": {
                "sample": {
                  "op": "node",
                  "id": "sample",
                  "pointer": "/sample"
                },
                "annual_minor_units": {
                  "op": "divide",
                  "left": {
                    "op": "subtract",
                    "left": {
                      "op": "node",
                      "id": "sample",
                      "pointer": "/cost"
                    },
                    "right": {
                      "op": "node",

Step 66

Check the result against independent evidence and retain refusals. The assertion makes this example fail if native verification behaves differently.

JSON
                      "id": "sample",
                      "pointer": "/salvage"
                    }
                  },
                  "right": {
                    "op": "node",
                    "id": "sample",
                    "pointer": "/years"
                  }
                }
              }
            }
          }
        },
        {
          "id": "verified",
          "after": [
            "duplicate"
          ],
          "output": "object",
          "step": {
            "kind": "verify",
            "condition": {
              "op": "and",

Step 67

Build the next part of the local workflow. Values defined in earlier chunks remain in scope; concatenate the chunks in their displayed order.

JSON
              "items": [
                {
                  "op": "less_equal",
                  "left": {
                    "op": "literal",
                    "value": "0"
                  },
                  "right": {
                    "op": "node",
                    "id": "sample",
                    "pointer": "/cost"
                  }
                },
                {
                  "op": "less_equal",
                  "left": {
                    "op": "literal",
                    "value": "0"
                  },
                  "right": {
                    "op": "node",
                    "id": "sample",
                    "pointer": "/salvage"
                  }

Step 68

Build the next part of the local workflow. Values defined in earlier chunks remain in scope; concatenate the chunks in their displayed order.

JSON
                },
                {
                  "op": "less_equal",
                  "left": {
                    "op": "literal",
                    "value": "1"
                  },
                  "right": {
                    "op": "node",
                    "id": "sample",
                    "pointer": "/years"
                  }
                },
                {
                  "op": "less_equal",
                  "left": {
                    "op": "node",
                    "id": "sample",
                    "pointer": "/salvage"
                  },
                  "right": {
                    "op": "node",
                    "id": "sample",
                    "pointer": "/cost"

Step 69

Build the next part of the local workflow. Values defined in earlier chunks remain in scope; concatenate the chunks in their displayed order.

JSON
                  }
                },
                {
                  "op": "less_equal",
                  "left": {
                    "op": "multiply",
                    "left": {
                      "op": "node",
                      "id": "calculate",
                      "pointer": "/annual_minor_units"
                    },
                    "right": {
                      "op": "node",
                      "id": "sample",
                      "pointer": "/years"
                    }
                  },
                  "right": {
                    "op": "subtract",
                    "left": {
                      "op": "node",
                      "id": "sample",
                      "pointer": "/cost"
                    },

Step 70

Build the next part of the local workflow. Values defined in earlier chunks remain in scope; concatenate the chunks in their displayed order.

JSON
                    "right": {
                      "op": "node",
                      "id": "sample",
                      "pointer": "/salvage"
                    }
                  }
                },
                {
                  "op": "equal",
                  "left": {
                    "op": "less_equal",
                    "left": {
                      "op": "multiply",
                      "left": {
                        "op": "add",
                        "left": {
                          "op": "node",
                          "id": "calculate",
                          "pointer": "/annual_minor_units"
                        },
                        "right": {
                          "op": "literal",
                          "value": "1"
                        }

Step 71

Build the next part of the local workflow. Values defined in earlier chunks remain in scope; concatenate the chunks in their displayed order.

JSON
                      },
                      "right": {
                        "op": "node",
                        "id": "sample",
                        "pointer": "/years"
                      }
                    },
                    "right": {
                      "op": "subtract",
                      "left": {
                        "op": "node",
                        "id": "sample",
                        "pointer": "/cost"
                      },
                      "right": {
                        "op": "node",
                        "id": "sample",
                        "pointer": "/salvage"
                      }
                    }
                  },
                  "right": {
                    "op": "literal",
                    "value": false

Step 72

Keep the exact acknowledged checkpoint. Reopening with an older pin is an error; do not silently discover and adopt newer state.

JSON
                  }
                }
              ]
            },
            "value": {
              "op": "node",
              "id": "calculate",
              "pointer": ""
            }
          }
        },
        {
          "id": "checkpoint",
          "after": [
            "verified"
          ],
          "output": "object",
          "step": {
            "kind": "checkpoint"
          }
        },
        {
          "id": "review",
          "after": [

Step 73

Keep the exact acknowledged checkpoint. Reopening with an older pin is an error; do not silently discover and adopt newer state.

JSON
            "checkpoint"
          ],
          "output": "object",
          "step": {
            "kind": "approval",
            "operation": "workpaper"
          }
        },
        {
          "id": "workpaper",
          "after": [
            "review"
          ],
          "output": "object",
          "step": {
            "kind": "effect",
            "request": {
              "op": "set",
              "value": {
                "op": "input",
                "name": "write",
                "pointer": ""
              },
              "pointer": "/payload/data/arguments/value",

Step 74

Check the result against independent evidence and retain refusals. The assertion makes this example fail if native verification behaves differently.

JSON
              "replacement": {
                "op": "json_text",
                "value": {
                  "op": "node",
                  "id": "verified",
                  "pointer": ""
                }
              }
            }
          }
        },
        {
          "id": "finished",
          "after": [
            "workpaper"
          ],
          "output": "object",
          "step": {
            "kind": "verify",
            "condition": {
              "op": "equal",
              "left": {
                "op": "node",
                "id": "workpaper",

Step 75

Check the result against independent evidence and retain refusals. The assertion makes this example fail if native verification behaves differently.

JSON
                "pointer": "/status"
              },
              "right": {
                "op": "literal",
                "value": "effect_returned"
              }
            },
            "value": {
              "op": "node",
              "id": "verified",
              "pointer": ""
            }
          }
        }
      ]
    },
    "verifier": {
      "op": "and",
      "items": [
        {
          "op": "equal",
          "left": {
            "op": "input",
            "name": "context",

Step 76

Build the next part of the local workflow. Values defined in earlier chunks remain in scope; concatenate the chunks in their displayed order.

JSON
            "pointer": "/read_count"
          },
          "right": {
            "op": "literal",
            "value": "1"
          }
        },
        {
          "op": "equal",
          "left": {
            "op": "get",
            "value": {
              "op": "parse_json",
              "value": {
                "op": "input",
                "name": "context",
                "pointer": "/operations/0/response/content"
              }
            },
            "pointer": "/engagement"
          },
          "right": {
            "op": "literal",
            "value": "ENG-ALPHA"

Step 77

Build the next part of the local workflow. Values defined in earlier chunks remain in scope; concatenate the chunks in their displayed order.

JSON
          }
        },
        {
          "op": "equal",
          "left": {
            "op": "get",
            "value": {
              "op": "parse_json",
              "value": {
                "op": "input",
                "name": "context",
                "pointer": "/operations/0/response/content"
              }
            },
            "pointer": "/workflow"
          },
          "right": {
            "op": "literal",
            "value": "recalculation"
          }
        },
        {
          "op": "if",
          "condition": {

Step 78

Build the next part of the local workflow. Values defined in earlier chunks remain in scope; concatenate the chunks in their displayed order.

JSON
            "op": "equal",
            "left": {
              "op": "input",
              "name": "context",
              "pointer": "/phase"
            },
            "right": {
              "op": "literal",
              "value": "before_effect"
            }
          },
          "yes": {
            "op": "and",
            "items": [
              {
                "op": "equal",
                "left": {
                  "op": "input",
                  "name": "context",
                  "pointer": "/effect_count"
                },
                "right": {
                  "op": "literal",
                  "value": "0"

Step 79

Build the next part of the local workflow. Values defined in earlier chunks remain in scope; concatenate the chunks in their displayed order.

JSON
                }
              },
              {
                "op": "equal",
                "left": {
                  "op": "parse_json",
                  "value": {
                    "op": "input",
                    "name": "context",
                    "pointer": "/candidate/payload/data/arguments/value"
                  }
                },
                "right": {
                  "op": "object",
                  "fields": {
                    "sample": {
                      "op": "get",
                      "value": {
                        "op": "index",
                        "value": {
                          "op": "get",
                          "value": {
                            "op": "parse_json",
                            "value": {

Step 80

Build the next part of the local workflow. Values defined in earlier chunks remain in scope; concatenate the chunks in their displayed order.

JSON
                              "op": "input",
                              "name": "context",
                              "pointer": "/operations/0/response/content"
                            }
                          },
                          "pointer": "/samples"
                        },
                        "index": {
                          "op": "input",
                          "name": "context",
                          "pointer": "/inputs/index"
                        }
                      },
                      "pointer": "/sample"
                    },
                    "annual_minor_units": {
                      "op": "divide",
                      "left": {
                        "op": "subtract",
                        "left": {
                          "op": "get",
                          "value": {
                            "op": "index",
                            "value": {

Step 81

Build the next part of the local workflow. Values defined in earlier chunks remain in scope; concatenate the chunks in their displayed order.

JSON
                              "op": "get",
                              "value": {
                                "op": "parse_json",
                                "value": {
                                  "op": "input",
                                  "name": "context",
                                  "pointer": "/operations/0/response/content"
                                }
                              },
                              "pointer": "/samples"
                            },
                            "index": {
                              "op": "input",
                              "name": "context",
                              "pointer": "/inputs/index"
                            }
                          },
                          "pointer": "/cost"
                        },
                        "right": {
                          "op": "get",
                          "value": {
                            "op": "index",
                            "value": {

Step 82

Build the next part of the local workflow. Values defined in earlier chunks remain in scope; concatenate the chunks in their displayed order.

JSON
                              "op": "get",
                              "value": {
                                "op": "parse_json",
                                "value": {
                                  "op": "input",
                                  "name": "context",
                                  "pointer": "/operations/0/response/content"
                                }
                              },
                              "pointer": "/samples"
                            },
                            "index": {
                              "op": "input",
                              "name": "context",
                              "pointer": "/inputs/index"
                            }
                          },
                          "pointer": "/salvage"
                        }
                      },
                      "right": {
                        "op": "get",
                        "value": {
                          "op": "index",

Step 83

Build the next part of the local workflow. Values defined in earlier chunks remain in scope; concatenate the chunks in their displayed order.

JSON
                          "value": {
                            "op": "get",
                            "value": {
                              "op": "parse_json",
                              "value": {
                                "op": "input",
                                "name": "context",
                                "pointer": "/operations/0/response/content"
                              }
                            },
                            "pointer": "/samples"
                          },
                          "index": {
                            "op": "input",
                            "name": "context",
                            "pointer": "/inputs/index"
                          }
                        },
                        "pointer": "/years"
                      }
                    }
                  }
                }
              }

Step 84

Build the next part of the local workflow. Values defined in earlier chunks remain in scope; concatenate the chunks in their displayed order.

JSON
            ]
          },
          "no": {
            "op": "and",
            "items": [
              {
                "op": "equal",
                "left": {
                  "op": "input",
                  "name": "context",
                  "pointer": "/phase"
                },
                "right": {
                  "op": "literal",
                  "value": "complete"
                }
              },
              {
                "op": "equal",
                "left": {
                  "op": "input",
                  "name": "context",
                  "pointer": "/effect_count"
                },

Step 85

Build the next part of the local workflow. Values defined in earlier chunks remain in scope; concatenate the chunks in their displayed order.

JSON
                "right": {
                  "op": "literal",
                  "value": "1"
                }
              },
              {
                "op": "equal",
                "left": {
                  "op": "parse_json",
                  "value": {
                    "op": "input",
                    "name": "context",
                    "pointer": "/operations/1/request/payload/data/arguments/value"
                  }
                },
                "right": {
                  "op": "object",
                  "fields": {
                    "sample": {
                      "op": "get",
                      "value": {
                        "op": "index",
                        "value": {
                          "op": "get",

Step 86

Build the next part of the local workflow. Values defined in earlier chunks remain in scope; concatenate the chunks in their displayed order.

JSON
                          "value": {
                            "op": "parse_json",
                            "value": {
                              "op": "input",
                              "name": "context",
                              "pointer": "/operations/0/response/content"
                            }
                          },
                          "pointer": "/samples"
                        },
                        "index": {
                          "op": "input",
                          "name": "context",
                          "pointer": "/inputs/index"
                        }
                      },
                      "pointer": "/sample"
                    },
                    "annual_minor_units": {
                      "op": "divide",
                      "left": {
                        "op": "subtract",
                        "left": {
                          "op": "get",

Step 87

Build the next part of the local workflow. Values defined in earlier chunks remain in scope; concatenate the chunks in their displayed order.

JSON
                          "value": {
                            "op": "index",
                            "value": {
                              "op": "get",
                              "value": {
                                "op": "parse_json",
                                "value": {
                                  "op": "input",
                                  "name": "context",
                                  "pointer": "/operations/0/response/content"
                                }
                              },
                              "pointer": "/samples"
                            },
                            "index": {
                              "op": "input",
                              "name": "context",
                              "pointer": "/inputs/index"
                            }
                          },
                          "pointer": "/cost"
                        },
                        "right": {
                          "op": "get",

Step 88

Build the next part of the local workflow. Values defined in earlier chunks remain in scope; concatenate the chunks in their displayed order.

JSON
                          "value": {
                            "op": "index",
                            "value": {
                              "op": "get",
                              "value": {
                                "op": "parse_json",
                                "value": {
                                  "op": "input",
                                  "name": "context",
                                  "pointer": "/operations/0/response/content"
                                }
                              },
                              "pointer": "/samples"
                            },
                            "index": {
                              "op": "input",
                              "name": "context",
                              "pointer": "/inputs/index"
                            }
                          },
                          "pointer": "/salvage"
                        }
                      },
                      "right": {

Step 89

Build the next part of the local workflow. Values defined in earlier chunks remain in scope; concatenate the chunks in their displayed order.

JSON
                        "op": "get",
                        "value": {
                          "op": "index",
                          "value": {
                            "op": "get",
                            "value": {
                              "op": "parse_json",
                              "value": {
                                "op": "input",
                                "name": "context",
                                "pointer": "/operations/0/response/content"
                              }
                            },
                            "pointer": "/samples"
                          },
                          "index": {
                            "op": "input",
                            "name": "context",
                            "pointer": "/inputs/index"
                          }
                        },
                        "pointer": "/years"
                      }
                    }

Step 90

Build the next part of the local workflow. Values defined in earlier chunks remain in scope; concatenate the chunks in their displayed order.

JSON
                  }
                }
              },
              {
                "op": "equal",
                "left": {
                  "op": "input",
                  "name": "context",
                  "pointer": "/result"
                },
                "right": {
                  "op": "object",
                  "fields": {
                    "sample": {
                      "op": "get",
                      "value": {
                        "op": "index",
                        "value": {
                          "op": "get",
                          "value": {
                            "op": "parse_json",
                            "value": {
                              "op": "input",
                              "name": "context",

Step 91

Build the next part of the local workflow. Values defined in earlier chunks remain in scope; concatenate the chunks in their displayed order.

JSON
                              "pointer": "/operations/0/response/content"
                            }
                          },
                          "pointer": "/samples"
                        },
                        "index": {
                          "op": "input",
                          "name": "context",
                          "pointer": "/inputs/index"
                        }
                      },
                      "pointer": "/sample"
                    },
                    "annual_minor_units": {
                      "op": "divide",
                      "left": {
                        "op": "subtract",
                        "left": {
                          "op": "get",
                          "value": {
                            "op": "index",
                            "value": {
                              "op": "get",
                              "value": {

Step 92

Build the next part of the local workflow. Values defined in earlier chunks remain in scope; concatenate the chunks in their displayed order.

JSON
                                "op": "parse_json",
                                "value": {
                                  "op": "input",
                                  "name": "context",
                                  "pointer": "/operations/0/response/content"
                                }
                              },
                              "pointer": "/samples"
                            },
                            "index": {
                              "op": "input",
                              "name": "context",
                              "pointer": "/inputs/index"
                            }
                          },
                          "pointer": "/cost"
                        },
                        "right": {
                          "op": "get",
                          "value": {
                            "op": "index",
                            "value": {
                              "op": "get",
                              "value": {

Step 93

Build the next part of the local workflow. Values defined in earlier chunks remain in scope; concatenate the chunks in their displayed order.

JSON
                                "op": "parse_json",
                                "value": {
                                  "op": "input",
                                  "name": "context",
                                  "pointer": "/operations/0/response/content"
                                }
                              },
                              "pointer": "/samples"
                            },
                            "index": {
                              "op": "input",
                              "name": "context",
                              "pointer": "/inputs/index"
                            }
                          },
                          "pointer": "/salvage"
                        }
                      },
                      "right": {
                        "op": "get",
                        "value": {
                          "op": "index",
                          "value": {
                            "op": "get",

Step 94

Build the next part of the local workflow. Values defined in earlier chunks remain in scope; concatenate the chunks in their displayed order.

JSON
                            "value": {
                              "op": "parse_json",
                              "value": {
                                "op": "input",
                                "name": "context",
                                "pointer": "/operations/0/response/content"
                              }
                            },
                            "pointer": "/samples"
                          },
                          "index": {
                            "op": "input",
                            "name": "context",
                            "pointer": "/inputs/index"
                          }
                        },
                        "pointer": "/years"
                      }
                    }
                  }
                }
              }
            ]
          }

Step 95

Build the next part of the local workflow. Values defined in earlier chunks remain in scope; concatenate the chunks in their displayed order.

JSON
        }
      ]
    }
  },
  "controls": {
    "graph": {
      "version": 1,
      "id": "accounting-controls",
      "inputs": {
        "read": "object",
        "write": "object",
        "index": "integer"
      },
      "environment": {
        "policy": "1111111111111111111111111111111111111111111111111111111111111111",
        "tools": "2222222222222222222222222222222222222222222222222222222222222222",
        "credentials": "3333333333333333333333333333333333333333333333333333333333333333",
        "evidence": "4444444444444444444444444444444444444444444444444444444444444444",
        "host_configuration": null
      },
      "terminal": "finished",
      "nodes": [
        {
          "id": "evidence",

Step 96

Keep this calculation pure, version its meaning and check every reused result independently. The counters show whether work was reused.

JSON
          "after": [],
          "output": "object",
          "step": {
            "kind": "read",
            "request": {
              "op": "input",
              "name": "read",
              "pointer": ""
            }
          }
        },
        {
          "id": "source",
          "after": [],
          "output": "object",
          "step": {
            "kind": "pure",
            "value": {
              "op": "parse_json",
              "value": {
                "op": "node",
                "id": "evidence",
                "pointer": "/response/content"
              }

Step 97

Build the next part of the local workflow. Values defined in earlier chunks remain in scope; concatenate the chunks in their displayed order.

JSON
            }
          }
        },
        {
          "id": "scope",
          "after": [],
          "output": "boolean",
          "step": {
            "kind": "policy",
            "condition": {
              "op": "equal",
              "left": {
                "op": "node",
                "id": "source",
                "pointer": "/engagement"
              },
              "right": {
                "op": "literal",
                "value": "ENG-ALPHA"
              }
            }
          }
        },
        {

Step 98

Keep this calculation pure, version its meaning and check every reused result independently. The counters show whether work was reused.

JSON
          "id": "sample",
          "after": [
            "scope"
          ],
          "output": "object",
          "step": {
            "kind": "pure",
            "value": {
              "op": "index",
              "value": {
                "op": "node",
                "id": "source",
                "pointer": "/samples"
              },
              "index": {
                "op": "input",
                "name": "index",
                "pointer": ""
              }
            }
          }
        },
        {
          "id": "calculate",

Step 99

Keep this calculation pure, version its meaning and check every reused result independently. The counters show whether work was reused.

JSON
          "after": [],
          "output": "object",
          "step": {
            "kind": "pure",
            "value": {
              "op": "object",
              "fields": {
                "sample": {
                  "op": "node",
                  "id": "sample",
                  "pointer": "/sample"
                },
                "effective": {
                  "op": "if",
                  "condition": {
                    "op": "less_equal",
                    "left": {
                      "op": "node",
                      "id": "sample",
                      "pointer": "/units"
                    },
                    "right": {
                      "op": "node",
                      "id": "sample",

Step 100

Review the original request and the native selection separately from the agent. The confirmation binds the signed approval to that selection.

JSON
                      "pointer": "/approval_limit"
                    }
                  },
                  "yes": {
                    "op": "literal",
                    "value": true
                  },
                  "no": {
                    "op": "node",
                    "id": "sample",
                    "pointer": "/approved"
                  }
                },
                "evidence_id": {
                  "op": "node",
                  "id": "sample",
                  "pointer": "/evidence_id"
                }
              }
            }
          }
        },
        {
          "id": "duplicate",

Step 101

Keep this calculation pure, version its meaning and check every reused result independently. The counters show whether work was reused.

JSON
          "after": [],
          "output": "object",
          "step": {
            "kind": "pure",
            "value": {
              "op": "object",
              "fields": {
                "sample": {
                  "op": "node",
                  "id": "sample",
                  "pointer": "/sample"
                },
                "effective": {
                  "op": "if",
                  "condition": {
                    "op": "less_equal",
                    "left": {
                      "op": "node",
                      "id": "sample",
                      "pointer": "/units"
                    },
                    "right": {
                      "op": "node",
                      "id": "sample",

Step 102

Review the original request and the native selection separately from the agent. The confirmation binds the signed approval to that selection.

JSON
                      "pointer": "/approval_limit"
                    }
                  },
                  "yes": {
                    "op": "literal",
                    "value": true
                  },
                  "no": {
                    "op": "node",
                    "id": "sample",
                    "pointer": "/approved"
                  }
                },
                "evidence_id": {
                  "op": "node",
                  "id": "sample",
                  "pointer": "/evidence_id"
                }
              }
            }
          }
        },
        {
          "id": "verified",

Step 103

Check the result against independent evidence and retain refusals. The assertion makes this example fail if native verification behaves differently.

JSON
          "after": [
            "duplicate"
          ],
          "output": "object",
          "step": {
            "kind": "verify",
            "condition": {
              "op": "equal",
              "left": {
                "op": "node",
                "id": "calculate",
                "pointer": "/effective"
              },
              "right": {
                "op": "if",
                "condition": {
                  "op": "less_equal",
                  "left": {
                    "op": "node",
                    "id": "sample",
                    "pointer": "/units"
                  },
                  "right": {
                    "op": "node",

Step 104

Keep the exact acknowledged checkpoint. Reopening with an older pin is an error; do not silently discover and adopt newer state.

JSON
                    "id": "sample",
                    "pointer": "/approval_limit"
                  }
                },
                "yes": {
                  "op": "literal",
                  "value": true
                },
                "no": {
                  "op": "node",
                  "id": "sample",
                  "pointer": "/approved"
                }
              }
            },
            "value": {
              "op": "node",
              "id": "calculate",
              "pointer": ""
            }
          }
        },
        {
          "id": "checkpoint",

Step 105

Keep the exact acknowledged checkpoint. Reopening with an older pin is an error; do not silently discover and adopt newer state.

JSON
          "after": [
            "verified"
          ],
          "output": "object",
          "step": {
            "kind": "checkpoint"
          }
        },
        {
          "id": "review",
          "after": [
            "checkpoint"
          ],
          "output": "object",
          "step": {
            "kind": "approval",
            "operation": "workpaper"
          }
        },
        {
          "id": "workpaper",
          "after": [
            "review"
          ],

Step 106

Check the result against independent evidence and retain refusals. The assertion makes this example fail if native verification behaves differently.

JSON
          "output": "object",
          "step": {
            "kind": "effect",
            "request": {
              "op": "set",
              "value": {
                "op": "input",
                "name": "write",
                "pointer": ""
              },
              "pointer": "/payload/data/arguments/value",
              "replacement": {
                "op": "json_text",
                "value": {
                  "op": "node",
                  "id": "verified",
                  "pointer": ""
                }
              }
            }
          }
        },
        {
          "id": "finished",

Step 107

Check the result against independent evidence and retain refusals. The assertion makes this example fail if native verification behaves differently.

JSON
          "after": [
            "workpaper"
          ],
          "output": "object",
          "step": {
            "kind": "verify",
            "condition": {
              "op": "equal",
              "left": {
                "op": "node",
                "id": "workpaper",
                "pointer": "/status"
              },
              "right": {
                "op": "literal",
                "value": "effect_returned"
              }
            },
            "value": {
              "op": "node",
              "id": "verified",
              "pointer": ""
            }
          }

Step 108

Check the result against independent evidence and retain refusals. The assertion makes this example fail if native verification behaves differently.

JSON
        }
      ]
    },
    "verifier": {
      "op": "and",
      "items": [
        {
          "op": "equal",
          "left": {
            "op": "input",
            "name": "context",
            "pointer": "/read_count"
          },
          "right": {
            "op": "literal",
            "value": "1"
          }
        },
        {
          "op": "equal",
          "left": {
            "op": "get",
            "value": {
              "op": "parse_json",

Step 109

Build the next part of the local workflow. Values defined in earlier chunks remain in scope; concatenate the chunks in their displayed order.

JSON
              "value": {
                "op": "input",
                "name": "context",
                "pointer": "/operations/0/response/content"
              }
            },
            "pointer": "/engagement"
          },
          "right": {
            "op": "literal",
            "value": "ENG-ALPHA"
          }
        },
        {
          "op": "equal",
          "left": {
            "op": "get",
            "value": {
              "op": "parse_json",
              "value": {
                "op": "input",
                "name": "context",
                "pointer": "/operations/0/response/content"
              }

Step 110

Build the next part of the local workflow. Values defined in earlier chunks remain in scope; concatenate the chunks in their displayed order.

JSON
            },
            "pointer": "/workflow"
          },
          "right": {
            "op": "literal",
            "value": "controls"
          }
        },
        {
          "op": "if",
          "condition": {
            "op": "equal",
            "left": {
              "op": "input",
              "name": "context",
              "pointer": "/phase"
            },
            "right": {
              "op": "literal",
              "value": "before_effect"
            }
          },
          "yes": {
            "op": "and",

Step 111

Build the next part of the local workflow. Values defined in earlier chunks remain in scope; concatenate the chunks in their displayed order.

JSON
            "items": [
              {
                "op": "equal",
                "left": {
                  "op": "input",
                  "name": "context",
                  "pointer": "/effect_count"
                },
                "right": {
                  "op": "literal",
                  "value": "0"
                }
              },
              {
                "op": "equal",
                "left": {
                  "op": "parse_json",
                  "value": {
                    "op": "input",
                    "name": "context",
                    "pointer": "/candidate/payload/data/arguments/value"
                  }
                },
                "right": {

Step 112

Build the next part of the local workflow. Values defined in earlier chunks remain in scope; concatenate the chunks in their displayed order.

JSON
                  "op": "object",
                  "fields": {
                    "sample": {
                      "op": "get",
                      "value": {
                        "op": "index",
                        "value": {
                          "op": "get",
                          "value": {
                            "op": "parse_json",
                            "value": {
                              "op": "input",
                              "name": "context",
                              "pointer": "/operations/0/response/content"
                            }
                          },
                          "pointer": "/samples"
                        },
                        "index": {
                          "op": "input",
                          "name": "context",
                          "pointer": "/inputs/index"
                        }
                      },

Step 113

Build the next part of the local workflow. Values defined in earlier chunks remain in scope; concatenate the chunks in their displayed order.

JSON
                      "pointer": "/sample"
                    },
                    "effective": {
                      "op": "if",
                      "condition": {
                        "op": "less_equal",
                        "left": {
                          "op": "get",
                          "value": {
                            "op": "index",
                            "value": {
                              "op": "get",
                              "value": {
                                "op": "parse_json",
                                "value": {
                                  "op": "input",
                                  "name": "context",
                                  "pointer": "/operations/0/response/content"
                                }
                              },
                              "pointer": "/samples"
                            },
                            "index": {
                              "op": "input",

Step 114

Build the next part of the local workflow. Values defined in earlier chunks remain in scope; concatenate the chunks in their displayed order.

JSON
                              "name": "context",
                              "pointer": "/inputs/index"
                            }
                          },
                          "pointer": "/units"
                        },
                        "right": {
                          "op": "get",
                          "value": {
                            "op": "index",
                            "value": {
                              "op": "get",
                              "value": {
                                "op": "parse_json",
                                "value": {
                                  "op": "input",
                                  "name": "context",
                                  "pointer": "/operations/0/response/content"
                                }
                              },
                              "pointer": "/samples"
                            },
                            "index": {
                              "op": "input",

Step 115

Build the next part of the local workflow. Values defined in earlier chunks remain in scope; concatenate the chunks in their displayed order.

JSON
                              "name": "context",
                              "pointer": "/inputs/index"
                            }
                          },
                          "pointer": "/approval_limit"
                        }
                      },
                      "yes": {
                        "op": "literal",
                        "value": true
                      },
                      "no": {
                        "op": "get",
                        "value": {
                          "op": "index",
                          "value": {
                            "op": "get",
                            "value": {
                              "op": "parse_json",
                              "value": {
                                "op": "input",
                                "name": "context",
                                "pointer": "/operations/0/response/content"
                              }

Step 116

Review the original request and the native selection separately from the agent. The confirmation binds the signed approval to that selection.

JSON
                            },
                            "pointer": "/samples"
                          },
                          "index": {
                            "op": "input",
                            "name": "context",
                            "pointer": "/inputs/index"
                          }
                        },
                        "pointer": "/approved"
                      }
                    },
                    "evidence_id": {
                      "op": "get",
                      "value": {
                        "op": "index",
                        "value": {
                          "op": "get",
                          "value": {
                            "op": "parse_json",
                            "value": {
                              "op": "input",
                              "name": "context",
                              "pointer": "/operations/0/response/content"

Step 117

Build the next part of the local workflow. Values defined in earlier chunks remain in scope; concatenate the chunks in their displayed order.

JSON
                            }
                          },
                          "pointer": "/samples"
                        },
                        "index": {
                          "op": "input",
                          "name": "context",
                          "pointer": "/inputs/index"
                        }
                      },
                      "pointer": "/evidence_id"
                    }
                  }
                }
              }
            ]
          },
          "no": {
            "op": "and",
            "items": [
              {
                "op": "equal",
                "left": {
                  "op": "input",

Step 118

Build the next part of the local workflow. Values defined in earlier chunks remain in scope; concatenate the chunks in their displayed order.

JSON
                  "name": "context",
                  "pointer": "/phase"
                },
                "right": {
                  "op": "literal",
                  "value": "complete"
                }
              },
              {
                "op": "equal",
                "left": {
                  "op": "input",
                  "name": "context",
                  "pointer": "/effect_count"
                },
                "right": {
                  "op": "literal",
                  "value": "1"
                }
              },
              {
                "op": "equal",
                "left": {
                  "op": "parse_json",

Step 119

Build the next part of the local workflow. Values defined in earlier chunks remain in scope; concatenate the chunks in their displayed order.

JSON
                  "value": {
                    "op": "input",
                    "name": "context",
                    "pointer": "/operations/1/request/payload/data/arguments/value"
                  }
                },
                "right": {
                  "op": "object",
                  "fields": {
                    "sample": {
                      "op": "get",
                      "value": {
                        "op": "index",
                        "value": {
                          "op": "get",
                          "value": {
                            "op": "parse_json",
                            "value": {
                              "op": "input",
                              "name": "context",
                              "pointer": "/operations/0/response/content"
                            }
                          },
                          "pointer": "/samples"

Step 120

Build the next part of the local workflow. Values defined in earlier chunks remain in scope; concatenate the chunks in their displayed order.

JSON
                        },
                        "index": {
                          "op": "input",
                          "name": "context",
                          "pointer": "/inputs/index"
                        }
                      },
                      "pointer": "/sample"
                    },
                    "effective": {
                      "op": "if",
                      "condition": {
                        "op": "less_equal",
                        "left": {
                          "op": "get",
                          "value": {
                            "op": "index",
                            "value": {
                              "op": "get",
                              "value": {
                                "op": "parse_json",
                                "value": {
                                  "op": "input",
                                  "name": "context",

Step 121

Build the next part of the local workflow. Values defined in earlier chunks remain in scope; concatenate the chunks in their displayed order.

JSON
                                  "pointer": "/operations/0/response/content"
                                }
                              },
                              "pointer": "/samples"
                            },
                            "index": {
                              "op": "input",
                              "name": "context",
                              "pointer": "/inputs/index"
                            }
                          },
                          "pointer": "/units"
                        },
                        "right": {
                          "op": "get",
                          "value": {
                            "op": "index",
                            "value": {
                              "op": "get",
                              "value": {
                                "op": "parse_json",
                                "value": {
                                  "op": "input",
                                  "name": "context",

Step 122

Build the next part of the local workflow. Values defined in earlier chunks remain in scope; concatenate the chunks in their displayed order.

JSON
                                  "pointer": "/operations/0/response/content"
                                }
                              },
                              "pointer": "/samples"
                            },
                            "index": {
                              "op": "input",
                              "name": "context",
                              "pointer": "/inputs/index"
                            }
                          },
                          "pointer": "/approval_limit"
                        }
                      },
                      "yes": {
                        "op": "literal",
                        "value": true
                      },
                      "no": {
                        "op": "get",
                        "value": {
                          "op": "index",
                          "value": {
                            "op": "get",

Step 123

Review the original request and the native selection separately from the agent. The confirmation binds the signed approval to that selection.

JSON
                            "value": {
                              "op": "parse_json",
                              "value": {
                                "op": "input",
                                "name": "context",
                                "pointer": "/operations/0/response/content"
                              }
                            },
                            "pointer": "/samples"
                          },
                          "index": {
                            "op": "input",
                            "name": "context",
                            "pointer": "/inputs/index"
                          }
                        },
                        "pointer": "/approved"
                      }
                    },
                    "evidence_id": {
                      "op": "get",
                      "value": {
                        "op": "index",
                        "value": {

Step 124

Build the next part of the local workflow. Values defined in earlier chunks remain in scope; concatenate the chunks in their displayed order.

JSON
                          "op": "get",
                          "value": {
                            "op": "parse_json",
                            "value": {
                              "op": "input",
                              "name": "context",
                              "pointer": "/operations/0/response/content"
                            }
                          },
                          "pointer": "/samples"
                        },
                        "index": {
                          "op": "input",
                          "name": "context",
                          "pointer": "/inputs/index"
                        }
                      },
                      "pointer": "/evidence_id"
                    }
                  }
                }
              },
              {
                "op": "equal",

Step 125

Build the next part of the local workflow. Values defined in earlier chunks remain in scope; concatenate the chunks in their displayed order.

JSON
                "left": {
                  "op": "input",
                  "name": "context",
                  "pointer": "/result"
                },
                "right": {
                  "op": "object",
                  "fields": {
                    "sample": {
                      "op": "get",
                      "value": {
                        "op": "index",
                        "value": {
                          "op": "get",
                          "value": {
                            "op": "parse_json",
                            "value": {
                              "op": "input",
                              "name": "context",
                              "pointer": "/operations/0/response/content"
                            }
                          },
                          "pointer": "/samples"
                        },

Step 126

Build the next part of the local workflow. Values defined in earlier chunks remain in scope; concatenate the chunks in their displayed order.

JSON
                        "index": {
                          "op": "input",
                          "name": "context",
                          "pointer": "/inputs/index"
                        }
                      },
                      "pointer": "/sample"
                    },
                    "effective": {
                      "op": "if",
                      "condition": {
                        "op": "less_equal",
                        "left": {
                          "op": "get",
                          "value": {
                            "op": "index",
                            "value": {
                              "op": "get",
                              "value": {
                                "op": "parse_json",
                                "value": {
                                  "op": "input",
                                  "name": "context",
                                  "pointer": "/operations/0/response/content"

Step 127

Build the next part of the local workflow. Values defined in earlier chunks remain in scope; concatenate the chunks in their displayed order.

JSON
                                }
                              },
                              "pointer": "/samples"
                            },
                            "index": {
                              "op": "input",
                              "name": "context",
                              "pointer": "/inputs/index"
                            }
                          },
                          "pointer": "/units"
                        },
                        "right": {
                          "op": "get",
                          "value": {
                            "op": "index",
                            "value": {
                              "op": "get",
                              "value": {
                                "op": "parse_json",
                                "value": {
                                  "op": "input",
                                  "name": "context",
                                  "pointer": "/operations/0/response/content"

Step 128

Build the next part of the local workflow. Values defined in earlier chunks remain in scope; concatenate the chunks in their displayed order.

JSON
                                }
                              },
                              "pointer": "/samples"
                            },
                            "index": {
                              "op": "input",
                              "name": "context",
                              "pointer": "/inputs/index"
                            }
                          },
                          "pointer": "/approval_limit"
                        }
                      },
                      "yes": {
                        "op": "literal",
                        "value": true
                      },
                      "no": {
                        "op": "get",
                        "value": {
                          "op": "index",
                          "value": {
                            "op": "get",
                            "value": {

Step 129

Review the original request and the native selection separately from the agent. The confirmation binds the signed approval to that selection.

JSON
                              "op": "parse_json",
                              "value": {
                                "op": "input",
                                "name": "context",
                                "pointer": "/operations/0/response/content"
                              }
                            },
                            "pointer": "/samples"
                          },
                          "index": {
                            "op": "input",
                            "name": "context",
                            "pointer": "/inputs/index"
                          }
                        },
                        "pointer": "/approved"
                      }
                    },
                    "evidence_id": {
                      "op": "get",
                      "value": {
                        "op": "index",
                        "value": {
                          "op": "get",

Step 130

Build the next part of the local workflow. Values defined in earlier chunks remain in scope; concatenate the chunks in their displayed order.

JSON
                          "value": {
                            "op": "parse_json",
                            "value": {
                              "op": "input",
                              "name": "context",
                              "pointer": "/operations/0/response/content"
                            }
                          },
                          "pointer": "/samples"
                        },
                        "index": {
                          "op": "input",
                          "name": "context",
                          "pointer": "/inputs/index"
                        }
                      },
                      "pointer": "/evidence_id"
                    }
                  }
                }
              }
            ]
          }
        }

Step 131

Build the next part of the local workflow. Values defined in earlier chunks remain in scope; concatenate the chunks in their displayed order.

JSON
      ]
    }
  },
  "aml": {
    "graph": {
      "version": 1,
      "id": "accounting-aml",
      "inputs": {
        "read": "object",
        "write": "object",
        "index": "integer"
      },
      "environment": {
        "policy": "1111111111111111111111111111111111111111111111111111111111111111",
        "tools": "2222222222222222222222222222222222222222222222222222222222222222",
        "credentials": "3333333333333333333333333333333333333333333333333333333333333333",
        "evidence": "4444444444444444444444444444444444444444444444444444444444444444",
        "host_configuration": null
      },
      "terminal": "finished",
      "nodes": [
        {
          "id": "evidence",
          "after": [],

Step 132

Keep this calculation pure, version its meaning and check every reused result independently. The counters show whether work was reused.

JSON
          "output": "object",
          "step": {
            "kind": "read",
            "request": {
              "op": "input",
              "name": "read",
              "pointer": ""
            }
          }
        },
        {
          "id": "source",
          "after": [],
          "output": "object",
          "step": {
            "kind": "pure",
            "value": {
              "op": "parse_json",
              "value": {
                "op": "node",
                "id": "evidence",
                "pointer": "/response/content"
              }
            }

Step 133

Build the next part of the local workflow. Values defined in earlier chunks remain in scope; concatenate the chunks in their displayed order.

JSON
          }
        },
        {
          "id": "scope",
          "after": [],
          "output": "boolean",
          "step": {
            "kind": "policy",
            "condition": {
              "op": "equal",
              "left": {
                "op": "node",
                "id": "source",
                "pointer": "/engagement"
              },
              "right": {
                "op": "literal",
                "value": "ENG-ALPHA"
              }
            }
          }
        },
        {
          "id": "sample",

Step 134

Keep this calculation pure, version its meaning and check every reused result independently. The counters show whether work was reused.

JSON
          "after": [
            "scope"
          ],
          "output": "object",
          "step": {
            "kind": "pure",
            "value": {
              "op": "index",
              "value": {
                "op": "node",
                "id": "source",
                "pointer": "/samples"
              },
              "index": {
                "op": "input",
                "name": "index",
                "pointer": ""
              }
            }
          }
        },
        {
          "id": "calculate",
          "after": [],

Step 135

Keep this calculation pure, version its meaning and check every reused result independently. The counters show whether work was reused.

JSON
          "output": "object",
          "step": {
            "kind": "pure",
            "value": {
              "op": "object",
              "fields": {
                "sample": {
                  "op": "node",
                  "id": "sample",
                  "pointer": "/sample"
                },
                "review_required": {
                  "op": "equal",
                  "left": {
                    "op": "less_equal",
                    "left": {
                      "op": "node",
                      "id": "sample",
                      "pointer": "/total_cents"
                    },
                    "right": {
                      "op": "node",
                      "id": "sample",
                      "pointer": "/threshold_cents"

Step 136

Keep this calculation pure, version its meaning and check every reused result independently. The counters show whether work was reused.

JSON
                    }
                  },
                  "right": {
                    "op": "literal",
                    "value": false
                  }
                },
                "evidence_id": {
                  "op": "node",
                  "id": "sample",
                  "pointer": "/evidence_id"
                }
              }
            }
          }
        },
        {
          "id": "duplicate",
          "after": [],
          "output": "object",
          "step": {
            "kind": "pure",
            "value": {
              "op": "object",

Step 137

Build the next part of the local workflow. Values defined in earlier chunks remain in scope; concatenate the chunks in their displayed order.

JSON
              "fields": {
                "sample": {
                  "op": "node",
                  "id": "sample",
                  "pointer": "/sample"
                },
                "review_required": {
                  "op": "equal",
                  "left": {
                    "op": "less_equal",
                    "left": {
                      "op": "node",
                      "id": "sample",
                      "pointer": "/total_cents"
                    },
                    "right": {
                      "op": "node",
                      "id": "sample",
                      "pointer": "/threshold_cents"
                    }
                  },
                  "right": {
                    "op": "literal",
                    "value": false

Step 138

Check the result against independent evidence and retain refusals. The assertion makes this example fail if native verification behaves differently.

JSON
                  }
                },
                "evidence_id": {
                  "op": "node",
                  "id": "sample",
                  "pointer": "/evidence_id"
                }
              }
            }
          }
        },
        {
          "id": "verified",
          "after": [
            "duplicate"
          ],
          "output": "object",
          "step": {
            "kind": "verify",
            "condition": {
              "op": "equal",
              "left": {
                "op": "node",
                "id": "calculate",

Step 139

Build the next part of the local workflow. Values defined in earlier chunks remain in scope; concatenate the chunks in their displayed order.

JSON
                "pointer": "/review_required"
              },
              "right": {
                "op": "equal",
                "left": {
                  "op": "less_equal",
                  "left": {
                    "op": "node",
                    "id": "sample",
                    "pointer": "/total_cents"
                  },
                  "right": {
                    "op": "node",
                    "id": "sample",
                    "pointer": "/threshold_cents"
                  }
                },
                "right": {
                  "op": "literal",
                  "value": false
                }
              }
            },
            "value": {

Step 140

Keep the exact acknowledged checkpoint. Reopening with an older pin is an error; do not silently discover and adopt newer state.

JSON
              "op": "node",
              "id": "calculate",
              "pointer": ""
            }
          }
        },
        {
          "id": "checkpoint",
          "after": [
            "verified"
          ],
          "output": "object",
          "step": {
            "kind": "checkpoint"
          }
        },
        {
          "id": "review",
          "after": [
            "checkpoint"
          ],
          "output": "object",
          "step": {
            "kind": "approval",

Step 141

Check the result against independent evidence and retain refusals. The assertion makes this example fail if native verification behaves differently.

JSON
            "operation": "workpaper"
          }
        },
        {
          "id": "workpaper",
          "after": [
            "review"
          ],
          "output": "object",
          "step": {
            "kind": "effect",
            "request": {
              "op": "set",
              "value": {
                "op": "input",
                "name": "write",
                "pointer": ""
              },
              "pointer": "/payload/data/arguments/value",
              "replacement": {
                "op": "json_text",
                "value": {
                  "op": "node",
                  "id": "verified",

Step 142

Check the result against independent evidence and retain refusals. The assertion makes this example fail if native verification behaves differently.

JSON
                  "pointer": ""
                }
              }
            }
          }
        },
        {
          "id": "finished",
          "after": [
            "workpaper"
          ],
          "output": "object",
          "step": {
            "kind": "verify",
            "condition": {
              "op": "equal",
              "left": {
                "op": "node",
                "id": "workpaper",
                "pointer": "/status"
              },
              "right": {
                "op": "literal",
                "value": "effect_returned"

Step 143

Check the result against independent evidence and retain refusals. The assertion makes this example fail if native verification behaves differently.

JSON
              }
            },
            "value": {
              "op": "node",
              "id": "verified",
              "pointer": ""
            }
          }
        }
      ]
    },
    "verifier": {
      "op": "and",
      "items": [
        {
          "op": "equal",
          "left": {
            "op": "input",
            "name": "context",
            "pointer": "/read_count"
          },
          "right": {
            "op": "literal",
            "value": "1"

Step 144

Build the next part of the local workflow. Values defined in earlier chunks remain in scope; concatenate the chunks in their displayed order.

JSON
          }
        },
        {
          "op": "equal",
          "left": {
            "op": "get",
            "value": {
              "op": "parse_json",
              "value": {
                "op": "input",
                "name": "context",
                "pointer": "/operations/0/response/content"
              }
            },
            "pointer": "/engagement"
          },
          "right": {
            "op": "literal",
            "value": "ENG-ALPHA"
          }
        },
        {
          "op": "equal",
          "left": {

Step 145

Build the next part of the local workflow. Values defined in earlier chunks remain in scope; concatenate the chunks in their displayed order.

JSON
            "op": "get",
            "value": {
              "op": "parse_json",
              "value": {
                "op": "input",
                "name": "context",
                "pointer": "/operations/0/response/content"
              }
            },
            "pointer": "/workflow"
          },
          "right": {
            "op": "literal",
            "value": "aml"
          }
        },
        {
          "op": "if",
          "condition": {
            "op": "equal",
            "left": {
              "op": "input",
              "name": "context",
              "pointer": "/phase"

Step 146

Build the next part of the local workflow. Values defined in earlier chunks remain in scope; concatenate the chunks in their displayed order.

JSON
            },
            "right": {
              "op": "literal",
              "value": "before_effect"
            }
          },
          "yes": {
            "op": "and",
            "items": [
              {
                "op": "equal",
                "left": {
                  "op": "input",
                  "name": "context",
                  "pointer": "/effect_count"
                },
                "right": {
                  "op": "literal",
                  "value": "0"
                }
              },
              {
                "op": "equal",
                "left": {

Step 147

Build the next part of the local workflow. Values defined in earlier chunks remain in scope; concatenate the chunks in their displayed order.

JSON
                  "op": "parse_json",
                  "value": {
                    "op": "input",
                    "name": "context",
                    "pointer": "/candidate/payload/data/arguments/value"
                  }
                },
                "right": {
                  "op": "object",
                  "fields": {
                    "sample": {
                      "op": "get",
                      "value": {
                        "op": "index",
                        "value": {
                          "op": "get",
                          "value": {
                            "op": "parse_json",
                            "value": {
                              "op": "input",
                              "name": "context",
                              "pointer": "/operations/0/response/content"
                            }
                          },

Step 148

Build the next part of the local workflow. Values defined in earlier chunks remain in scope; concatenate the chunks in their displayed order.

JSON
                          "pointer": "/samples"
                        },
                        "index": {
                          "op": "input",
                          "name": "context",
                          "pointer": "/inputs/index"
                        }
                      },
                      "pointer": "/sample"
                    },
                    "review_required": {
                      "op": "equal",
                      "left": {
                        "op": "less_equal",
                        "left": {
                          "op": "get",
                          "value": {
                            "op": "index",
                            "value": {
                              "op": "get",
                              "value": {
                                "op": "parse_json",
                                "value": {
                                  "op": "input",

Step 149

Build the next part of the local workflow. Values defined in earlier chunks remain in scope; concatenate the chunks in their displayed order.

JSON
                                  "name": "context",
                                  "pointer": "/operations/0/response/content"
                                }
                              },
                              "pointer": "/samples"
                            },
                            "index": {
                              "op": "input",
                              "name": "context",
                              "pointer": "/inputs/index"
                            }
                          },
                          "pointer": "/total_cents"
                        },
                        "right": {
                          "op": "get",
                          "value": {
                            "op": "index",
                            "value": {
                              "op": "get",
                              "value": {
                                "op": "parse_json",
                                "value": {
                                  "op": "input",

Step 150

Build the next part of the local workflow. Values defined in earlier chunks remain in scope; concatenate the chunks in their displayed order.

JSON
                                  "name": "context",
                                  "pointer": "/operations/0/response/content"
                                }
                              },
                              "pointer": "/samples"
                            },
                            "index": {
                              "op": "input",
                              "name": "context",
                              "pointer": "/inputs/index"
                            }
                          },
                          "pointer": "/threshold_cents"
                        }
                      },
                      "right": {
                        "op": "literal",
                        "value": false
                      }
                    },
                    "evidence_id": {
                      "op": "get",
                      "value": {
                        "op": "index",

Step 151

Build the next part of the local workflow. Values defined in earlier chunks remain in scope; concatenate the chunks in their displayed order.

JSON
                        "value": {
                          "op": "get",
                          "value": {
                            "op": "parse_json",
                            "value": {
                              "op": "input",
                              "name": "context",
                              "pointer": "/operations/0/response/content"
                            }
                          },
                          "pointer": "/samples"
                        },
                        "index": {
                          "op": "input",
                          "name": "context",
                          "pointer": "/inputs/index"
                        }
                      },
                      "pointer": "/evidence_id"
                    }
                  }
                }
              }
            ]

Step 152

Build the next part of the local workflow. Values defined in earlier chunks remain in scope; concatenate the chunks in their displayed order.

JSON
          },
          "no": {
            "op": "and",
            "items": [
              {
                "op": "equal",
                "left": {
                  "op": "input",
                  "name": "context",
                  "pointer": "/phase"
                },
                "right": {
                  "op": "literal",
                  "value": "complete"
                }
              },
              {
                "op": "equal",
                "left": {
                  "op": "input",
                  "name": "context",
                  "pointer": "/effect_count"
                },
                "right": {

Step 153

Build the next part of the local workflow. Values defined in earlier chunks remain in scope; concatenate the chunks in their displayed order.

JSON
                  "op": "literal",
                  "value": "1"
                }
              },
              {
                "op": "equal",
                "left": {
                  "op": "parse_json",
                  "value": {
                    "op": "input",
                    "name": "context",
                    "pointer": "/operations/1/request/payload/data/arguments/value"
                  }
                },
                "right": {
                  "op": "object",
                  "fields": {
                    "sample": {
                      "op": "get",
                      "value": {
                        "op": "index",
                        "value": {
                          "op": "get",
                          "value": {

Step 154

Build the next part of the local workflow. Values defined in earlier chunks remain in scope; concatenate the chunks in their displayed order.

JSON
                            "op": "parse_json",
                            "value": {
                              "op": "input",
                              "name": "context",
                              "pointer": "/operations/0/response/content"
                            }
                          },
                          "pointer": "/samples"
                        },
                        "index": {
                          "op": "input",
                          "name": "context",
                          "pointer": "/inputs/index"
                        }
                      },
                      "pointer": "/sample"
                    },
                    "review_required": {
                      "op": "equal",
                      "left": {
                        "op": "less_equal",
                        "left": {
                          "op": "get",
                          "value": {

Step 155

Build the next part of the local workflow. Values defined in earlier chunks remain in scope; concatenate the chunks in their displayed order.

JSON
                            "op": "index",
                            "value": {
                              "op": "get",
                              "value": {
                                "op": "parse_json",
                                "value": {
                                  "op": "input",
                                  "name": "context",
                                  "pointer": "/operations/0/response/content"
                                }
                              },
                              "pointer": "/samples"
                            },
                            "index": {
                              "op": "input",
                              "name": "context",
                              "pointer": "/inputs/index"
                            }
                          },
                          "pointer": "/total_cents"
                        },
                        "right": {
                          "op": "get",
                          "value": {

Step 156

Build the next part of the local workflow. Values defined in earlier chunks remain in scope; concatenate the chunks in their displayed order.

JSON
                            "op": "index",
                            "value": {
                              "op": "get",
                              "value": {
                                "op": "parse_json",
                                "value": {
                                  "op": "input",
                                  "name": "context",
                                  "pointer": "/operations/0/response/content"
                                }
                              },
                              "pointer": "/samples"
                            },
                            "index": {
                              "op": "input",
                              "name": "context",
                              "pointer": "/inputs/index"
                            }
                          },
                          "pointer": "/threshold_cents"
                        }
                      },
                      "right": {
                        "op": "literal",

Step 157

Build the next part of the local workflow. Values defined in earlier chunks remain in scope; concatenate the chunks in their displayed order.

JSON
                        "value": false
                      }
                    },
                    "evidence_id": {
                      "op": "get",
                      "value": {
                        "op": "index",
                        "value": {
                          "op": "get",
                          "value": {
                            "op": "parse_json",
                            "value": {
                              "op": "input",
                              "name": "context",
                              "pointer": "/operations/0/response/content"
                            }
                          },
                          "pointer": "/samples"
                        },
                        "index": {
                          "op": "input",
                          "name": "context",
                          "pointer": "/inputs/index"
                        }

Step 158

Build the next part of the local workflow. Values defined in earlier chunks remain in scope; concatenate the chunks in their displayed order.

JSON
                      },
                      "pointer": "/evidence_id"
                    }
                  }
                }
              },
              {
                "op": "equal",
                "left": {
                  "op": "input",
                  "name": "context",
                  "pointer": "/result"
                },
                "right": {
                  "op": "object",
                  "fields": {
                    "sample": {
                      "op": "get",
                      "value": {
                        "op": "index",
                        "value": {
                          "op": "get",
                          "value": {
                            "op": "parse_json",

Step 159

Build the next part of the local workflow. Values defined in earlier chunks remain in scope; concatenate the chunks in their displayed order.

JSON
                            "value": {
                              "op": "input",
                              "name": "context",
                              "pointer": "/operations/0/response/content"
                            }
                          },
                          "pointer": "/samples"
                        },
                        "index": {
                          "op": "input",
                          "name": "context",
                          "pointer": "/inputs/index"
                        }
                      },
                      "pointer": "/sample"
                    },
                    "review_required": {
                      "op": "equal",
                      "left": {
                        "op": "less_equal",
                        "left": {
                          "op": "get",
                          "value": {
                            "op": "index",

Step 160

Build the next part of the local workflow. Values defined in earlier chunks remain in scope; concatenate the chunks in their displayed order.

JSON
                            "value": {
                              "op": "get",
                              "value": {
                                "op": "parse_json",
                                "value": {
                                  "op": "input",
                                  "name": "context",
                                  "pointer": "/operations/0/response/content"
                                }
                              },
                              "pointer": "/samples"
                            },
                            "index": {
                              "op": "input",
                              "name": "context",
                              "pointer": "/inputs/index"
                            }
                          },
                          "pointer": "/total_cents"
                        },
                        "right": {
                          "op": "get",
                          "value": {
                            "op": "index",

Step 161

Build the next part of the local workflow. Values defined in earlier chunks remain in scope; concatenate the chunks in their displayed order.

JSON
                            "value": {
                              "op": "get",
                              "value": {
                                "op": "parse_json",
                                "value": {
                                  "op": "input",
                                  "name": "context",
                                  "pointer": "/operations/0/response/content"
                                }
                              },
                              "pointer": "/samples"
                            },
                            "index": {
                              "op": "input",
                              "name": "context",
                              "pointer": "/inputs/index"
                            }
                          },
                          "pointer": "/threshold_cents"
                        }
                      },
                      "right": {
                        "op": "literal",
                        "value": false

Step 162

Build the next part of the local workflow. Values defined in earlier chunks remain in scope; concatenate the chunks in their displayed order.

JSON
                      }
                    },
                    "evidence_id": {
                      "op": "get",
                      "value": {
                        "op": "index",
                        "value": {
                          "op": "get",
                          "value": {
                            "op": "parse_json",
                            "value": {
                              "op": "input",
                              "name": "context",
                              "pointer": "/operations/0/response/content"
                            }
                          },
                          "pointer": "/samples"
                        },
                        "index": {
                          "op": "input",
                          "name": "context",
                          "pointer": "/inputs/index"
                        }
                      },

Step 163

Build the next part of the local workflow. Values defined in earlier chunks remain in scope; concatenate the chunks in their displayed order.

JSON
                      "pointer": "/evidence_id"
                    }
                  }
                }
              }
            ]
          }
        }
      ]
    }
  }
}

Read the evidence

The JSON report identifies the actual rows, original signatures verified, changed signatures refused and native learning/qualification results. A cached calculation or qualified procedure never replaces an operation's native admission checks. Retain the final checkpoint and original evidence independently.

Add the controls your deployment needs

Issuer and bounded root warrants, reviewed tool activation and delegation/shared quotas configure authority before the agent runs. Transport identity, MCP and framework adapters carry proposals to that protected host. Encrypted tracing, metrics and exports, receipt chains and historical replay provide their corresponding observation and audit views. RC5 semantic facts add reviewed typed corroboration of source claims. Each linked page includes its actual Python, TypeScript and MCP composition.

Search guides, examples and API reference.