# App-layer integration notes The app layer in `src/apps/` is wired into `src/app.ts` and verified live (`GET /` tiles, `GET /apps/:id`, GET action submit, same `act()` as MCP). ## What exists - `src/apps/types.ts` — the contract: `AppDefinition`, state schema, action/effect schema. - `src/apps/storage.ts` — `packageStorage()` with shared in-memory fallback; `createMemoryStore()` for isolated/fresh stores. - `src/apps/registry.ts` — `list_apps`, `get_app`, `get_app_state`, `act`, `add_app`, `remove_app`, `export_app`, `import_app`, `validateDefinition`. - `src/apps/forms.ts` — `actFromForm(id, entries)` — the UI path; funnels into the same `act()` MCP uses. - `src/apps/render.ts` — browser-safe (zero runtime imports) HTML builders: `renderHomeTiles`, `renderAppSection(def, state, appBasePath, fromPath?)`. Counter comes from `catalog/counter/definition.json` via `add_app` (no in-code harness). ## Edge rule: app actions are GET, never POST Kody's edge rejects a mutating request to a `*.kody.run` package-app subdomain when the browser reports a foreign or `null` `Origin`: > Cross-origin mutating requests to a package-app subdomain are not allowed. A plain same-origin POST works from some browsers, but embedded views, sandboxed iframes, and some older browsers report `Origin: null`. The Scribe must not depend on that. The edge does not block GET. Rules for every current and future app: 1. Render UI actions as `