diff --git a/docs/offscale-plugin.md b/docs/offscale-plugin.md index ea785146..3e6c257b 100644 --- a/docs/offscale-plugin.md +++ b/docs/offscale-plugin.md @@ -576,6 +576,51 @@ Used for both `/api/...` and the frontend route. Nothing else in the codebase ma --- +## What is built, as of 2026-08-14 + +The plugin system works end to end for a plugin that has an `api/router.ts`. Verified against a running +server, with **no restart at any point**: + +``` +/api/example/ping BEFORE install 404 +AFTER install 200 {"plugin":"example","ok":true} +AFTER disable 404 +AFTER enable 200 +AFTER uninstall 404 +core routes throughout 200 +``` + +| Piece | Where | +| ------------------------------------------- | --------------------------------------------- | +| Manifest type, `mountPrefix`, validation | `servers/plugins/manifest.ts` | +| Discovery by convention | `servers/plugins/discover.ts` | +| Disk ⋈ database, and the rebuild | `servers/plugins/mount.ts` | +| `buildHonoApp` / `rebuildHonoApp` | `servers/hono.ts` | +| The closure that makes the swap take effect | `server.tsx`, the `/api/*` route | +| Install state | `plugin_installs` (`officer_db/src/plugins/`) | +| The four verbs | `servers/api/plugins/router.ts`, owner-only | +| The screen | `/plugins` — two panels, `?selected=` | +| The reference plugin | `plugins/example/` — meant to be read | + +### Not wired yet + +- **The schema push.** A plugin with `db/schema.ts` installs, but its tables are not created. Marked + `[open]` in the router. +- **The sidecar's PM2 entry.** A plugin with `sidecar/` installs, but no process starts. This is the same + hole `app-store/pm2.ts:23-29` documents for the app store, and it is the next thing to build. +- **Websocket providers.** `server.reload({ routes })` is proven but not called; Bun's route table is + still the six hardcoded providers. +- **Totality across plugin routes.** `PROTECTED_API_PREFIXES` remains the core list, so plugin mounts are + not covered by the boot check — and the check is reading the wrong list anyway (see below). The + assertion wants moving into `buildHonoApp`, which is now the single place routes are mounted. + +### Deliberately not done + +**Offscale is not extracted.** The infrastructure is ready for it, but moving it means deleting working +code across ~50 files, and that should happen with someone watching rather than unattended. + +--- + ## The state of the app store, as found It **is** the plugin system, roughly 90% built, with one structural hole.