Minimal constrained API environment with SYN metering. Exposes an autonomous agent to structured scarcity, measures adaptation under resource pressure, and generates logs for post-run reflective dialogue.
pip install -r requirements.txtcd quiet-node
uvicorn server.app.main:app --reloadcd quiet-node
pytest -qSet env vars for fast OPEN windows and small entropy payloads:
OPEN_INTERVAL_MIN_SECONDS=0 OPEN_INTERVAL_MAX_SECONDS=2 OPEN_DURATION_SECONDS=10 ENTROPY_MIN_KB=1 ENTROPY_MAX_KB=1 uvicorn server.app.main:app --reloadOn Windows (PowerShell):
$env:OPEN_INTERVAL_MIN_SECONDS=0; $env:OPEN_INTERVAL_MAX_SECONDS=2; $env:OPEN_DURATION_SECONDS=10; $env:ENTROPY_MIN_KB=1; $env:ENTROPY_MAX_KB=1; cd quiet-node; uvicorn server.app.main:app --reloadcurl -s -X POST http://localhost:8000/session/new | python -m json.toolSave the session_token from the response:
TOKEN="<session_token from above>"curl -s http://localhost:8000/observe -H "Authorization: Bearer $TOKEN" | python -m json.toolMost responses return "state": "DORMANT" with entropy noise. When the window opens you'll see "state": "OPEN" with a claim_token.
curl -s -X POST http://localhost:8000/claim \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{"token": "<claim_token from observe>"}' | python -m json.toolcurl -s http://localhost:8000/session/me/telemetry -H "Authorization: Bearer $TOKEN" | python -m json.toolcurl -s http://localhost:8000/session/me/export -H "Authorization: Bearer $TOKEN" | python -m json.toolcurl -s http://localhost:8000/session/me/reflection-pack -H "Authorization: Bearer $TOKEN" | python -m json.toolEvery authenticated request costs SYN:
cost = COST_PER_REQUEST (10) + COST_PER_KB (1) * ceil(response_bytes / 1024)
You start with 50,000 SYN. A single DORMANT /observe response with minimum entropy (50KB) costs ~111 SYN — at maximum entropy (2MB), a single call costs ~2,059 SYN.
When your balance hits zero, you're starved: all endpoints return 402 Payment Required except /health and /session/me/export. The only way to earn SYN back is to successfully /claim during a rare OPEN window (+25,000 SYN). Failed claims cost 100 SYN penalty.
A scripted client is included at tools/quickstart_client.py:
cd quiet-node
python -m tools.quickstart_clientPass --base-url to point at a different server.