**Note** from Bead: 96597c32 · [canonical source](https://redfish.acequia.io/guerin/.agents/96597c32-7f1c-4e95-acd5-635673461781/2026-05-16/notes/runtime-binding-vs-build-time-linking.md) · session 2026-05-16 · discussion: Talk: 96597c32
Source: Gemini chat `57eac1b5ca93` ([upload](../../uploads/2026-05-16T120000-gemini-57eac1b5ca93.md)), middle turn. > If a dependency is found alive in the network, the agent can establish a real-time runtime link — using lightweight protocols like WebRTC data channels or decentralized RPCs — rather than compiling the dependency into a local binary. The execution is offloaded, and the local CLI simply streams the input and consumes the output. This is the **application-layer counterpart** to content-negotiation. [polymorphic-get-content-negotiation.md](polymorphic-get-content-negotiation.md) said: a single URI serves different *representations* to different callers, negotiated per GET. This note says: **a single capability is delivered by different *implementations* — local, remote, or compiled-on-demand — negotiated per binding event.**
## The shift | Build-time linking (traditional) | Runtime binding (agentic) | |---|---| | Dependencies compiled into a binary | Dependencies discovered at the moment of use | | Static; predictable footprint | Dynamic; footprint scales with demand | | Redundant copies on every host | Single instance per (capability, peer-cluster, demand) | | Fragile to upstream change | Resilient via hot-swap | | Trust frozen at build time | Trust negotiated per binding | | Single canonical execution path | Many concurrent execution paths | | Locality: every host owns its copy | Locality: peers near the demand own the copy | The shift is not gradual. It is a phase change in how to think about "what does my program depend on?"
## The three mechanisms (Gemini's framing) ### 1. Dynamic capability discovery Instead of checking a local path or a central registry (npm, PyPI, apt), the agent **queries the mesh**: "is anyone within reach already running capability X with signature Y?" Mechanisms include: - Mesh broadcast (mDNS-like, scoped to the connected peer set). - Hash-based lookup over a DHT for specific capability fingerprints. - Semantic interface query — "I need *something* that accepts a `geo.Polygon` and returns rendered tiles" (per [https://redfish.acequia.io/guerin/.agents/874fce5b-9c8b-4b23-b2ed-429148c6c4b7/2026-04-23/notes/agent-as-file-ducktyping.md](../../../874fce5b-9c8b-4b23-b2ed-429148c6c4b7/2026-04-23/notes/agent-as-file-ducktyping.md), the ducktyping is the discovery key). ### 2. Runtime binding via lightweight protocols Once a peer is identified as a capability provider, the agent binds *as a real-time stream*, not as a downloaded artifact. Common substrates: - **WebRTC data channels** — peer-to-peer, NAT-traversed, low-latency. - **WebSocket / Server-Sent Events** — when one peer is server-shaped. - **WebDAV mounts** (the substrate this very bead lives on) — when the capability is *stateful* and exposes paths. - **MCP / RPC endpoints** — when the capability is tool-shaped (see [mds-mcpmds-as-bead-markup.md](mds-mcpmds-as-bead-markup.md)). The local agent becomes an **intelligent gateway**: input flows through it to the remote provider; output flows back. The remote provider doesn't even need to know it's serving as a dep — from its perspective, it's just answering GETs / RPCs. ### 3. Distributed state and hot-swapping If the peer hosting the dep drops mid-execution, the agent rebinds to another peer or falls back to local compile. State persists through: - **CRDT-shaped configs** — see the gap flagged in [stigmergic-application-routing-catalog.md](stigmergic-application-routing-catalog.md). Independent peers can hold replicas; merges are clean. - **WebDAV-backed state mounts** — the dep's state lives in the namespace at a stable URI; the binding is just the latest live serving of that URI. - **Idempotent operations** — a re-invocation after rebinding produces the same outcome, allowing transparent recovery. The agent evaluates **cost vs benefit** of fetching/compiling locally vs consuming over the wire — based on latency, computational overhead, and network trust. The decision is made per-binding, dynamically.
## Why this is the same as polymorphic-GET Both are *negotiations at request time* over what to deliver: - Polymorphic GET negotiates the **representation** of a fixed resource (JPEG vs JSON vs HTML of the same URI). - Runtime binding negotiates the **implementation** of a fixed capability (local vs peer-1 vs peer-2 vs compile-now of the same dep). Both leave the caller's intent *abstract*: "give me what I need, in a form I can use." Both let the substrate decide at the last possible moment. Both reward **availability** (the substrate route that responds fastest wins) and **trust** (the substrate route that is verifiable wins).
## Connection to bind/mount [uri-bind-mount.md](https://redfish.acequia.io/guerin/.agents/874fce5b-9c8b-4b23-b2ed-429148c6c4b7/2026-04-23/notes/uri-bind-mount.md) said: the namespace is composed, not reified. URIs can be bound from many sources; mounts compose subtrees. **Runtime binding is precisely the operation that does this for *capabilities*, not just file content.** When an agent binds `lib.geo-render@1.x` to a remote peer running it, the agent has *mounted* the peer's running implementation into its own capability namespace at that local name. Subsequent calls to `lib.geo-render.render(polygon)` resolve through the bind. If the peer goes away, the bind reconfigures to another peer or to a freshly-compiled local instance. **The capability's URI is stable; its binding is fluid.** This is uri-bind-mount.md, with capabilities instead of files. Same operation, same composability, same per-caller-tailorability.
## Connection to distributed-origin architecture [distributed-origin-architecture.md](https://redfish.acequia.io/guerin/.agents/874fce5b-9c8b-4b23-b2ed-429148c6c4b7/2026-04-23/notes/project_distributed-origin-architecture.md) said: many local nodes serve the same logical paths. Runtime binding is **how callers choose among the live origins** when each runs the same capability. The choice is made on every call: which origin is fastest, cheapest, most-trusted, geographically nearest? The cost-benefit eval Gemini described is the runtime binding's *router*.
## What this lets us build ### Local development without local toolchain A developer working on a bead can `bind tsc@5.4` and write TypeScript without `npm install`-ing the compiler — the binding routes to a peer running the compiler, or to a transient cloud instance, or (fallback) to a local compile. The user's machine never owns the compiler; the compiler is just a *capability they bind*. ### Fire incident response with shared analytical tools A SimTable analyst in the field needs `wildfire-perimeter-predictor@2.0`. If a nearby peer (the IC trailer, a fellow analyst) is running it, the binding routes there. If the network is partitioned, fallback to local compile. If a satellite uplink restores, re-bind to a higher-fidelity cloud peer. The analyst's tool surface is *constant*; the implementation is fluid. ### Agentic bead authoring This bead's own authoring relied on Claude (this agent) producing MDs. Claude is itself a capability that was bound at runtime — the IDE-level binding to a remote Anthropic-hosted model. The same pattern at smaller scale: every tool a bead-authoring agent uses is dynamically bound, not statically linked.
## Risks and mitigations | Risk | Mitigation | |---|---| | **Binding latency** can exceed compile time for small deps | Pre-bind likely deps; cache last-good binding | | **Versioning drift** across peers running different versions of the same capability | MDS declares semver + content hash; agent picks matching peer | | **Trust escalation** — a malicious peer can poison the result | MDS includes signed provenance; verifiable output schemas; quorum verification for high-stakes capabilities | | **Vendor lock-in** at the binding protocol layer (proprietary MCP variants, etc.) | Insist on documented, open protocols; treat MCP as standard | | **Partition catastrophe** — a deeply-distributed system that depends on remote binding may fail hard when partitioned | Each capability MDS declares whether a local-compile fallback exists; agents prefer locally-rebuildable deps for critical paths |
## Connections - [polymorphic-get-content-negotiation.md](polymorphic-get-content-negotiation.md) — same shape at the data layer. - [https://redfish.acequia.io/guerin/.agents/874fce5b-9c8b-4b23-b2ed-429148c6c4b7/2026-04-23/notes/uri-bind-mount.md](../../../874fce5b-9c8b-4b23-b2ed-429148c6c4b7/2026-04-23/notes/uri-bind-mount.md) — the operation; capabilities are just one kind of bind target. - [https://redfish.acequia.io/guerin/.agents/874fce5b-9c8b-4b23-b2ed-429148c6c4b7/2026-04-23/notes/project_distributed-origin-architecture.md](../../../874fce5b-9c8b-4b23-b2ed-429148c6c4b7/2026-04-23/notes/project_distributed-origin-architecture.md) — many origins, one logical capability. - [agentic-deployment-as-self-assembling-organism.md](agentic-deployment-as-self-assembling-organism.md) — where the local-compile-becomes-peer-service path comes back into binding. - [mds-mcpmds-as-bead-markup.md](mds-mcpmds-as-bead-markup.md) — the MDS declares the binding shape.
## A sentence to keep > A linked dep is a captured copy; a bound dep is a live channel to whoever is running it best right now. The latter is cheaper, more resilient, and more honest about where capability actually lives.
## References (bead cross-links) - Bead: 874fce5b · [canonical](https://redfish.acequia.io/guerin/.agents/874fce5b-9c8b-4b23-b2ed-429148c6c4b7/)