Repository navigation
docs(agents): fund-safety, crash-consistency and distributed-transaction invariants - #493
Conversation
Verification: PR #493 (fund-safety invariants section in AGENTS.md)Tested as-is at head Descriptive claims — all verified
Invariants vs merged code — the audit gaps (consistent with the doc's framing, stating them for the record)
Both gaps are exactly what the audit series tracks, so the doc is honest as written; flagging so reviewers don't mistake the rules for implemented behavior. Factual nits to fix while you're in there
Docs-only: no battery impact (branch is based on pre-#506 Disposition: land-with-followups — fix the "replace directive" wording (and optionally the patch count) in a quick amend; the invariant content itself is accurate against the merged tree, with the two open gaps correctly tracked by #507/#511. |
Adds the Fund safety, crash consistency, and distributed transaction invariants section to
AGENTS.md, placed directly after Orientation so every agent reads it before touching payment code, plus an implementation-specific subsection (gonuts fork maintenance, bbolt persistence, counter ownership, WalletPort/sidecar, pure-Go/OpenWrt constraint).Why: cross-implementation audit of Go vs Rust/CDK found the same invariant classes behind #257, #266, #375, #403, #417, #480 recurring because the knowledge lived in issue threads, not in agent guidance. Encoded rules: derivation outputs never re-exposed; counters monotonic, reserved before the exposing call; canonical mint identity at every persistence boundary; validate-before-receive; irreversible-op + fallible-work means durable forward recovery or compensation; ambiguous outcomes reconciled not blind-retried; idempotent retries; partial successes never discarded; process-memory state not authoritative; migrations preserve value per-item; research-first rule for protocol-sensitive changes (NUTs, CDK/gonuts source, issue history).
Docs-only change; verified against upstream/main.