feat(protocol)!: kernel capability wire v2 and ctx capability maps

Replace top-level seed/proc bits (bits, bits2, … bits11) with
kernelCapabilityWords (semantic camelCase keys), kernelCapabilityWireVersion,
and helpers in kernel-capability-wire.js. Bump bare-os-protocol to 0.9.0 and
BARE_OS_KERNEL_FEATURE_BITS_DOC to 15.

Booter: emit/consume v2 on bare_os.capabilities, /proc/bare_os_features, debug
proc, offline LKG seedCapabilityInfo; BARE_OS_SEED_CAP_STRICT walks semantic
keys. Guest ctx exposes frozen bareOsAdvertisedKernelCapabilityWords and
bareOsSeedKernelCapabilityWords; remove per-word bareOsAdvertisedKernelCapabilities*
and bareOsSeedCapability* (BARE_OS_CTX_API_VERSION 1.22.0).

Kernel boot policy (stock init.js + seeder copy) reads advertised/seed words
via those maps. Update bare-os-ctx.d.ts, CI verifiers, compatibility matrix,
capability-words docs, ADR 001, and changelogs.

Fix duplicate re-exports of EXTENDED_SEEDING_PLATFORM and RLIMITS_DELEGATES_SHELL
in bare-os-protocol/index.js (Pear/Bare duplicate export error).
This commit is contained in:
Raven Scott
2026-04-04 07:19:46 -04:00
parent 21a05806b4
commit f13e2db689
62 changed files with 1812 additions and 1734 deletions
+33
View File
@@ -0,0 +1,33 @@
# Kernel capability words (authoritative map)
Seed RPC **`bare_os.capabilities`**, **`/proc/bare_os_features`**, and guest **`ctx`** (**`bareOsAdvertisedKernelCapabilityWords`** / **`bareOsSeedKernelCapabilityWords`**) use **wire v2**: eleven unsigned 32-bit masks live under one JSON object **`kernelCapabilityWords`** with **semantic camelCase** keys below. Numeric values and **bit positions** match the legacy v1 layout (top-level **`bits`**, **`bits2`**, … **`bits11`**); only the JSON shape changed.
| `kernelCapabilityWords` key | Semantic label | Stock mask constant (`bare-os-protocol`) | `boot.policy.json` required mask | Proc JSON module (`bare-os-booter`) |
| --- | --- | --- | --- | --- |
| `primary` | `PRIMARY` | `BARE_OS_KERNEL_FEATURES_STOCK_WORD_PRIMARY` | `minKernelCapabilitiesPrimary` | (core tree; not a single module) |
| `extendedSeedingPlatform` | `EXTENDED_SEEDING_PLATFORM` | `BARE_OS_KERNEL_FEATURES_STOCK_WORD_EXTENDED_SEEDING_PLATFORM` | `requireKernelCapabilitiesExtendedSeedingPlatform` | — |
| `rlimitsDelegatesShell` | `RLIMITS_DELEGATES_SHELL` | `BARE_OS_KERNEL_FEATURES_STOCK_WORD_RLIMITS_DELEGATES_SHELL` | `requireKernelCapabilitiesRlimitsDelegatesShell` | — |
| `offlineNetExtensions` | `OFFLINE_NET_EXTENSIONS` | `BARE_OS_KERNEL_FEATURES_STOCK_WORD_OFFLINE_NET_EXTENSIONS` | `requireKernelCapabilitiesOfflineNetExtensions` | — |
| `hostTransportDelegates` | `HOST_TRANSPORT_DELEGATES` | `BARE_OS_KERNEL_FEATURES_STOCK_WORD_HOST_TRANSPORT_DELEGATES` | `requireKernelCapabilitiesHostTransportDelegates` | — |
| `replicationOperatorSurface` | `REPLICATION_OPERATOR_SURFACE` | `BARE_OS_KERNEL_FEATURES_STOCK_WORD_REPLICATION_OPERATOR_SURFACE` | `requireKernelCapabilitiesReplicationOperatorSurface` | `bare-os-proc-replication-operator-surface.js` |
| `pearCorestoreHrpc` | `PEAR_CORESTORE_HRPC` | `BARE_OS_KERNEL_FEATURES_STOCK_WORD_PEAR_CORESTORE_HRPC` | `requireKernelCapabilitiesPearCorestoreHrpc` | `bare-os-proc-pear-corestore-hrpc.js` |
| `bareRuntimeProtoMux` | `BARE_RUNTIME_PROTO_MUX` | `BARE_OS_KERNEL_FEATURES_STOCK_WORD_BARE_RUNTIME_PROTO_MUX` | `requireKernelCapabilitiesBareRuntimeProtoMux` | `bare-os-proc-bare-runtime-proto-mux.js` |
| `bareModuleCryptoStaging` | `BARE_MODULE_CRYPTO_STAGING` | `BARE_OS_KERNEL_FEATURES_STOCK_WORD_BARE_MODULE_CRYPTO_STAGING` | `requireKernelCapabilitiesBareModuleCryptoStaging` | `bare-os-proc-bare-module-crypto-staging.js` |
| `pearInspectLoggerTls` | `PEAR_INSPECT_LOGGER_TLS` | `BARE_OS_KERNEL_FEATURES_STOCK_WORD_PEAR_INSPECT_LOGGER_TLS` | `requireKernelCapabilitiesPearInspectLoggerTls` | `bare-os-proc-pear-inspect-logger-tls.js` |
| `hypercorePackHrpcLifecycle` | `HYPERCORE_PACK_HRPC_LIFECYCLE` | `BARE_OS_KERNEL_FEATURES_STOCK_WORD_HYPERCORE_PACK_HRPC_LIFECYCLE` | `requireKernelCapabilitiesHypercorePackHrpcLifecycle` | `bare-os-proc-hypercore-pack-hrpc-lifecycle.js` |
**Offline LKG:** `boot.policy.json` boolean **`offlineLkgRequireHypercorePackHrpcLifecycle`** sets host env **`BARE_OS_OFFLINE_LKG_REQUIRE_HYPERCORE_PACK_HRPC_LIFECYCLE=1`** (strict class hints for the eleventh word).
**Probe env (telemetry):**
| Env var | Word |
| --- | --- |
| `BARE_OS_PROBE_ID_BARE_MODULE_CRYPTO_STAGING` | ninth word |
| `BARE_OS_PROBE_ID_PEAR_INSPECT_LOGGER_TLS` | tenth word |
| `BARE_OS_PROBE_ID_HYPERCORE_PACK_HRPC_LIFECYCLE` | eleventh word |
**Proc visibility:** `BARE_OS_HIDE_PROC_HYPERCORE_PACK_HRPC_LIFECYCLE` (`0` / `false` / `off`) omits eleventh-word **`/proc`** JSON entries from directory listings, resolution, and the proc index.
**Guest `ctx` (1.22.0+):** use frozen **`bareOsAdvertisedKernelCapabilityWords`** and **`bareOsSeedKernelCapabilityWords`** with the same keys as the table above (e.g. **`hypercorePackHrpcLifecycle`** for the eleventh word).
See also [kernel-capabilities-index.md](./kernel-capabilities-index.md) and [ADR 001](../../developer-guide/adr/001-kernel-feature-bits-governance.md).