mirror of
https://github.com/hanzoai/skills.git
synced 2026-11-19 00:47:36 +00:00
287 lines
24 KiB
HTML
287 lines
24 KiB
HTML
<!doctype html>
|
|
<html lang="en"><head>
|
|
<meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1">
|
|
<title>hip-0122</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-0122.md">
|
|
|
|
<link rel="icon" href="/favicon.svg">
|
|
<link rel="canonical" href="https://hanzoskills.com/hip-0122">
|
|
</head>
|
|
<!-- Reading this with a machine? Every page here is also plain markdown.
|
|
This one: https://hanzoskills.com/hip-0122.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-0122</h1><p class="lede">HIP-122: zip — The ZAP-Native Application Server Core. Status Final. Hanzo architectural specification.</p><h1>HIP-0122: zip — The ZAP-Native Application Server Core</h1>
|
|
<h2>Abstract</h2>
|
|
<p><strong>zip</strong> is the one Hanzo application server core: a high-performance Go framework (Fiber v3 / fasthttp derived) whose primary transport is <strong>ZAP</strong> (HIP-0114) and whose secondary transport is HTTP, selected as a <em>value</em> on one verb — <code>app.Listen(":9653", "http://:8080")</code>. Every Hanzo Go service is a thin composition over a <code>zip.App</code>; the unified <code>cloud</code> binary (HIP-0106) is itself the proof: its core is a measured <strong>977 lines</strong> (<code>serve.go</code> 260 + <code>subsystems/subsystems.go</code> 312 + <code>build.go</code> 405) hosting <strong>74,561 lines</strong> of mounted plugins under <code>clients/</code> — a <strong>76:1 plugin-to-core ratio</strong>. The server is not where the product lives; the server is what the product mounts on.</p>
|
|
<p>This HIP specifies the zip contract — <code>App</code>, <code>Ctx</code>, transport-as-value <code>Listen</code>, <code>Mount</code>, <code>Module</code>, typed handlers, identity accessors, and shutdown lifecycle — so that HIP-0106 (the host binary), HIP-0106 (the plugin/VM shapes), and every <code>hanzoai/<repo></code> service compose on one substrate instead of each re-deciding a framework.</p>
|
|
<h2>Specification</h2>
|
|
<h3>One verb, transport as a value</h3>
|
|
<p>zip serves ONE fiber/fasthttp handler tree on any number of addresses. The transport is selected by the address <strong>scheme</strong>, never by a method name (<code>transport.go</code>):</p>
|
|
<pre><code class="lang-go">app.Listen(":9653") // ZAP — bare address = ZAP (the primary)
|
|
app.Listen(":9653", "http://:8080") // ZAP primary + HTTP secondary, one call
|
|
app.Listen("http://:8080") // HTTP only (edge/interop shape)</code></pre>
|
|
<ul><li><code>DefaultScheme = "zap"</code>: the path of least resistance is ZAP-native.</li></ul>
|
|
<p> ZAP is the primary wire (TLS 1.3 + post-quantum; the gRPC replacement per HIP-0120); HTTP is the interop/edge secondary.</p>
|
|
<ul><li><code>RegisterTransport(scheme, fn)</code> is the ONLY extension point: a</li></ul>
|
|
<p> <code>TransportFunc</code> builds a <code>Server{ListenAndServe, Close}</code> for an address. New protocols never change the <code>Listen</code> API — this mirrors <code>net.Listen(network, addr)</code>: the network is a value, not a <code>ListenTCP</code>/<code>ListenUDP</code> method explosion.</p>
|
|
<ul><li>Same handler tree, same middleware, same auth, same error handling</li></ul>
|
|
<p> over every transport. Routes ARE the surface; there is no per-transport wiring. Streaming responses ride ZAP through the same framework path (<code>zap-proto/http</code> v0.2.0+).</p>
|
|
<h3>The app surface — routes, groups, mounts, modules</h3>
|
|
<p>| Entry point | Contract | Used by | |---|---|---| | <code>app.Get/Post/...(path, fn)</code> | Sinatra/Express idiom; the primary API | all native Hanzo handlers | | <code>zip.Get<a href="app, path, fn">In, Out</a></code> | typed handlers → OpenAPI 3.1 at <code>/docs</code> AND a free MCP tool projection at <code>/mcp</code> (JSON-RPC 2.0) | typed public surfaces | | <code>app.Group(prefix)</code> | route grouping | <code>/v1/...</code> service prefixes | | <code>app.Mount(prefix, h http.Handler)</code> | registers <code>prefix+"/*"</code> via <code>AdaptNetHTTP</code>; the handler receives the <strong>full original path</strong> (nothing stripped) | migration of chi/gin/beego/net-http code (HIP-0106 adapters); subsystem mounts that own their canonical prefix | | <code>app.Module(method+path, runtime, path)</code> | mounts a HIP-0105 extension (wasm/goja/pyvm/starlark/native) as a route — one mount API for every guest language | user-supplied and multi-language handlers |</p>
|
|
<p><code>Mount</code> preserving the full path is load-bearing: a subsystem mounted at <code>/v1/iam</code> still sees <code>/v1/iam/...</code> — its routes are identical standalone, embedded, or as a plugin VM (HIP-0106's "one service, three shapes" depends on this).</p>
|
|
<p>Adapters (<code>adapt.go</code>: <code>AdaptNetHTTP</code>, <code>AdaptNetHTTPFunc</code>, <code>AdaptNetHTTPMiddleware</code>) are migration tools costing ~5% versus native dispatch, per HIP-0106: new code is written natively against zip; adapted routes are replaced when feasible.</p>
|
|
<h3>Identity and request context</h3>
|
|
<p><code>zip.Ctx</code> (<code>ctx.go</code>) carries the gateway-minted identity of HIP-0026 / HIP-0134 as first-class accessors — services never parse headers:</p>
|
|
<pre><code class="lang-go">c.Org() // X-Org-Id (gateway-minted from the JWT owner claim)
|
|
c.User() // X-User-Id
|
|
c.UserEmail() // X-User-Email
|
|
c.IsAdmin() // X-User-IsAdmin == "true" (org-scoped; see HIP-0118)
|
|
c.RequestID() // X-Request-Id</code></pre>
|
|
<p>Plus the one JSON entry point: <code>c.Bind</code> / <code>c.JSON</code> route through zip's internal <code>jsonenc</code> — stdlib <code>encoding/json/v2</code> under <code>GOEXPERIMENT=jsonv2</code>, stdlib v1 otherwise. No third-party JSON library exists in the stack (HIP-0106 invariant; the measured json/v2 wins and the per-connection budget — 8.02 KiB and 1.00 goroutine per connection, 100k conns per 1 GiB replica — are documented in HIP-0106 "Per-replica capacity budget" and are not restated here).</p>
|
|
<p>Logging is <code>luxfi/log</code> via <code>c.Log()</code> — never <code>slog</code>, never <code>uber/zap</code>.</p>
|
|
<h3>Lifecycle</h3>
|
|
<p><code>closers.go</code>: <code>Module()</code> and any resource-owning mount register closers on the App; <code>Shutdown()</code> runs them once, first-error-wins. This is the same lifecycle the <code>cloud</code> host drives through <code>RegisterWithShutdown</code> (below) — one teardown discipline from the framework up.</p>
|
|
<h3>The host shape — cloud as the reference composition</h3>
|
|
<p>The realized <code>cloud</code> binary demonstrates what "thin composition over zip" means, with measured numbers (non-test Go, <code>hanzoai/cloud</code> at v1.786.x, 2026-07):</p>
|
|
<p>| Layer | Files | LOC | |---|---|---:| | Core (serve + registry + subsystem table) | <code>serve.go</code>, <code>subsystems/subsystems.go</code>, <code>build.go</code> | <strong>977</strong> | | Plugins (mounted subsystems) | <code>clients/*</code> | <strong>74,561</strong> |</p>
|
|
<p><strong>76:1.</strong> The core does exactly four things: build deps, mount registered subsystems in order onto one <code>zip.App</code>, serve the transports, and tear down in reverse order. Everything else — IAM, KMS, commerce, ML, fleet, console BFF, sixty-plus packages — is a plugin registered through the one registry API (<code>build.go:351</code>):</p>
|
|
<pre><code class="lang-go">cloud.Register(name string, order int, mount MountFunc)
|
|
cloud.RegisterWithShutdown(name string, order int, mount MountFunc, shutdown ShutdownFunc)</code></pre>
|
|
<p>A subsystem's <code>init()</code> calls <code>Register</code>; a blank import in <code>cmd/cloud</code> activates it; <code>MountAll</code> mounts onto the shared <code>zip.App</code>. This is the substrate HIP-0106's plugin VMs generalize: an embedded plugin is a mount in-process, a plugin VM is the same mount behind a ZAP hop — the <code>zip.App</code> surface is identical.</p>
|
|
<p><strong>Requirement:</strong> every Hanzo Go service exposes its business surface as a mount against a <code>zip.App</code> (the HIP-0106 <code>Mount(app, deps)</code> contract). A service that spins up its own parallel framework — or adds a second server core — is nonconformant.</p>
|
|
<h2>Rationale</h2>
|
|
<p><strong>Why a framework HIP at all.</strong> Because the 76:1 measurement is the architecture. When the server core is one small, shared, boring layer, every product decision becomes a plugin decision — independently mountable, testable, and (per HIP-0106) independently packageable. The alternative — each service owning its own server — is how the pre-HIP-0106 estate accumulated N frameworks and N half-consistent identity parsers.</p>
|
|
<p><strong>Why ZAP-primary rather than HTTP-primary with ZAP bolted on.</strong> Hanzo's internal traffic is ZAP (HIP-0106, HIP-0114, HIP-0120); HTTP exists for the external edge and interop. A server core whose default is the internal wire makes the correct thing the effortless thing — <code>app.Listen(":9653")</code> is conformant by default. The reverse default would make every service opt in to its own platform's transport.</p>
|
|
<p><strong>Why transport-as-value.</strong> Decomplecting "what the handler does" from "how bytes arrive" is the same move HIP-0106 makes for packaging ("what the service does" vs "what process it lives in"). Values, not method explosions: one <code>Listen</code>, schemes as data, <code>RegisterTransport</code> as the single seam.</p>
|
|
<p><strong>Why no escape hatches.</strong> zip deliberately has no <code>.Fast()</code> raw-mode bypass and no per-runtime mount APIs (<code>app.ModuleWasm</code> does not exist). Escape hatches are how second ways in; the profiled hot path (HIP-0106's measured budget) shows the framework does not need one.</p>
|
|
<p><strong>Orthogonality.</strong> One HIP per layer:</p>
|
|
<ul><li>HIP-0114 / HIP-0120 — the <strong>wire</strong>: ZAP envelope, framing, the</li></ul>
|
|
<p> three-protocol rule. zip terminates these; it does not define them.</p>
|
|
<ul><li><strong>HIP-0122 (this)</strong> — the <strong>server core</strong>: App, Ctx, Listen, Mount,</li></ul>
|
|
<p> Module, lifecycle.</p>
|
|
<ul><li>HIP-0106 — the <strong>host binary</strong>: deps wiring, subsystem registry</li></ul>
|
|
<p> policy, fail-closed embeds (its registry rides this HIP's App).</p>
|
|
<ul><li>HIP-0106 — the <strong>packaging shapes</strong> mounted on this core.</li><li>HIP-0105 — the <strong>guest runtimes</strong> behind <code>Module</code>.</li></ul>
|
|
<h2>Decided vs shipped</h2>
|
|
<p>Everything specified here is <strong>shipped</strong>: zip v1.2.1 (<code>github.com/zap-proto/zip</code>), one-verb <code>Listen</code> with ZAP default, streaming-over-ZAP, <code>Mount</code>/<code>Module</code>/typed handlers/MCP projection, and the 977-line <code>cloud</code> host consuming it in production. The one naming residue is transitional: <code>hanzoai/zip v0.2.0</code> still appears as an indirect dependency in older go.mod graphs (e.g. <code>gateway</code>) until those repos rebase onto <code>zap-proto/zip</code> — same code lineage, one module path forward.</p>
|
|
<h2>References</h2>
|
|
<ul><li>HIP-0026 — Identity & Access Management Standard (the minted</li></ul>
|
|
<p> identity <code>Ctx</code> exposes)</p>
|
|
<ul><li>HIP-0105 — In-Process Extension Runtime Standard (the runtimes</li></ul>
|
|
<p> behind <code>Module</code>)</p>
|
|
<ul><li>HIP-0106 — Cloud — Unified Hanzo Binary (the reference host; stack</li></ul>
|
|
<p> table, adapters, measured capacity budget)</p>
|
|
<ul><li>HIP-0134 — One Process, One Socket, One Identity (who owns the principal)</li><li>HIP-0114 — ZAP — Inter-VM Cognitive Transport (the primary wire)</li><li>HIP-0106 — Hanzo Plugin & VM Model (the shapes mounted on this core)</li><li>HIP-0120 — ZAP-Native Transport & gRPC Elimination (the permitted</li></ul>
|
|
<p> protocol set)</p>
|
|
<ul><li><code>~/work/zap/zip</code> — reference implementation (<code>transport.go</code>,</li></ul>
|
|
<p> <code>adapt.go</code>, <code>ctx.go</code>, <code>closers.go</code>, <code>mcp.go</code>, <code>typed.go</code>)</p>
|
|
<ul><li><code>hanzoai/cloud</code> — <code>serve.go</code>, <code>subsystems/subsystems.go</code>,</li></ul>
|
|
<p> <code>build.go</code> (the 977-line host; <code>Register</code> at build.go:351)</p>
|
|
<h2>Copyright</h2>
|
|
<p>Copyright and related rights waived via <a href="https://creativecommons.org/publicdomain/zero/1.0/">CC0</a>.</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-0122.md">This page as plain text</a> · <a href="/llms.txt">Index for agents</a></div>
|
|
</footer>
|
|
</div></body></html> |