Your browser sucks, JavaScript disabled! Gunnar's console needs JavaScript and WebAssembly. Git over SSH on port 2222 does not.

nordisk/holger

.nornir/assets/flow_plugin_registry.svg

<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1180 680" font-family="'DejaVu Sans', 'Segoe UI', sans-serif">
  <defs>
    <linearGradient id="board" x1="0" y1="0" x2="0" y2="1">
      <stop offset="0" stop-color="#0b1c2e"/><stop offset="1" stop-color="#06111d"/>
    </linearGradient>
    <linearGradient id="chip" x1="0" y1="0" x2="0" y2="1">
      <stop offset="0" stop-color="#14384f"/><stop offset="1" stop-color="#0e2a3e"/>
    </linearGradient>
    <linearGradient id="rail" x1="0" y1="0" x2="0" y2="1">
      <stop offset="0" stop-color="#173d57"/><stop offset="1" stop-color="#0c2438"/>
    </linearGradient>
    <marker id="arr" markerWidth="9" markerHeight="9" refX="7" refY="3" orient="auto"><path d="M0 0 L7 3 L0 6 Z" fill="#6fd3f5"/></marker>
    <marker id="arrg" markerWidth="9" markerHeight="9" refX="7" refY="3" orient="auto"><path d="M0 0 L7 3 L0 6 Z" fill="#86b3cc"/></marker>
  </defs>

  <rect x="0" y="0" width="1180" height="680" fill="url(#board)"/>
  <g stroke="#143a52" stroke-width="1"><line x1="0" y1="74" x2="1180" y2="74"/><line x1="0" y1="640" x2="1180" y2="640"/></g>
  <g fill="#16415c"><circle cx="40" cy="40" r="2"/><circle cx="1140" cy="40" r="2"/><circle cx="40" cy="660" r="2"/><circle cx="1140" cy="660" r="2"/></g>

  <text x="40" y="44" fill="#eaf6ff" font-size="22" font-weight="700">The plugin registry — how a backend plugs in</text>
  <text x="560" y="44" fill="#9fc9e0" font-size="14.5">RON config &#8594; wire_holger() &#8594; one trait object per repo &#8594; FastRoutes dispatch</text>

  <!-- RON config -->
  <rect x="40" y="120" width="226" height="180" rx="10" fill="url(#chip)" stroke="#5aa6cf" stroke-width="2"/>
  <text x="153" y="150" fill="#eaf6ff" font-size="15" font-weight="700" text-anchor="middle">holger.ron</text>
  <text x="153" y="170" fill="#9fc9e0" font-size="11" text-anchor="middle">a directed graph</text>
  <g font-family="'DejaVu Sans Mono', monospace" font-size="10.5" fill="#a9d8ee">
    <text x="56" y="196">Repository {</text>
    <text x="66" y="212">ron_repo_type: "maven3"</text>
    <text x="66" y="228">ron_archive_path: &#8230;.znippy</text>
    <text x="66" y="244">ron_in / ron_out</text>
    <text x="56" y="260">}</text>
    <text x="56" y="280" fill="#86b3cc">ExposedEndpoint &#183; StorageEndpoint</text>
  </g>

  <!-- wiring engine -->
  <rect x="330" y="104" width="248" height="212" rx="10" fill="url(#chip)" stroke="#7fc8ea" stroke-width="2.5"/>
  <text x="454" y="134" fill="#eaf6ff" font-size="15" font-weight="700" text-anchor="middle">wire_holger()</text>
  <text x="454" y="154" fill="#9fc9e0" font-size="11" text-anchor="middle">multi-pass resolver</text>
  <g font-size="11" fill="#bcd9ec">
    <text x="346" y="180">1 &#183; index nodes by name</text>
    <text x="346" y="202">2 &#183; instantiate_backends()</text>
    <text x="362" y="218" fill="#86b3cc" font-size="10">backend_from_config() match arm</text>
    <text x="346" y="240">3 &#183; wire repo &#8594; storage / exposed</text>
    <text x="346" y="262">4 &#183; reverse links exposed &#8594; repos</text>
    <text x="346" y="284">5 &#183; build FastRoutes per endpoint</text>
  </g>

  <!-- the registry match -->
  <rect x="642" y="104" width="232" height="212" rx="10" fill="url(#chip)" stroke="#5aa6cf" stroke-width="2"/>
  <text x="758" y="134" fill="#eaf6ff" font-size="14.5" font-weight="700" text-anchor="middle">backend_from_config</text>
  <text x="758" y="152" fill="#9fc9e0" font-size="10.5" text-anchor="middle">repository.rs — the registry</text>
  <g font-family="'DejaVu Sans Mono', monospace" font-size="10" fill="#a9d8ee">
    <text x="656" y="176">match ron_repo_type {</text>
    <text x="668" y="192">"rust"  =&gt; RustRepo&#8230;</text>
    <text x="668" y="208">"maven3"=&gt; MavenRepoZnippy</text>
    <text x="668" y="224">"pip"   =&gt; PipRepoZnippy</text>
    <text x="668" y="240">"docker"=&gt; DockerRepoZnippy</text>
    <text x="668" y="256">&#8230; 13 znippy families &#8230;</text>
    <text x="656" y="272">}</text>
  </g>
  <text x="758" y="296" fill="#86b3cc" font-size="10" text-anchor="middle">&#8594; Arc&lt;dyn RepositoryBackendTrait&gt;</text>

  <!-- FastRoutes -->
  <rect x="938" y="120" width="206" height="180" rx="10" fill="url(#chip)" stroke="#7fc8ea" stroke-width="2.5"/>
  <text x="1041" y="150" fill="#eaf6ff" font-size="15" font-weight="700" text-anchor="middle">FastRoutes</text>
  <text x="1041" y="170" fill="#9fc9e0" font-size="11" text-anchor="middle">per exposed endpoint</text>
  <text x="1041" y="194" fill="#86b3cc" font-size="10.5" text-anchor="middle">first_byte_index[256]</text>
  <text x="1041" y="212" fill="#86b3cc" font-size="10.5" text-anchor="middle">first_byte_len[256]</text>
  <text x="1041" y="236" fill="#a9d8ee" font-size="10.5" text-anchor="middle">name &#8594; bucket &#8594; backend</text>
  <text x="1041" y="258" fill="#86b3cc" font-size="10" text-anchor="middle">O(1) lookup on the hot path</text>
  <text x="1041" y="282" fill="#86b3cc" font-size="10" text-anchor="middle">shared by gRPC + LocalHolger</text>

  <!-- build arrows -->
  <g stroke="#6fd3f5" stroke-width="3" fill="none">
    <path d="M266 210 H328" marker-end="url(#arr)"/>
    <path d="M578 210 H640" marker-end="url(#arr)"/>
    <path d="M874 210 H936" marker-end="url(#arr)"/>
  </g>

  <!-- the trait contract rail -->
  <rect x="40" y="372" width="1104" height="116" rx="12" fill="url(#rail)" stroke="#7fc8ea" stroke-width="2"/>
  <text x="64" y="400" fill="#dff1ff" font-size="15" font-weight="700">trait RepositoryBackendTrait</text>
  <text x="360" y="400" fill="#7fa8c4" font-size="11">the one contract every backend implements — the seam new ecosystems plug into</text>
  <g font-family="'DejaVu Sans Mono', monospace" font-size="11" fill="#bcd9ec">
    <text x="64" y="428">name() -&gt; &amp;str</text>
    <text x="300" y="428">format() -&gt; ArtifactFormat</text>
    <text x="600" y="428">is_writable() -&gt; bool</text>
    <text x="860" y="428">fetch(id) -&gt; Option&lt;Vec&lt;u8&gt;&gt;</text>
    <text x="64" y="452">put(id, data)</text>
    <text x="300" y="452">handle_http2_request(suburl, body) -&gt; (status, headers, bytes)</text>
    <text x="860" y="452">fetch_many_with_upstreams(&#8230;)</text>
  </g>
  <text x="64" y="476" fill="#86b3cc" font-size="10.5">defined once in traits/ &#8226; znippy_type_id() pins each format to znippy's DenseUnion discriminant (source of truth)</text>

  <!-- dispatch at runtime -->
  <rect x="40" y="540" width="226" height="80" rx="10" fill="url(#chip)" stroke="#5aa6cf" stroke-width="2"/>
  <text x="153" y="570" fill="#eaf6ff" font-size="14" font-weight="700" text-anchor="middle">request (repo name)</text>
  <text x="153" y="592" fill="#86b3cc" font-size="10.5" text-anchor="middle">gRPC service / HolgerObject</text>
  <text x="153" y="610" fill="#86b3cc" font-size="10" text-anchor="middle">runtime, after wiring</text>

  <rect x="470" y="540" width="240" height="80" rx="10" fill="url(#chip)" stroke="#5aa6cf" stroke-width="2"/>
  <text x="590" y="570" fill="#eaf6ff" font-size="14" font-weight="700" text-anchor="middle">FastRoutes.lookup(name)</text>
  <text x="590" y="592" fill="#86b3cc" font-size="10.5" text-anchor="middle">&#8594; Arc&lt;dyn Backend&gt;</text>
  <text x="590" y="610" fill="#86b3cc" font-size="10" text-anchor="middle">vtable dispatch, no match on type</text>

  <rect x="918" y="540" width="226" height="80" rx="10" fill="url(#chip)" stroke="#5aa6cf" stroke-width="2"/>
  <text x="1031" y="570" fill="#eaf6ff" font-size="14" font-weight="700" text-anchor="middle">backend.fetch / .put</text>
  <text x="1031" y="592" fill="#86b3cc" font-size="10.5" text-anchor="middle">the concrete plugin runs</text>
  <text x="1031" y="610" fill="#86b3cc" font-size="10" text-anchor="middle">core never knows the ecosystem</text>

  <g stroke="#86b3cc" stroke-width="2.5" fill="none" stroke-dasharray="2 0">
    <path d="M266 580 H468" marker-end="url(#arrg)"/>
    <path d="M710 580 H916" marker-end="url(#arrg)"/>
  </g>
  <path d="M1041 300 V372" stroke="#6fd3f5" stroke-width="3" fill="none" marker-end="url(#arr)"/>
  <text x="1058" y="340" fill="#86b3cc" font-size="10">holds vtables</text>
</svg>