Status, 11 October 2026: the handoff for a module written against the accepted contract. The contract is accepted (decision 004) and not implemented: no module answers these operations yet, and the API does not send them. This page replaces the Module JSON 1.0 developer brief that stood here until 11 October 2026; that proposal is archived.
Building a module
Owner: Artem Belikov for the PHP platforms. A module is the piece installed in a shop that answers the Store Deputy API over one signed URL. Everything it must do is in two contract files and the pages that explain them; this page says what to read in which order, what the first module must deliver, and how it is proved. Nothing here asks the module to keep a journal, know who is asking, or talk to a language model.
What to read, in order
| File | What it gives you |
|---|---|
contracts/module/operations.schema.json (download) | One self-contained JSON Schema 2020-12: the envelope (Request, ResponseOk, ResponseError), the manifest, the neutral model, and <operation>.params and <operation>.result for every operation. Validate your own payloads with any Draft 2020-12 validator, in PHP too. Under x-rules, the rules every module follows; under x-capabilities, the names you may declare |
contracts/module/operations.examples.json (download) | Every example as a full request and response pair, 35 of them. Ready fixtures for your tests |
contracts/module/protocol.yaml | The transport, HMAC signing in both directions, pairing, connection.pair, connection.revoke, store.describe, the error codes and Pause. These did not change on 11 October; operations.json only references them |
contracts/module/signature-vectors.json with contracts/scripts/vectors.php | Fixed signature inputs and outputs, verified with the current module's Signature class on PHP 7.3 and 8.1. Run them against your implementation first |
contracts/errors.yaml | Every error code and what the agent sees for it |
Prose: Module Protocol 1 for the transport, signing, pairing, Pause, the data model and the OpenCart mapping; Operation shape for the operations, the apply rules, the capabilities and the rules every module follows; the comparison for why this shape and not Module JSON 1.0. Decisions 004 and 007 say why; from the earlier decision 006 one thing touches the module: categoryIds and manufacturerId on every product. The module never sends anything to the API: the catalog.changed hint of 006 was removed on 15 October 2026.
What the first module delivers
- The setup operations as they are:
connection.pair,connection.revoke,store.describe, with the manifest in the new shape: capability names fromoperations.json, every write withconditional, all five limits. product.search,product.get,product.listin the neutral model, includingcategoryIdsandmanufacturerId, with the identifier matching rules: trim and case-fold,%,_and*literal, every match returned and none picked.product.applyonprice: one conditional statement per item where the tables allow it, read-back, the product-saved notification for listening extensions, one outcome per item. Whether a second field (status) is in the first delivery is an open question on the API side; the design asks for it as the proof that the shape generalizes.- The strict envelope: at most
maxBodyBytesread, duplicated keys and unknown fields refused withinvalid_paramsbefore dispatch. - Not in the first module: the
variant.*operations (OpenCart 3 has no variants; the module does not declarevariant.read), and the other resources. The module sends no hints; it only answers requests.
Declare in store.describe only what is built and tested. A module that lacks an operation answers unknown_op; the API then tells the agent the capability is unavailable and does not count the shop as unhealthy.
How it is proved
- Schema. Every answer validates against
operations.schema.json; every request you accept validates too. The examples file is your first fixture set. - Signature vectors.
php contracts/scripts/vectors.phpreproduces every vector. - The conformance suite (
bun run conformance:test --endpoint … --platform opencart; its README iscontracts/conformance/README.md): black-box scenarios over HTTP against your test shop, including the fourteen evidence casesEV-*of the rules. The module is done when the suite reportsadapter conformant: yeson both local OpenCart shops. On 11 October 2026 the suite still checks the removed operations; it is retargeted in the change that follows the contract. - The current module under
module/opencart3x/answers the removed operations in the old OpenCart-shaped fields;bun run shops:uprebuilds the two test shops with it,bun run store:testruns the API's connection scenarios against them. Keep the operation names in one dispatch table so that a rename costs one edit.
What is not decided
- The scope of the first write:
priceonly, orpriceandstatus. Owner: Yevhen Kariakin. - The signing profile stays HMAC with the
X-SD-*headers of Module Protocol 1; RFC 9421 from the Module JSON 1.0 proposal was not taken. Owner: Dmitriy Zhuk. - The split of the PHP module into a shared core and platform adapters (adapter architecture). Owner: Artem Belikov.