DIAGNOSTIC — DO NOT MERGE: switch_relays → relay.nsec.app + proxy second sub#5
DIAGNOSTIC — DO NOT MERGE: switch_relays → relay.nsec.app + proxy second sub#5DocNR wants to merge 8 commits into
Conversation
First probe returned ["wss://relay.nsec.app"] and Coracle's UI still stalled, disproving the welshman-narrowing hypothesis. Pivoting to return null (Amber's responder-only pattern) + keeping the proxy's secondary sub on relay.nsec.app, to validate whether the real architectural combo lets sign_event complete. Plan: ~/hq/clave/plans/2026-04-19-switch-relays-nsec-app-diagnostic.md
Pivot (2026-04-19 second probe)Build 15 probe result: Coracle UI did not advance — disproves the welshman-narrowing hypothesis. Any non-null Pivoting, not reverting yet. Two new commits pivot the iOS side to Amber's responder-only pattern ( Commits:
Proxy deploy on Dell unchanged — already running the secondary sub from the first probe. Decision tree still applies after build 16:
Still draft. Still do not merge. |
…not merge) Probe B found 0 events on relay.nsec.app secondary sub despite successful connection. Grep confirmed Clave's own NSE/app/AppState all use narrow kinds:24133 + #p:signerPubkey filters; the proxy was using a broad kinds:24133 filter. Strict relays appear to drop broad subs. Probe C narrows secondary subs to registered signer pubkeys at sub-open time to validate that hypothesis. Plan: ~/hq/clave/plans/2026-04-19-switch-relays-nsec-app-diagnostic.md
… not merge) Pyramid + fevela tests showed requests arrived on their URI relays (via proxy secondary subs), APNs fired, NSE woke and signed — but response was always routed to SharedConstants.relayURL (relay.powr.build) because LightSigner's bunker/NSE fallback branch hardcoded it. Clients not subscribed to relay.powr.build timed out waiting. Fix: thread push-payload relay_url through NotificationService + ClaveApp (AppDelegate push handler) to LightSigner.handleRequest as responseRelayUrl, used as the publish target when responseRelays aren't provided. Matches the per-event relay_url the proxy already sends. Plan: ~/hq/clave/plans/2026-04-19-switch-relays-nsec-app-diagnostic.md
Probe E (build 17) — final-mile fixProbes B-D established that pyramid and fevela fail to accept Clave's signed response even when the proxy catches the request on their URI relay and APNs fires successfully. Grep revealed why: Fix commits:
Changes:
Proxy-side config (Dell Still draft. Still do not merge. |
Closing — architecture fully validated, changes upstreaming as separate PRsFive probes, three client library families, full end-to-end validation complete. Summary:
Full write-up: Followup PRs (new branches off main, not this branch):
Dell proxy reverted to Closing; branch will be deleted. |
Brainstorm review of design-system.md against shipped code surfaced 9 inconsistencies + 1 anti-pattern still present. Fixed everything in one batch so the next TestFlight archive carries it all. Code: - HomeView: drop .padding(.bottom, 8) on SlimIdentityBar invocation — slim banner owns its outer bottom padding (12pt); stacking another 8pt on top was double-counting (review #4) - HomeView: drop .padding(.bottom, 8) inside statsRow — listSectionSpacing(0) carries the gap to Connected Clients; the residual padding kept the visible gap excessive after polish round 2 (review #2) - AccountDetailView: avatarLarge letter fallback opacity 0.25 → 0.22 to align with SlimIdentityBar's 0.22 (review #3) - ConnectSheet: add .presentationBackground(Color(.systemGroupedBackground)) — was the last sheet still defaulting to translucent (review #9) - ApprovalSheet: rename @State capExceeded → showConnectionCapAlert for naming convention parity with HomeView (review #7) design-system.md: - New "Cross-platform applicability" section at the top — clarifies what carries directly to clave.casa web companion (color tokens, displayLabel rule, identity-vs-functional zone philosophy, avatar treatments, copy patterns, anti-patterns) vs what's iOS-only (SwiftUI modifiers, haptics, sheet/toolbar conventions) - §3 Typography: corrected initial-letter font scale — AvatarView uses size*0.35 mono (pubkey) or size*0.4 proportional (name); was wrongly documented as a single 0.37 (review #1) - §4 Avatars: added Treatment Selection Rule table (B on neutral bg, C on saturated theme gradient) + clarified 1-vs-2 letter behavior (review #5, #6) - §4 Sizing scale: expanded table to include initial font + border thickness per slot, with the ~5% border scaling rule (review #8) - §5 Spacing: explicit "single source of truth" note on slim banner bottom padding; new "Stats row" subsection capturing the ultraThinMaterial-on-small-cards-OK rule (review gap #10, #4) - §6 HomeView gradient: documented palette[0] defensive fallback when currentAccount is nil (review #13) - §7 Patterns: new "State variable naming" subsection with the showCapAlert / showAccountCapAlert / showConnectionCapAlert convention (review #7 doc side) - §11 Anti-patterns: audit-point note that ConnectSheet was the last surface to acquire .presentationBackground (review #9 doc side) Build green on iOS Simulator 26.4. pbxproj still 41 — assumes user hasn't yet archived 41; bump to 42 if needed before re-archive. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This PR is a diagnostic. It must not be merged. It will be closed and the branch deleted after the test completes, regardless of outcome.
Purpose
Validate the proxy-per-client-relay architectural direction end-to-end with minimal code before committing to the full 1-2 day backlog implementation. Two coordinated changes:
Shared/LightSigner.swift):switch_relaysRPC now returns["wss://relay.nsec.app"]instead of["wss://relay.powr.build"]. For Coracle (whose nostrconnect URI already containsrelay.nsec.app), welshman should treat this as a pool narrowing rather than a migration — no UI stall.relay-proxy/proxy.js): parameterizedconnectRelay(relayUrl, subId)and fans out overRELAY_URL+SECONDARY_RELAY_URLS(defaults towss://relay.nsec.app). When asign_eventarrives on the secondary relay for a registered pubkey, the same APNs push pipeline fires. Adds a[Compliance]log line per kind:24133 event for per-client PRIMARY/SECONDARY classification.Expected outcomes (truth table)
Scope
In: one-line iOS
switch_relaysresponse change + ~60-line proxy multi-relay sub refactor + a structured[Compliance]log line.Out: any other iOS behavior, any persistence of per-client URI relays (the full proxy-per-client-relay work this diagnostic de-risks), any
switch_relaysresponse policy change beyond the relay URL swap.Revert plan
After the test outcome is recorded:
git checkout main && git pull --rebase origin main && sudo cp relay-proxy/proxy.js /opt/clave-proxy/proxy.js && sudo systemctl restart clave-proxymain(supersedes the diagnostic build 15)Trip-wires against accidental merge
// DIAGNOSTIC 2026-04-19comment naming this planSECONDARY_RELAY_URLSPlan
Local: `~/hq/clave/plans/2026-04-19-switch-relays-nsec-app-diagnostic.md` (not in repo — lives in the sprint docs tree)
Context docs (local):
nullprobeNotes
wss://relay.nsec.appwithout asking. Fine for a single diagnostic session with light load; reverted before it matters.mainhas linear history + no force push, so there's no mechanical risk of this sneaking in.