Skip to content

docs: plugin distribution design (ADR-0025/0026 + design doc)#1428

Merged
os-zhuang merged 3 commits into
mainfrom
claude/plugin-package-distribution-0as8w
Jun 1, 2026
Merged

docs: plugin distribution design (ADR-0025/0026 + design doc)#1428
os-zhuang merged 3 commits into
mainfrom
claude/plugin-package-distribution-0as8w

Conversation

@os-zhuang

@os-zhuang os-zhuang commented Jun 1, 2026

Copy link
Copy Markdown
Contributor

What

Design docs for distributing code-bearing marketplace contributions (plugins with npm deps, drivers, connectors, AI extensions, client UI plugins), alongside the existing pure-element / metadata-only JSON package flow. Docs only — no code or schema changes.

  • ADR-0025 — Plugin Package Distribution (server/runtime): .osplugin artifact, build→sign→publish, permissioned install, trust/isolation tiers.
  • ADR-0026 — Client-Side UI Plugin Distribution: runtime:'ui' variant reusing the ADR-0025 backbone (field renderers / view types / widgets in the browser).
  • docs/design/plugin-distribution.md — supply-side companion to the existing marketplace-publishing.md: operationalizes the ADRs into layers, a scenario catalog, and workflows.

Why

Pure-element packages compile to JSON and publish/install trivially because nothing executes. Code contributions carry executable code + deps, so distribution must additionally solve build/bundling, dependency handling, trust/security, and version compatibility. The repo already has the authoring half (packages/plugins/*, microkernel plugin-loader, PluginPermissionEnforcer, QuickJS sandbox, sys_* schema); these docs design the missing distribution layer on top.

ADR-0025 key decisions

  • .osplugin artifact + compiled objectstack.plugin.json (adds engines/runtime/permissions/integrity).
  • build → sign → publish extending os package publish; registry stores browsable metadata and the binary blob (sys_plugin/sys_plugin_version/sys_plugin_installation).
  • Permissioned install: resolve → compat → consent → verified download → materialize → register → load.
  • Trust tiers: in-process (T0) / QuickJS sandbox (T1) / out-of-process (T2).
  • Bundled-default packaging (no npm at install time); manifest-deps opt-in.

Scenario-review refinements (§3.10)

  1. Default-deny trust — T0 reserved for verified publishers; third-party defaults to sandbox/worker, enforced at publish.
  2. Externalize @objectstack/* as host-provided peer-dep singletons (bundling forks the engine).
  3. Protocol-first compatibility over platform semver.
  4. Permissions compose with object/field-level RLS.
  5. Secrets via settings/KV store (ADR-0007), never in the artifact.
  6. Connectors span declarative (OpenAPI/MCP) + code-plugin sub-paths.
  7. Explicit three-layer model: L0 declarative JSON / L1 sandboxed-script JSON / L2 code plugin.

ADR-0026 key decisions

  • UI plugin = runtime:'ui' .osplugin (browser ESM bundle registering field/view/widget extensions).
  • Two-tier loading: U0 in-app module (verified) / U1 iframe sandbox (third-party default, postMessage RPC + per-plugin CSP).
  • Server-authoritative data — UI plugins read/write only via the client SDK under the user's session, so all access stays RLS-gated server-side.

Reconciliation with ADR-0019 (important)

ADR-0019 makes the App the only consumer-facing unit; plugins/drivers/UI/themes are internal contributions a consumer never installs directly. These docs (ADR-0025 §3.11, ADR-0026 §3.7) reconcile explicitly:

  • Audience = developers/operators/ISVs. A plugin reaches a tenant bundled inside an App or operator-provisioned — not browsed in the consumer Marketplace.
  • Two catalogs, one backbone: consumer App Marketplace (type: app) vs developer/operator contribution catalog — same signed sys_* registry + artifact storage.
  • This pipeline builds the L2-sandbox + permission-enforcer "load-bearing wall" that ADR-0019 §Out-of-scope named as the prerequisite for any future self-serve code marketplace; it does not open that gate.

Scope

Design/ADRs + one design doc only. Phasing in each doc's §4. Builds on ADR-0003/0004/0007/0010/0016/0019/0022/0023/0024.

https://claude.ai/code/session_01DRww7tXjCVdqXsHtv5gDq6

Design the publish and install flow for code plugins (vs. the existing
metadata-only JSON package flow):

- .osplugin signed artifact format + compiled objectstack.plugin.json
  manifest (adds engines/runtime/permissions/integrity blocks)
- build -> sign -> publish pipeline extending os package publish, storing
  both browsable JSON metadata and the binary artifact blob
- permissioned install flow: resolve -> compat -> consent -> verify ->
  materialize -> register -> load
- trust/isolation tiers (in-process / QuickJS sandbox / out-of-process)
  reusing the existing loader, permission enforcer, and sandbox
- bundled-default packaging (no npm at install time); manifest-deps opt-in
- unifies packages and plugins: a pure-element package is the degenerate
  plugin (empty dist, no permissions)

https://claude.ai/code/session_01DRww7tXjCVdqXsHtv5gDq6
@vercel

vercel Bot commented Jun 1, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
spec Ready Ready Preview, Comment Jun 1, 2026 1:36am

Request Review

@github-actions github-actions Bot added size/m documentation Improvements or additions to documentation and removed size/m labels Jun 1, 2026
ADR-0025 §3.10 scenario-review refinements:
- default-deny trust: T0 in-process reserved for verified publishers,
  third-party defaults to sandbox/worker, enforced at publish
- externalize @objectstack/* as host-provided peer-dep singletons
  (bundling forks the engine)
- protocol-first compatibility gating over platform semver
- plugin permissions compose with object/field-level RLS
- secrets via settings/KV store (ADR-0007), never in the artifact
- connectors span declarative (OpenAPI/MCP) + code-plugin sub-paths
- explicit three-layer model (L0 JSON / L1 sandboxed-script / L2 code)

ADR-0026 (new): client-side UI plugin distribution
- runtime:'ui' variant of .osplugin reusing the ADR-0025 backbone
- two-tier loading: U0 in-app module (verified) / U1 iframe sandbox
  (third-party default) with postMessage RPC + per-plugin CSP
- server-authoritative data (RLS-gated) so client grants can't bypass
  server permissions

https://claude.ai/code/session_01DRww7tXjCVdqXsHtv5gDq6
@github-actions github-actions Bot added the size/l label Jun 1, 2026
@os-zhuang os-zhuang changed the title docs(adr): ADR-0025 plugin package distribution (code + deps) docs(adr): ADR-0025 plugin distribution + ADR-0026 UI plugins Jun 1, 2026
…ution design

- ADR-0025 §3.11: reconcile with ADR-0019 (App is the only consumer-facing
  unit). The .osplugin pipeline serves developers/operators, not consumers;
  plugins reach a tenant bundled inside an App or operator-provisioned. Two
  catalogs (consumer App Marketplace vs developer/operator contribution
  catalog) over one signed sys_* backbone. This ADR builds the L2-sandbox +
  enforcer 'load-bearing wall' that ADR-0019 named as the prerequisite for any
  future self-serve code marketplace — it does not open that gate.
- ADR-0026 §3.7: same reconciliation for UI plugins (ship inside Apps or
  operator-provisioned; never consumer-browsed).
- New docs/design/plugin-distribution.md: supply-side companion to
  marketplace-publishing.md. Operationalizes ADR-0025/0026 into the three
  distribution layers (L0/L1/L2), a scenario-driven contribution catalog,
  build/sign/publish, install/load, trust tiers, security, lifecycle, and
  worked examples.
- marketplace-publishing.md: cross-link to the companion design.

Docs only; no package or runtime changes.

https://claude.ai/code/session_01DRww7tXjCVdqXsHtv5gDq6
@github-actions github-actions Bot added size/xl and removed size/l labels Jun 1, 2026
@os-zhuang os-zhuang changed the title docs(adr): ADR-0025 plugin distribution + ADR-0026 UI plugins docs: plugin distribution design (ADR-0025/0026 + design doc) Jun 1, 2026
@os-zhuang os-zhuang marked this pull request as ready for review June 1, 2026 01:38
@os-zhuang os-zhuang merged commit 896ca9a into main Jun 1, 2026
12 checks passed
xuyushun441-sys pushed a commit that referenced this pull request Jun 1, 2026
feat(app-shell): FlowRunner — render & resume interactive screen-flows (#1428)

objectui@7130d4efe23926347a1c8df3a5674fa3336931a2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation size/xl

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants