# Restep implementation and verification coverage

Restep defines verifiable conventions for HTTP APIs that share clients and tools.
This matrix describes draft 6 (`"restep": "1.0-draft.6"`, in English and Spanish), not a certification of production deployments.
The reference, `restep-check` 0.9.1, the server library 0.2.0, the Rails implementation and the other tools follow draft 6. The full `tools/verify.mjs` run over all of them together passed on 2026-11-23 (one skip: the `httpx` case of `restep-py`).
Passing `restep-check` verifies the exercised observations, not every MUST in the specification.

| Requirement | Implementation | Verification | Limits |
|---|---|---|---|
| core: representations, errors, discovery, singletons, client-chosen ids (§3–5) | Reference and server library; independent Rails and PostgreSQL implementation (`tools/restep-rails/`, written from the text only) | `restep-check` 0.9.1 against the reference with `--writes`: 0 failures, 532 passed, 50 skipped; read only, 311 passed, 19 skipped. Rails (core, query, writes and cache, one singleton): 55 own tests, 0 failures; `restep-check` 0.7.0: 223 passed, 1 failed, 1 warning, 17 skipped (`tools/restep-rails/resultado-borrador-6.txt`) | The one Rails failure (`discovery.collations` on an `enum` sort key) came from the checker and the text, and is being fixed. Rails does not declare `id_from`. Its ambiguity logs: `tools/restep-rails/AMBIGUEDADES.md` (draft 6 section) and `tools/AMBIGUEDADES-RAILS-DESTINO.md` |
| query: filters, named filters, sorting, fields, cursors, collations (§6) | Reference and server library; Rails | Checker mutations and server tests | Database adapters must implement comparison and pagination semantics themselves; the checker cannot know which items a named filter returns, only that it narrows, combines with AND and fails loudly |
| writes: retry and replay (§7.1) | Reference and server library; Rails; PostgreSQL adapter `restep-server/pg.mjs` (effect, reservation and response in one transaction) | Checker, `recovery.test.mjs` (simulated) and `pg.test.mjs` against a real PostgreSQL 14: two server processes, SIGKILL before/after COMMIT, lost COMMIT acknowledgement, terminated backend, PostgreSQL crash and WAL recovery | In-memory stores do not survive restart. Only the bundled PostgreSQL adapter is tested; effects outside the database, OS/disk crashes and other databases are not certified. `pg.test.mjs` is skipped, visibly, without PostgreSQL binaries |
| writes: optimistic concurrency (§7.2) | Reference and server library; PostgreSQL adapter locks the item (`FOR UPDATE`) inside the write transaction | Checker, server tests and `pg.test.mjs` (concurrent PATCH/DELETE with the same version from two processes) | Without `createTransaction` and a locking adapter, the library's mutex only covers one process |
| cache: Cache-Control, validators, 304, cache groups (§8, a profile of its own since draft 6) | Reference, server library and Rails, which announce `cache` | `restep-check` `cache` checks and server tests | CDN invalidation and distributed cache behaviour are not certified |
| inherit: inherited values (§11.6, an extension since draft 6, experimental) | Reference only (`products` and `categories`); the server library does not implement it | Checker and the reference's mutations | Hidden sources and propagation to sync and cache groups are not checked |
| Server library (`tools/restep-server/`, draft 6) | Announces `"1.0-draft.6"` with `core`, `query`, `writes`, `cache`, and `actions` (only `new`) and `oauth` when configured. Implements `415`/charset, `_etag` on every item body, the query in "the same request", `idempotency.anonymous`, `id_from` with `taken`, `collations` (declaration; `"server"` order from the adapter), singletons, the name grammar at start-up, decoded path segments, the `Origin` check for browser credentials | `test.mjs` (35: 0 failures from `restep-check` 0.7.0 `--writes`, with and without oauth, plus handler tests for each draft 6 rule), `recovery.test.mjs`, `pg.test.mjs`; its discovery document validates against `discovery.json` | Not implemented, and not announced: `relations` (include, subcollections), `sync`, `inherit`, `batch`, `filter-expr`, `query-method`, retirement (`deprecations`), read-only fields other than `id`, `406`. Delegated to the adapter: unreadable fields in filters, sort and `total`, `"server"` collation, remembering deleted `id`s, per-field `403` and state `409`. `pg.mjs` does not support client-chosen `id`s |
| relations: expansion, subcollection `href` (§9) | Reference (to-one, to-many, `href`, polymorphic, `include_depth` 2, dotted `fields` and filters) and mock | `restep-check` 0.9.1 (`relations.*`, `core.subcollection.*`, each with a mutation), mock and client suites | The server library and Rails do not implement this profile. Not checked: a related item the principal cannot see (needs two principals), undeclared relationships, subcollections of subcollections |
| sync: replicas and visibility (§10, experimental) | Experimental client and separate sync fixture | `restep-sync/test.mjs` | The reference and the server library lack sync and checker coverage is not complete; IndexedDB and production permission changes are not certified |
| oauth: discovery (§11.5) | Reference and server library | Checker including unauthenticated requests | Not an OAuth security audit; insufficient-scope coverage requires suitable credentials |
| actions (§11.1) | Reference (item and collection actions, `GET` and `POST`, `input`, idempotent and not); mock (simulated, no effect); server `new` action | `restep-check` 0.9.1 (`actions.*`, each with a mutation), tool-specific suites | Not checked: `409` for the item's state, `403`/`404` per principal, running `POST` collection actions on data the checker did not create, the key without credentials under `anonymous: false` |
| batch, filter-expr, query-method (§11.2–4, experimental) | Specification | No complete executable conformance coverage | Experimental contract; not production-certified by the checker |
| Credential isolation (§4.3) | MCP HTTP client | `restep-mcp/test.mjs` with injected fetch | Covers outgoing credentials and redirects, not a complete MCP transport audit |
| JSON Schemas and examples | `discovery.json` and `problem.json` (draft 6) | `tools/spec-examples.test.mjs`: every JSON example in `/1/spec.md` parses, and its discovery documents, discovery fragments and errors validate | Run on the English text, which prevails. Rules that relate one member to another are left to the checker, which also runs those that need no request on a file (`restep-check --schema discovery`, reported apart from the schema) |
| Generated documentation | HTML sources, Markdown, tool pages, explorer assets | `tools/verify.mjs` | The Spanish translation has the same structure as the English text, but no person has reviewed their equivalence yet |
| TypeScript client | Typed client and generator | Type checking, fake-fetch tests, reference integration | Full run requires Node >=22.18 and installed development dependencies |

## Commands

From the source project's `projects/restep` directory:

```sh
node tools/verify.mjs
node tools/verify.mjs --unit
```

The first runs all tool suites sequentially, including Python and TypeScript. It fails
if local integration servers cannot start. The second is explicitly a smaller, port-free
verification: generated files, the specification's JSON examples against the schemas, server handler tests, recovery, credential isolation,
TypeScript types and selected client tests. The full run also runs the PostgreSQL suite when
PostgreSQL binaries and the `pg` package are available, and lists it as skipped otherwise.
Neither command proves independent interoperability. Browser tests depend on the
explorer suite finding Chrome/Chromium; read its reported skips.
