Skip to content

Start an agent's evidence at its first bond (ADR 0013) - #334

Merged
RunTimeAdmin merged 2 commits into
mainfrom
docs/adr-0013-first-bond
Nov 16, 2026
Merged

RunTimeAdmin merged 2 commits into
mainfrom
docs/adr-0013-first-bond

Conversation

@RunTimeAdmin

@RunTimeAdmin RunTimeAdmin commented Nov 16, 2026 •

Copy link
Copy Markdown
Owner

ADR 0013 and its build: an agent's evidence starts at its first bond, so a registration that never bonds costs the oracles no reads (F-01 of the 16 November security review).

What changes

  • Bonds come from the registry scan. It now reads AgentStatusUpdated in the calls it already makes. An agent's first Active log is its bond (bondedBlock). The identity registry allows Active only with the minimum stake, and nothing returns to PendingBond.
  • Only bonded agents are read. The epoch, the scored chain's payment scan and each payment chain's scan work from bonded agents only. The link scan, which asks nothing per agent, keeps every registration.
  • before_bond. A payment before the first bond is refused by the scan, by a payment chain's scan (by the bond block's time), by POST /attest (402) and by peer import. The bond's own block counts. POST /attest answers 503 bond_not_seen while the registry scan has not read far enough to tell. A slashed agent is taken as before.
  • The testnet demo agent. On Arc testnet's identity proxy, a registration before block 62914014, when the registry still made agents Active, counts from its block. One agent is affected: the demo agent, registered 18 September, with 11 payments.
  • Catch-up for a saved state. A state saved by an earlier build reads its status logs once at the next start, with a read at each registration still without a bond. On testnet that is about 46 reads, instead of about 1,000 across 9.9 million blocks (both Arc RPCs refuse spans over 10,000 blocks). Credits already held stay.
  • /health reports agents: { registered, bonded }.

Checked on the live operators first. Neither the primary nor the checker holds a credit settled before its agent's first bond (2,568 and 2,562 events), and all 47 registrations have one. So the rule changes no evidence already held on testnet.

Tests. oracle/first-bond.test.js, end to end:

  • an agent that never bonded gets no reads and no scan calls, and keeps a credit it already held;
  • the attest refusals, and the 503 while the bond is unread.

Plus unit tests in chain.test.js (first bond, the catch-up and its skips, the testnet rule), payment-scan.test.js, payment-chains.test.js and payment-chain-outcomes.test.js (the payment-chain attest answers). Oracle suite with CI=1: 1559 of 1559 pass. scripts/check-docs.mjs is ok. A second Claude agent reviewed the diff and found no bug in the rule; that is not an independent review. Its points on slashed agents, a test that did not reach the catch-up, and the untested payment-chain path are fixed here.

Rollout. Deploy both testnet operators in one window between epochs (they run at about :57 and :58), as with #301. Then compare their /health agent counts, and run the pre-bond credit check again: it should still find none.

🤖 Generated with Claude Code

RunTimeAdmin and others added 2 commits November 16, 2026 12:07
Registration costs only gas, yet every registered agent adds payment-scan
calls on each chain and a daily bond read. Under ADR 0013 the oracle reads and
scans only agents that have bonded, found from the identity registry's first
AgentStatusUpdated(did, Active) log, and a payment before an agent's first
bond is refused as before_bond on every path. Credits already held stay.
Docs only; not built.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The registry scan now reads AgentStatusUpdated with registrations and
transfers, and an agent's first Active log is its bond. The epoch and the
payment scans read only bonded agents. A payment before the bond is refused
as before_bond by both scans, POST /attest and peer import, and POST /attest
answers 503 bond_not_seen while it cannot tell yet. Arc testnet's one
registration from before PendingBond counts from its block. A saved state
catches up its status logs once, a read at each registration still without
a bond. /health reports registered and bonded agents.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@RunTimeAdmin RunTimeAdmin changed the title Add ADR 0013: an agent's evidence starts at its first bond Start an agent's evidence at its first bond (ADR 0013) Nov 16, 2026
@RunTimeAdmin
RunTimeAdmin merged commit 31ad9bc into main Nov 16, 2026
7 checks passed
@RunTimeAdmin
RunTimeAdmin deleted the docs/adr-0013-first-bond branch November 16, 2026 19:19
RunTimeAdmin added a commit that referenced this pull request Nov 16, 2026
Sigvara#333 and #334 added ten oracle tests and left the hand-kept count at
1549. The suite has 1559 at 62f1247 (CI=1, all pass). In place, so no line
moves and the wiki's anchors hold.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant