You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
release: ship capability-gated install for embedders
Phase 1 of the lean-embed cycle: introduce a capability-gated install
API so hosts opt into exactly the surface they need without changing
what a mino_install_core-equipped runtime exposes to user Clojure.
New surface:
- mino_install_minimal: floor (reader, evaluator, GC, persistent
collections, numeric ops, basic seq, foundational macros). No
core.clj eval.
- mino_install_regex / _bignum / _multimethods / _protocols /
_transducers: each flips its capability bit and (for the C-backed
ones) registers prims into clojure.core.
- mino_install_clojure_core: evaluates core.clj against whatever
capability bits the host has flipped. Optional sections are wrapped
in (when (mino-installed? :cap) ...) and skip cleanly when off.
- mino_install_core: back-compat alias that pre-sets the canonical
Clojure-core caps (regex + bignum + multimethods + protocols +
transducers) then calls mino_install_clojure_core. Existing
embedders see no behaviour change.
mino_state_t carries a new caps_installed bitmask; MINO_CAP_*
constants plus mino_capability_installed / mino_capabilities let
host code query what is on. A static capability registry powers
mino_capability_for_symbol(name), used by eval_symbol to raise an
enriched diagnostic when user code calls a name from a capability
the host disabled.
New diagnostic code MNS002 (capability-disabled), distinct from
MNS001 (unbound symbol). The :mino/data payload carries
{:capability :symbol :reason :enable-via} so user-side error
handlers can pattern-match on the disabled capability.
REPL UX: :capabilities (alias :caps) prints a two-column
installed-vs-not table; the banner shows "embedded, N of M
capabilities installed" plus a one-liner pointing to :capabilities
when the runtime is in a partial-install state.
Capability-install ordering rule: a capability that gates a
core.clj section must have its bit set before
mino_install_clojure_core runs. The back-compat mino_install_core
wrapper handles this for the canonical caps; mino_install_all does
the same for the I/O / fs / proc / stm / agent / async / host tier.
Critical bug found and fixed during integration: each
mino_install_<cap> originally installed its prims into the
caller-supplied env (a user env from mino_env_new), not the
clojure.core ns env. core.clj eval (which runs with current_ns =
clojure.core) then could not resolve the capability's prims, raising
MNS002 even on a fully-installed runtime. Each install_<cap> now
ns_env_ensures clojure.core and installs into that env.
tests/embed_caps_test.c exercises three paths: minimal floor,
minimal + selective caps (multimethods only) with MNS002
verification on the off caps, and install_all coverage. Standalone
test suite (1616 tests, 7527 assertions) green; embed_multi_state
green; embed_stm_test pre-existing latent bug unrelated to this
change.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
0 commit comments