From 113751ef1b81de4313343276143f662e56a0bea8 Mon Sep 17 00:00:00 2001 From: William Valentin Date: Mon, 16 Feb 2026 01:49:05 -0800 Subject: [PATCH] docs(plan): mark bonjour discovery gap completed --- ...-02-16-bonjour-mdns-discovery-checklist.md | 40 +++++++++++++++++++ docs/plans/state.json | 26 +++++++++++- 2 files changed, 64 insertions(+), 2 deletions(-) create mode 100644 docs/plans/2026-02-16-bonjour-mdns-discovery-checklist.md diff --git a/docs/plans/2026-02-16-bonjour-mdns-discovery-checklist.md b/docs/plans/2026-02-16-bonjour-mdns-discovery-checklist.md new file mode 100644 index 0000000..fde2f32 --- /dev/null +++ b/docs/plans/2026-02-16-bonjour-mdns-discovery-checklist.md @@ -0,0 +1,40 @@ +# Bonjour/mDNS Discovery Checklist + +Date: 2026-02-16 +Status: completed + +## Scope + +- Add optional LAN service advertisement/discovery for the Flynn gateway. +- Keep discovery disabled by default and safe for production deployments. + +## Completed + +- Added `server.discovery` config schema in `src/config/schema.ts`: + - `enabled` (default `false`) + - `service_name` (default `flynn-gateway`) + - `service_type` (default `_flynn._tcp`) + - `txt` (default `{}`) +- Added gateway discovery runtime in `src/gateway/discovery.ts`: + - starts mDNS advertisement via `avahi-publish-service` (Linux) with fallback to `dns-sd` (macOS) + - supports graceful shutdown (`SIGTERM` with fallback `SIGKILL`) +- Wired discovery into gateway lifecycle in `src/gateway/server.ts`: + - starts advertisement after gateway listen + - stops advertisement during shutdown + - injects non-secret TXT metadata (`instance`, `version`) plus optional config `txt` + - skips advertisement when bound to loopback (`server.localhost: true`) +- Wired config into gateway construction in `src/daemon/services.ts`. +- Updated docs: + - `README.md` with Bonjour/mDNS configuration and behavior notes + - `config/default.yaml` with discovery defaults and LAN safety comment +- Added tests: + - `src/config/schema.test.ts` (discovery defaults + custom config) + - `src/gateway/discovery.test.ts` (spawn path, fallback path, hard failure path) + - `src/gateway/server.discovery.test.ts` (gateway lifecycle start/stop + loopback skip) + +## Tests + +## Verification + +- `pnpm test:run src/config/schema.test.ts src/gateway/discovery.test.ts src/gateway/server.discovery.test.ts` +- `pnpm typecheck` diff --git a/docs/plans/state.json b/docs/plans/state.json index 44b782c..07e0637 100644 --- a/docs/plans/state.json +++ b/docs/plans/state.json @@ -385,6 +385,28 @@ ], "test_status": "pnpm test:run src/config/schema.test.ts src/memory/qmd-search.test.ts + pnpm typecheck passing" }, + "bonjour-mdns-discovery": { + "file": "2026-02-16-bonjour-mdns-discovery-checklist.md", + "status": "completed", + "date": "2026-02-16", + "updated": "2026-02-16", + "summary": "Implemented optional LAN Bonjour/mDNS discovery for gateway advertisement via host tools (`avahi-publish-service` with `dns-sd` fallback), including safe default-off config (`server.discovery.*`), lifecycle start/stop wiring, loopback guardrails, docs, and tests.", + "files_created": [ + "docs/plans/2026-02-16-bonjour-mdns-discovery-checklist.md", + "src/gateway/discovery.ts", + "src/gateway/discovery.test.ts", + "src/gateway/server.discovery.test.ts" + ], + "files_modified": [ + "src/config/schema.ts", + "src/config/schema.test.ts", + "src/daemon/services.ts", + "src/gateway/server.ts", + "config/default.yaml", + "README.md" + ], + "test_status": "pnpm test:run src/config/schema.test.ts src/gateway/discovery.test.ts src/gateway/server.discovery.test.ts + pnpm typecheck passing" + }, "skill-safety-scanner": { "file": "2026-02-15-skill-safety-scanner-checklist.md", "status": "completed", @@ -2775,12 +2797,12 @@ "tier2_completion": "4/4 (100%) — inbound webhooks, vector memory search, Dockerfile, heartbeat monitor", "tier3_completion": "5/5 (100%) — lane queue, credential redaction, web UI token dashboard, xAI (Grok) provider, Voyage AI embeddings", "tier4_completion": "4/4 (100%) — gateway lock, shell completion, Tailscale Serve/Funnel, DM pairing codes", - "feature_gap_scorecard": "108/128 match (84%), 0 partial (0%), 20 missing (16%)", + "feature_gap_scorecard": "109/128 match (85%), 0 partial (0%), 19 missing (15%)", "operator_dx_milestone": "Phase 3 (Live Ops Dashboard): 2/2 plans complete — milestone done", "gmail_auth_cli": "flynn gmail-auth command implemented with OAuth2 flow, doctor check, config routed to Telegram", "native_audio_support": "completed — smart routing for native audio (Gemini/OpenAI/GitHub) vs Whisper transcription fallback", "remaining_phases_completion": "Phase 1: 3/3 (100%) — context levels, command registry, memory structure. Phase 2: 3/3 (100%) — component registry, confidence routing, history index. Phase 3: 2/2 (100%) — adaptive memory/compaction, truthfulness/autonomy hardening", - "next_up": "Select next OpenClaw gap item from roadmap and open the next scoped implementation checklist" + "next_up": "OpenClaw gap: Signal channel adapter (open next scoped implementation checklist)" }, "soul_md_and_cron_create": { "date": "2026-02-11",