feat(booter): tune 1GiB-class hosts — pipeline ceilings, IPC/MQ, rlimits

Raise simulated pipeline absolute caps (defaults 512 MiB / 2 M lines) via
BARE_OS_PIPELINE_ABS_MAX_BYTES and BARE_OS_PIPELINE_ABS_MAX_LINES so large
BARE_OS_PIPELINE_MAX_* values take effect after streaming multiplier.

Copy missing host env into the guest (BARE_OS_IPC_MAX_CHANNELS, POSIX MQ
defaults, abs caps, BARE_OS_VFS_MAX_OPEN). Add aliases:
BARE_OS_STREAMING_MULTIPLIER → BARE_OS_SHELL_STREAMING_MULT,
BARE_OS_TIMER_BUDGET_MS → BARE_OS_EXEC_LINE_BUDGET_MS,
BARE_OS_TELEMETRY_OTEL=1 → default OTL JSONL path.

Extend POSIX mq_open defaults and maxmsg ceiling; mirror BARE_OS_VFS_MAX_OPEN
to RLIMIT_NOFILE in /proc/bare_os/rlimits.json.

Document the profile in the Pear cookbook and refresh pipeline limits in the
handbook; extend runtime caps env key list.
This commit is contained in:
Raven Scott
2026-04-22 21:54:42 -04:00
parent 463e482198
commit 32446dfdef
6 changed files with 130 additions and 10 deletions
@@ -24,6 +24,23 @@ This chapter ties the Hyperdrive-resident kernel ([`kernel/init.js`](../kernel/i
- **`/proc/bare_os/net_summary.json`** — Coalesced swarm / seed RPC hints for operators (topic, peer count, staging slot, replication queue, snapshot / firewall stats when present).
- **`ctx.vfs.watch(path)`** — Hyperdrive-backed watch when `BARE_OS_VFS_WATCH` is not `0`; returns `{ watcher, destroy, … }`. With `BARE_OS_VFS_WATCH_PSEUDO=1`, may watch coalesced `/proc/bare_os/metrics_live.json`.
### ~1GiB host RAM (pipeline / swarm / IPC)
Set these on the **Pear/Bare host** process before boot (the booter merges them into guest `vfs.env`; Hyperswarm reads swarm caps from the host environment at process start).
| Goal | Variables |
| --- | --- |
| Large pipeline bursts (`yes \| head …`, big `find`/`ls`) | `BARE_OS_PIPELINE_MAX_STAGES`, `BARE_OS_PIPELINE_MAX_BYTES`, `BARE_OS_PIPELINE_MAX_LINES`; optional `BARE_OS_SHELL_STREAMING=1` with `BARE_OS_SHELL_STREAMING_MULT` (same effect as legacy `BARE_OS_STREAMING_MULTIPLIER`). Absolute ceilings default to **512MiB** captured bytes and **2M** lines (`BARE_OS_PIPELINE_ABS_MAX_BYTES` / `_LINES` override). |
| Swarm | `BARE_OS_SWARM_MAX_PEERS`, `BARE_OS_SWARM_MAX_CLIENT_CONNECTIONS`, `BARE_OS_SWARM_MAX_SERVER_CONNECTIONS`, `BARE_OS_SWARM_MAX_PARALLEL` → Hyperswarm ctor. |
| FIFOs / POSIX MQ | `BARE_OS_IPC_MAX_CHANNELS`; `BARE_OS_POSIX_MQ_MAX_MSGS`, `BARE_OS_POSIX_MQ_MSG_BYTES` (defaults for `mq_open` when attrs omitted). |
| FD hint for scripts | `BARE_OS_VFS_MAX_OPEN` → mirrored as `RLIMIT_NOFILE` in **`/proc/bare_os/rlimits.json`**. |
| Long sessions / cron-style `execLine` wall budget | `BARE_OS_EXEC_LINE_BUDGET_MS` or alias `BARE_OS_TIMER_BUDGET_MS`. |
| OTL-style JSON lines | `BARE_OS_TELEMETRY_OTEL_JSONL=/abs/path` or shorthand `BARE_OS_TELEMETRY_OTEL=1`**`/var/log/bare-os/otel.jsonl`**. |
**Verify after boot:** **`/proc/bare_os/capabilities.json`** (`ctxApiVersion`, pipeline caps), **`/proc/bare_os_resources`**, **`/proc/bare_os/rlimits.json`**. **`ctxApiVersion`** only changes with a booter/protocol bump, not with env tuning.
Storage write limits use existing hooks (**`BARE_OS_VFS_QUOTA_*`**, **`BARE_OS_HOST_STORAGE_JSON`**, **`BARE_OS_BARE_STORAGE_QUOTA_JSON`** on bare-storage paths)—there is no separate `BARE_OS_STORAGE_QUOTA_BYTES` knob.
## Pear / Git / HTTP
- **Mirror-drive hints** — `ctx.bareOsEmitMirrorDriveHint({ label?, key? })` emits `bare-os:mirror-drive-hint` on Node-style hosts for mirror-drivestyle workflows (labels/keys only; trust boundaries unchanged).