Islandflow turn record

Fix local backend connectivity

api cors deployed dev:web verified dev:desktop verified native deployment path

Summary

Local web and desktop development were failing to reach the hosted Islandflow backend because browser CORS preflight requests were blocked by the native API edge. The API now reflects allowed local origins, answers OPTIONS preflight, and the local web surface connects cleanly to https://api.flow.deltaisland.io.

The terminal UI also now avoids oversized evidence URLs and stale request floods, which were showing up as noisy browser network warnings after the CORS fix landed.

Changes Made

API CORS layerAdded reusable CORS helpers, configured allowed origins, wrapped API responses, and handled OPTIONS globally.
Local dev originsNext dev now allows localhost, 127.0.0.1, detected local IPv4 addresses, and optional NEXT_ALLOWED_DEV_ORIGINS.
Terminal fetch stabilityChunked option evidence lookups, bounded flow packet fetch concurrency, and abort stale hydration requests.
Chart overlay capChanged the equity overlay range request from 2500 rows to the API-supported 1000-row maximum.

Context

The repo is using native deployment for the hosted API, not Docker compose. I deployed the API CORS fix through the native deploy path and validated the running islandflow-api.service directly after the deploy wrapper returned a nonzero verification-tail exit.

After CORS was fixed, the local browser could connect, but terminal helper fetches still produced warnings from oversized /option-prints/by-trace query strings and fast-changing live windows. Those were separate frontend request-shaping issues, not the main websocket/backend connection.

Important Implementation Details

Relevant Diff Snippets

Rendered with @pierre/diffs/ssr from a representative diff covering the API CORS helper, API wiring, Next dev-origin config, and terminal fetch handling.

Expected Impact for End-Users

Developers can run bun run dev:web or bun run dev:desktop and see the local terminal connect to the hosted native backend without CORS failures. The live terminal should also stay calmer under evidence-heavy alert windows because it no longer emits oversized by-trace URLs or piles up stale support requests.

Validation

Issues, Limitations, and Mitigations

Follow-up Work