Skip to content

fix(payments): add atomic bounded payment lifecycle - #11

Open
drewstone wants to merge 11 commits into
mainfrom
fix/x402-priced-reservation
Open

fix(payments): add atomic bounded payment lifecycle#11
drewstone wants to merge 11 commits into
mainfrom
fix/x402-priced-reservation

Conversation

@drewstone

@drewstone drewstone commented Aug 14, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Add one durable claim, settle, release, reclaim, and recovery state machine.
  • Price conservative UTF-8 input, output, provider, tool, and reasoning bounds before execution.
  • Enforce one nonce owner across retries, replicas, and mixed gateway versions.
  • Retain completed provider work until a late receipt can settle it.
  • Abort sandbox streams when the HTTP reader disconnects.

Incident protections

  • A replay cannot reuse a signed nonce before its full signed expiry.
  • A canceled or crashed request cannot refund work that may have executed.
  • A retry cannot release another request's payment reservation.
  • Usage storage failure cannot refund already-settled work.

Proof at a32c1f6b9b4f8e16e8b683caa35c88e381d8b83f

  • pnpm test — 16 files, 252 tests passed
  • pnpm typecheck — passed
  • pnpm build — passed
  • pnpm pack --dry-run — passed; observer and type entries present
  • git diff --check origin/main..HEAD — passed
  • git merge-tree --write-tree origin/main HEAD — clean

Release

No package publish or production deployment has occurred.
After approval and merge, publish @tangle-network/agent-gateway@0.7.2, then merge Insurance #93.

@drewstone

Copy link
Copy Markdown
Contributor Author

/review

@drewstone

Copy link
Copy Markdown
Contributor Author

/review

@drewstone

Copy link
Copy Markdown
Contributor Author

/review

@drewstone

Copy link
Copy Markdown
Contributor Author

/review

@drewstone

Copy link
Copy Markdown
Contributor Author

/review 2335d1589f801c77a56fb8521b305582e505ed7a

@drewstone

Copy link
Copy Markdown
Contributor Author

/review 2335d15

@drewstone

Copy link
Copy Markdown
Contributor Author

/review

@drewstone

Copy link
Copy Markdown
Contributor Author

/review

@drewstone

Copy link
Copy Markdown
Contributor Author

/review

@drewstone

Copy link
Copy Markdown
Contributor Author

/review a32c1f6

@drewstone

Copy link
Copy Markdown
Contributor Author

/review

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