{"slug":"oip-spec","title":"OIP (Object Invocation Protocol) Specification","body":"OIP (Object Invocation Protocol) defines the invocation of work objects. OIP specifies message formats for requests and responses. OIP maintains invariants for consistent execution. OIP provides a live conformance test. OIP ensures verifiable execution through receipts.\n\n## OIP Overview\n\nOIP defines a protocol for invoking discrete work objects. A work object performs a specific task. OIP provides a standardized mechanism for interaction with server-side capabilities. OIP ensures transparency and verifiability for every operation. The OIP unit is the work object. The OIP proof is the receipt. The OIP loop is object, invoke, ledger, receipt, replay, repair.\n\n## Protocol Foundations\n\nOIP defines message formats. Every party knows the exact shape of every message. OIP maintains invariants. Rules always hold, regardless of the invoking party. OIP provides a conformance test. The conformance test verifies implementation adherence to OIP rules.\n\n## OIP Invocation and Proof\n\nAn invocation triggers a work object. `POST /api/dispatch {key, body}` invokes an object. `GET /api/dispatch?invoke=KEY&body=...` also invokes an object. Every invocation appends to the ledger. Every invocation returns a receipt. The receipt proves the invocation. The `/api/dispatch?receipt=inv_ID` route retrieves a receipt.\n\n## Run the Conformance Proof\n\nOIP conformance is verifiable. The `GET /api/dispatch?conformance=1&format=markdown` route executes all 14 clauses of this specification. The execution involves real invocations, real receipts, and real denials. The route returns `PASS` or `FAIL` per clause. A `CONFORMANT` verdict establishes OIP as a protocol, comparable to HTTP or MCP (Model Context Protocol). A failing clause identifies the specific non-conformant behavior.\n\n```bash\ncurl 'https://miscsubjects.com/api/dispatch?conformance=1&format=markdown'\n```\n\n## OIP Message Formats\n\n### Invocation Request\n\nAn OIP invocation request specifies the target object and its parameters. The `key` identifies the work object. The `body` provides invocation parameters.\n\n```http\nPOST https://miscsubjects.com/api/dispatch\nContent-Type: application/json\n\n{\n  \"key\": \"NOW\",\n  \"body\": \"\"\n}\n```\n\n```http\nGET https://miscsubjects.com/api/dispatch?invoke=NOW&body=&share=<TOKEN>\n```\n\n### Invocation Receipt\n\nEvery invocation returns an OIP envelope. The envelope contains the result, invocation details, and proof status. The `invocation_id` uniquely identifies the invocation. The `links.receipt` provides the URL for the full receipt. The `proof.ok` status indicates successful execution.\n\n```json\n{\n  \"result\": \"The current time is 2023-10-27T10:00:00Z.\",\n  \"ran\": true,\n  \"invocation\": {\n    \"invocation_id\": \"inv_abc123\",\n    \"object_id\": \"NOW\",\n    \"links\": {\n      \"receipt\": {\n        \"href\": \"https://miscsubjects.com/api/dispatch?receipt=inv_abc123\",\n        \"title\": \"View full invocation receipt\"\n      }\n    }\n  },\n  \"proof\": {\n    \"ok\": true,\n    \"confirm\": {\n      \"href\": \"https://miscsubjects.com/api/dispatch?confirm=inv_abc123\",\n      \"title\": \"Confirm invocation proof\"\n    },\n    \"say_to_user\": \"✓ Done via NOW. Proof: inv_abc123\"\n  }\n}\n```\n\n## End-to-End Example\n\nThis example demonstrates invoking the `NOW` object and retrieving its receipt.\n\n1.  **Invoke the `NOW` object:**\n    ```bash\n    curl -X POST 'https://miscsubjects.com/api/dispatch' \\\n      -H 'Content-Type: application/json' \\\n      -d '{\"key\": \"NOW\", \"body\": \"\"}'\n    ```\n    This command returns an OIP envelope including an `invocation_id`, for example, `inv_def456`.\n\n2.  **Retrieve the receipt:**\n    ```bash\n    curl 'https://miscsubjects.com/api/dispatch?receipt=inv_def456'\n    ```\n    This command returns the full request, response, and execution trace for `inv_def456`.\n\n## Receipt Rule\n\nAn OIP receipt provides an immutable record of an invocation. The receipt includes the full request, the full response, the actor, and the execution trace. The `/api/dispatch?receipt=inv_ID` route retrieves a receipt. A receipt serves as verifiable evidence of an object's execution.\n\n## Conformance Rule\n\nOIP conformance is verifiable. The `GET /api/dispatch?conformance=1` route executes all specification clauses. A `PASS` verdict indicates conformance. A `FAIL` verdict identifies the non-conformant clause. This mechanism provides a live, objective assessment of OIP implementation adherence.\n\n## OIP Security Measures\n\nOIP implements capability scoping. A capability token grants permission for specific object invocations. OIP enforces public documentation. Public documentation requires zero credentials. Object invocation always requires a scoped capability token. This separation ensures secure access control. The `share=<TOKEN>` parameter in `GET` invocations demonstrates token usage. An API (Application Programming Interface) key or CLI (Command Line Interface) token provides the necessary authorization for `POST` invocations.\n\n## OIP Error Handling and Debugging\n\nOIP provides repair lineage. A failed invocation generates a receipt. The receipt includes diagnostic information. A subsequent repair invocation links to the original failed invocation via `replay_of`. OIP implements fail-closed behavior. An unknown object invocation returns `ran:false`. The response includes nearest-key suggestions. This prevents ambiguous success states. Failures are annotated, never deleted, ensuring a complete audit trail.\n\n## OIP and MCP Comparison\n\nOIP provides the invocation mechanism for work objects. MCP (Model Context Protocol) establishes a session between a model and a server. An MCP session exposes tools, resources, and prompts. OIP enables the invocation of these tools and resources within an MCP session. OIP focuses on discrete object execution. MCP focuses on contextual interaction. OIP provides the underlying execution primitive for tools utilized by an MCP agent.\n\n## The 14 Conformance Clauses\n\nC1. **Self-describing manifest:** OIP defines a self-describing manifest. The `GET /api/dispatch` route returns the OIP version and an endpoint map. This mechanism enables API discovery.\nC2. **Object self-description:** OIP specifies object self-description. The `GET /api/dispatch?key=KEY` route returns the object's full contract. This contract defines the object's capabilities and parameters.\nC3. **Plain-language discovery:** OIP supports plain-language discovery. The `GET /api/dispatch?ask=plain words` route returns the best object with a runnable call. This mechanism facilitates human-readable object identification.\nC4. **Invocation envelope:** OIP specifies an invocation envelope. Every call returns an `invocation_id`, a receipt link, and an `ok:true` proof status for successful execution. This provides immediate feedback and traceability.\nC5. **Receipt forensics:** OIP provides receipt forensics. The `GET /api/dispatch?receipt=inv_ID` route returns the full request, full response, and a story line for the invocation. This enables detailed post-hoc analysis.\nC6. **Replay:** OIP supports replay. A `POST {replay:inv_ID}` invocation re-runs the recorded call. The new invocation links to the original via `replay_of`. This mechanism facilitates re-execution and verification.\nC7. **Repair lineage:** OIP provides repair lineage. A failed call is repairable. Both the original and repair receipts link to each other. Failures are annotated, never deleted. This ensures a complete audit trail for problem resolution.\nC8. **Fail closed:** OIP implements fail-closed behavior. Unknown objects return `ran:false` with nearest-key suggestions. The system never returns a `200 OK` status that indicates success for an unknown object. This prevents ambiguous or incorrect execution.\nC9. **Append-only ledger:** OIP maintains an append-only ledger. Every invocation lands in the ledger with its request, response, actor, and trace. This ensures immutability and a complete history of operations.\nC10. **Idempotency:** OIP ensures idempotency. An identical call inside the dedup window returns the original receipt. The system performs no second execution. This prevents redundant operations.\nC11. **Capability scoping:** OIP implements capability scoping. A row-scoped token fires its one permitted object. The system denies access everywhere else. This enforces fine-grained access control.\nC12. **Public documentation plane:** OIP defines a public documentation plane. Documentation requires zero credentials. Actions always require scoped credentials. This separates information access from execution privileges.\nC13. **Clarity recursion:** OIP implements clarity recursion. Models score every article via `/api/articles`. Failures trigger machine revisions. Gaps become new machine-written articles. This ensures continuous documentation improvement.\nC14. **Human/machine duality:** OIP specifies human/machine duality. Every article is one object with two synchronized faces: a human-readable page at `/a/<slug>` and a machine-readable JSON bundle via `/api/articles?slug=<slug>`. This supports diverse consumption methods.\n## Latest clarity reviews (live)\n\nFresh models are sent this article's bundle and asked two separate questions: how clear is the machine JSON, and how clear is the English body. Scores are 0 to 10. The full history is in the append-only ledger.\n\n- 2026-07-03 02:16 · model `gemini/gemini-2.5-flash` · NEEDS WORK · JSON 9/10 · English 8/10 · zero-context human 7/10\n- 2026-07-03 02:15 · model `@cf/meta/llama-3.3-70b-instruct-fp8-fast` · NEEDS WORK · JSON 9/10 · English 8/10 · zero-context human 7/10\n  - gaps named: Detailed MCP comparison; OIP security measures; Error handling and debugging\n\nHow the loop self-corrects: a failing review queues a model revision of this article (a new append-only version). A missing concept named by a reviewer queues a brand-new machine-written article, which then enters the same review cycle.","register":"oip_protocol","tags":["oip","object-invocation-protocol","protocol-specification","machine-native-json","primer"],"style":{"accent":"#16324f","measure":860},"claims":[{"id":"oip-c1","tier":"system","text":"The OIP article layer is generated from live directory rows, so it documents the objects that actually run the reference implementation.","who_claims":"system/oip_articles","source_ids":["oip-s3","oip-s4"]},{"id":"oip-c2","tier":"system","text":"The OIP operating path is caller to directory object to dispatch runner to invocation ledger to receipt.","who_claims":"system/oip_articles","source_ids":["oip-s1"]},{"id":"oip-c3","tier":"system","text":"Every executable capability in the reference implementation is reachable as an OIP object with a human article, a machine document, invocation history, and receipt path.","who_claims":"system/oip_articles","source_ids":["oip-s2","oip-s3"]},{"id":"oip-c4","tier":"system","text":"Tap & Go is the copy primitive: one drop carries credential, protocol, tree, search, execute, and receipt instructions without a separate token-map-bundle assembly step.","who_claims":"system/oip_articles","source_ids":["oip-s2"]},{"id":"oip-c5","tier":"system","text":"OIP receipts are the proof object for actions: they record request, response, actor, links, replay, repair, and lineage.","who_claims":"system/oip_articles","source_ids":["oip-s2","oip-s5"]}],"sources":[{"id":"oip-s1","type":"protocol","title":"BUILD_SPEC object invocation path","url":"https://miscsubjects.com/api/file/docs/BUILD_SPEC.md","summary":"Defines directory rows, dispatch, ledger, and the escalation path for changing the build.","quote":"Run anything: POST https://miscsubjects.com/api/dispatch {key, body}","claim_ids":["oip-c2"],"link_status":"ok","hash":"oipbuildspec0001"},{"id":"oip-s2","type":"protocol","title":"Object Invocation Protocol spec","url":"https://miscsubjects.com/api/file/docs/OIP.md","summary":"Defines OIP surfaces, invariant loop, receipt/replay/repair, and invocation envelopes.","quote":"identify, explain, invoke, ledger, yield","claim_ids":["oip-c3","oip-c4","oip-c5"],"link_status":"ok","hash":"oipspec00000002"},{"id":"oip-s3","type":"protocol","title":"Live OIP capability tree","url":"https://miscsubjects.com/api/dispatch?map=1&format=markdown","summary":"Public recursive capability tree.","quote":"root > shelf > system article > capability article > receipt","claim_ids":["oip-c1","oip-c3"],"link_status":"ok","hash":"oipmap0000000002"},{"id":"oip-s4","type":"protocol","title":"Directory row documentation","url":"https://miscsubjects.com/api/dispatch?key=OIP_TREE&format=markdown","summary":"Capability articles are generated from live rows.","quote":"Machine Contract","claim_ids":["oip-c1"],"link_status":"ok","hash":"oiprow0000000003"},{"id":"oip-s5","type":"protocol","title":"Invocation ledger","url":"https://miscsubjects.com/api/invocations","summary":"Append-only invocation records and receipt links.","quote":"invocations","claim_ids":["oip-c5"],"link_status":"ok","hash":"oipinvocations0005"}],"prov":{"model":"system/oip_articles","action":"generate"}}