21 NAND Docs 中文

Agents-API circuits #283, #284

The control rules of an agent session built as on-chain circuits: #283 is the first version, #284 adds circuit breakers, reason codes and tiered payment.

What it is

The two circuits

Item#283#284
Buildv2v5
Inputs / outputs / state bits16 / 15 / 1016 / 17 / 23
NAND152295
LATCH1023
Netlist1,104 bytes, sha256 93d65a3634679190…2,157 bytes, sha256 de800761487244af…
Block121240525121331172
Spot check after going on chain64 sets of step(), match local64 sets of step(), match local

To check the on-chain netlist bit by bit, see the last section of Check it yourself.

What #284 adds

Item#283#284Reason code when triggered
Round limit (a model call and a compression each count as a round)72552
Tool failure retries13, stops on the 4th failure3
Sub-agents running at once37—
Sub-agent failures (3 cycles with no reply also count as one)nonestops on the 3rd4
Compression has no effectgets stuckstops if the context is still full after 3 compressions in a row6
Repeated tool definition lookupsno limitat most 3 in a row, stops on the next one7
Budget used up / key rejectedstopsstops1 / 5
Payment1 bit2 bits: 0 no pay, 1 partial, 2 full—

How it is proven correct

Sessions that were run

Try one call yourself

Run one cycle of #284 on chain (needs Foundry's cast)
cast call 0x6Fb4089e7Cbaa9660Fd11056274Cbd8117EE5B38 \
  "step(uint256,bytes,bytes)(bytes,bytes)" \
  284 0x89ab14 0x07a0 \
  --rpc-url https://bsc-rpc.publicnode.com