Skip to content

feat: declare the runner contract once - #2146

Merged
neuromechanist merged 4 commits into
feature/portable-compute-epicfrom
feature/pc-dm04-runner-contract
Nov 13, 2026
Merged

neuromechanist merged 4 commits into
feature/portable-compute-epicfrom
feature/pc-dm04-runner-contract

Conversation

@neuromechanist

@neuromechanist neuromechanist commented Nov 13, 2026 •

Copy link
Copy Markdown
Contributor

Declares protocol nemar.runner.v1 once in shared/: the executor, accounting, backend and runner refusal words and runner_lost (the thirteenth platform failure code, four details) in shared/compute-state.ts; the protocol words, prefixes, header, numbers and the ten request and response zod shapes in shared/contract/compute-runner.ts, with the byte-shared compute-runner.schema.json.

Requests are strict, responses are open (a claim answer holds at most 32 jobs); test/compute-runner-contract.unit.test.ts pins every word and number, reads the schema back against the constants, and judges a generated corpus of 198 instances by Ajv and zod, which agree on every one.

Gates run: bun run typecheck and bun run lint clean; bunx biome check on the three named files clean; bun test test/compute-runner-contract.unit.test.ts 40 pass; grep -rl "compute-state" test backend/test | xargs bun test 1498 pass, 0 fail; test/contract-schemas.test.ts pass (compute-runner.ts added to its strict-by-design list, one line).
Each test group fails under a one-line mutation (22 mutations run, all killed, reverted).

Not run, would check: the full bun test, because it is the epic gate.

Card DM-04.

Review round 1 fixes (head d133cfd):
The new exemption of compute-runner.ts in test/contract-schemas.test.ts (a deviation from the card's Scope, needed because its request schemas are strict) now keeps the per-schema protection: the five request names are added to the strict-name set the import guard looks for (pinned length 10 to 15), with probes and a test that each is strict by behavior and that no runner response is in the set.
A probe file in shared/contract that imported RunnerClaimRequestSchema made the guard fail, and was removed.
The docblock and test name there now list compute-runner.ts and say why it is exempt.
The claim response cannot enforce jobs.length <= free_slots (a cross-field rule), so the runner must check it; this is now in the compute-runner.ts docblock.
A claimed job's cores, gpus and memory_mb bounds (1-256, 0-8, 1-16777216) are the registration bounds reused; this is an inference, the card does not state them.
min_runner_version stays a strict semver as the card states. Patch note for DM-07: the Worker must answer a version of at most 32 characters.
backend/src/services/compute-pipeline.ts builds NON_DATASET_FAILURE_WORDS from PLATFORM_FAILURE_CODES, so runner_lost stops counting against a dataset's cooldown (intended; no backend test pins it; DM-05 and DM-06 authors should know).
Gates rerun: bun run typecheck and bun run lint clean; biome check on the four touched files clean; the compute-state importers 1499 pass, 0 fail; the runner and contract-schemas tests 104 pass, 0 fail.

@github-actions

github-actions Bot commented Nov 13, 2026 •

Copy link
Copy Markdown

📦 Package Preview

Your package is ready to test!

bun install -g nemar-cli@PR2146

Version: 0.10.34-PR2146.d133cfd
Commit: d133cfd


🤖 Updated on each push.

@neuromechanist
neuromechanist merged commit 6f5f87d into feature/portable-compute-epic Nov 13, 2026
1 check passed
@neuromechanist
neuromechanist deleted the feature/pc-dm04-runner-contract branch November 13, 2026 20:33

This branch was previously deployed

1 inactive deployment
npm — d133cfd8 Deployed Nov 13, 2026 by neuromechanist via publish #4408
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant