{"data":{"kind":"file","path":"README.md","version_id":"eoa04ehhsqq2or5r166s3dny","entry":{"name":"README.md","path":"README.md","is_directory":false,"size":2821,"modified_at":"2026-10-11T13:27:31.092000","content_hash":"ac08b8731c04661ef8e74c3a2e86c643a15b111fcfcb77b5fccfb6068eb932a1"},"entries":[],"content":"# s2ar-env\n\nDeterministic puzzle environments — **baba** (Baba-Is-You rules on a tiny board, eleven levels with certified solution\nlengths), **sokoban** (generated into a certified push band), **snap** (a two-seat card duel against a house policy),\n**cityglitch** (a 5×5 slide puzzle with reactive enemies: 92 levels and bands certified by the optimal solver), **ofc**\n(Pineapple Open-Face Chinese poker against a first-legal house) — served by `api.s2ar.dev/v1/env`, with **every finished episode sealed as a signed, replayable record** and a signed\n**scorecard** over any set of your episodes. This package is a client: the engines run on the server; what you train on\nis the number anyone can verify free at `https://api.s2ar.dev/v1/verify/{record_sha256}`.\n\n- The catalogue (levels, certified lengths, baselines, each env's **reward-integrity audit record**): `GET https://api.s2ar.dev/v1/env`\n- Worked example: https://s2ar.dev/examples/play-an-environment.html · the audit of the reward: https://s2ar.dev/examples/audit-a-reward.html\n- Price: $0.02 an episode (steps free), ten episodes a day free without a key; a key from https://api.s2ar.dev/login ($1 on sign-in) or x402 (USDC on Base).\n\n## verifiers\n\n```python\nimport verifiers as vf\nfrom s2ar_env import load_environment\n\nenv = load_environment(env=\"baba\", seeds=range(11))         # one episode per seed; S2AR_API_KEY in the environment for volume\n# vf-eval s2ar_env -a '{\"env\": \"sokoban\", \"band\": \"easy\", \"seeds\": [1, 2, 3]}'\n```\n\nThe model answers one action per turn (a letter for baba/sokoban, a legal number for snap); the reward is the sealed\nrecord's return, never a local grade. The record's sha is in the final turn.\n\n## Plain client\n\n```python\nfrom s2ar_env import Client\nc = Client()                                  # keyless: the free samples\nep = c.reset(\"baba\", seed=0)\nout = c.step(ep[\"episode_id\"], \"R\"); out = c.step(ep[\"episode_id\"], \"R\")\nout[\"verdict\"], out[\"record_sha256\"]          # 'win', the sealed episode\nc.scorecard(\"walk right twice\", [out[\"record_sha256\"], ...])\n```\n\n## OpenEnv\n\n`openenv/` holds a `reset / step / state` shim (FastAPI) and its Dockerfile: `docker build -t s2ar-env openenv/ && docker run -e S2AR_API_KEY=… -p 8000:8000 s2ar-env`. One episode per container; `/state` carries the sealed record's sha.\n\n## What the records say\n\n`env-episode`: the env and its version, the engine's sha, the seed, the level, every action and reward, the final state,\na chained digest — replayable by anyone with the engine at that sha. `env-scorecard`: your policy label, the episodes'\ndigests, mean return, win rate, the env's audit record. The reward itself is audited (degenerate probes, invariance,\nsoundness, a seeded exploit search): baba and sokoban grade A. An episode left open past its window is never charged.\n","encoding":"utf-8","truncated":false,"total_bytes":2821},"status":null}