Validation
Testing
The goal is not just passing tests. The goal is proving that agents make fewer attempts, complete deterministically, and cannot cheat admission.
Run everything
npm run check
This runs:
node --test tests/*.test.jsnode examples/agent-sim/simulate.js
Unit tests
npm run test
The current test suite validates the non-negotiable core properties:
- Signed tickets verify successfully.
- Spent tickets cannot be redeemed twice.
- Tampered tickets fail signature verification.
100-agent simulator
npm run simulate
| Agent group | Policy | Expected result |
|---|---|---|
| 50 loose-deadline agents | Can wait 15 seconds | Use free lane. |
| 30 urgent budgeted agents | Deadline 2.5 seconds, budget 0.01 USDC | Use mock paid priority. |
| 20 urgent unbudgeted agents | Deadline 2.5 seconds, no budget | Fail cleanly. |
Interpreting simulator output
| Metric | What good looks like | Why it matters |
|---|---|---|
retryReductionPercent | 80% or higher versus naive retry. | This is the first business proof: less wasted traffic during overload. |
successes | Loose-deadline agents complete; urgent budgeted agents complete through priority. | Shows demand is coordinated instead of discarded. |
paid / free | Paid priority is consistently admitted before free-lane work. | Validates the mechanism before real money is connected. |
replayFailures | Replays are rejected and counted. | Proves ticket single-use behavior. |
ticketBreachRate | Zero. | Any admitted invalid ticket is a release blocker. |
Acceptance targets
- At least 80% fewer requests than naive retry.
- 0 successful tampered tickets.
- 0 double-admission from one ticket.
- Paid priority p95 below free-lane p95.
- Free-lane redemptions admitted inside the promised window.
Public endpoint checks
curl -I https://x429.dev/docs/
curl -I https://x429.dev/429
curl https://x429.dev/.well-known/x429.json
curl https://x429.dev/llms.txt