feat(kernel): wave 2 guest OS surface and operator parity

- Extend capability model (featureBits2) and align ADR, protocol, /proc, verify scripts
- Add seed RPC + /proc mirrors for replication queue, MBR failover hints, optional attestation
- Pear bridge: IPC request/response, mirror-drive / HDMS pairing hints, dev diagnostics
- Initd: IdleSec for socket units, units.d drop-ins, richer readiness (e.g. exec:)
- Cron: @reboot and JitterSec-style scheduling
- VFS: Linux-shaped /proc stubs (cgroups, tcp), bounded vfs.watch on safe pseudo paths
- Shell: gated parameter expansion v2; /bin/env -S and --env-file (staged script without ESM export)
- Schemas under docs/schemas; expand contract tests; kernel.ext.d → /proc extensions registry
- Refresh handbook, developer-guide, reference index, package READMEs; keep seeder kernel tree in sync
This commit is contained in:
Raven Scott
2026-04-04 02:04:59 -04:00
parent 8c3151319d
commit 2919f606ce
50 changed files with 2252 additions and 602 deletions
@@ -1,4 +1,4 @@
# ADR 001: Kernel feature bit governance (v2)
# ADR 001: Kernel feature bit governance (v3)
## Status
@@ -19,9 +19,11 @@ Bare OS advertises optional booter and seed-channel capabilities as a versioned
3. **`/proc/bare_os_features`** — Must include `doc`, effective `bits` (stock mask minus env-disabled features such as crypto urandom), and optional `seedHandshake` summary. The unified tree under `/proc/bare_os/` duplicates the same content for stable paths (see `docs/reference/kernel-extensions.md`).
4. **Bits 2830 (assigned)****28:** `BARE_OS_FEATURE_SEED_MANIFEST_HINTS_RPC` (`bare_os.manifest_hints`). **29:** `BARE_OS_FEATURE_LIFECYCLE_TELEMETRY_V3` (NDJSON / boot events `lifecycleSchemaVersion: 3`). **30:** `BARE_OS_FEATURE_BOOT_POLICY_V2` (extended `boot.policy.json` fields). Further bits require a new ADR revision if the integer space is exhausted (avoid `1 << 31` in JS without `>>> 0` discipline).
4. **Bits 2830 (assigned, word 1)****28:** `BARE_OS_FEATURE_SEED_MANIFEST_HINTS_RPC` (`bare_os.manifest_hints`). **29:** `BARE_OS_FEATURE_LIFECYCLE_TELEMETRY_V3` (NDJSON / boot events `lifecycleSchemaVersion: 3`). **30:** `BARE_OS_FEATURE_BOOT_POLICY_V2` (extended `boot.policy.json` fields). **No further bits** are assigned on word 1 without revisiting this ADR (avoid `1 << 31` in JS without `>>> 0` discipline).
5. **Second capability word (`bits2`)** — Wave 2 adds **`BARE_OS_KERNEL_FEATURES_STOCK_V2`** and named **`BARE_OS_FEATURE2_*`** constants (bits 031, always use **`>>> 0`** when masking). Seed JSON **`bare_os.capabilities`** and **`/proc/bare_os_features`** include **`bits2`** alongside **`bits`**. **`BARE_OS_SEED_CAP_STRICT`** may require both words when the booter advertises stock v2. New guest-visible behavior on word 2 follows the same documentation rule as word 1: [`docs/reference/kernel-capabilities-index.md`](../../docs/reference/kernel-capabilities-index.md), [`docs/reference/kernel-extensions.md`](../../docs/reference/kernel-extensions.md), and relevant handbook chapters.
## Consequences
- Seeder RPC `bare_os.capabilities` must return `protocolPackageVersion` and `featureBitsDoc` alongside `bits` for operator clarity.
- CI should keep seeder and booter copies of the stock mask aligned (`BARE_OS_KERNEL_FEATURES_STOCK_V1`).
- Seeder RPC `bare_os.capabilities` must return `protocolPackageVersion` and `featureBitsDoc` alongside `bits` (and `bits2` when used) for operator clarity.
- CI should keep seeder and booter copies of the stock masks aligned (`BARE_OS_KERNEL_FEATURES_STOCK_V1`, `BARE_OS_KERNEL_FEATURES_STOCK_V2`).