Skip to content

feat(lambdadelta): plugin-system foundation — capability model, package format, provisioner, harness, minter (#33) - #99

Merged
hyperpolymath merged 1 commit into
mainfrom
feat/33-lambdadelta-plugin-foundation
Sep 22, 2026
Merged

hyperpolymath merged 1 commit into
mainfrom
feat/33-lambdadelta-plugin-foundation

Conversation

@hyperpolymath

Copy link
Copy Markdown
Owner

What

Foundation for the λδ plugin system + wizard of #33 — the two fundamentals the issue says must land early ("capability model" + "package format", because they shape the kernel/host seam), plus the author loop, without touching kernel semantics.

Dependency map (upstream/cross-dependency):

Shipped foundation

Component Where State
Capability model core/src/lambdadelta/capability.rs :notes/read :notes/write :agents/run; allows/missing/require; agents-run ⇒ notes-read
Host enforcement lambdadelta_host::register_gated grant check runs BEFORE the notebook is touched → structured LdError::Capability, never a panic, never a partial effect
Package format core/src/lambdadelta/package.rs homoiconic manifest.ld (λδ map via the ordinary reader — no second parser); typed :config schema + resolve_config
Provisioner (pure core) core/src/lambdadelta/provisioner.rs total refusal when requested ⊄ granted (missing names the delta); grants exactly what was requested
Harness core/src/lambdadelta/harness.rs closure-registered sandbox (kernel never depends on a host); assert-eq/assert record (never abort); eval errors become failed assertions
Minter scripts/ld-mint.js + just ld-new scaffolds plugins/<name>/; ESM, runs on Bun + Node
Reference package plugins/word-count/ minted by the minter (dogfood)
End-to-end proof core/tests/lambdadelta_plugin_system.rs manifest validates → provisions → runs green vs fixture notebook; partial grants refused; read-only sandbox denies the plugin's mutation
Design doc docs/design/lambdadelta-plugin-system.adoc four components + wizard, tier/trust model, deferred items

This discharges the spec §7 proof obligation for the gated path — "capability non-escalation … until authority is represented and checked at dispatch": authority is now represented (CapabilitySet) and checked at every gated dispatch.

Deferred (explicit, documented in the design doc)

Configurator UI (schema + validation already done), provisioner host-prompt + install receipts, registry, signing/provenance (estate-level open question), and the wizard itself (presentation glue over the now-existing components).

Verification

  • cargo test: 118 tests green (incl. new integration suite + doctests); clippy --all-targets --features wasm -D warnings clean; wasm32 build clean; cargo fmt --check clean.
  • The estate's byte-safe invisible-character scanner: 0 blocking hits across the new files; SPDX headers on all new source files.
  • node --check scripts/ld-mint.js; minter exercised end-to-end (minted word-count → integration test runs it).

Refs #33

…ge format, provisioner, harness, minter (issue #33)

Lands the two fundamentals the issue says shape the kernel/host seam,
plus the author loop, without touching kernel semantics:

* capability.rs — the capability model: catalogue (:notes/read,
  :notes/write, :agents/run), CapabilitySet grants, :agents/run implies
  :notes/read. require() is the single choke point.
* lambdadelta_host::register_gated — enforcement at the seam: every
  gated builtin checks its Gate BEFORE touching the notebook; denial is
  a structured LdError::Capability (new error variant), never a panic
  and never a partial effect. Ungated registration stays for trusted
  host contexts (formulas/agents).
* package.rs — the homoiconic package format: manifest.ld is a λδ map
  literal parsed by the ordinary reader (no second parser); fields
  mirror BoJ cartridge.json + PanLL contracts (name/version/spdx/tier/
  description); tiers teranga/shield/ayo; resolve_config() is the
  configurator's typed-schema enforcement.
* provisioner.rs — pure install plans: refuses TOTALLY when requested
  is not a subset of granted (missing names the delta); grants exactly
  what was requested (least privilege by data).
* harness.rs — the sandboxed author/test environment: closure-registered
  host surface (kernel never depends on a host), assert-eq/assert record
  into HarnessReport instead of aborting; eval errors become failed
  assertions; per-harness Budget override.
* scripts/ld-mint.js — the minter: just ld-new <name> scaffolds
  plugins/<name>/ (manifest.ld, src/main.ld, test/main.test.ld,
  README.adoc); plain ESM, works on Bun and Node.
* plugins/word-count/ — the reference package, minted by the minter.
* core/tests/lambdadelta_plugin_system.rs — end-to-end proof: manifest
  validates, provisions over full grants, runs GREEN in the harness
  against a fixture notebook; partial grants refused; read-only sandbox
  denies the plugin's mutation; :agents/run not implied by :notes/read.
* docs/design/lambdadelta-plugin-system.adoc — design + status for the
  four components + wizard, tier/trust model, deferred items
  (configurator UI, install receipts, registry, signing).

Discharges the spec §7 proof obligation for the gated path ('capability
non-escalation … until authority is represented and checked at
dispatch'). Sequencing per the issue: L0/L1 landed -> capability layer +
package format + minter/harness now -> provisioner host-prompt,
configurator UI and the wizard are the documented next layer.

Local verification: cargo test (118 tests incl. doc-tests) green,
clippy --all-targets --features wasm -D warnings clean, wasm32 build
clean, fmt clean.
@coderabbitai

coderabbitai Bot commented Sep 22, 2026

Copy link
Copy Markdown

Warning

Review limit reached

Next included review available in 59 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Learn how review limits work.

Review configuration:

⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Advanced

Run ID: ceed93f4-df9f-4be7-b1fc-8cf8c932f6fa

📥 Commits

Reviewing files that changed from the base of the PR and between df685a9 and 7f8da2a.

📒 Files selected for processing (17)
  • Justfile
  • core/src/lambdadelta/capability.rs
  • core/src/lambdadelta/error.rs
  • core/src/lambdadelta/harness.rs
  • core/src/lambdadelta/mod.rs
  • core/src/lambdadelta/package.rs
  • core/src/lambdadelta/provisioner.rs
  • core/src/lambdadelta_host.rs
  • core/tests/lambdadelta_plugin_system.rs
  • docs/design/lambdadelta-plugin-system.adoc
  • docs/design/lambdadelta-spec.adoc
  • plugins/README.adoc
  • plugins/word-count/README.adoc
  • plugins/word-count/manifest.ld
  • plugins/word-count/src/main.ld
  • plugins/word-count/test/main.test.ld
  • scripts/ld-mint.js

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@hyperpolymath
hyperpolymath merged commit 33d2731 into main Sep 22, 2026
22 of 26 checks passed
@hyperpolymath
hyperpolymath deleted the feat/33-lambdadelta-plugin-foundation branch September 22, 2026 10:13
@sonarqubecloud

Copy link
Copy Markdown

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