What lives where — as of 4 Apr 2026
site/ directory
Deploy
Auto — fswatch → generate-dashboard.js → wrangler pages deploy
Pages
/
/build
/status
/changelog
/flow
Cf-Access-Jwt-Assertion
Auth Layer 2
Koda JWT — issued by /api/auth/token, 24h expiry
Serves
/api/* REST endpoints
/console/* PWA
api.koda.systems/console/ instead.
api.koda.systems — token not valid for a different origin
Status
CORS whitelist ready in server.js, but domain not wired up
Cloudflare Access issues the Cf-Access-Jwt-Assertion header scoped to api.koda.systems.
If the console were served from console.koda.systems, that header wouldn't be present
(different origin, different Access application), so POST /api/auth/token would fail.
Additionally, auth.js has a hardcoded CF Access login redirect pointing at api.koda.systems.
To split the domains you'd need: a second CF Access application for console.koda.systems,
CORS for cross-origin API calls, and an updated auth redirect URL.
For now, serving the console at /console/ on the same origin as /api/ is simpler
and avoids all cross-origin issues.
apps/console/
Every external system Koda touches is gated by the External Integration Pattern (EIP) — a five-layer defence covering process isolation, chokepoint modules + lint, the bundle-router meta-loader (3 runtimes, 13 bundles, 62 actions), three-actor audit + anomaly watchdog, and confirm-before-destructive guardrails. The dispatch gate is HARD-FAIL since koda-core 2.82.0: any unregistered action is refused with an audit row + owner DM.
bundles/<name>.yaml declare actions, chokepoint functions, permissions, destructive flags, and matcher instructions