Skip to content

feat(plugins): add experimental Phase 0 kernel - #8460

Closed
nwparker wants to merge 1 commit into
mainfrom
nwparker/plugins-p0-kernel-core
Closed

nwparker wants to merge 1 commit into
mainfrom
nwparker/plugins-p0-kernel-core

Conversation

@nwparker

Copy link
Copy Markdown
Contributor

Summary

Adds the experimental, feature-flagged Phase 0 plugin kernel:

  • Manifest v1, qualified plugin identities, capability fingerprints, and hash-keyed consent state.
  • Content-addressed local/Git installation at <publisher>.<id>/<content-hash> with atomic current pointers, immutable provenance, system Git, and no install scripts.
  • Separately versioned Host API v0 facade with Zod parameters/results, deny-by-default capability enforcement, mutation audit logging, encrypted secrets, scoped storage/settings, and bounded event delivery.
  • Lazy worker activation, scrubbed environment, active-worker/idle limits, supervised SIGKILL recovery, bounded backoff, and errored terminal state.
  • Desktop IPC, serve RPC, and relay-facing capability-gate conformance through the same enforcement chokepoint.
  • Authoritative feature-flag kill switch and fail-closed behavior when plugin infrastructure is unavailable.

This is intentionally experimental and makes no public API compatibility promise.

Security boundaries

Capabilities gate Orca host APIs; they do not sandbox worker access to the operating system. Consent UI in the top stack PR states this explicitly.

Relay provisioning/distribution remains deferred and fail-closed. Paired web/mobile plugin UI is also deferred; this kernel does not expose plugin surfaces there.

The installer rejects unsafe paths/symlinks, hashes nested .git content, uses length-prefixed hash framing, bounds discovery, serializes lockfile writes, and preserves crash-consistent source provenance.

Prior art credit

This work adopts and substantially reworks the kernel from community PR #7506 by @s546126, and ports selected supervisor, identifier-safety, installer, disclaimer, and conformance ideas from community PR #5801 by @gsxdsm. No comments were posted on those community PRs.

Validation

Validated at the top of this three-PR stack on macOS with Electron 43.1.0:

  • pnpm typecheck — passed.
  • pnpm lint — passed; only pre-existing warnings outside this stack.
  • Reliability gates, max-lines ratchet, localization parity, and localization coverage — passed.
  • Plugin/seam Vitest matrix — 55 files, 315 tests passed.
  • Settings-schema regressions — 2 files, 107 tests passed.
  • Startup unit gate — 20 samples, P95 2.63 ms, budget under 50 ms.
  • Real worker supervision integration covers SIGKILL plus 500/2000/5000 ms restart backoff to errored.
  • Real Electron A/B launch test with 0 versus 20 approved inert plugins passed; no worker marker executed before activation.

Signed packaged-app validation and Windows/Linux live evidence remain CI/follow-up work.

Stack

  1. This PR: main-process kernel and enforcement.
  2. Next: sandboxed panel host and renderer.
  3. Final: consent/settings UI and demo workflow.

Draft only — do not merge until the full stack has been reviewed together.

@nwparker

Copy link
Copy Markdown
Contributor Author

Superseded by #8549, which condenses the whole plugin-system stack into a single PR against main.

@nwparker nwparker closed this Jul 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant