Expand bounded awk/expr/test toward Issue 7; refresh man, profile 1.0.18,
posix matrix/dashboard, and syscalls/process_table schema alignment (v8). Booter: replication_operator_sketch/corestore hints, HRPC allowlist tests, Protomux cap channel 65536-byte bound + export, Wasm posix_profile_peek, swarm-disk and security_posture docs. Coreutils/kernel: pkg-swarm-index pathCapabilityEnvelopeVerify on get; pathcap-verify --trusted failure hint; rebuild bins and sync seeder. Docs: KERNEL_CONTRACT, kernel-extensions, capabilities index, environment appendix (warm-cache tuning, cap channel, Wasm env), handbook observability, vault threat model (multisig), developer-guide ctx/HRPC/Wasm, DOCUMENTATION release-checklist note, release-checklist optional tier1 drift. Changelog maintenance in bare-os-booter and bare-os-protocol.
This commit is contained in:
@@ -9,6 +9,7 @@ This document is the **single overview** of how the Bare OS “kernel” is spli
|
||||
| **Wire + disk I/O** | Booter | Hyperswarm, Protomux, `SwarmDisk`, Corestore, Hyperdrive open/replicate |
|
||||
| **VFS + policy** | Booter | `createVfs`, path classes, mounts, synthetic `/proc`; optional read-only **system** alias via **`BARE_OS_VFS_SYSTEM_RO_ALIAS`** (see `vfs.js`) |
|
||||
| **Identity / vault** | Booter + bins | Session env, account file, `login` / `savevault` flows |
|
||||
| **POSIX-like IPC** | Booter | In-memory FIFOs under **`/run/bare-os/ipc/<name>`** (**`bare-os-ipc.js`**); **`mq_open` / `mq_send` / `mq_receive`** via **`ctx.bareOsSyscall`** map to **`bareOsIpc`** priority queues (**higher `prio` first**, then FIFO by enqueue **`seq`**) with **`maxmsg`** / **`maxBytes`** caps — distinct from FIFO byte streams. Telemetry: **`bareOsIpc.stats().posixMessageQueues`** (schema **2**). |
|
||||
| **Init / services** | Booter | `bare-initd`, `systemctl` delegate, unit files |
|
||||
| **Guest shell + `/bin`** | Image + booter | Hyperdrive-resident scripts; host delegates for selected CLIs |
|
||||
| **Extensions** | Image | `kernel.ext.d`, manifests; resolver in booter |
|
||||
@@ -63,7 +64,7 @@ sequenceDiagram
|
||||
|
||||
## WebAssembly guest probes
|
||||
|
||||
When **`BARE_OS_WASM_KERNEL=1`**, **`ctx.bareOsWasmKernelInstantiate`** compiles with bounded **`Memory`**. With **`BARE_OS_WASM_KERNEL_SYSCALL=1`**, the import object includes **`env.bare_os_pathconf`** (UTF-8 path/name pointers into linear memory, NUL-terminated textual result) backed by **`ctx.bareOsPathconf`**, **`env.bare_os_umask_get`** from session **`UMASK`**, and **`env.bare_os_wall_time_ms32`** (low 32 bits of wall clock, signed wrap). With **`BARE_OS_WASM_KERNEL_MONOTONIC_MS=1`** (also requires syscall imports), **`env.bare_os_monotonic_ms`** returns **`Number`** monotonic milliseconds from the booter clock helper (bounded, sync — no async syscall bridge). With **`BARE_OS_WASM_KERNEL_HOSTNAME_IMPORT=1`**, **`env.bare_os_hostname_peek`** writes session **`HOSTNAME`** (or **`bare-os`**) NUL-terminated into guest memory (bounded). General async **`ctx.bareOsSyscall`** (including **`clock_gettime`**, **`nanosleep`**, socket bridge ops) is intentionally **not** imported into Wasm — use JS **`ctx.bareOsSyscall`** from the host-injected context when you need parity with **`posixXsh.namesCsv`**; see [`posix-syscall-facade-map.md`](../reference/posix-syscall-facade-map.md) and [`developer-guide/kernel-program.md`](../../developer-guide/kernel-program.md).
|
||||
When **`BARE_OS_WASM_KERNEL=1`**, **`ctx.bareOsWasmKernelInstantiate`** compiles with bounded **`Memory`**. With **`BARE_OS_WASM_KERNEL_SYSCALL=1`**, the import object includes **`env.bare_os_pathconf`** (UTF-8 path/name pointers into linear memory, NUL-terminated textual result) backed by **`ctx.bareOsPathconf`**, **`env.bare_os_umask_get`** from session **`UMASK`**, and **`env.bare_os_wall_time_ms32`** (low 32 bits of wall clock, signed wrap). With **`BARE_OS_WASM_KERNEL_MONOTONIC_MS=1`** (also requires syscall imports), **`env.bare_os_monotonic_ms`** returns **`Number`** monotonic milliseconds from the booter clock helper (bounded, sync — no async syscall bridge). With **`BARE_OS_WASM_KERNEL_HOSTNAME_IMPORT=1`**, **`env.bare_os_hostname_peek`** writes session **`HOSTNAME`** (or **`bare-os`**) NUL-terminated into guest memory (bounded). With **`BARE_OS_WASM_KERNEL_POSIX_PROFILE_PEEK=1`**, **`env.bare_os_posix_profile_peek`** writes the declared **`BARE_OS_POSIX_PROFILE_VERSION`** string NUL-terminated (bounded). General async **`ctx.bareOsSyscall`** (including **`clock_gettime`**, **`nanosleep`**, socket bridge ops) is intentionally **not** imported into Wasm — use JS **`ctx.bareOsSyscall`** from the host-injected context when you need parity with **`posixXsh.namesCsv`**; see [`posix-syscall-facade-map.md`](../reference/posix-syscall-facade-map.md) and [`developer-guide/kernel-program.md`](../../developer-guide/kernel-program.md).
|
||||
|
||||
## Typed errors (for callers)
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@ This document is the **normative contract** for how closely the stock Bare OS ke
|
||||
|
||||
| Constant | Value |
|
||||
| -------- | ----- |
|
||||
| `BARE_OS_POSIX_PROFILE_VERSION` | `1.0.17` |
|
||||
| `BARE_OS_POSIX_PROFILE_VERSION` | `1.0.18` |
|
||||
| `BARE_OS_POSIX_PROFILE_ID` | `bare-os-posix-like` |
|
||||
| `BARE_OS_POSIX_PROFILE_REFERENCE` | Open Group Issue 7 index URL |
|
||||
|
||||
@@ -19,7 +19,7 @@ This document is the **normative contract** for how closely the stock Bare OS ke
|
||||
Bare OS does **not** expose a C ABI. The following **observability contracts** stand in for “system calls”:
|
||||
|
||||
- **`/proc/bare_os/syscalls.json`** — Declares **fd model**, **signal model**, **errno hints**, **operation detail**, **`posixXsh`**, **`socketMsgSurface`**, and related adjuncts (schema **11** in stock builds; see [`docs/reference/posix-compliance-matrix.json`](../reference/posix-compliance-matrix.json)). **`ops`** lists invocable **`ctx.bareOsSyscall`** names (**`posix_fadvise`** as a simulated no-op hint; **`clock_gettime`** for REALTIME / MONOTONIC sketches alongside **`nanosleep`**); **`opsDetail`** also carries **POSIX.1 XSH** logical names (**`open`**, **`close`**, **`read`**, **`write`**, **`readv`**, **`writev`**, **`getsockopt`**, **`setsockopt`**, **`lseek`**, **`pipe`**, **`dup`**, **`dup2`**, **`fcntl`**, **`poll`**, **`select`**, **`umask`**, **`fsync`**, **`fdatasync`**, **`posix_fadvise`**, and **socket family** probes) with **`posixAlignment`** (**`simulated`**, **`partial`**, **`ENOTSUP`**) and **`mapsTo`** for traceability; stable **`susv4Refs`** string tokens (for example **`XSH/open`**) support audit cross-walks. The **`posixXsh`** object summarizes those XSH names (via **`bareOsPosixXshOpsCsv()`**); schema **3** pairs with syscall proc **11**. **`socketMsgSurface`** (schema **5**) documents **`sendmsg`** / **`recvmsg`** on the bridge: bounded **iovec** flattening for datagram and stream paths; binary ancillary control on **`sendmsg`** remains **`ENOTSUP`** with structured rejection metadata unless **`BARE_OS_POSIX_SOCKET_SCM_RIGHTS=1`**, in which case JSON-shaped **`cmsgs`** may request logical **`scmRightsLocalDup`** on **SOCK_STREAM** and **SOCK_DGRAM** bridge fds (guest logical FD duplication — not host **`SCM_RIGHTS`**); **`recvmsg`** reports **`controllen: 0`** on the receive path. **`fcntl`** supports **`F_GETFL`** / **`F_SETFL`** (Linux-shaped **`O_APPEND`** **`0x400`**, **`O_NONBLOCK`** **`0x800`**) and **cooperative advisory locks** via **`F_GETLK`** / **`F_SETLK`** / **`F_SETLKW`** using **`args.path`** (absolute) or **`args.fd`** whose logical target is an absolute path; contended **`F_SETLK`** returns **`EAGAIN`**. **`F_SETLKW`** also returns **`EAGAIN`** by default; with **`BARE_OS_POSIX_FCNTL_BLOCKING_WAIT`**, waiters are queued **FIFO per lock path** until the lock is free or **`BARE_OS_FCNTL_LOCK_WAIT_MS_MAX`** elapses (**`ETIMEDOUT`**; default **30000** ms, max **300000**). There is **no** cross-path global fairness and **no** host deadlock detection. Unknown FDs yield **`EBADF`**. **`readv`** / **`writev`** perform bounded scatter/gather on **`BARE_OS_POSIX_FD_SIM`** pipe read/write ends. **`poll`** / **`select`** share the same logical FD readiness probe when **`BARE_OS_POSIX_FD_SIM`** is enabled; with **`BARE_OS_POSIX_SOCKET_FD_BRIDGE=1`**, bridged **datagram** fds participate (**`SOCK_DGRAM`** via **`bareDgram`** when merged) with bounded **`recv`** / **`recvfrom`** queues (**`BARE_OS_POSIX_DGRAM_RECVQ_MAX`**, **`BARE_OS_POSIX_DGRAM_RECV_BLOCK_MS_MAX`**); passive **`SOCK_STREAM`** uses **`bind`/`listen`/`accept`** when **`bareTcp.Server`** is available. **Socket-shaped** syscalls default to **`ENOSYS`** / **`ENOTSUP`**; with **`BARE_OS_POSIX_SOCKET_FD_BRIDGE=1`**, **`socket`** + **`connect`** may use **`ctx.bare.bareTcp.Socket`** (**`SOCK_STREAM`**) or **`bareDgram`** (**`SOCK_DGRAM`**) when merged. The stock booter **caches** this JSON until warm read-cache invalidation.
|
||||
- **`/proc/bare_os/process_table.json`** — **PGID** / **SID**-style fields, **`parentName`** (from **`ppid`**), **signal routing**, and initd binding for the **logical** process table (not host PIDs).
|
||||
- **`/proc/bare_os/process_table.json`** — **schema 8** — **PGID** / **SID**-style fields, **`parentName`** (from **`ppid`**), **signal routing**, initd binding, optional per-row accounting (**`threads`**, **`cpuMs*`**, I/O stubs, **`replicationHint`**) for the **logical** process table (not host PIDs).
|
||||
|
||||
**Explicit non-goals**
|
||||
|
||||
@@ -73,6 +73,8 @@ Signal names accepted by **`kill`** and shell builtins follow POSIX **names** wh
|
||||
|
||||
Bump **`BARE_OS_POSIX_PROFILE_VERSION`** in `bare-os-protocol` when **intentional** utility, shell, VFS, or proc-contract behavior changes. Update this file, handbook ch.9, and §14a in the same change set.
|
||||
|
||||
**1.0.18** — **`awk`**: **`getline var < path`** reads from the guest VFS with per-path line caching; POSIX math builtins **`atan2`**, **`cos`**, **`sin`**, **`exp`**, **`log`**, **`sqrt`**; unary **`-`**; **`substr(s, start)`** two-argument suffix form; async evaluation path in the engine for I/O-capable builtins. Man page and handbook §7 updated. **`expr`**: POSIX **`: `** match-length operator (ECMA **`RegExp`** body under **`^(?:…)`**). **`test`**: **`FILE1 -nt FILE2`**, **`FILE1 -ot FILE2`**, **`FILE1 -ef FILE2`** using **`mtimeMs`** and optional **`dev`/`ino`**.
|
||||
|
||||
**1.0.17** — Syscalls proc **schema 11** (**`susv4Refs`** on **`opsDetail`**, **`posixXsh` schema 3**); **`ctx`** API **1.53.0**; **`disk.os`** **`replication_operator_sketch` schema 7** (**`corestoreSnapshotUxHint`**, **`pkgIndexSurface`**, **`bare_os.pkg_index_get`** + **`BARE_OS_PKG_INDEX_PATH`**); optional **Protomux cap channel** (**`BARE_OS_PROTOMUX_CAP_CHANNEL`**, feature bit); **`metrics_live.replicationLive`** collaboration hints + optional **`BARE_OS_COLLAB_SESSION_NDJSON`**; **`security_posture`** blind-relay posture sketch; **`ctx.bareOsVerifyPathCapabilityEnvelopeTrusted`** + **`BARE_OS_PATH_CAPABILITY_TRUSTED_PUBKEYS_HEX`**; **`/proc/bare_os/boot_budget_summary.json`**; warm-cache adaptive **jitter** (**`BARE_OS_VFS_WARM_REPL_ADAPTIVE_JITTER_PCT`**); shell unset-only default expansion (**`BARE_OS_SHELL_POSIX_UNSET_ONLY_DEFAULT`**); **`pathcap-verify --trusted`**; **`pkg-swarm-index`** **`list` / `get`** against drive manifest or HRPC.
|
||||
|
||||
**1.0.16** — Stock **`pathcap-verify`**, **`pkg-swarm-index`**, optional **path-capability** VFS gate (**`BARE_OS_PATH_CAPABILITY_*`**), **`ctx.bareOsVerifyPathCapabilityEnvelope`**, **`disk.os` path manifest + `bare_os.search_local` hrpc**, **`metrics_live.replicationLive` schema 4** (**`warmReplAdaptive`**), boot budget transaction **`bootBudgetSchemaVersion` 2** (**`bootBudgetViolations`**), Wasm **`env.bare_os_ctx_api_version_peek`**, optional **`BARE_OS_POSIX_SOCKET_CONNECT_TIMEOUT_MS`** on bridge TCP **`connect`**, **`BARE_OS_SAVEVAULT_PRESNAPSHOT_HINT`** host event, optional **`BARE_OS_RC_PROPOSAL_MULTISIG_STRICT`** + **`rc.proposals/enabled`** audit rows (**`rc.proposal.multisig_*`**).
|
||||
|
||||
Reference in New Issue
Block a user