Status, 11 October 2026: accepted by Dmitriy Zhuk and Yevhen Kariakin; not implemented. Proposed on 8 October 2026 in a brainstorming session with Yevhen Kariakin. Nothing on this page runs yet: the API, the MCP tools and the OpenCart 3 module still speak the Module Protocol 1 operations until iteration 6 in PLAN.md lands. The reference page is Operation shape.
004 — Resources, verbs and intent tools
The shape of every operation is fixed once, in three layers, so that a new shop platform is a new driver and nothing else changes. A platform driver (the module in the shop, or a connector on the Store Deputy side for a hosted platform such as Shopify) exposes each resource through at most four verbs: search, get, list and the conditional write apply. The agent sees narrow tools named after an intent (price_change_propose), never a resource or a field. One change engine in the Store Deputy API turns an intent into a plan, collects the owner's approval, dispatches apply and reconciles the result.
Context
The scenario matrix of 8 October 2026 lists 125 scenarios and names 97 distinct module operations, almost every one used once, with twenty-two different verbs. Dmitriy's JSON evolution proposal and Module Protocol 1 agree on one endpoint, typed JSON and a platform-neutral model. After the merge of 8 October, the scenario, example and approval pages already use the Protocol 1 envelope and keep the operation ledger in the API; the remaining differences sit in json.md, pilot.schema.json and decision 003: a module-side journal with operations.get, a revision fingerprint instead of an expected value, a filter language executed by the module, RFC 9421 signing and semantic HTTP statuses.
Three facts found while exploring decide the shape:
- A hosted platform has no module. Shopify is an OAuth app and the Admin GraphQL API; there is no PHP endpoint to sign and no table in the merchant's store to hold a journal. A search of the Shopify and WooCommerce documentation found no conditional (compare-and-set) price write on either platform: a driver there must read, compare and write, and say so. Whatever the module protocol is, it is one transport; the abstraction that makes a platform a driver must live in the API.
- The agent has eight rounds. An Agentfy turn is a loop of at most
MAX_ITERATIONS(8) model round-trips (agentfy/api/src/slices/agent/tool/README.md). No scenario can be served by paging through a catalog in the model's head; filtering and arithmetic must happen in the API in one call. - Nothing bounds a tool result. Agentfy reads the
tools/callanswer withresponse.text()and no byte limit (agentfy/api/src/slices/agent/app/data/mcp.gateway.ts:262) and handscontentandstructuredContentto the model as they came (agentfy/api/src/slices/agent/app/domain/mcpTool.ts:189). Store Deputy returns the same JSON twice, as text and asstructuredContent. One neutral product in thecatalog.getshape is 761 bytes; two thousand of them are about 3 MB on the model's input, beyond any context window. Compaction runs between turns, not inside one. Only the Store Deputy MCP can bound a result, so its tools must.
The proposal's own module brief would also stop the pilot: it says to advertise reads only where atomic compare, update and receipt cannot be guaranteed on non-transactional tables, and OpenCart 3's default tables are MyISAM. Protocol 1's split, one conditional statement in the module and reconciliation in the API, is what makes a write on OpenCart 3 honest.
Decision
Three layers, each with one job:
- Driver primitives: resource × four verbs. Every resource of the neutral model (
product,variant,category,manufacturer,order,customer,couponfirst) has at mostsearch,get,listandapply, named<resource>.<verb>.applyis today'sprice.applygeneralized: items of{ id, expected, set }over the resource's allow-listed writable fields,expectedcovering every field inset, independent items, a non-atomic batch, per-item outcomesapplied,conflict,not_found,rejected,failed, and the platform's product-saved event after an applied item. Capabilities are declared per resource and per writable field (product.read,product.list,product.write.price) withconditional: atomic | emulated. The envelope, HMAC signing, "every answer is HTTP 200", error codes and data model of Protocol 1 are unchanged. Creation and deletion are out: creation is not a conditional write and needs its own idempotency rule; deletion gains no authority from the matrix. - Agent tools: narrow and named after an intent. Reads per resource where the agent needs them (
catalog_find_products,catalog_get_products,catalog_query_products), one proposal tool per intent (price_change_propose, laterstatus_change_propose,stock_change_propose), and onechange_status. No tool argument names a resource, a field or an expected value; the intent fixes the field and the API readsexpectedfrom the shop. A proposal accepts either explicit items or aselection(the same filter the query tool takes) with anadjustment(percent, fixed amount, rounding); the API expands the selection and computes the prices. Every read tool returns compact rows limited to 50 by default with atotal, and the full product shape only by explicit ids. - One change engine in the API. The STOR-5 slice (
PriceChange, versions,actionHash,PriceChangeJob) becomesChange,ChangeVersion,ChangeJobwith items{ resource, id, expected, set }. The lifecycle does not change: proposal, version, approval on the site, a job valid 24 hours, dispatch through<resource>.applyin batches ofmaxItemsPerWrite, read-back through<resource>.get, reconciliation, receipt. Each intent tool is a facade over this one service.
Decomposition rule. A scenario maps to a tool or part of one, the tool to a workflow service in the API, the service to N primitive calls. Scenario ids attach to tools and services, never to driver operations.
No compatibility obligation. Yevhen's decision in the session: nothing is deployed and there are no customers, so Protocol 1's operation names and the OpenCart 3 module are rewritten to this shape in the same step that moves the module to the neutral model. No aliases, no deprecation period.
Alternatives considered
- Named intent commands in the module (
catalog.product.status.set,inventory.set, as in the matrix). Precise per-platform semantics, but every new intent changes the contract and every adapter; the module contract grows with the product's ambitions. Rejected: the most expensive path for four platforms. - One universal primitive (
resource.apply { type, items },resource.get { type, ids }). Fewest operations, but one large discriminated schema, weaker contract checks and worse readability; capability gating is per resource and field anyway, so the complexity moves into the schema. Rejected. - Generic "change any field" tool for the agent. More coverage, weaker guarantees: an approval card is understandable only when the intent is known in advance. Rejected; a missing intent is a deliberate, visible gap that costs one facade and one card to add.
- A filter language executed by the module (the proposal's
products.search). Case-sensitive binary matching, signed 15-minute cursors and a 10-second deadline cannot be implemented faithfully on Shopify's search syntax or WooCommerce REST, so conformance drifts per platform, and shared hosting cannot promise the deadline. Rejected for the driver; the query lives in the API (see open questions).
Consequences
- A new platform implements four verbs per resource it supports and declares what it has; MCP tools, approval, ledger and the data model do not change.
- The 97 operations of the matrix collapse to about 15 resources and 4 verbs; audits, duplicate detection, dependency checks, queries and analytics become computations in the API over data read through
listandget. - The OpenCart 3 module must prove
product.applyforpriceand forstatuson both test shops with the event witness: the first evidence that the generalization works and is not a rename. Note, 20 October 2026 (proposed by Yevhen Kariakin, pending the founder's acceptance): OpenCart 3 cannot fire its admin events from the storefront, where the module's endpoint lives. So the witness proves that the module declares the listener in the manifest (product_edit_listener) and that the receipt names it; it does not prove the listener ran.appliedis proven by the read-back, asoperations.mddefines it. Shown only on the local test shops. - The STOR-5 price-change slice is generalized before part 2 (execution) is built, so execution is written once.
- Decision 003's methods (
products.price.set,operations.get, the module journal) are not implemented. The scenario matrix, the approval page, the security findings (nonce store, response binding) and the capability and limit declarations of the proposal are kept.
Scope
In: the shape of driver operations, capabilities, MCP tool families, response limits, the generic change engine, the decomposition rule. Out: where the API gets data for catalog_query_products (mirror or live pages; live pages in the proposed decision 007), the Commerce port and driver registry in the API, creation and deletion, analytics, the shopper agent, the fate of the signing profile and HTTP semantics of the JSON proposal. These are separate decisions, listed below.
Constraints and numbers
| Fact | Where |
|---|---|
| Agent turn: at most 8 model round-trips | agentfy/api/src/slices/agent/tool/README.md, MAX_ITERATIONS |
| MCP result read without a size bound | agentfy/api/src/slices/agent/app/data/mcp.gateway.ts:262 |
| Result handed to the model unchanged | agentfy/api/src/slices/agent/app/domain/mcpTool.ts:189 |
| One neutral product example: 761 bytes | docs/protocol/index.md, catalog.get example |
catalog_list page: at most 100, default 50 | api/src/slices/mcp/server/domain/storeTools.ts:13 |
| Port with one implementation | api/src/slices/store/store/domain/bridge.gateway.ts:21 |
Module dispatch by op, OpenCart SQL inside every class | module/opencart3x/upload/admin/controller/extension/storedeputy/bridge.php:37 |
| Operation ledger | api/src/slices/mcp/policy/mcpOperation.prisma |
| Price-change plan, the seed of the change engine | api/src/slices/operations/priceChange/priceChange.prisma |
| 125 scenarios, 97 operation names, 5 P0 | docs/protocol/scenarios.md |
What this supersedes or must be reconciled with
- Replaces the operation set of Module Protocol 1 (
catalog.*,price.apply) and the five pilot methods of decision 003 with the resource × verb shape, once accepted. The transport, signing, error and data-model sections of Protocol 1 stand. - Keeps the boundaries of decision 002: Agentfy owns the harness, Store Deputy owns the MCP, approvals and the ledger, the driver owns platform semantics.
contracts/module/protocol.yaml,contracts/mcp/tools.yamlandcontracts/module-json/change only after this record is accepted, with fixtures in the same change andbun run contracts:checkpassing.
Open questions
| Question | Owner |
|---|---|
| Accepted on 11 October 2026 over decision 003, which is now superseded. Closed. | Dmitriy Zhuk |
Where catalog_query_products reads from: a catalog mirror in the API fed by product.list and platform webhooks, or live pages at query time. With 8 rounds and bounded results the mirror is the likely answer; needs its own design (reading strategy). Decided in decision 006, its withdrawal proposed by decision 007 (live scan, proposed). | yevhen.kariakin |
| The Commerce port and driver registry in the API, and whether WooCommerce starts as a plugin on the shared PHP core or as a REST driver without a plugin. | yevhen.kariakin |
Idempotency rule for create operations. | yevhen.kariakin, Artem Belikov |
Store Deputy returns every tool result twice (text and structuredContent) because Agentfy does not read isError; halving it needs an Agentfy change. | Agentfy team |
| Whether the signing profile (RFC 9421) and semantic HTTP statuses of the JSON proposal are taken up in a later protocol version. | Dmitriy Zhuk, yevhen.kariakin |