[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7DCZZ7KY5W22VM9T793WHVX":3,"skill-same:01M7DCZZ7KY5W22VM9T793WHVX":46},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":24,"commitSha":25,"skillDirectory":26,"forksCount":27,"repositoryHtmlUrl":28,"repositoryHomepageUrl":29,"ownerHtmlUrl":30,"ownerBlogUrl":6,"ownerDescription":6,"updatedAt":31,"install":32,"resources":45},"01M7DCZZ7KY5W22VM9T793WHVX","add-a-language",null,"How to add a new eval language runtime to reeval (Dart, Go, and so on): LanguageAdapter, stdio transport, attempt protocol v2, conformance goldens and a feature smoke fixture. Use when extending reeval beyond TypeScript *.eval.ts or wiring another *.eval.\u003Clang> suffix.","reeval-ai\u002Freeval","reeval-ai","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F354599760?v=4","01M7DCZWK0K84BEW1ECSTKP6MK","reeval.ai","01M7DCZWM22FTSWRP1FNVPA7NK",13,"Apache-2.0","https:\u002F\u002Fgithub.com\u002Freeval-ai\u002Freeval\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fadd-a-language\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: add-a-language\ndescription: >\n  How to add a new eval language runtime to reeval (Dart, Go, and so on): LanguageAdapter,\n  stdio transport, attempt protocol v2, conformance goldens and a feature smoke fixture.\n  Use when extending reeval beyond TypeScript *.eval.ts or wiring another *.eval.\u003Clang> suffix.\n---\n\n# Add a language runtime to reeval\n\nreeval routes every eval file through a **`LanguageAdapter`**. TypeScript is adapter #1\n(in-process jiti). Python is adapter #2 (out-of-process runner over stdio). The next\nlanguage registers another adapter and ships an SDK package; the engine, plan and attempt\nlifecycle stay shared.\n\n**Rules (non-negotiable):**\n\n- **SDKs are language-native; the wire format is never the public API.** Python evals import\n  `evaluate` and `expect` from `reeval_python`, use snake_case (`c.read_file`, `assert result.ok`,\n  typed `ExecResult` \u002F `Turn` \u002F `Verdict`), and snake_case options mapped to camelCase on the wire\n  internally, at any depth, from the generated key tables (`CAMEL_KEYS`, and `RECORD_FIELDS`,\n  whose keys are the eval's own and keep their spelling). Plain `assert`s in an eval file are\n  checks in the record: the SDK rewrites them at import, as pytest does, and sends a protocol\n  `record` call named by the assert's test as written. A pass is sent at once; a failure only if\n  its `AssertionError` escapes the body, so a failure the body catches isn't a failed check. The\n  message is the failure's reason. Use `expect(…).to_succeed()` and the other matchers for\n  reeval-specific checks.\n  Follow the language's own sync and async idioms rather than TypeScript's promises: in Python a\n  `def` body runs on a worker thread with a blocking context (`c.exec` returns its result) and\n  `reeval_python.expect`, and an `async def` body gets coroutines and `reeval_python.aio.expect`,\n  whose typed matchers return coroutines so the type checker reports a missing `await`. A poll\n  takes a function that reads or runs something (`expect.poll(lambda: c.read_file(p))`), which the\n  SDK calls once to learn the subject for reeval to re-read.\n- **TypeScript stays in-process.** Never send `.eval.ts` through the runner transport; records,\n  stacks and matcher behavior must stay unchanged.\n- **No per-language branches in the engine.** The worker calls `loadEvalModule()` only; do not\n  fork plan\u002Fmatrix logic or special-case languages in `engine\u002Fworker.ts`.\n- **Update goldens in the same PR** when declaration or attempt-protocol shapes change\n  (`test\u002Fconformance\u002F`, plan snapshots, SDK mirrors).\n\n## How languages plug together\n\n```mermaid\nflowchart TD\n  CLI[\"reeval run\"] --> Disc[\"File discovery\u003Cbr\u002F>include globs from every adapter\"]\n  Disc --> Worker[\"Engine worker\u003Cbr\u002F>loadEvalModule()\"]\n  Worker --> Pick{\"adapterForFile()\u003Cbr\u002F>by extension\"}\n\n  Pick -->|\".eval.ts\"| TS[\"TypeScript adapter\u003Cbr\u002F>remote: false\"]\n  TS --> Jiti[\"jiti import in the worker\u003Cbr\u002F>evaluate \u002F group register directly\"]\n\n  Pick -->|\".eval.py\"| Py[\"Python adapter\u003Cbr\u002F>remote: true\"]\n  Pick -.->|\".eval.dart (next)\"| Dart[\"Dart adapter\u003Cbr\u002F>remote: true\"]\n  Py --> Remote[\"remote.ts\u003Cbr\u002F>spawn runnerCommand()\"]\n  Dart -.-> Remote\n  Remote \u003C-->|\"stdin\u002Fstdout\u003Cbr\u002F>protocol v2 NDJSON\"| SDK[\"Language SDK runner\u003Cbr\u002F>reeval_python \u002F sdks\u002Fdart\"]\n  SDK -->|\"collect → declared tree\"| Declare[\"declareTree()\"]\n  SDK \u003C-->|\"start · {id, call, key} · replies · done\"| Host[\"attempt-host.ts\"]\n\n  Jiti --> Plan[\"Shared plan and matrix\u003Cbr\u002F>(one code path)\"]\n  Declare --> Plan\n  Plan --> Attempt[\"Attempt lifecycle\u003Cbr\u002F>sandbox · harness · checks · judge · record\"]\n  Jiti -->|\"c.send \u002F c.exec \u002F expect\"| Attempt\n  Host -->|\"same AttemptContext + match.ts\"| Attempt\n\n  Conf[\"Conformance goldens\u003Cbr\u002F>declare\u002F* · context\u002F*.ndjson\"] -. \"every SDK must pass\" .-> SDK\n```\n\n## The adapter interface\n\nDefined in `packages\u002Freeval\u002Fsrc\u002Flanguage-runner\u002Fadapter.ts`:\n\n| Type \u002F field | Purpose |\n|---|---|\n| `LanguageAdapter` | `InProcessAdapter \\| RemoteAdapter` — discriminated on `remote` |\n| `InProcessAdapter` | `remote: false`; no `runnerCommand` (TypeScript) |\n| `RemoteAdapter` | `remote: true`; required `runnerCommand(root)` (Python) |\n| `id` | Stable name (`typescript`, `python`, …) |\n| `extensions` | Eval file suffixes (e.g. `.eval.ts`, `.eval.py`) |\n| `includeGlobs` | Default discovery patterns merged into config `include` |\n| `load(file, root)` | Worker **collect**: register evals via `evaluate` \u002F `group` (TS) or remote `declareTree` |\n| `runnerCommand(root)` | **Remote only:** spawn the SDK (`resolvePythonRunnerCommand` in `python-runner.ts`: `uv run … python -m reeval_python`, `.venv\u002Fbin\u002Fpython`, or `python3`) |\n\nEntry point: `loadEvalModule()` in `language-runner\u002Fload.ts` →\n`adapterForFile(file).load(...)`.\n\nRegister new adapters in `LANGUAGE_ADAPTERS`. Merge their `includeGlobs` via\n`defaultIncludeGlobs()` (config default `include`). For Python-only env helpers today, see\n`runnerEnv()` in the same file; add analogous SDK path overrides when the next language needs them.\n\n## Out-of-process transport (remote adapters only)\n\nGeneric code lives under `packages\u002Freeval\u002Fsrc\u002Flanguage-runner\u002F` (ported from the Dart spike;\nsee [Prior art](#prior-art-dart-spike) below):\n\n| Module | Role |\n|---|---|\n| `protocol.ts` | `RUNNER_PROTOCOL = 3`. Session messages use `t` (`hello`, `collect`, `declared`, `log`). Attempt traffic uses shapes from `src\u002Fcontract\u002Fattempt.ts` (`start`, `abort`, `done`, `{id, call}`, replies), each with the `key` reeval gave the body in its `start` — no `t` on attempt lines. `key` is unique per started body; `attempt.id` isn't (two evals on one cell share it), so never multiplex on it. |\n| `transport.ts` | Spawns the runner; one JSON message a line on its stdin (to it) and stdout (from it). A stdout line that isn't a message is shown on stderr; one that starts with `{` but isn't JSON (a bare `NaN`) ends the session with an error |\n| `attempt-host.ts` | Maps protocol ops to real `AttemptContext` (`expect` → `match.ts`) |\n| `remote.ts` | `collectLanguageFile`: collect tree, `declareTree`, run remote bodies |\n\nSDK runner responsibilities:\n\n1. Keep stdin and stdout for messages only: move fd 0 and fd 1 aside (non-inheritable copies the\n   runner alone reads and writes), point fd 1 at stderr and fd 0 at `\u002Fdev\u002Fnull`, so neither a\n   child process nor the body's own input can write into a message or read one. A forked child\n   shares those copies but not the runner's lock: send its output to stderr. reeval takes a\n   stdout line as a message only when it has a message's shape (`isFromRunner`), so print\n   nothing else there that could pass for one. Write strict JSON: a value with NaN or Infinity\n   in it fails the eval's call that passed it (Python's `allow_nan=False`), since reeval ends the\n   session on a line that starts with `{` but doesn't parse. Send\n   `{ t: 'hello', protocol: 3, sdk, version, runtime }`. reeval sets `REEVAL_RUNNER=stdio` and\n   `REEVAL_RUNNER_PROTOCOL`; a runner started without them, or on another protocol, exits\n   non-zero with a sentence naming both versions instead of saying hello.\n2. On `{ t: 'collect', file }`, import the eval file; reply with `{ t: 'declared', file, tree }`\n   (tree must match `schema\u002Fplan\u002Fdeclaration.schema.json`).\n3. On `start`, run the body async; each `c.*` becomes `{ id, call, key }`; read replies\n   (including `expect` assertion records); send `{ type: 'done', key, error? }`.\n4. On `{ type: 'abort', key }`, reeval has already settled the attempt: fail the body's calls in\n   flight and every later one at once, without sending them, and stop the body where the\n   language can. A body that keeps running must not reach reeval (it answers any call whose key\n   it no longer knows with an `AbortError`).\n5. Route a body's prints as `{ t: 'log', key, stream, text }`, one line each, by the language's\n   async-local context (`contextvars` in Python), so concurrent bodies' output stays apart.\n6. Send the language's own regular expressions as `{ matchedBy, answers }` (`matchedBy` is how\n   the language writes the pattern, e.g. Python's `repr`), never translated to JavaScript.\n   reeval runs the matcher and, when it tests a string `answers` lacks, replies\n   `{ ok: true, op: 'expect', untested: { [matchedBy]: strings } }` and records nothing: match\n   them in the language, off the thread that reads reeval's messages, add them to `answers` and\n   make the same call again. Stop after a few rounds (Python stops at 5): a subject that\n   changes on every read never runs out of new strings. reeval refuses `poll` with such an\n   argument. `{ regexp, flags }` is for a language whose patterns are JavaScript's.\n\nDeclaration tree JSON is validated by the same contract TypeScript uses (`declareTree` in the worker).\n\n## Conformance contract (every SDK)\n\nGoldens live in `packages\u002Freeval\u002Ftest\u002Fconformance\u002F` ([README](..\u002F..\u002F..\u002Fpackages\u002Freeval\u002Ftest\u002Fconformance\u002FREADME.md)).\nTypeScript holds them to the real code in `conformance.test.ts`. Each SDK mirrors the suite in its\nown test runner.\n\n1. **`test\u002Fconformance\u002Fdeclare\u002F\u003Ccase>\u002F`** — `expected.json` equals the tree the SDK records\n   (Python: `packages\u002Freeval-python\u002Ftests\u002Ftest_conformance_declare.py`).\n2. **`test\u002Fconformance\u002Fcontext\u002F\u003Ccase>.ndjson`** — port of `conformance\u002Frunner.ts`: replay each\n   `reeval` line, run a tiny eval body that emits the golden `runner` lines, match the `record` line.\n3. **Repo gate** — `packages\u002Freeval\u002Ftest\u002Fpython-sdk.test.ts` runs `uv sync` + `uv run pytest` when\n   `uv` is present; add a sibling gate per language.\n4. **`test\u002Fconformance\u002Flauncher\u002F`** — the SDK's `reeval` command, which downloads, checks, caches\n   and runs the binary, against a fake release server. Add a runner module in its `runners\u002F`\n   (Python's `runners\u002Fpython.ts` is the reference) and a row in `ci.yml`'s `launchers` matrix; see\n   its [README](..\u002F..\u002F..\u002Fpackages\u002Freeval\u002Ftest\u002Fconformance\u002Flauncher\u002FREADME.md).\n\nWhen TypeScript changes declaration or protocol behavior, run\n`REEVAL_UPDATE_SNAPSHOTS=1` on `conformance.test.ts`, review the diff, and update every SDK mirror\nin the **same PR**. Do not duplicate the full `test\u002Ffeatures\u002F` corpus per language — one **smoke\nfixture** per adapter plus declare\u002Fcontext conformance is enough.\n\n## Checklist: add a new language\n\nUse **Python** as the worked reference (`packages\u002Freeval-python\u002F`, feature fixture\n`packages\u002Freeval\u002Ftest\u002Ffeatures\u002Fpython-sdk\u002Fhello\u002F`).\n\n| Step | Work |\n|---|---|\n| 1 | SDK under `packages\u002Freeval-\u003Clang>\u002F` or `sdks\u002F\u003Clang>\u002F`: declare API, attempt context, runner entrypoint |\n| 2 | Register adapter in `language-runner\u002Fadapter.ts` (`extensions`, `includeGlobs`, `remote: true`, `runnerCommand`) |\n| 3 | Declare conformance: mirror each `test\u002Fconformance\u002Fdeclare\u002F\u003Ccase>\u002F` |\n| 4 | Context conformance: NDJSON scripts through the SDK runner |\n| 5 | One feature fixture (`\u003Clang>-sdk\u002Fhello`: `lands` + `canary`) on **fake**; add **docker** \u002F **real** when sandbox or Cursor checks apply ([feature contract](..\u002F..\u002F..\u002Fpackages\u002Freeval\u002Ftest\u002Ffeatures\u002FREADME.md)) |\n| 6 | Plan case under `test\u002Fplan\u002F\u003Clang>\u002F` + snapshot |\n| 7 | Row in `test\u002Ffeatures\u002Finventory.ts`, row in `features.test.ts`, then `pnpm features:matrix --write` |\n| 8 | CI: install the SDK toolchain; run conformance (and a gate test like `python-sdk.test.ts`) |\n| 9 | User docs on [docs.page](https:\u002F\u002Fuse.docs.page) when the language is product-ready (optional for adapter-only PRs) |\n\n### Python reference map\n\n| Piece | Location |\n|---|---|\n| Declare API | `packages\u002Freeval-python\u002Fsrc\u002Freeval_python\u002Fdeclare.py` |\n| Runner + collect | `packages\u002Freeval-python\u002Fsrc\u002Freeval_python\u002Frunner.py` |\n| Attempt `c.*` over the socket | `packages\u002Freeval-python\u002Fsrc\u002Freeval_python\u002Fcontext.py` |\n| uv project + project dep | `packages\u002Freeval\u002Ftest\u002Ffeatures\u002Fpython-sdk\u002Fhello\u002Fpyproject.toml` (`tomli` import in `lands.eval.py`) |\n| Declare goldens | `packages\u002Freeval-python\u002Ftests\u002Ftest_conformance_declare.py` |\n| `reeval` launcher | `packages\u002Freeval-python\u002Fsrc\u002Freeval_python\u002Fcli.py`, held to `test\u002Fconformance\u002Flauncher\u002F` by `runners\u002Fpython.ts` |\n| Smoke fixture | `packages\u002Freeval\u002Ftest\u002Ffeatures\u002Fpython-sdk\u002Fhello\u002F` (`lands.eval.py`, `canary.eval.py`) |\n| Plan snapshot | `packages\u002Freeval\u002Ftest\u002Fplan\u002Fpython\u002Fhello\u002F` |\n\nReal-tier smoke uses `REEVAL_FIXTURE_HARNESS=cursor`, one short `c.send` turn, and checks that\nsurvive a real agent (see `lands.eval.py` in that fixture).\n\n## Verify on fake, Docker and real tiers\n\nFrom the repo root after `pnpm build`:\n\n```bash\ncd packages\u002Freeval\npnpm test:features    # fake sandbox; Docker legs run when Docker is available\npnpm test:docker      # Docker only; fails if Docker is missing (REEVAL_TEST_REQUIRE_DOCKER=1 in CI)\npnpm test:real        # real Cursor fixtures; needs REEVAL_TEST_REAL=1 and CURSOR_API_KEY\npnpm test:plan        # plan snapshots for new include globs \u002F eval files\nnode --test test\u002Fpython-sdk.test.ts   # Python declare conformance (uv required)\n```\n\nDebug one fixture by hand: `REEVAL_TEST_KEEP=1` on the feature test, then in the temp project\n`reeval run --ui plain`. For Docker: `REEVAL_FIXTURE_SANDBOX=docker`.\n\nFilter to your fixture while iterating:\n\n```bash\npnpm build\ncd packages\u002Freeval\nnode --test --test-name-pattern 'python-sdk\u002Fhello' test\u002Ffeatures.test.ts\n```\n\n## Environment variables\n\nDocumented for users in `docs\u002Freference\u002Fenvironment-variables.mdx`. Remote runners receive:\n\n| Variable | Purpose |\n|---|---|\n| `REEVAL_RUNNER` | `stdio`, set by the engine when it spawns the SDK; a runner started without it says to use `reeval run` |\n| `REEVAL_PROJECT_ROOT` | Project root for eval imports |\n| `REEVAL_PYTHON` \u002F `REEVAL_PYTHON_SDK` | Override Python binary or monorepo SDK path (Python today) |\n\nAdd language-specific overrides in the adapter or `runnerEnv()` when the next SDK needs them.\n\n## Prior art: Dart spike\n\nBefore the generic `language-runner` layer, branch **`ehesp\u002Fexperiment-dart-evals-ca15`**\n(`origin\u002Fehesp\u002Fexperiment-dart-evals-ca15`) proved Dart evals with engine-local hooks and an\nearlier RPC shape. Round 2 notes live on **`ehesp\u002Fexperiment-dart-evals-r2-ca15`**. A Dart adapter\non main should:\n\n- Reuse `remote.ts` \u002F `protocol.ts` (attempt protocol **v2**, not legacy `t.*` attempt RPC).\n- Move SDK code to `sdks\u002Fdart` (or `packages\u002Freeval-dart`) and delete Dart-only engine forks.\n- Re-run declare + context goldens; update expect traffic for v2.\n- Copy the `python-sdk\u002Fhello` fixture pattern for smoke + plan.\n\nRough size versus greenfield: **medium** epic — much smaller than the original spike if transport\nstays generic (register adapter + SDK port + conformance + one fixture).\n","# Add a language runtime to reeval\n\nreeval routes every eval file through a **`LanguageAdapter`**. TypeScript is adapter #1\n(in-process jiti). Python is adapter #2 (out-of-process runner over stdio). The next\nlanguage registers another adapter and ships an SDK package; the engine, plan and attempt\nlifecycle stay shared.\n\n**Rules (non-negotiable):**\n\n- **SDKs are language-native; the wire format is never the public API.** Python evals import\n  `evaluate` and `expect` from `reeval_python`, use snake_case (`c.read_file`, `assert result.ok`,\n  typed `ExecResult` \u002F `Turn` \u002F `Verdict`), and snake_case options mapped to camelCase on the wire\n  internally, at any depth, from the generated key tables (`CAMEL_KEYS`, and `RECORD_FIELDS`,\n  whose keys are the eval's own and keep their spelling). Plain `assert`s in an eval file are\n  checks in the record: the SDK rewrites them at import, as pytest does, and sends a protocol\n  `record` call named by the assert's test as written. A pass is sent at once; a failure only if\n  its `AssertionError` escapes the body, so a failure the body catches isn't a failed check. The\n  message is the failure's reason. Use `expect(…).to_succeed()` and the other matchers for\n  reeval-specific checks.\n  Follow the language's own sync and async idioms rather than TypeScript's promises: in Python a\n  `def` body runs on a worker thread with a blocking context (`c.exec` returns its result) and\n  `reeval_python.expect`, and an `async def` body gets coroutines and `reeval_python.aio.expect`,\n  whose typed matchers return coroutines so the type checker reports a missing `await`. A poll\n  takes a function that reads or runs something (`expect.poll(lambda: c.read_file(p))`), which the\n  SDK calls once to learn the subject for reeval to re-read.\n- **TypeScript stays in-process.** Never send `.eval.ts` through the runner transport; records,\n  stacks and matcher behavior must stay unchanged.\n- **No per-language branches in the engine.** The worker calls `loadEvalModule()` only; do not\n  fork plan\u002Fmatrix logic or special-case languages in `engine\u002Fworker.ts`.\n- **Update goldens in the same PR** when declaration or attempt-protocol shapes change\n  (`test\u002Fconformance\u002F`, plan snapshots, SDK mirrors).\n\n## How languages plug together\n\n```mermaid\nflowchart TD\n  CLI[\"reeval run\"] --> Disc[\"File discovery\u003Cbr\u002F>include globs from every adapter\"]\n  Disc --> Worker[\"Engine worker\u003Cbr\u002F>loadEvalModule()\"]\n  Worker --> Pick{\"adapterForFile()\u003Cbr\u002F>by extension\"}\n\n  Pick -->|\".eval.ts\"| TS[\"TypeScript adapter\u003Cbr\u002F>remote: false\"]\n  TS --> Jiti[\"jiti import in the worker\u003Cbr\u002F>evaluate \u002F group register directly\"]\n\n  Pick -->|\".eval.py\"| Py[\"Python adapter\u003Cbr\u002F>remote: true\"]\n  Pick -.->|\".eval.dart (next)\"| Dart[\"Dart adapter\u003Cbr\u002F>remote: true\"]\n  Py --> Remote[\"remote.ts\u003Cbr\u002F>spawn runnerCommand()\"]\n  Dart -.-> Remote\n  Remote \u003C-->|\"stdin\u002Fstdout\u003Cbr\u002F>protocol v2 NDJSON\"| SDK[\"Language SDK runner\u003Cbr\u002F>reeval_python \u002F sdks\u002Fdart\"]\n  SDK -->|\"collect → declared tree\"| Declare[\"declareTree()\"]\n  SDK \u003C-->|\"start · {id, call, key} · replies · done\"| Host[\"attempt-host.ts\"]\n\n  Jiti --> Plan[\"Shared plan and matrix\u003Cbr\u002F>(one code path)\"]\n  Declare --> Plan\n  Plan --> Attempt[\"Attempt lifecycle\u003Cbr\u002F>sandbox · harness · checks · judge · record\"]\n  Jiti -->|\"c.send \u002F c.exec \u002F expect\"| Attempt\n  Host -->|\"same AttemptContext + match.ts\"| Attempt\n\n  Conf[\"Conformance goldens\u003Cbr\u002F>declare\u002F* · context\u002F*.ndjson\"] -. \"every SDK must pass\" .-> SDK\n```\n\n## The adapter interface\n\nDefined in `packages\u002Freeval\u002Fsrc\u002Flanguage-runner\u002Fadapter.ts`:\n\n| Type \u002F field | Purpose |\n|---|---|\n| `LanguageAdapter` | `InProcessAdapter \\| RemoteAdapter` — discriminated on `remote` |\n| `InProcessAdapter` | `remote: false`; no `runnerCommand` (TypeScript) |\n| `RemoteAdapter` | `remote: true`; required `runnerCommand(root)` (Python) |\n| `id` | Stable name (`typescript`, `python`, …) |\n| `extensions` | Eval file suffixes (e.g. `.eval.ts`, `.eval.py`) |\n| `includeGlobs` | Default discovery patterns merged into config `include` |\n| `load(file, root)` | Worker **collect**: register evals via `evaluate` \u002F `group` (TS) or remote `declareTree` |\n| `runnerCommand(root)` | **Remote only:** spawn the SDK (`resolvePythonRunnerCommand` in `python-runner.ts`: `uv run … python -m reeval_python`, `.venv\u002Fbin\u002Fpython`, or `python3`) |\n\nEntry point: `loadEvalModule()` in `language-runner\u002Fload.ts` →\n`adapterForFile(file).load(...)`.\n\nRegister new adapters in `LANGUAGE_ADAPTERS`. Merge their `includeGlobs` via\n`defaultIncludeGlobs()` (config default `include`). For Python-only env helpers today, see\n`runnerEnv()` in the same file; add analogous SDK path overrides when the next language needs them.\n\n## Out-of-process transport (remote adapters only)\n\nGeneric code lives under `packages\u002Freeval\u002Fsrc\u002Flanguage-runner\u002F` (ported from the Dart spike;\nsee [Prior art](#prior-art-dart-spike) below):\n\n| Module | Role |\n|---|---|\n| `protocol.ts` | `RUNNER_PROTOCOL = 3`. Session messages use `t` (`hello`, `collect`, `declared`, `log`). Attempt traffic uses shapes from `src\u002Fcontract\u002Fattempt.ts` (`start`, `abort`, `done`, `{id, call}`, replies), each with the `key` reeval gave the body in its `start` — no `t` on attempt lines. `key` is unique per started body; `attempt.id` isn't (two evals on one cell share it), so never multiplex on it. |\n| `transport.ts` | Spawns the runner; one JSON message a line on its stdin (to it) and stdout (from it). A stdout line that isn't a message is shown on stderr; one that starts with `{` but isn't JSON (a bare `NaN`) ends the session with an error |\n| `attempt-host.ts` | Maps protocol ops to real `AttemptContext` (`expect` → `match.ts`) |\n| `remote.ts` | `collectLanguageFile`: collect tree, `declareTree`, run remote bodies |\n\nSDK runner responsibilities:\n\n1. Keep stdin and stdout for messages only: move fd 0 and fd 1 aside (non-inheritable copies the\n   runner alone reads and writes), point fd 1 at stderr and fd 0 at `\u002Fdev\u002Fnull`, so neither a\n   child process nor the body's own input can write into a message or read one. A forked child\n   shares those copies but not the runner's lock: send its output to stderr. reeval takes a\n   stdout line as a message only when it has a message's shape (`isFromRunner`), so print\n   nothing else there that could pass for one. Write strict JSON: a value with NaN or Infinity\n   in it fails the eval's call that passed it (Python's `allow_nan=False`), since reeval ends the\n   session on a line that starts with `{` but doesn't parse. Send\n   `{ t: 'hello', protocol: 3, sdk, version, runtime }`. reeval sets `REEVAL_RUNNER=stdio` and\n   `REEVAL_RUNNER_PROTOCOL`; a runner started without them, or on another protocol, exits\n   non-zero with a sentence naming both versions instead of saying hello.\n2. On `{ t: 'collect', file }`, import the eval file; reply with `{ t: 'declared', file, tree }`\n   (tree must match `schema\u002Fplan\u002Fdeclaration.schema.json`).\n3. On `start`, run the body async; each `c.*` becomes `{ id, call, key }`; read replies\n   (including `expect` assertion records); send `{ type: 'done', key, error? }`.\n4. On `{ type: 'abort', key }`, reeval has already settled the attempt: fail the body's calls in\n   flight and every later one at once, without sending them, and stop the body where the\n   language can. A body that keeps running must not reach reeval (it answers any call whose key\n   it no longer knows with an `AbortError`).\n5. Route a body's prints as `{ t: 'log', key, stream, text }`, one line each, by the language's\n   async-local context (`contextvars` in Python), so concurrent bodies' output stays apart.\n6. Send the language's own regular expressions as `{ matchedBy, answers }` (`matchedBy` is how\n   the language writes the pattern, e.g. Python's `repr`), never translated to JavaScript.\n   reeval runs the matcher and, when it tests a string `answers` lacks, replies\n   `{ ok: true, op: 'expect', untested: { [matchedBy]: strings } }` and records nothing: match\n   them in the language, off the thread that reads reeval's messages, add them to `answers` and\n   make the same call again. Stop after a few rounds (Python stops at 5): a subject that\n   changes on every read never runs out of new strings. reeval refuses `poll` with such an\n   argument. `{ regexp, flags }` is for a language whose patterns are JavaScript's.\n\nDeclaration tree JSON is validated by the same contract TypeScript uses (`declareTree` in the worker).\n\n## Conformance contract (every SDK)\n\nGoldens live in `packages\u002Freeval\u002Ftest\u002Fconformance\u002F` ([README](..\u002F..\u002F..\u002Fpackages\u002Freeval\u002Ftest\u002Fconformance\u002FREADME.md)).\nTypeScript holds them to the real code in `conformance.test.ts`. Each SDK mirrors the suite in its\nown test runner.\n\n1. **`test\u002Fconformance\u002Fdeclare\u002F\u003Ccase>\u002F`** — `expected.json` equals the tree the SDK records\n   (Python: `packages\u002Freeval-python\u002Ftests\u002Ftest_conformance_declare.py`).\n2. **`test\u002Fconformance\u002Fcontext\u002F\u003Ccase>.ndjson`** — port of `conformance\u002Frunner.ts`: replay each\n   `reeval` line, run a tiny eval body that emits the golden `runner` lines, match the `record` line.\n3. **Repo gate** — `packages\u002Freeval\u002Ftest\u002Fpython-sdk.test.ts` runs `uv sync` + `uv run pytest` when\n   `uv` is present; add a sibling gate per language.\n4. **`test\u002Fconformance\u002Flauncher\u002F`** — the SDK's `reeval` command, which downloads, checks, caches\n   and runs the binary, against a fake release server. Add a runner module in its `runners\u002F`\n   (Python's `runners\u002Fpython.ts` is the reference) and a row in `ci.yml`'s `launchers` matrix; see\n   its [README](..\u002F..\u002F..\u002Fpackages\u002Freeval\u002Ftest\u002Fconformance\u002Flauncher\u002FREADME.md).\n\nWhen TypeScript changes declaration or protocol behavior, run\n`REEVAL_UPDATE_SNAPSHOTS=1` on `conformance.test.ts`, review the diff, and update every SDK mirror\nin the **same PR**. Do not duplicate the full `test\u002Ffeatures\u002F` corpus per language — one **smoke\nfixture** per adapter plus declare\u002Fcontext conformance is enough.\n\n## Checklist: add a new language\n\nUse **Python** as the worked reference (`packages\u002Freeval-python\u002F`, feature fixture\n`packages\u002Freeval\u002Ftest\u002Ffeatures\u002Fpython-sdk\u002Fhello\u002F`).\n\n| Step | Work |\n|---|---|\n| 1 | SDK under `packages\u002Freeval-\u003Clang>\u002F` or `sdks\u002F\u003Clang>\u002F`: declare API, attempt context, runner entrypoint |\n| 2 | Register adapter in `language-runner\u002Fadapter.ts` (`extensions`, `includeGlobs`, `remote: true`, `runnerCommand`) |\n| 3 | Declare conformance: mirror each `test\u002Fconformance\u002Fdeclare\u002F\u003Ccase>\u002F` |\n| 4 | Context conformance: NDJSON scripts through the SDK runner |\n| 5 | One feature fixture (`\u003Clang>-sdk\u002Fhello`: `lands` + `canary`) on **fake**; add **docker** \u002F **real** when sandbox or Cursor checks apply ([feature contract](..\u002F..\u002F..\u002Fpackages\u002Freeval\u002Ftest\u002Ffeatures\u002FREADME.md)) |\n| 6 | Plan case under `test\u002Fplan\u002F\u003Clang>\u002F` + snapshot |\n| 7 | Row in `test\u002Ffeatures\u002Finventory.ts`, row in `features.test.ts`, then `pnpm features:matrix --write` |\n| 8 | CI: install the SDK toolchain; run conformance (and a gate test like `python-sdk.test.ts`) |\n| 9 | User docs on [docs.page](https:\u002F\u002Fuse.docs.page) when the language is product-ready (optional for adapter-only PRs) |\n\n### Python reference map\n\n| Piece | Location |\n|---|---|\n| Declare API | `packages\u002Freeval-python\u002Fsrc\u002Freeval_python\u002Fdeclare.py` |\n| Runner + collect | `packages\u002Freeval-python\u002Fsrc\u002Freeval_python\u002Frunner.py` |\n| Attempt `c.*` over the socket | `packages\u002Freeval-python\u002Fsrc\u002Freeval_python\u002Fcontext.py` |\n| uv project + project dep | `packages\u002Freeval\u002Ftest\u002Ffeatures\u002Fpython-sdk\u002Fhello\u002Fpyproject.toml` (`tomli` import in `lands.eval.py`) |\n| Declare goldens | `packages\u002Freeval-python\u002Ftests\u002Ftest_conformance_declare.py` |\n| `reeval` launcher | `packages\u002Freeval-python\u002Fsrc\u002Freeval_python\u002Fcli.py`, held to `test\u002Fconformance\u002Flauncher\u002F` by `runners\u002Fpython.ts` |\n| Smoke fixture | `packages\u002Freeval\u002Ftest\u002Ffeatures\u002Fpython-sdk\u002Fhello\u002F` (`lands.eval.py`, `canary.eval.py`) |\n| Plan snapshot | `packages\u002Freeval\u002Ftest\u002Fplan\u002Fpython\u002Fhello\u002F` |\n\nReal-tier smoke uses `REEVAL_FIXTURE_HARNESS=cursor`, one short `c.send` turn, and checks that\nsurvive a real agent (see `lands.eval.py` in that fixture).\n\n## Verify on fake, Docker and real tiers\n\nFrom the repo root after `pnpm build`:\n\n```bash\ncd packages\u002Freeval\npnpm test:features    # fake sandbox; Docker legs run when Docker is available\npnpm test:docker      # Docker only; fails if Docker is missing (REEVAL_TEST_REQUIRE_DOCKER=1 in CI)\npnpm test:real        # real Cursor fixtures; needs REEVAL_TEST_REAL=1 and CURSOR_API_KEY\npnpm test:plan        # plan snapshots for new include globs \u002F eval files\nnode --test test\u002Fpython-sdk.test.ts   # Python declare conformance (uv required)\n```\n\nDebug one fixture by hand: `REEVAL_TEST_KEEP=1` on the feature test, then in the temp project\n`reeval run --ui plain`. For Docker: `REEVAL_FIXTURE_SANDBOX=docker`.\n\nFilter to your fixture while iterating:\n\n```bash\npnpm build\ncd packages\u002Freeval\nnode --test --test-name-pattern 'python-sdk\u002Fhello' test\u002Ffeatures.test.ts\n```\n\n## Environment variables\n\nDocumented for users in `docs\u002Freference\u002Fenvironment-variables.mdx`. Remote runners receive:\n\n| Variable | Purpose |\n|---|---|\n| `REEVAL_RUNNER` | `stdio`, set by the engine when it spawns the SDK; a runner started without it says to use `reeval run` |\n| `REEVAL_PROJECT_ROOT` | Project root for eval imports |\n| `REEVAL_PYTHON` \u002F `REEVAL_PYTHON_SDK` | Override Python binary or monorepo SDK path (Python today) |\n\nAdd language-specific overrides in the adapter or `runnerEnv()` when the next SDK needs them.\n\n## Prior art: Dart spike\n\nBefore the generic `language-runner` layer, branch **`ehesp\u002Fexperiment-dart-evals-ca15`**\n(`origin\u002Fehesp\u002Fexperiment-dart-evals-ca15`) proved Dart evals with engine-local hooks and an\nearlier RPC shape. Round 2 notes live on **`ehesp\u002Fexperiment-dart-evals-r2-ca15`**. A Dart adapter\non main should:\n\n- Reuse `remote.ts` \u002F `protocol.ts` (attempt protocol **v2**, not legacy `t.*` attempt RPC).\n- Move SDK code to `sdks\u002Fdart` (or `packages\u002Freeval-dart`) and delete Dart-only engine forks.\n- Re-run declare + context goldens; update expect traffic for v2.\n- Copy the `python-sdk\u002Fhello` fixture pattern for smoke + plan.\n\nRough size versus greenfield: **medium** epic — much smaller than the original spike if transport\nstays generic (register adapter + SDK port + conformance + one fixture).\n",{"name":5,"description":7},"main","6fb66482952dcf7c440a6c82595cf359dbb7f6ed",".agents\u002Fskills\u002Fadd-a-language",0,"https:\u002F\u002Fgithub.com\u002Freeval-ai\u002Freeval","https:\u002F\u002Fdocs.reeval.ai","https:\u002F\u002Fgithub.com\u002Freeval-ai","2026-11-15 06:04:49",{"source":8,"skillName":5,"commands":33,"prompt":43,"zipAvailable":44},[34,37,40],{"tool":35,"command":36},"npx","npx skills add reeval-ai\u002Freeval --skill add-a-language",{"tool":38,"command":39},"bunx","bunx skills add reeval-ai\u002Freeval --skill add-a-language",{"tool":41,"command":42},"pnpm","pnpm dlx skills add reeval-ai\u002Freeval --skill add-a-language","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Freeval-ai\u002Freeval\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fadd-a-language\u002FSKILL.md",true,[],[47,54,61,68,75,82],{"skillNo":48,"name":49,"nameZh":6,"description":50,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":51,"categories":52,"keywords":53,"publishedAt":19},"01M7DD63XGPTQAZZ3FHTK32HM3","setup","Read this first, before the reeval skill, whenever you're asked to set up, install, add, try or get started with reeval (the eval runner for coding agents), in a project or an empty directory, including \"set up reeval here\" and \"add evals\". It detects what's set up, asks what to evaluate, installs reeval, writes one to three small evals that show its value (a skill with and without, when the project has skills), runs `reeval doctor` for keys and Docker, and explains the results.","https:\u002F\u002Fgithub.com\u002Freeval-ai\u002Freeval\u002Fblob\u002Fmain\u002Fskills\u002Fsetup\u002FSKILL.md",[],[],{"skillNo":55,"name":56,"nameZh":6,"description":57,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":58,"categories":59,"keywords":60,"publishedAt":19},"01M7DD5X2NMVWR1TTKSYM24FBZ","reeval","How to write, run and debug evals with reeval, the eval runner for coding agents (npm package reeval; CLI `reeval`, alias `re`). Use whenever a task mentions reeval, reeval.config.ts, *.eval.ts files, `reeval run`, evals for a coding agent, comparing skills, MCP servers or docs, or lift. Not for changing reeval's own source: contributors follow the repository's AGENTS.md.","https:\u002F\u002Fgithub.com\u002Freeval-ai\u002Freeval\u002Fblob\u002Fmain\u002Fskills\u002Freeval\u002FSKILL.md",[],[],{"skillNo":62,"name":63,"nameZh":6,"description":64,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":65,"categories":66,"keywords":67,"publishedAt":19},"01M7DD5SATZ1PJ799YFKHW92GF","eval-rubric","The rubric reeval holds evals to, one section per remark kind. Load it when writing or reviewing a reeval eval's name, prompts, judge questions or compare, or when a reeval run prints a Remarks block.","https:\u002F\u002Fgithub.com\u002Freeval-ai\u002Freeval\u002Fblob\u002Fmain\u002Fskills\u002Feval-rubric\u002FSKILL.md",[],[],{"skillNo":69,"name":70,"nameZh":6,"description":71,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":72,"categories":73,"keywords":74,"publishedAt":19},"01M7DD5NQ68B0V41YP6KVM0JBB","house-greeting","The house style for greetings in this organization. Use when writing any greeting function, message or text.","https:\u002F\u002Fgithub.com\u002Freeval-ai\u002Freeval\u002Fblob\u002Fmain\u002Fpackages\u002Freeval\u002Ftest\u002Freal-agents\u002Fskills\u002Fhouse-greeting\u002FSKILL.md",[],[],{"skillNo":76,"name":77,"nameZh":6,"description":78,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":79,"categories":80,"keywords":81,"publishedAt":19},"01M7DD5MR0VM7CJ1D79XA4VKJS","greet","Greets people.","https:\u002F\u002Fgithub.com\u002Freeval-ai\u002Freeval\u002Fblob\u002Fmain\u002Fpackages\u002Freeval\u002Ftest\u002Fplan\u002Fyaml-paths\u002Fproject\u002Fskills\u002Fgreet\u002FSKILL.md",[],[],{"skillNo":83,"name":84,"nameZh":6,"description":85,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":86,"categories":87,"keywords":88,"publishedAt":19},"01M7DD5KGCB8MA5ATWSJDDM0SV","lint","The project's own lint skill.","https:\u002F\u002Fgithub.com\u002Freeval-ai\u002Freeval\u002Fblob\u002Fmain\u002Fpackages\u002Freeval\u002Ftest\u002Fplan\u002Fplugins\u002Fskills\u002Flint\u002FSKILL.md",[],[]]