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 cases compare invoices with purchase orders and delivery evidence. One case has an amount mismatch and another lacks delivery. The graph independently checks the result before recording the reviewed 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 | transactions; 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.
python -m pip install https://docs.soterias.io/downloads/api-preview/soterias_local-0.1.0rc5%2Bapi2-cp311-abi3-win_amd64.whlnpm 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@24Python 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"// Installed native TypeScript parity of workflows.py; fresh disposable UNIT setup only.
import assert from "node:assert/strict";
import fs from "node:fs";
import path from "node:path";
import crypto from "node:crypto";
import { DatabaseSync } from "node:sqlite";
import { createInterface } from "node:readline/promises";
import {
Procedure,
ProcedureMemory,
Executor,
Reviewer,
canonicalize,
verifyAttestation,
type ProcedureEnvironment,
type ProcedureRun,
type QualifiedProcedure,
} from "@soterias/core";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()// %% Load explicit operator inputs
// These values select existing authority; the agent cannot replace them.
const kind = process.env.SOTERIAS_CASE ?? "transactions";
assert(["aml", "transactions", "recalculation", "controls"].includes(kind));
const root = path.resolve(process.env.SOTERIAS_ROOT!),
custody = path.resolve(process.env.SOTERIAS_CUSTODY!),
output = path.resolve(process.env.SOTERIAS_OUTPUT!),
unitConfirm = false;
assert(fs.statSync(output).isDirectory() && fs.readdirSync(output).length === 0,
"Select an existing empty private output directory");
const read = (name: string) => fs.readFileSync(path.join(root, name));
const encode = (v: unknown) =>
canonicalize(Buffer.from(JSON.stringify(v))).canonical;
const sha = (v: Uint8Array) =>
crypto.createHash("sha256").update(v).digest("hex");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", "transactions"),
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()
)
)// %% Bind the current native environment
// Retain exact policy, tool, credential, source and configuration identities.
const profile = JSON.parse(read("document-profile.json").toString()),
checkpoint = read("workflow-checkpoint.json"),
pins = JSON.parse(checkpoint.toString());
const environment: ProcedureEnvironment = {
policy: sha(encode(profile.base.policy)),
tools: sha(encode(pins.tools)),
credentials: sha(encode(pins.credentials)),
evidence: profile.document_routes[0].source,
host_configuration: pins.configuration,
};
const recipes = JSON.parse(
fs.readFileSync(new URL("./plans.json", import.meta.url), "utf8"),
);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// %% Create the procedure and independent verifier
// The recipe is fixed by the application, not supplied by an agent.
const procedure = new Procedure(
encode({ ...recipes[kind!].graph, environment }),
{ verifier: recipes[kind!].verifier },
);
let memory = ProcedureMemory.create(path.join(output, "memory"));
const options = {
root,
custody,
configuration: read("document-profile.json"),
checkpoint,
passphrase: Buffer.from("disposable-native-sqlite-unit-unlock"),
};
const opening = (selected: Buffer) => {
const owner = new Executor({
...options,
checkpoint: selected,
});
owner.verifyOutcomes(
read("workflow-verification-profile.json"),
);
return owner;
};
const trust = read("workflow-verifier-trust.json"),
anchor = encode(JSON.parse(trust.toString()).anchor);
const reviewedRequests = new Map<string, Buffer>();
function ledger(): { operation_id: string; value: string }[] {
const db = new DatabaseSync(path.join(root, "ledger.sqlite3"), {
readOnly: true,
});
try {
return db
.prepare(
"SELECT operation_id,value FROM broker_effects ORDER BY operation_id",
)
.all() as { operation_id: string; value: string }[];
} finally {
db.close();
}
}
const expectedLedger = () =>
sha(
Buffer.concat(ledger().flatMap((row) => [encode(row), Buffer.from("\n")])),
);
async function approve(
host: Executor,
run: ProcedureRun,
): Promise<{ host: Executor; approval: Buffer }> {
const original = run.pendingRequest;
assert(original);
const prepared = host.prepare(original),
before = ledger();
host.close();
reviewedRequests.set(
JSON.parse(original.toString()).payload.data.operation_id,
original,
);
const reviewer = new Reviewer({
...options,
checkpoint: prepared.checkpoint,
signingKey: JSON.parse(read("operation-key.json").toString()),
});
try {
const pending = reviewer.prepare(original, prepared, {
expiresAtMs: BigInt(Date.now()) + 300000n,
});
console.log("Review exact request:", original.toString());
console.log("Review selection:", pending.selection.toString());
if (!unitConfirm) {
const terminal = createInterface({
input: process.stdin,
output: process.stdout,
});
try {
assert.equal(
await terminal.question(
"Type APPROVE to sign this exact operation: ",
),
"APPROVE",
);
} finally {
terminal.close();
}
}
const approval = reviewer.approve(pending, {
confirmation: pending.confirmationDigest,
});
assert.deepEqual(ledger(), before);
return { host: opening(prepared.checkpoint), approval };
} finally {
reviewer.close();
}
}
let host = opening(checkpoint),
qualified: QualifiedProcedure | undefined;
const runs: unknown[] = [];
let signatures = 0,
mutations = 0;
try {
for (let index = 0; index < 6; index++) {
const r = JSON.parse(read("allow-document-request.json").toString()),
w = JSON.parse(read("allow-request.json").toString());
for (const [prefix, request] of [
["read", r],
["write", w],
] as const) {
request.payload.data.operation_id = `${kind}-${prefix}-${index}`;
request.payload.data.evaluated_at_ms = String(Date.now());
}
w.payload.data.arguments.expected = expectedLedger();
const inputs = { read: r, write: w, index: String(index) };
const run =
index < 5
? procedure.start(inputs, { environment })
: qualified!.start(inputs, { environment });
let state = await host.runAsync(run, { environment }),
pauses = 0;
while (state === "awaiting_approval") {
const approved = await approve(host, run);
host = approved.host;
state = await host.runAsync(run, {
environment,
approval: approved.approval,
});
pauses++;
}
fs.writeFileSync(
path.join(output, `run-${index}-metrics.json`),
JSON.stringify(run.report, null, 2) + "\n",
{ flag: "wx", mode: 0o600 },
);
fs.writeFileSync(
path.join(output, `run-${index}-receipts.json`),
JSON.stringify(
run.receipts.map((r) => JSON.parse(r.toString())),
null,
2,
) + "\n",
{ flag: "wx", mode: 0o600 },
);
assert.equal(state, "verified", JSON.stringify(run.report));
assert.equal(pauses, 2);
for (const raw of run.receipts) {
const receipt = JSON.parse(raw.toString()),
kind = receipt.claims.body.kind,
role =
kind === "verifier_result"
? "verifier"
: ["broker_dispatch", "effect_observation"].includes(kind)
? "broker"
: "authorization";
const binding = receipt.claims.binding,
original = reviewedRequests.get(binding.operation_id);
assert(original);
const action = JSON.parse(original.toString()).payload.data;
assert.equal(binding.request, canonicalize(original).sha256);
assert.equal(binding.tool_id, action.tool_id);
assert.equal(binding.action, action.action);
assert.equal(binding.actor.principal_id, action.principal_id);
assert.equal(
binding.arguments,
sha(
Buffer.concat([
Buffer.from("soterias:attestation-arguments:1\0"),
encode(action.arguments),
]),
),
);
const route = profile.base.routes.find(
(r: { tool_id: string; action: string }) =>
r.tool_id === action.tool_id && r.action === action.action,
);
assert(route);
assert.equal(
binding.resource,
sha(
Buffer.concat([
Buffer.from("soterias:attestation-resource:1\0"),
encode(route.resource),
]),
),
);
const policy = read(
role === "verifier"
? "workflow-verifier-policy.json"
: role + "-policy.json",
);
const verified = verifyAttestation(raw, { trust, anchor, policy });
assert.equal(verified.assurance, "pinned_issuer_signature_and_bindings");
assert.equal(verified.expectedBindingChecked, false);
signatures++;
if (kind === "verifier_result") {
assert.equal(receipt.claims.body.verdict, "success");
assert(receipt.claims.body.settlement);
}
const altered = structuredClone(receipt),
signature: string = altered.signature.signature;
altered.signature.signature =
(signature[0] === "0" ? "1" : "0") + signature.slice(1);
assert.throws(() =>
verifyAttestation(encode(altered), { trust, anchor, policy }),
);
mutations++;
}
const expected =
kind === "transactions"
? { sample: `TX-${index}`, matches: ![3, 4].includes(index) }
: kind === "recalculation"
? {
sample: `ASSET-${index}`,
annual_minor_units: String(
Math.floor(((index + 1) * 120000 - 20000) / 5),
),
}
: kind === "aml"
? {
sample: `CASE-${index}`,
review_required: (index + 1) * 100000 > 250000,
evidence_id: `TRANSACTIONS-${index}`,
}
: {
sample: `PAY-${index}`,
effective: (index + 1) * 10000 <= 25000 || index % 2 === 0,
evidence_id: `APPROVAL-${index}`,
};
assert.deepEqual(run.result, expected);
const rows = ledger();
assert.equal(rows.length, index + 1);
assert.deepEqual(
JSON.parse(
rows.find((row) => row.operation_id === `${kind}-write-${index}`)!
.value,
),
expected,
);
const metrics = run.report;
assert.equal(metrics.independently_verified, true);
assert.equal(metrics.broker_targets, "2");
assert.equal(metrics.model_calls, "0");
assert.equal(metrics.token_source, "no_model_invoked");
if (index < 5)
memory.observe(run, {
phase: index < 3 ? "training" : index === 3 ? "shadow" : "canary",
});
else assert.equal(metrics.trace.filter((n) => n.reused_pure).length, 1);
runs.push({ output: run.result, metrics });
if (index === 4) {
memory = ProcedureMemory.open(path.join(output, "memory"));
qualified = memory.qualify(procedure, { environment });
}
}
const summary = {
status: "PASS_ACTUAL_LOCAL_GUARDED_WORKFLOW",
case: kind,
runs,
signatures_verified: signatures,
signature_mutations_rejected: mutations,
qualification: qualified!.report,
unit_confirmation: unitConfirm,
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",
],
};
fs.writeFileSync(
path.join(output, "REPORT.json"),
JSON.stringify(summary, null, 2) + "\n",
{ flag: "wx" },
);
console.log(
JSON.stringify({
status: summary.status,
case: kind,
runs: runs.length,
signatures_verified: signatures,
}),
);
fs.writeFileSync(
path.join(output, "acknowledged-checkpoint.json"),
host.checkpoint(),
{ flag: "wx", mode: 0o600 },
);
fs.writeFileSync(
path.join(output, "reviewed-requests.json"),
JSON.stringify(
Object.fromEntries(
[...reviewedRequests].map(([k, v]) => [k, JSON.parse(v.toString())]),
),
null,
2,
) + "\n",
{ flag: "wx", mode: 0o600 },
);
} finally {
host.close();
}Run exploratory, shadow and compiled samples
Every protected target still goes through native policy, review and broker admission.
# %% 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.
"""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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
}
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.
),
},
)
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.
)
+ "\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.
{
"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.
"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.
{
"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.
],
"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.
"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.
},
{
"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.
"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.
"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.
"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.
"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.
},
"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.
},
{
"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.
"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.
"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.
"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.
"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.
},
{
"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.
"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.
"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.
"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.
},
"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.
},
{
"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.
},
"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.
"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.
"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.
"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.
},
{
"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.
},
"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.
},
"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.
"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.
"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.
},
"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.
},
"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.
}
},
"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.
"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.
"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.
"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.
"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.
"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.
"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.
"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.
},
{
"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.
},
"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.
},
"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.
"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.
"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.
},
"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.
"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.
"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.
"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.
"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.
"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.
"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.
"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.
"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.
"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.
"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.
"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.
"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.
"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.
"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.
"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.
"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.
"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.
"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.
"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.
"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.
},
{
"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.
}
},
{
"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.
"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.
},
"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": falseStep 72
Keep the exact acknowledged checkpoint. Reopening with an older pin is an error; do not silently discover and adopt newer state.
}
}
]
},
"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.
"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.
"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.
"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.
"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.
}
},
{
"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.
"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.
}
},
{
"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.
"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.
"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.
"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.
"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.
]
},
"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.
"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.
"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.
"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.
"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.
"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.
}
}
},
{
"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.
"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.
"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.
"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.
"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.
}
]
}
},
"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.
"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.
}
}
},
{
"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.
"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.
"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.
"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.
"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.
"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.
"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.
"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.
"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.
"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.
"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.
}
]
},
"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.
"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.
},
"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.
"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.
"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.
"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.
"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.
"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.
},
"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.
}
},
"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.
"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.
"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.
},
"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.
"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.
"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.
"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.
"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.
"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.
"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.
}
},
"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.
}
},
"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.
"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.
"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.
]
}
},
"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.
"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.
}
},
{
"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.
"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.
"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.
}
},
"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.
"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": falseStep 138
Check the result against independent evidence and retain refusals. The assertion makes this example fail if native verification behaves differently.
}
},
"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.
"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.
"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.
"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.
"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.
}
},
"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.
}
},
{
"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.
"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.
},
"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.
"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.
"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.
"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.
"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.
"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.
},
"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.
"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.
"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.
"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.
"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.
"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.
},
"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.
"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.
"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.
"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": falseStep 162
Build the next part of the local workflow. Values defined in earlier chunks remain in scope; concatenate the chunks in their displayed order.
}
},
"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.
"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.