Bead: Local Gateway Agent

**Bead** `aeb319e9-a00c-46cc-8b33-07eabcf17813` · [canonical URI](https://redfish.acequia.io/guerin/.agents/aeb319e9-a00c-46cc-8b33-07eabcf17813/) · discussion: Talk: Local Gateway Agent This page is the wiki facet of a [bead](https://redfish.acequia.io/guerin/.agents/); the bead is the source of truth.

> A prototype bead at the **composition rung** of the bead chain. The chain so far is declaration ([agentify-bead](https://redfish.acequia.io/guerin/.agents/d9dfa5e4-3c92-4216-bd53-13b520c59a5e/)) -> routing ([hey-you-its-me](https://redfish.acequia.io/guerin/.agents/ec4d09d8-7f06-41d3-80fe-80aeaedba680/)) -> handler ([webdav-bead](https://redfish.acequia.io/guerin/.agents/fe7fbaf5-4c47-43b6-be1b-2f6ca15e8bfa/)). This bead **handles agentify-bead and then webdav-bead** via Plan-9 parameterized `mount`/`import`, and runs as a concrete agent: a deterministic **local-network gateway setup agent** (cognition rung 0; an LLM only on ambiguity).

## Identity - **URI:** https://redfish.acequia.io/guerin/.agents/aeb319e9-a00c-46cc-8b33-07eabcf17813/ - **Local origin:** `sites/redfish.acequia.io/guerin/.agents/aeb319e9-a00c-46cc-8b33-07eabcf17813/` - **GUID:** `aeb319e9-a00c-46cc-8b33-07eabcf17813` - **Slug:** `local-gateway-agent` (working name, pending Stephen) - **Opened:** 2026-06-13 - **Parciante:** Stephen Guerin (guerin) - **Currently animated by:** Claude (CE/CV — Claude Code extension, bead scribe with filesystem/WebDAV write authority)

## Motivation (Why a GUID) Two threads converge here. A practical thread (how to sync new phone media, then named Cache-API caches, between domain origins managed by service workers, **without a cloud roundtrip**) drove a concrete LAN architecture: WebDAV PUT as the only SW-drivable transport, Caddy as a local TLS gateway, `.local`/mDNS addressing, and naming as a governance act. Then Stephen reframed it: *make a bead in the prototype bead chain that handles agentify-bead and then webdav-bead, using Plan-9 mount and import with parameters; this bead should become mountable as an agent (`agent.md`) that actually executes the setup for someone's domain and network topology, with a hard-scripted front-end that needs no LLM, escalating to a model only for ambiguous requests.* A fresh GUID gives that composition-and-application its own addressable home.

## Mechanism (What this bead does) 1. **Composes the chain.** Mounts agentify-bead (declaration, read-only, `-b`) and webdav-bead (handler, `-a`), then *imports* the handler runtime with parameters (`--as handler --cognition rung0 --scope ... --integrity ...`). See [chain-mount-import.md](https://redfish.acequia.io/guerin/.agents/aeb319e9-a00c-46cc-8b33-07eabcf17813/2026-06-13/notes/chain-mount-import.md). 2. **Carries the gateway architecture** as durable notes: local-first cache sync, Caddy TLS, mDNS governed naming, router-as-mayordomo. 3. **Defines the reified setup agent**: a deterministic (rung-0) front-end that takes a domain + network topology and emits a Caddyfile + mDNS config + governed-name allocations; an LLM is invoked only for the ambiguous tail. See [reified-setup-agent.md](https://redfish.acequia.io/guerin/.agents/aeb319e9-a00c-46cc-8b33-07eabcf17813/2026-06-13/notes/reified-setup-agent.md).

## Folder Layout ``` aeb319e9-a00c-46cc-8b33-07eabcf17813/ ├── about.md # this file — descriptive self ├── README.md # front-door sidecar ├── agent.md # operative self (imports the chain, runs as setup agent) ├── agent.json # machine twin (A2A card) ├── names.json # local namespace (binds the chain beads) ├── keywords.json # index surface ├── uploads/ │ └── README.md # inbound dock └── 2026-06-13/ ├── notes/ │ ├── 00-local-first-cache-sync.md # SW-only-HTTP; cache<->WebDAV impedance; two-layer split │ ├── caddy-local-tls-gateway.md # Caddy TLS; mixed-content/CORS/PNA; loopback vs gateway │ ├── mdns-governed-naming.md # .local; collisions; names-as-bindings; governed namespace │ ├── router-as-mayordomo.md # gateway belongs in the router; market vs tech gap │ ├── reified-setup-agent.md # rung-0 deterministic front-end; LLM only on ambiguity │ └── chain-mount-import.md # ★ parameterized mount/import of agentify -> webdav └── chats/ └── 2026-06-13-local-gateway-and-chain-mount.md # verbatim session log ```

## Session Log - **2026-06-13** — Bead opened. Conversation began on syncing phone media to a WebDAV server (PUT), broadened to syncing named Cache-API caches between SW-managed origins, then to avoiding the cloud roundtrip. Established: a service worker can only drive HTTP `fetch`, so WebDAV is the only SW-layer transport (rsync/WebRTC re-enter only at the node-to-node hop); the cache<->WebDAV impedance match; Caddy as a local TLS gateway (internal CA vs DNS-01; loopback vs LAN door; CORS + PNA gotchas); `.local`/mDNS addressing and the collision/auto-suffix hazard; naming as a governed (mayordomo) act, Bob/little-bob; the gateway belongs in the router (compuerta). Wrote five architecture notes. - **2026-06-13 (later)** — Stephen: survey all beads from the last two weeks; make a bead in the **prototype bead chain** that handles agentify-bead then webdav-bead; Plan-9 has mount and import with parameters. Surveyed ~44 recent beads. Found the chain (agentify `d9dfa5e4` -> hey-you-its-me `ec4d09d8` -> webdav `fe7fbaf5`), the `bead-mount` design ([plan9-beads `975f5db5`](https://redfish.acequia.io/guerin/.agents/975f5db5-905e-42c4-8ec6-f3911a691374/)), and the `start-bead`-as-`import()` design (webdav-bead import-semantics note). Reframed this bead as the **composition rung**; wrote [chain-mount-import.md](https://redfish.acequia.io/guerin/.agents/aeb319e9-a00c-46cc-8b33-07eabcf17813/2026-06-13/notes/chain-mount-import.md) (parameterized mount/import + this bead's namespace-file) and laid down `agent.md`/`agent.json`.

## Modus Operandi (How to interact) - Read [chain-mount-import.md](https://redfish.acequia.io/guerin/.agents/aeb319e9-a00c-46cc-8b33-07eabcf17813/2026-06-13/notes/chain-mount-import.md) first for the chain position and the mount/import parameters; then the gateway notes for the application. - Deposit material in `uploads/` per the blackboard protocol. - Nothing here is reified into the canonical protocol; the `bead-mount` / `import` parameter surface is composed from the proposed designs in `975f5db5` and `fe7fbaf5`, both awaiting Stephen's binding.

## Capabilities - **Composition reference**: a worked instance of `import(declaration) + import(handler, params) + a rung-0 competence`. - **Local-network gateway setup** (design): emits Caddyfile + mDNS config + governed-name allocations from a topology declaration; offers them, does not reify infrastructure it does not own.

## Lifecycle Active design thread. The next artifact is the deterministic generator `skills/gateway-setup.mjs` (topology in, config artifacts out) plus this bead's `agent.json.handler`/`import` blocks once the parameter surface is bound. Apoptoses into a citable record once a reference implementation is hatched; the folder persists as the fossil.

## Limitations - Paper design plus captured architecture. No running animator, no `gateway-setup.mjs`, no live mount table yet. - The `mount`/`import` parameter surface is **composed from proposed designs** (`975f5db5` bead-mount, `fe7fbaf5` import-semantics), not ratified into `.agents/beads.md`. - The integrity pin in the import manifest is a placeholder until the rung-0 skill is built.

## References (bead cross-links) - Bead: Agentify Bead · [canonical](https://redfish.acequia.io/guerin/.agents/d9dfa5e4-3c92-4216-bd53-13b520c59a5e/) - Bead: Hey You Its Me · [canonical](https://redfish.acequia.io/guerin/.agents/ec4d09d8-7f06-41d3-80fe-80aeaedba680/) - Bead: As Webdav Handler · [canonical](https://redfish.acequia.io/guerin/.agents/fe7fbaf5-4c47-43b6-be1b-2f6ca15e8bfa/) - Bead: Plan9 Beads · [canonical](https://redfish.acequia.io/guerin/.agents/975f5db5-905e-42c4-8ec6-f3911a691374/) - Bead: 874fce5b · [canonical](https://redfish.acequia.io/guerin/.agents/874fce5b-9c8b-4b23-b2ed-429148c6c4b7/) - Bead: CV · [canonical](https://redfish.acequia.io/guerin/.agents/5595c7f1-4621-437c-a4ae-7902b640f0e8/)

See all: Beads