mirror of
https://github.com/hanzoai/skills.git
synced 2026-11-19 00:47:36 +00:00
hanzoskills.com/llms.txt now opens with the install line, the API reference index and the company index, so an agent that lands on any one of the three can find the rest. robots.txt claimed 537 documents while llms.txt counts 920. The number is gone from robots.txt; llms.txt derives it. public/ is regenerated from scripts/site.py, which it had fallen behind: the copy-prompt menu and agent bar were in the generator and not in the committed pages. tests/site.mjs passes against the result. Co-authored-by: Hanzo Dev <[email protected]>
298 lines
33 KiB
HTML
298 lines
33 KiB
HTML
<!doctype html>
|
|
<html lang="en"><head>
|
|
<meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1">
|
|
<title>hip-1326</title>
|
|
<meta name="color-scheme" content="dark">
|
|
<style>
|
|
/* Committed to one visual world: a dark instrument panel. No light variant —
|
|
the dot field and the hairline rules only read on black, and a naive
|
|
inversion would wash both out. Every colour is painted explicitly so the page
|
|
never borrows a host background. */
|
|
@font-face{font-family:'Zen';src:url('/fonts/Zen-Variable.woff2') format('woff2');font-weight:100 900;font-style:normal;font-display:swap}
|
|
@font-face{font-family:'Zen';src:url('/fonts/Zen-Italic-Variable.woff2') format('woff2');font-weight:100 900;font-style:italic;font-display:swap}
|
|
@font-face{font-family:'Zen Mono';src:url('/fonts/ZenMono-Variable.woff2') format('woff2');font-weight:100 900;font-style:normal;font-display:swap}
|
|
@font-face{font-family:'Zen Mono';src:url('/fonts/ZenMono-Italic-Variable.woff2') format('woff2');font-weight:100 900;font-style:italic;font-display:swap}
|
|
@font-face{font-family:'Zen Pixel Square';src:url('/fonts/ZenPixel-Square.woff2') format('woff2');font-style:normal;font-display:swap}
|
|
|
|
:root{
|
|
--ink:#f4f4f2; --soft:#9c9c98; --faint:#6a6a66; --ground:#000; --panel:#0a0a0a;
|
|
--line:#232323; --line-hi:#3a3a3a; --accent:#f4f4f2;
|
|
--font-zen-sans:'Zen',-apple-system,BlinkMacSystemFont,"Segoe UI",Helvetica,Arial,sans-serif;
|
|
--font-zen-mono:'Zen Mono',ui-monospace,"SF Mono",SFMono-Regular,Menlo,Consolas,monospace;
|
|
--font-zen-pixel-square:'Zen Pixel Square',monospace;
|
|
--mono:var(--font-zen-mono);
|
|
--sans:var(--font-zen-sans);
|
|
/* Controls are pills and surfaces are soft, as on hanzo.ai. */
|
|
--r:999px; --r-soft:14px;
|
|
}
|
|
*{box-sizing:border-box}
|
|
html{-webkit-text-size-adjust:100%}
|
|
body{margin:0;background:var(--ground);color:var(--ink);font-family:var(--sans);
|
|
font-size:16px;line-height:1.65;-webkit-font-smoothing:antialiased}
|
|
.wrap{max-width:60rem;margin:0 auto;padding:0 1.75rem}
|
|
|
|
/* The dot field. A halftone made of one repeating radial-gradient, faded out
|
|
along the diagonal by a mask so it reads as a wave rather than wallpaper. */
|
|
/* No overflow clip here: the dot field is inset to the box already, and a clip
|
|
would cut off the copy-prompt menu. */
|
|
.hero{position:relative;border-bottom:1px solid var(--line)}
|
|
.hero::before{content:"";position:absolute;inset:0;
|
|
background-image:radial-gradient(var(--line-hi) 1px, transparent 1px);
|
|
background-size:7px 7px;
|
|
-webkit-mask-image:linear-gradient(115deg,#000 0%,rgba(0,0,0,.55) 38%,transparent 72%);
|
|
mask-image:linear-gradient(115deg,#000 0%,rgba(0,0,0,.55) 38%,transparent 72%);
|
|
pointer-events:none}
|
|
.hero .wrap{position:relative;padding-top:5.5rem;padding-bottom:4rem}
|
|
|
|
nav{border-bottom:1px solid var(--line)}
|
|
nav .in{max-width:60rem;margin:0 auto;padding:1.1rem 1.75rem;display:flex;
|
|
justify-content:space-between;align-items:center;gap:1rem}
|
|
.brand{font-family:var(--mono);font-size:.85rem;letter-spacing:.14em;
|
|
text-transform:uppercase;color:var(--ink);text-decoration:none;
|
|
display:inline-flex;align-items:center;gap:.6rem}
|
|
.brand i{font-style:normal;color:var(--faint)}
|
|
.mark{width:1.15em;height:1.15em;display:block;flex:0 0 auto}
|
|
nav a.up{font-family:var(--mono);font-size:.72rem;letter-spacing:.14em;
|
|
text-transform:uppercase;color:var(--soft);text-decoration:none}
|
|
nav a.up:hover{color:var(--ink)}
|
|
|
|
h1{font-family:var(--mono);font-size:clamp(2rem,5.4vw,3.4rem);line-height:1.12;
|
|
letter-spacing:-.02em;margin:0 0 1.1rem;font-weight:500;text-wrap:balance}
|
|
h1 em{font-style:normal;color:var(--faint)}
|
|
.lede{color:var(--soft);font-size:1.05rem;max-width:52ch;margin:0 0 2.25rem}
|
|
|
|
.btns{display:flex;flex-wrap:wrap;gap:.7rem;margin:0 0 .5rem;align-items:center}
|
|
.btn{display:inline-flex;align-items:center;gap:.5rem;font-family:var(--mono);
|
|
font-size:.72rem;letter-spacing:.14em;text-transform:uppercase;
|
|
padding:.8rem 1.4rem;border:1px solid var(--line-hi);border-radius:var(--r);
|
|
color:var(--ink);text-decoration:none;background:transparent;cursor:pointer;
|
|
line-height:1.2;font-weight:400}
|
|
.btn:hover{background:#141414;text-decoration:none;border-color:var(--soft)}
|
|
.btn.solid{background:var(--ink);color:#000;border-color:var(--ink)}
|
|
.btn.solid:hover{background:#d8d8d4}
|
|
.btn .chev{width:.7em;height:.7em;flex:0 0 auto;transition:transform .15s ease}
|
|
.btn[aria-expanded="true"] .chev{transform:rotate(180deg)}
|
|
|
|
/* Copy-prompt selector. Each row copies the prompt for its own target. */
|
|
.copy{position:relative;display:inline-flex}
|
|
.menu{position:absolute;top:calc(100% + .5rem);left:0;z-index:20;min-width:21rem;
|
|
background:var(--panel);border:1px solid var(--line-hi);border-radius:var(--r-soft);
|
|
padding:.4rem;display:flex;flex-direction:column;
|
|
box-shadow:0 12px 32px rgba(0,0,0,.75)}
|
|
.menu[hidden]{display:none}
|
|
.mi{display:flex;align-items:center;gap:.7rem;width:100%;text-align:left;
|
|
padding:.62rem .8rem;border:0;border-radius:calc(var(--r-soft) - .35rem);
|
|
background:transparent;color:var(--ink);font-family:var(--mono);font-size:.76rem;
|
|
letter-spacing:.04em;text-decoration:none;cursor:pointer;line-height:1.3;
|
|
white-space:nowrap}
|
|
.mi:hover,.mi:focus-visible{background:#181818;outline:none}
|
|
.mi .mark{width:1.05rem;height:1.05rem;color:var(--soft)}
|
|
.mi:hover .mark{color:var(--ink)}
|
|
.mi u{margin-left:auto;color:var(--faint);text-decoration:none;font-size:.68rem;
|
|
letter-spacing:.1em;text-transform:uppercase}
|
|
|
|
/* Works-with bar: one scrolling row, name and mark per agent. */
|
|
.strip{border-bottom:1px solid var(--line);background:var(--panel)}
|
|
.strip .in{max-width:60rem;margin:0 auto;padding:.9rem 1.75rem;display:flex;
|
|
align-items:center;gap:1.25rem;font-family:var(--mono);font-size:.72rem;
|
|
letter-spacing:.1em;text-transform:uppercase;color:var(--faint)}
|
|
.strip b{color:var(--soft);font-weight:400;flex:0 0 auto;
|
|
border-right:1px solid var(--line);padding-right:1.25rem;align-self:stretch;
|
|
display:flex;align-items:center}
|
|
.bar{display:flex;align-items:center;gap:.5rem;flex:1 1 auto;min-width:0;
|
|
overflow-x:auto;scrollbar-width:none;scroll-snap-type:x proximity;
|
|
-webkit-overflow-scrolling:touch;
|
|
-webkit-mask-image:linear-gradient(90deg,#000 calc(100% - 3rem),transparent);
|
|
mask-image:linear-gradient(90deg,#000 calc(100% - 3rem),transparent)}
|
|
.bar::-webkit-scrollbar{display:none}
|
|
.agent{display:inline-flex;align-items:center;gap:.45rem;flex:0 0 auto;
|
|
padding:.4rem .85rem;border:1px solid var(--line);border-radius:var(--r);
|
|
color:var(--soft);white-space:nowrap;scroll-snap-align:start;
|
|
text-decoration:none;background:var(--ground)}
|
|
.agent:hover{color:var(--ink);border-color:var(--line-hi);text-decoration:none}
|
|
.agent .mark{width:.95rem;height:.95rem}
|
|
|
|
h2{font-family:var(--mono);font-size:1.1rem;letter-spacing:-.01em;margin:2.75rem 0 .75rem;font-weight:500}
|
|
h3{font-size:1rem;margin:2rem 0 .5rem;font-weight:600}
|
|
h4,h5,h6{font-size:.94rem;margin:1.5rem 0 .5rem;font-weight:600}
|
|
p{margin:0 0 1rem;max-width:70ch}
|
|
ul,ol{margin:0 0 1rem;padding-left:1.35rem;max-width:70ch}
|
|
li{margin:.22rem 0}
|
|
a{color:var(--ink);text-decoration:underline;text-underline-offset:3px;
|
|
text-decoration-color:var(--line-hi)}
|
|
a:hover{text-decoration-color:var(--ink)}
|
|
a:focus-visible{outline:1px solid var(--ink);outline-offset:3px}
|
|
code{font-family:var(--mono);font-size:.85em;background:var(--panel);
|
|
border:1px solid var(--line);border-radius:5px;padding:.1em .36em}
|
|
pre{background:var(--panel);border:1px solid var(--line);padding:1rem 1.1rem;
|
|
border-radius:var(--r-soft);overflow-x:auto;margin:0 0 1.25rem}
|
|
pre code{background:none;border:0;padding:0;font-size:.82rem;line-height:1.7}
|
|
blockquote{margin:0 0 1rem;padding-left:1rem;border-left:1px solid var(--line-hi);color:var(--soft)}
|
|
hr{border:0;border-top:1px solid var(--line);margin:2.5rem 0}
|
|
table{border-collapse:collapse;width:100%;margin:0 0 1.25rem;font-size:.92rem;
|
|
display:block;overflow-x:auto}
|
|
th,td{border:1px solid var(--line);padding:.5rem .7rem;text-align:left}
|
|
|
|
.curl{display:block;background:var(--panel);border:1px solid var(--line);
|
|
border-radius:var(--r-soft);padding:.95rem 1.1rem;font-family:var(--mono);
|
|
font-size:.8rem;color:var(--soft);overflow-x:auto;margin:0 0 2.5rem;
|
|
white-space:pre;line-height:1.9}
|
|
.curl b{color:var(--ink);font-weight:400}
|
|
.curl i{font-style:normal;color:var(--faint)}
|
|
|
|
/* index */
|
|
#q{width:100%;padding:.85rem 1.2rem;font-family:var(--mono);font-size:.85rem;color:var(--ink);
|
|
background:var(--panel);border:1px solid var(--line);border-radius:var(--r);margin:0 0 .6rem}
|
|
#q::placeholder{color:var(--faint);text-transform:uppercase;letter-spacing:.1em;font-size:.72rem}
|
|
#q:focus{outline:none;border-color:var(--soft)}
|
|
#count{color:var(--faint);font-family:var(--mono);font-size:.72rem;letter-spacing:.1em;
|
|
text-transform:uppercase;margin:0 0 2rem}
|
|
.cat{margin:2.5rem 0 .5rem;font-family:var(--mono);font-size:.7rem;letter-spacing:.16em;
|
|
text-transform:uppercase;color:var(--faint);border-bottom:1px solid var(--line);
|
|
padding-bottom:.45rem}
|
|
.row{display:block;padding:.6rem .9rem;margin:0 -.9rem;border-bottom:1px solid var(--line);
|
|
border-radius:var(--r-soft);text-decoration:none}
|
|
.row:hover{background:#0a0a0a}
|
|
.nm{font-family:var(--mono);font-size:.84rem;color:var(--ink);display:block}
|
|
.ds{color:var(--soft);font-size:.9rem;display:block;margin-top:.12rem}
|
|
footer{margin-top:4rem;padding:2rem 0 4rem;border-top:1px solid var(--line);
|
|
color:var(--faint);font-size:.85rem}
|
|
footer a{color:var(--soft)}
|
|
.fmap{display:grid;gap:1.75rem;grid-template-columns:repeat(auto-fit,minmax(11rem,1fr));
|
|
margin:0 0 2rem;font-size:.85rem}
|
|
.fmap b{display:block;font-family:var(--mono);font-size:.68rem;letter-spacing:.16em;
|
|
text-transform:uppercase;color:var(--faint);font-weight:400;margin:0 0 .6rem;
|
|
border-bottom:1px solid var(--line);padding-bottom:.4rem}
|
|
.fmap a{display:inline-block;color:var(--ink);text-decoration:none;margin:.3rem .35rem 0 0}
|
|
.fmap a:hover{text-decoration:underline}
|
|
.fmap div{color:var(--faint);line-height:1.5}
|
|
.fend{border-top:1px solid var(--line);padding-top:1.25rem;font-size:.82rem}
|
|
|
|
@media (max-width:640px){
|
|
.hero .wrap{padding-top:3.25rem;padding-bottom:2.75rem}
|
|
.btns{gap:.5rem}
|
|
.btn{padding:.75rem 1.15rem;font-size:.68rem}
|
|
.copy,.copy .btn{width:100%;justify-content:center}
|
|
.menu{left:0;right:0;min-width:0}
|
|
.strip .in{flex-direction:column;align-items:flex-start;gap:.6rem;padding:.9rem 1.75rem}
|
|
.strip b{border-right:0;padding-right:0}
|
|
.bar{width:100%}
|
|
}
|
|
</style>
|
|
<link rel="alternate" type="text/markdown" href="/hip-1326.md">
|
|
|
|
<link rel="icon" href="/favicon.svg">
|
|
<link rel="canonical" href="https://hanzoskills.com/hip-1326">
|
|
</head>
|
|
<!-- Reading this with a machine? Every page here is also plain markdown.
|
|
This one: https://hanzoskills.com/hip-1326.md
|
|
Index: https://hanzoskills.com/llms.txt
|
|
Corpus: https://hanzoskills.com/all.md
|
|
Append .md to any path for the markdown twin. -->
|
|
<body>
|
|
<nav><div class="in">
|
|
<a class="brand" href="/"><svg class="mark" viewBox="0 0 67 67" fill="currentColor" aria-hidden="true"><path d="M22.21 67V44.6369H0V67H22.21Z"/><path d="M66.7038 22.3184H22.2534L0.0878906 44.6367H44.4634L66.7038 22.3184Z"/><path d="M22.21 0H0V22.3184H22.21V0Z"/><path d="M66.7198 0H44.5098V22.3184H66.7198V0Z"/><path d="M66.7198 67V44.6369H44.5098V67H66.7198Z"/></svg> HANZO<i>SKILLS</i></a>
|
|
<a class="up" href="/">All skills</a>
|
|
</div></nav>
|
|
|
|
<div class="wrap">
|
|
<h1>hip-1326</h1><p class="lede">HIP-1326: AMQP — Exchanges, Queues and Bindings Onto the One Bus. Status Final. Hanzo architectural specification.</p><h1>HIP-1326: AMQP — Exchanges, Queues and Bindings Onto the One Bus</h1>
|
|
<h2>Abstract</h2>
|
|
<p><code>amqp</code> is AMQP 0-9-1 spoken on <code>:5672</code> and translated to and from the JetStream that <code>pubsub</code> serves. A standard RabbitMQ client points at the port and works unchanged. It is implemented in <code>hanzoai/cloud</code> at <code>apps/amqp</code> (HIP-0106) over the adaptor at <code>github.com/hanzoai/amqp</code>.</p>
|
|
<p>It is the second wire in the family HIP-1323 opened, and it is the one that tests the family's rule. A Kafka client names a topic and the bus already has somewhere to put it. An AMQP client DECLARES — exchanges, queues, bindings — and expects the declaration to outlive its connection and to be visible to its peers. So this adaptor has a topology to keep, which is exactly the state HIP-1323 §1 forbids an adaptor to hold. The resolution is that it does not hold it: the topology lives on the bus, in a JetStream KV bucket, and the adaptor is a mirror of it.</p>
|
|
<h2>Motivation</h2>
|
|
<p>The argument for meeting a client on the wire it already speaks is HIP-1323's and is not restated. What is worth stating is why AMQP is the harder half of it, because a reader who has the Kafka spec in hand will expect this one to be the same shape and it is not.</p>
|
|
<p>AMQP's routing is a topology the CLIENT builds. Publishing names an exchange and a routing key; what a message reaches is decided by the bindings other clients declared. Two facts follow, and they are the whole design. The first is that routing is a lookup and not a name, so the translation onto subjects has to be total — every exchange kind, every wildcard, every degenerate spelling — and where it cannot be total it has to REFUSE in the protocol's own vocabulary rather than silently route somewhere adjacent. The second is that the topology is durable and shared: a queue declared on one connection is consumed on another, and on a second replica.</p>
|
|
<p>A broker would keep that in its own store. This is not a broker, and a private store is how the two answers to "what is bound to this exchange" get shipped.</p>
|
|
<h2>Specification</h2>
|
|
<p>The key words MUST, MUST NOT, SHOULD, SHOULD NOT and MAY are to be interpreted as in RFC 2119.</p>
|
|
<h3>§1 Where it sits</h3>
|
|
<p>| Capability | What it is | Where a client meets it | |---|---|---| | <code>pubsub</code> (HIP-1060) | <strong>the bus</strong> — embedded NATS/JetStream | <code>:4222</code>, and <code>/v1/pubsub</code> | | <code>kafka</code> (HIP-1323) | a wire-protocol adaptor over that bus | <code>:9092</code> | | <code>amqp</code> | a wire-protocol adaptor over that bus | <code>:5672</code> | | <code>mq</code> (HIP-1061) | the managed product: org-scoped durable queues and streams | <code>/v1/mq</code> |</p>
|
|
<p>The adaptor MUST dial the bus through <code>pubsub.URL</code>, so it cannot end up bridging a bus other than the one the rest of the process publishes to.</p>
|
|
<p>It holds no state of its own. Messages live in one stream, <code>AMQP</code>, over subjects <code>amqp.></code>; the topology lives in one KV bucket, <code>amqp</code>. Both are the bus's. The adaptor keeps an in-memory mirror of the bucket and MUST treat it as a cache: it writes locally and then to the bucket, and every replica watches the bucket for the rest. A replica MUST drain the watch's initial replay before it serves a client, or two connections to two replicas disagree about what is declared.</p>
|
|
<p><code>:5672</code> is the default and is configurable by <code>CLOUD_AMQP_PORT</code>.</p>
|
|
<h3>§2 Exchanges, queues and bindings become subjects, consumers and filters</h3>
|
|
<p>| AMQP | On the bus | |---|---| | exchange + routing key | the subject <code>amqp.<exchange>.<key></code> | | queue | a durable pull consumer on the <code>AMQP</code> stream | | binding | a filter subject on that consumer | | exchange, queue, binding | a key in the <code>amqp</code> KV bucket |</p>
|
|
<p>Two spellings in the subject are not the obvious ones and both are load-bearing. The DEFAULT exchange — AMQP's <code>""</code> — is the word <code>_</code>, and only in the exchange position. An EMPTY routing key is spelled by omitting the word entirely, not by an empty word. So <code>("", "")</code> is <code>amqp._</code> and <code>("", "_")</code> is <code>amqp._._</code>, and a literal <code>_</code> key stays distinct from no key.</p>
|
|
<p>An exchange or queue name MUST be a single subject word — <code>[A-Za-z0-9_-]</code>, at most 128 characters. A name containing a dot MUST be refused, because exchange <code>a</code> with key <code>b.c</code> and exchange <code>a.b</code> with key <code>c</code> would otherwise be one subject. A routing key on a PUBLISH MUST be literal: an empty word, or any of <code>* # ></code>, is refused.</p>
|
|
<p>Exchange kinds <code>direct</code>, <code>fanout</code> and <code>topic</code> are implemented. <code>headers</code> is refused (§4): it routes on the message's own table rather than on a name, so there is no subject for it to be.</p>
|
|
<p>A queue's consumer is declared with explicit acknowledgement, a five-minute ack wait, and DELIVER-NEW — a queue holds what was published after it was declared, which is AMQP's rule. <code>MaxAckPending</code> is deliberately unbounded on the consumer because prefetch is a property of a CHANNEL, not of a queue (§3). Declaring the queue is what creates the consumer, so declaring is what starts collecting.</p>
|
|
<p>The queue's implicit binding to the default exchange under its own name is DERIVED and MUST NOT be stored, or unbinding it becomes representable.</p>
|
|
<h4>§2.1 <code>#</code> is not <code>></code></h4>
|
|
<p>AMQP's <code>#</code> matches ZERO or more words; NATS's <code>></code> matches ONE or more. They are not the same wildcard and a one-for-one rewrite silently loses the zero case — the message published to the exchange root, which is the case a binding of <code>#</code> most obviously means to catch.</p>
|
|
<p>A binding key ending in <code>#</code> therefore produces TWO filter subjects: the <code>></code> form and the bare prefix.</p>
|
|
<p>| exchange kind | binding key | filter subjects | |---|---|---| | <code>topic</code> | <code>a.<em></code> | <code>amqp.t.a.</em></code> | | <code>topic</code> | <code>a.#</code> | <code>amqp.t.a.></code> and <code>amqp.t.a</code> | | <code>topic</code> | <code>#</code> | <code>amqp.t.></code> and <code>amqp.t</code> | | <code>topic</code> | `<code> (empty) | </code>amqp.t<code> | | </code>fanout<code> | anything, ignored | </code>amqp.f.><code> and </code>amqp.f<code> | | </code>direct<code> | </code>k<code> | </code>amqp.d.k` |</p>
|
|
<p><code><em></code> MAY appear in any word of a <code>topic</code> binding key. <code>#</code> MUST appear only as the last word, because NATS matches a rest-wildcard only in last position; anywhere else it is refused (§4). A partial wildcard within a word — <code>a.b</em></code> — is refused: NATS has no such match. A <code>direct</code> binding key MUST hold no wildcard at all, because a direct key matches literally.</p>
|
|
<p>Filters MUST be deduplicated and sorted before they reach the consumer, since JetStream refuses a self-overlapping filter set.</p>
|
|
<h4>§2.2 A message keeps its properties and stays readable</h4>
|
|
<p>The AMQP body is the NATS payload verbatim. The content header's octets ride in one NATS header, <code>Amqp-Props</code>, base64-encoded.</p>
|
|
<p>This is the right way round: a NATS-NATIVE subscriber — one that speaks the bus directly, not through another wire adaptor — reads the body a publisher sent on <code>amqp.<exchange>.<routing key></code>, without having to know that AMQP was involved. Properties are available to whoever wants them and are in the way of nobody.</p>
|
|
<p>One bus does NOT mean one namespace. The AMQP and Kafka adaptors ride the same JetStream server, but each keeps its OWN subject subtree — <code>amqp.></code> here, <code>kafka-<topic>-<partition>.></code> there — so a message published through the Kafka wire is not readable through this one, and vice versa, and even the native reader of the Kafka subtree gets a Kafka <code>RecordBatch</code>, not the logical body. "Readable across wires" is therefore false as a blanket claim: a bus-native reader sees each wire's subtree in that wire's framing; the two wire adaptors do not read each other. This is measured in <code>hanzoai/cloud/e2e/crosswire</code>.</p>
|
|
<h3>§3 Acknowledgement, and what bounds a consumer</h3>
|
|
<p>| AMQP | On the bus | |---|---| | <code>basic.ack</code> | <code>Ack</code> | | <code>basic.nack</code> / <code>basic.reject</code>, <code>requeue=true</code> | <code>Nak</code> | | <code>basic.nack</code> / <code>basic.reject</code>, <code>requeue=false</code> | <code>Term</code> |</p>
|
|
<p><code>requeue</code> is honoured and is the only thing that chooses between <code>Nak</code> and <code>Term</code>. The <code>multiple</code> flag is supported on <code>ack</code> and <code>nack</code>: it settles every outstanding tag at or below the one named, and a tag of zero means all of them. <code>basic.reject</code> carries no such flag, per the protocol. Settling a tag that is not outstanding is a 406; a <code>multiple</code> settle that matches nothing is not an error. <code>basic.recover</code> is answered by re-queueing everything outstanding.</p>
|
|
<p>Delivery tags MUST be allocated in the order the deliveries are written to the socket, or a <code>multiple</code> ack settles a set the client did not mean.</p>
|
|
<p><code>basic.qos</code> prefetch-COUNT is implemented, per-consumer or, with the <code>global</code> flag, shared across the channel. Prefetch-SIZE is refused (§4). The count is enforced by the adaptor as an in-flight bound and is not merely a fetch size.</p>
|
|
<p>A <code>no-ack</code> consumer is UNBOUNDED, and this follows from the protocol rather than from an omission: such a consumer has no outstanding delivery to count, so there is nothing for prefetch to bound. A client that wants a ceiling MUST acknowledge.</p>
|
|
<p>Deliveries outstanding when a channel or connection closes are re-queued, never dropped.</p>
|
|
<h3>§4 What is not implemented, and how it says so</h3>
|
|
<p>Every entry below answers a CHANNEL exception — <code>channel.close</code> carrying reply code 540 NOT_IMPLEMENTED, the class and method that were sent, and a sentence naming what to do instead. The CONNECTION survives, so a client may open another channel and continue.</p>
|
|
<p>| Not implemented | Class | The answer says | |---|---|---| | <code>headers</code> exchanges | exchange | routes on something other than a name and has no subject to be | | transactions (<code>tx.*</code>) | tx | a publish is confirmed one at a time through <code>confirm.select</code> | | byte-counted qos (prefetch-size ≠ 0) | basic | bound the channel by message count instead | | the <code>immediate</code> flag | basic | publish with <code>mandatory</code> to learn that nothing is bound | | <code>channel.flow(false)</code> | channel | pause a consumer with <code>basic.cancel</code> or bound it with <code>basic.qos</code> | | exchange-to-exchange binding | exchange | bind the queue to each exchange it should read | | <code>#</code> before the end of a binding key | queue | NATS matches a rest-wildcard only in last position | | <code>basic.recover-async</code> | basic | use <code>basic.recover</code>, which is answered |</p>
|
|
<p>A refusal MUST name the remedy. A bare NOT_IMPLEMENTED tells a client author that something is missing and not which of the several things they were doing caused it.</p>
|
|
<h4>§4.1 What IS implemented, and is commonly assumed not to be</h4>
|
|
<p>Stated because the list above invites the wrong inference, and because a client author who assumes these are absent will write a worse client.</p>
|
|
<p><code>mandatory</code> is honoured, and <code>basic.return</code> is real: an unroutable mandatory publish comes back with reply code 312 NO_ROUTE carrying the original properties and body, and is not stored. Under publisher confirms it is still acknowledged, per the protocol — a return is not a failure to publish.</p>
|
|
<p><code>basic.get</code> is implemented, and answers <code>basic.get-empty</code> rather than blocking. Consumer cancellation is implemented, and <code>consumer_cancel_notify</code> is advertised. Publisher confirms (<code>confirm.select</code>) are implemented, with a per-message ack, and a nack when the bus refuses the publish.</p>
|
|
<h3>§5 Fail closed at boot</h3>
|
|
<p><code>Mount</code> MUST fail CLOSED. The bus connect, the stream creation, the topology bucket and the listen all happen before the port accepts, and a failure in any of them within the startup window aborts boot rather than serving a phantom broker. A broker that accepts a publish and drops it is worse than a port that refuses, because the publisher believes it published.</p>
|
|
<p>Mount order is the row position in <code>manifest/apps.go</code>, and this row MUST stay after <code>pubsub</code> so the embedded <code>:4222</code> is accepting when the adaptor dials it. The row is <code>Eager</code> for HIP-1323's reason: it owns a listener, and a lazily mounted listener would wait for an HTTP request its clients never make.</p>
|
|
<h3>§6 Two facts a single process cannot answer for the fleet</h3>
|
|
<p><code>exclusive</code> queues and the consumer count in <code>queue.declare-ok</code> are resolved from the sockets THIS process holds. A second replica cannot see the first's, so with more than one replica behind one Service <code>exclusive</code> is not a guarantee and the consumer count is a lower bound.</p>
|
|
<p>This is stated rather than fixed because the fix is a decision: either the exclusivity claim moves onto the bus, where every replica can see it, or the capability is documented as single-replica. Shipping it as though it holds is the one option that is wrong.</p>
|
|
<h3>§7 It mounts one HTTP route, and does not serve it</h3>
|
|
<p>The adaptor registers no HTTP route. Cloud's generic per-subsystem liveness route answers <code>GET /v1/amqp/health</code> with a constant, and it MUST NOT be read as a statement about the AMQP listener: it does not consult the broker, the port or the bus. A readiness check for this capability is a TCP check against <code>:5672</code>.</p>
|
|
<p>The consequence for the gates is HIP-1323 §2's and applies unchanged here: a capability that serves no HTTP operation cannot appear in a document-derived capability list, so <code>scripts/coverage.py</code> reads cloud's <code>manifest/apps.go</code> as a second source. <code>amqp</code> was the last capability with no HIP, and it was invisible to every gate that reads the emitted document.</p>
|
|
<h3>§8 The name</h3>
|
|
<p><code>amqp</code> is the protocol, and the protocol is what this capability is. Per HIP-0139 §2.5 it is a word because it is the word — an author asking "does this speak AMQP" finds it under exactly that name in the manifest, the package, the port's documentation and this HIP. It is NOT named for a broker, because it is not one, and naming it after one would promise the broker's whole surface.</p>
|
|
<h2>Rationale</h2>
|
|
<p><strong>Why the topology is on the bus rather than in the adaptor.</strong> A private store would be simpler to write and would make every replica a different broker. Two clients that declared the same queue against two replicas would each be told they succeeded and would then consume different messages. Putting it in a watched KV bucket keeps HIP-1323 §1's rule intact — one store, and the adaptor is not it — and makes a second replica a scaling decision rather than a correctness one, everywhere except §6.</p>
|
|
<p><strong>Why refusals are channel exceptions and not connection errors.</strong> A client that asks for a headers exchange has usually asked correctly for nine other things first. Closing the connection discards them and turns a feature gap into an outage; closing the channel leaves the client able to continue, and its library already knows how to handle exactly that.</p>
|
|
<p><strong>Why the translation refuses rather than approximates.</strong> Every entry in §4 has an approximation available, and each one is a lie of a different size. <code>#</code> in the middle of a binding key could be routed as <code>*</code>, which would deliver a different set. <code>immediate</code> could be treated as <code>mandatory</code>, which has different semantics on a queue with no consumer. A wrong delivery is worse than a refusal, because the refusal is visible at the moment the client is written and the wrong delivery is visible much later, to somebody else.</p>
|
|
<h2>Security Considerations</h2>
|
|
<p><strong>There is no authentication on <code>:5672</code> today.</strong> This is a known limitation, and it is stated here plainly because the port is a credential surface and a spec that omitted it would be describing a capability nobody has.</p>
|
|
<p>SASL PLAIN is offered in <code>connection.start</code>, and the <code>connection.start-ok</code> response is never parsed. Any username and password — or none — opens a full connection. The virtual host in <code>connection.open</code> is likewise discarded, so vhost is not a namespace here. <code>ACCESS_REFUSED</code> (403), AMQP's own code for an authorization failure, is declared in the implementation and returned nowhere.</p>
|
|
<p><strong>The namespace is flat.</strong> Exchange and queue names are global keys in one KV bucket, the subjects carry no org segment, and a queue's durable consumer name is the bare queue name. There is no tenant boundary: a connection may address any name in the deployment, and a <code>topic</code> binding of <code>#</code> attaches a consumer to an entire exchange. <code>pubsub</code> exports org-scoping helpers (<code>Org</code>, <code>Qualify</code>) and this adaptor calls neither.</p>
|
|
<p>Cloud adds nothing on this path and structurally cannot: the edge's identity and scope middleware is HTTP middleware bound to a capability's route prefixes, and a raw TCP listener has none. <code>Mount</code> receives the router and never uses it.</p>
|
|
<p><code>kafka</code> on <code>:9092</code> has the same posture — its dispatcher registers no SASL handshake and its <code>ApiVersions</code> advertises no SASL key, so a client cannot negotiate authentication even if it wanted to. This is one property of the family, not two independent gaps, and it SHOULD be closed once for both.</p>
|
|
<p><strong>What stands today is reachability, and only that.</strong> The chart declares no Service port and no container port for <code>:5672</code>, so the listener is not published by it; but it binds all interfaces inside the pod, a pod IP is routable on the cluster network by default, and <code>hanzoai/cloud</code> declares no NetworkPolicy. Production topology is declared in a private repository and MUST be checked rather than assumed.</p>
|
|
<p>Therefore: this capability MUST NOT be exposed beyond the fabric that needs it until one of the following holds.</p>
|
|
<ol><li><strong>Network.</strong> A NetworkPolicy admitting only the workloads that must reach it,</li></ol>
|
|
<p> and the listener bound to loopback where the client is co-resident. This is the cheaper option and it grants no tenancy — every admitted client still shares one flat namespace, so it is sufficient only where every admitted client is equally trusted.</p>
|
|
<ol><li><strong>Identity.</strong> An IAM-minted token presented in the SASL PLAIN response and</li></ol>
|
|
<p> validated there, yielding the same org the equivalent HTTP principal would carry, with the org then scoping the subject and the topology key. This is the option that makes the capability multi-tenant, and it is the one that lets §1's table read the same way for <code>:5672</code> as for <code>/v1/pubsub</code>.</p>
|
|
<p>A third option — a second policy engine on this wire — MUST NOT be taken. The subjects live on one bus and the authorization decision belongs with them.</p>
|
|
<p>Two implementation notes that bear on any such work. A <code>frame-max</code> bound is enforced on read, so an oversized frame cannot become an unbounded allocation. A content header declaring a body larger than the bus will accept is refused on the HEADER, before the body is read.</p>
|
|
<h2>References</h2>
|
|
<ul><li>HIP-0106 — Hanzo Plugin Contract</li><li>HIP-0139 — Capability</li><li>HIP-1060 — PubSub — The Tenant Endpoint on the Bus</li><li>HIP-1061 — MQ — Queues and Streams</li><li>HIP-1323 — Kafka — A Wire Onto the One Bus</li><li>AMQP 0-9-1, and its <code>basic</code>, <code>queue</code>, <code>exchange</code>, <code>tx</code> and <code>confirm</code> classes</li></ul>
|
|
<h2>Copyright</h2>
|
|
<p>Released under CC0 1.0 Universal Public Domain Dedication.</p>
|
|
<footer>
|
|
<div class="fmap">
|
|
<div><b>Build</b>
|
|
<a href="https://hanzo.app">hanzo.app</a> app builder
|
|
<a href="https://hanzo.codes">hanzo.codes</a> code with an agent
|
|
<a href="https://hanzoskills.com">hanzoskills.com</a> what an agent reads</div>
|
|
<div><b>Run</b>
|
|
<a href="https://console.hanzo.ai">console.hanzo.ai</a> cloud console
|
|
<a href="https://api.hanzo.ai">api.hanzo.ai</a> the API</div>
|
|
<div><b>Account</b>
|
|
<a href="https://hanzo.id">hanzo.id</a> sign in
|
|
<a href="https://pay.hanzo.ai">pay.hanzo.ai</a> top up
|
|
<a href="https://billing.hanzo.ai">billing.hanzo.ai</a> invoices and usage</div>
|
|
<div><b>Company</b>
|
|
<a href="https://hanzo.ai">hanzo.ai</a> canonical
|
|
<a href="https://hanzo.ventures">hanzo.ventures</a> ventures</div>
|
|
</div>
|
|
<div class="fend"><a href="/hip-1326.md">This page as plain text</a> · <a href="/llms.txt">Index for agents</a></div>
|
|
</footer>
|
|
</div></body></html> |