Two agents, one limit, one refused.
All examples
Local demonstrations
Updated
2 min read
by Anlyon Team

Run a shared-allowance accounting model

A dependency-free local example contrasts stale balance checks with reservation and shows why unknown outcomes keep capacity held.

local exampleconcurrencyimpact limits

This local program demonstrates why checking a balance and reserving it are different operations. It uses an in-memory model, no credentials and no network calls. It is an educational accounting example, not Anlyon's implementation or a distributed concurrency benchmark.

Run the example

Use Node.js 22 or newer. Download shared-allowance.mjs, save it locally, inspect it, and run:

node shared-allowance.mjs

The program uses built-in assertions and prints:

Stale checks admit 30 against a limit of 20.
Reservations admit 15; the second request is refused.
Unknown outcome keeps 15 held and 5 available.
Confirmed outcome consumes 15; availability remains 5.

The first scenario intentionally lets both callers read the same initial capacity before either spends it. Two requests of 15 each see a limit of 20 and both pass their independent checks. The resulting total is 30.

The second scenario reserves capacity as one indivisible local operation. The first request takes 15 and the second cannot reserve another 15. When the first result becomes unknown, its exposure stays held. Confirming it moves the quantity from held to consumed rather than replenishing the allowance.

What this does and does not establish

DemonstratedOutside this example
Stale observations can over-admitCross-process database coordination
Admission needs a reservation boundaryProvider API behavior
Uncertainty must retain exposureAnlyon's live deployment behavior
Settlement changes accounting statePeriod rollover and multiple limit scopes

JavaScript's synchronous local reservation is not a production concurrency solution. A deployed service needs the equivalent invariant across workers, crashes and persistent state.

Connect the model to a real integration

Anlyon impact limits apply to governed routed actions within one environment and configured scope. To validate your deployment, use the two-agent refund test procedure and collect actual effect and provider records. Keep the local demonstration results separate from those integration results.

Read impact-limit configuration and unknown exposure. Cleanup is simply deleting the downloaded script; the example creates no accounts, provider operations or files.

Continue with a related task

Free tier, no credit card. One command if you use Claude or Cursor.

$ claude mcp add anlyon -- npx -y @anlyonhq/mcp-server