# Machine10 Origin fallback contract v1 Contract: public v1. ## Configure The app must already have an installed Main Machine. An owner or delegated app manager can enable or remove the global mapping with either equivalent route: ```text PUT|DELETE https://jmpkit.com/api/apps//origin10/fallback PUT|DELETE https:///api/origin10/fallback ``` The initial mapping is fixed: ```json {"enabled":true,"match":"/**","on":"ziphost-miss","target":"machine-main"} ``` Reserved JMPKit paths stay Gateway-owned. `GET` and `HEAD` try Ziphost first; only a static `404` wakes Machine. Other supported application methods go directly to the mapped Machine. ## Request occurrence Gateway creates an `origin.request` occurrence whose payload is: ```json { "version": "origin10.request.v1", "requestId": "occ_...", "method": "GET", "url": "/path?mode=test", "headers": [["accept", "text/html"]], "bodyBase64": "", "client": {"ip": "...", "protocol": "https"} } ``` The complete JSON payload, including base64 body and selected headers, must fit the Main Machine's 32 KiB event limit. Treat all request content and client metadata as untrusted. ## Response Return this JSON envelope as the guest's response bytes: ```json { "version": "origin10.response.v1", "status": 200, "headers": [["content-type", "text/plain; charset=utf-8"]], "bodyBase64": "aGVsbG8=" } ``` Gateway validates the exact occurrence, status, headers, canonical base64, and bounds. It removes hop-by-hop and `x-jmpkit-*` response headers, makes cookies host-only, and suppresses bodies for `HEAD`, `204`, and `304`. A disconnected caller stops only the HTTP wait; an admitted durable turn may still commit. Expect `413` for oversized request envelopes, `503` when Machine cannot run, `504` at the response deadline, and `502` for failed turns or malformed response envelopes. Connected Origin may remain configured. The explicit Machine mapping wins while enabled. Removing it restores connected Origin or ordinary Ziphost/404 behavior. Confirmed Main Machine deletion removes the mapping automatically.