Lesson 05

The chain shows its edits. Replay stays offline.

Four hash-linked ledger blocks from a zero genesis to an anchor tip, with sandbox replay allowed and live endpoints refused.
Each block names the previous hash. Replay reads the chain and does not call production.

Every sealed entry stores seq, txId, stepId, prevEntrySha256, agentReasoningHash, toolName, sanitizedInput, the pre and post state pointers, compensationStatus, state, and entryHash. The hash is SHA-256 of the canonical body. The first previous hash is 64 zero characters. The raw reasoning text is never stored, only its hash.

Values whose keys match password, secret, token, authorization, api key, ssn, card, cvv, or credential are replaced with [REDACTED] before the entry is sealed.

What tamper-evident means here

Deleting both the log and the anchor leaves nothing to disagree with. The chain does not detect that wipe. Treat the anchor file, or the anchor row, as part of the evidence.

Replay

java -jar mcp-tx-proxy/target/tx-engine.jar replay \
  --tx cli-tx --wal-dir ./data --sandbox --up-to-step 3

--sandbox is mandatory. Without it the command refuses, because live replay is not permitted. --up-to-step is 1-based. Zero means the whole transaction. A positive limit stops before compensation entries and before steps past the cutoff. Replay checks that each recorded state edge is legal. It does not call tools. An illegal edge is AtpReplayDivergence (−31806).

Chaos metrics

The harness runs one plan under HTTP 500, HTTP 429, a timeout before the handler, a timeout after the handler, and a missing-argument hallucination.

java -jar mcp-tx-proxy/target/tx-engine.jar chaos --out chaos-bench/out/results.csv

Columns are mode,fault,step,recovered,orphaned,mttr_nanos,final_state. The engine column is a real saga. The other column is a simulated executor that does not compensate, so the CSV can compare orphan rates. It is not a second live agent. A 500 rolls back with no orphan. A single 429 or timeout is retried, because forwardRetries is 2 and the fault fires once, and the plan can still commit.

Next: call the same proxy from Python or Java.