Add portable ISA extension development and native UI skills

This commit is contained in:
Peter Willemsen
2026-10-21 12:30:00 +00:00
commit b8fda81e00
30 changed files with 4320 additions and 0 deletions
@@ -0,0 +1,32 @@
# Dashboard extension workers
## Package contract and consent
A worker-capable extension declares the exact `dashboard_worker` permission and a versioned `workers` array. Each worker has a unique safe relative packaged `.mjs` entry, unique functions, runtime `javascript-esm-v1`, and protocol `isa-extension-worker-v1`. A permission without workers, workers without the permission, unsafe paths, duplicate functions, or unsupported runtimes fail validation. Public and verified payload manifests must match exactly.
The permission is privileged. Installation or update requires an initially unchecked administrator consent and creates a grant bound to workspace, extension ID/version, exact payload SHA-256, worker metadata, approver, and time. A digest or metadata change invalidates the grant; automatic updates never preserve it. `stream_chat`, `native_code`, or `manage_extensions` alone is insufficient.
## Admission and authorization
Worker start/list/get/watch/cancel/delete use the existing extension bridge envelope. Start requires a current exact-digest grant, explicit extension linkage in the immutable workspace/group launch scope, a healthy runner, and both `thread_sync_enabled` and `cloud_managed_sessions_enabled`. Every operation inside the worker separately requires its ordinary permission and current resource links. Server scope replaces any worker-supplied actor, workspace, group, extension, model, tool, thread, file, or document identifier. Nested workers are forbidden.
Jobs, events, checkpoints, leases, idempotency records, and bounded terminal results are owner scoped. Closing the UI or logging out does not cancel a job. Cancellation, extension unlink/update/delete, access loss, destructive synchronization disablement, expiry, or quota failure revokes the lease and fences late output. Unleased queued jobs may be retried. An expired job resumes only from a committed extension checkpoint and stable next operation ID; an unknown non-idempotent side effect becomes `interrupted` and requires explicit retry.
## Runner security contract
The dashboard process never receives a Docker/Podman socket and the browser surface never exposes runner or engine control. The separate runner leases only server-selected verified bundle digest, extension version, worker entry, immutable scope, fixed runtime image digest, and limits. It rejects extension-supplied images, Containerfiles, commands, arguments, mounts, devices, ports, network modes, and runtime flags.
The administrator explicitly chooses `docker` or `podman` and an allowed local Unix socket or separately authenticated transport. Plaintext TCP is rejected. Admission stays closed until the adapter proves supported engine/API version, rootless or user-namespace mode, digest identity, non-root UID, read-only root, tmpfs scratch, all capabilities dropped, `no-new-privileges`, confinement, CPU/memory/PID/time/output bounds, no network/ports/mounts/devices, bounded stdio, and kill/remove/orphan cleanup. Requested settings are insufficient; effective container inspection must confirm them. No worker receives dashboard JWTs, provider keys, engine endpoints, or host files.
Communication is bounded newline-delimited stdio through the runner. The runner associates frames with the active lease and proxies allowlisted capability calls. Mutations and checkpoints require stable operation IDs so a lease retry cannot duplicate messages, files, email, tools, or other effects.
## Portable extension modules
Browser and Node ESM entries should import the same pure workflow modules and inject the appropriate high-level SDK transport. Worker graphs must not import DOM/Svelte stores, browser Workers, Node native addons, dynamic network modules, or disallowed built-ins. Browser `postMessage` and worker stdio transports implement the same request/event/error contract.
`hello-world` is the only end-to-end worker demonstration in this release. It checkpoints a deterministic workflow, performs multiple sequential cloud turns, emits progress and a terminal result, and supports list/reattach/cancel/delete after the app closes. `isa-match-rsx-to-quote` is an architectural reference only and must not declare or start a dashboard worker in this release.
## Administration
Pin the shared Node ESM runtime by digest and upgrade it explicitly after Docker and Podman conformance. Prefer rootless engines. Configure quotas, retry/backoff, secret-redacted diagnostics, orphan reconciliation, and a drain/cancel policy before disabling synchronization. Deleting a job physically removes its events, checkpoints, and result; shared workspace files retain their normal canonical lifecycle.