Repository navigation
Description
Ask
Make it a stated product rule, with a test behind it, that FTW is the complete product when run locally. No feature a household needs to use FTW may depend on the relay, the escrow, the push path or any other Sourceful service being reachable. Someone who only wants a box on their LAN, with app_link off, gets everything. Someone who has the app loses nothing but remote reach when Sourceful's services are down, and keeps the whole product on the box if those services are ever retired.
Today this holds in the code. It is not written down as a rule, it is not tested, and the list of what is relay-only by nature is spread over package comments and an ADR. Without that list, the next app-first feature can quietly land on the relay side alone.
What holds today, with evidence
- The app's request surface is a strict subset of the local API. Seven inbound message kinds (
go/internal/appproto/messages.go), and every implementedcmdop is annotatedVia(...)on the local route it shares:site.mode.setonPOST /api/mode,loadpoint.hold,loadpoint.boost,loadpoint.soc.setandloadpoint.surplus_only.seton the/api/loadpoints/{id}/…routes. api.passthroughruns the box's ownapi.Serverhandler in-process ("the same handler the LAN listener serves, trust boundary included",go/internal/appproto/passthrough.go). Its gate only refuses:E_USE_CMD,E_LOCAL_ONLY,E_WHOLE_DOCUMENT, non-/api/paths. The app never sees a route the LAN does not.- Nothing local reads the uplink.
main.goreferences it only for enrolment and the dead-man resync. Relay loss means one reconnecting goroutine with capped backoff and one log line. README.mdanddocs/architecture.mdboth say it: "An unavailable relay leaves local control and local recovery intact."- The uplink is a switch,
app_link.enabled, shown in Settings → FTW app. Fleet statistics is a separate switch. - The on-box UI has the everyday charging flow the roadmap credits to the webapp: plug-in view, SoC goal, schedule autosave, Charge now, battery boost (
web/ev-plan.js,web/loadpoints.jsand their tests). - Notifications have a provider that needs no Sourceful service:
ntfy, any server including self-hosted.
What is relay- or cloud-dependent by nature, and should become the whole reviewed list
- Remote reach itself. The webapp has only the relay carrier; the WebRTC LAN carrier is deferred in
srcfl/ftw-webappdocs/architecture.md, and pairing redemption happens inside the Noise handshake over the relay only. Thelan_hintin the QR payload is unused. So the app is a remote client, full stop, and that is fine as long as the box's own UI is complete. box.unreachablepush, the dead-man switch (go/internal/appuplink/deadman.go). Only the relay can say the box is gone. When the relay is down the switch simply cannot fire; nothing on the box changes.- Lock-screen push in practice. Web Push is posted straight to the browser vendor's push service, not through the relay, but only the app registers a subscription. The on-box UI has no service worker, so a local-only site uses
ntfyfor the same events. - Owner/viewer roles and invites. The LAN door is one house password with no per-person identity.
- Escrow recovery of a phone's keys.
Questions this issue should settle
- Default-on uplink. With
app_linkabsent the box dialswss://relay.ftw.energyat boot whether or not a phone is ever paired. That is a product choice (CHANGELOG 2.0.x), but a local-only site should be able to have no outbound connection to Sourceful at all, and setup should make the choice visible. - DNS in identity resolution.
gatewayidentityresolvesrelay.ftw.energyonly to learn which interface would carry the uplink, and its comment records that an earlier dead name made identity resolution fail at the lookup. A lookup failure must never block boot, identity or control. Worth a test. - Notifications when the app is closed is a roadmap acceptance item that only Web Push meets. Decide whether
ntfyis the sanctioned local answer and say so in docs, or add a channel that needs no third party. - Service downtime or retirement. The relay endpoint is a compile-time constant on purpose. If Sourceful's services are down, the app falls back to its cache carrier and the box carries on. If they are retired, the app is gone and the box must still be the whole product. The rule should say that plainly.
Proposed acceptance
- A sentence in the product rules (
AGENTS.md, mirrored inVISION.md): local-only operation is a supported configuration, and every feature needed to run FTW works withapp_linkoff and with the relay, escrow and push services unreachable. - The relay-only list above lives in
docs/architecture.mdunder Remote access boundary, so a reviewer can ask "why is this new thing on the relay-only list?" in a PR. - A test that boots Core with
app_linkon and the relay unresolvable or refusing, and asserts that control ticks, the on-box UI and/api/routes behave exactly as withapp_linkoff, with one honest status line and no log flood. A second case with DNS failing entirely covers the identity lookup. - A checklist line for contract changes: a new op or capability in
contract/registry.yamlnames its local route or UI, or is added to the relay-only list with the reason.
Why now
The roadmap's client table gives srcfl/ftw-webapp "fast everyday UI, charging interaction, intent/result feedback, notifications". That is the right split of responsibility, but it reads as if those things belong to the app. VISION says local operation survives loss of the caller or cloud. This issue asks for that to be explicit and tested before more app-first work lands.
🤖 Generated with Claude Code
Activity
docs(cloud): take in what C2 and C3 built (#1604)