diff --git a/sx/sx/essays/hypermedia-age-of-ai.sx b/sx/sx/essays/hypermedia-age-of-ai.sx index 016d476..634cf91 100644 --- a/sx/sx/essays/hypermedia-age-of-ai.sx +++ b/sx/sx/essays/hypermedia-age-of-ai.sx @@ -6,115 +6,101 @@ (defcomp ~essays/hypermedia-age-of-ai/essay-hypermedia-age-of-ai () (~docs/page :title "Hypermedia in the Age of AI" (p :class "text-stone-500 text-sm italic mb-8" - "Nick Blow argues that JSON hypermedia can serve AI agents better than HTML or RPC. He is right about the problem and wrong about the solution. The answer is not a better serialization of links. It is a representation that is simultaneously content, control, and code.") + "Neither JSON nor HTML is hypermedia. There is only the hypermedium — a self-defining representation — and s-expressions are an instance of it.") (~docs/section :title "I. The argument" :id "the-argument" (p :class "text-stone-600" - (a :href "https://nickblow.tech/posts/hypermedia-in-the-age-of-ai" :class "text-violet-600 hover:underline" "Blow's essay") - " starts from a position familiar to anyone who has followed the hypermedia discourse: Carson Gross's contention that sprinkling link objects into JSON does not make an API truly RESTful, because REST demands generic clients capable of interpreting hypermedia controls. Blow agrees that this has merit but argues the position is too restrictive. HTML is not the universal hypermedia format. LLMs choke on it. The real prize is " (em "progressive discovery") " — a client that learns what it can do by following links, not by reading documentation upfront.") + (a :href "https://nickblow.tech/posts/hypermedia-in-the-age-of-ai" :class "text-violet-600 hover:underline" "Nick Blow argues") + " that JSON hypermedia can serve AI agents better than HTML or RPC. Carson Gross contends that sprinkling link objects into JSON does not make an API truly RESTful, because REST demands generic clients capable of interpreting hypermedia controls. Blow agrees this has merit but thinks the position too restrictive. HTML is not the universal hypermedia format — LLMs choke on it. The real prize is " (em "progressive discovery") ": a client that learns what it can do by following links, not by reading documentation upfront.") (p :class "text-stone-600" - "He contrasts this with MCP, the Model Context Protocol now dominant for LLM tool use. MCP is RPC in a trench coat: the server declares all its tools upfront, the model receives the full catalogue in its system prompt, and it calls functions by name. This works, but it does not scale. A file management API that exposes create, read, update, delete, list, search, share, unshare, move, copy, rename, and permission management overwhelms the model before it has done anything. MCP forces " (em "total disclosure") " where hypermedia would offer " (em "progressive revelation") ".") + "He contrasts this with MCP, the Model Context Protocol now dominant for LLM tool use. MCP is RPC in a trench coat: the server declares all its tools upfront, the model receives the full catalogue in its system prompt, and it calls functions by name. This works, but it does not scale. MCP forces " (em "total disclosure") " where hypermedia would offer " (em "progressive revelation") ".") (p :class "text-stone-600" - "Blow proposes JSON-flavoured hypermedia as the fix — " (code "vnd.siren+json") ", custom content types, link relations in response payloads — so agents can discover capabilities by doing, not by reading a manual. Resources become state machines. Hyperlinks are state transitions. The agent explores the graph.") + "Blow proposes JSON-flavoured hypermedia as the fix — " (code "vnd.siren+json") ", custom content types, link relations in response payloads. Resources become state machines. Hyperlinks are state transitions. The agent explores the graph.") (p :class "text-stone-600" - "This is the right diagnosis. The prescription is too weak.")) + "This is the right diagnosis. But the prescription misidentifies the disease. The problem is not that we need a better wire format for links. The problem is that neither JSON nor HTML is actually hypermedia. And no amount of convention layered on top will make them so, because what makes something hypermedia is not what it carries but whether it can " (em "define itself") ".")) - (~docs/section :title "II. The JSON hypermedia trap" :id "json-trap" + (~docs/section :title "II. The self-definition criterion" :id "self-definition" (p :class "text-stone-600" - "JSON hypermedia has been proposed, specified, and implemented many times. HAL, JSON:API, Siren, Hydra, UBER, Collection+JSON. Each adds a linking convention on top of JSON. Each generates roughly the same amount of adoption: enough for a conference talk, not enough for an ecosystem. The reason is structural, not cultural.") + "What does it mean for a format to be hypermedia? The conventional answer focuses on " (em "affordances") ": a hypermedia format includes controls that tell the client what it can do next. Links, forms, actions. This is the definition that drives the JSON hypermedia proposals — add links to JSON, and JSON becomes hypermedia.") (p :class "text-stone-600" - "JSON is a data serialization format. It represents maps, arrays, strings, numbers, booleans, and null. That is all it represents. To make it hypermedia you must layer conventions on top: " (em "this key means a link") ", " (em "this object means an action") ", " (em "this array means available transitions") ". The client must know the convention. The convention must be specified in a separate document. The separate document must be read before the response makes sense.") + "But this definition is too shallow. It describes a property of the content without asking where the " (em "meaning") " of the content comes from. A Siren response includes an " (code "actions") " array — but what makes that array mean \"available actions\" rather than just \"a list of objects with href fields\"? The Siren specification, written in English prose, hosted on a separate document, maintained by a separate community. The meaning is " (em "external") " to the format.") (p :class "text-stone-600" - "This is exactly the problem Blow identifies with MCP — the client needs upfront knowledge — relocated from the system prompt to a media type specification. You have not eliminated the manual. You have moved it.") + "A true hypermedium does not need an external document to explain what it means. It defines its own interpretation. The format carries not just content and controls, but the rules by which content and controls are understood. The map " (em "is") " the territory — not because the map is accurate, but because the map can redraw itself.") (p :class "text-stone-600" - "HTML avoids this because presentation " (em "is") " semantics. A " (code "