Implement the 20-track POSIX + P2P roadmap: booter, protocol, coreutils, docs,

and seeder/kernel parity.

Booter / ctx (1.44.0)
- bareOsReadPearRuntimeSnapshotJson; hrpc stock routes documented (kernel.*,
  vfs.readText, bare_os.echo, bare_os.disk_os_hints).
- Peer admission: BARE_OS_DHT_ADDRESS_CLASS_ALLOWLIST + meta.dhtAddressClass;
  shouldAttemptPeer(peerKey, meta).
- Optional BARE_OS_VFS_WARM_CACHE_INVALIDATE_ON_APPEND on system drive cores.
- maybeMergeBareFromDrive: path dedupe + early exit when manifest keys satisfied.
- identity-account: zero UTF-8 passphrase buffer after PBKDF2 (string path).

Shell / utilities
- BARE_OS_SHELL_ERREXIT and set -e / set +e; tests in bare-os-booter/test.js.
- expand: comma-separated POSIX-style tab stops; man page + coreutils tests.

Tooling / docs
- kernel-microbench vfs: warmReplicationPathClassify sketch.
- holepunch-drift-repos suggestedCriticalRepos; sync-holepunch-clones report.
- scripts/README: pretest maintainer runbook; handbook/12 P2P vs POSIX.
- KERNEL_CONTRACT, environment appendix, PLACEHOLDER_BASELINE (multisig gate),
  compatibility matrix, posix artifacts, syscalls.example.json, seeder sync.

Requires: npm run pretest && npm test (already green in session).
This commit is contained in:
Raven Scott
2026-04-05 01:06:59 -04:00
parent f79db04313
commit c64910d72e
60 changed files with 1762 additions and 638 deletions
+3 -3
View File
@@ -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.8` |
| `BARE_OS_POSIX_PROFILE_VERSION` | `1.0.9` |
| `BARE_OS_POSIX_PROFILE_ID` | `bare-os-posix-like` |
| `BARE_OS_POSIX_PROFILE_REFERENCE` | Open Group Issue 7 index URL |
@@ -18,7 +18,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**, and **operation detail** (schema **6** in stock builds). **`ops`** lists invocable **`ctx.bareOsSyscall`** names; **`opsDetail`** also carries **POSIX.1 XSH** logical names (**`open`**, **`close`**, **`read`**, **`write`**, **`readv`**, **`writev`**, **`getsockopt`**, **`setsockopt`**, **`lseek`**, **`pipe`**, **`dup`**, **`dup2`**, **`fcntl`**, **`poll`**, **`select`**, **`umask`**, and **socket family** probes) with **`posixAlignment`** (**`simulated`**, **`partial`**, **`ENOTSUP`**) and **`mapsTo`** for traceability. The **`posixXsh`** object summarizes those XSH names (via **`bareOsPosixXshOpsCsv()`**). **`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`**, it **awaits** the lock up to **`BARE_OS_FCNTL_LOCK_WAIT_MS_MAX`** (default **30000**, max **300000**) then **`ETIMEDOUT`**. 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. **Socket-shaped** syscalls default to **`ENOSYS`** / **`ENOTSUP`**; with **`BARE_OS_POSIX_SOCKET_FD_BRIDGE=1`**, **`socket`** + **`connect`** may use **`ctx.bare.bareTcp.Socket`** when merged. The stock booter **caches** this JSON until warm read-cache invalidation.
- **`/proc/bare_os/syscalls.json`** — Declares **fd model**, **signal model**, **errno hints**, **operation detail**, **`posixXsh`**, **`socketMsgSurface`**, and related adjuncts (schema **8** in stock builds; see [`docs/reference/posix-compliance-matrix.json`](../reference/posix-compliance-matrix.json)). **`ops`** lists invocable **`ctx.bareOsSyscall`** names; **`opsDetail`** also carries **POSIX.1 XSH** logical names (**`open`**, **`close`**, **`read`**, **`write`**, **`readv`**, **`writev`**, **`getsockopt`**, **`setsockopt`**, **`lseek`**, **`pipe`**, **`dup`**, **`dup2`**, **`fcntl`**, **`poll`**, **`select`**, **`umask`**, and **socket family** probes) with **`posixAlignment`** (**`simulated`**, **`partial`**, **`ENOTSUP`**) and **`mapsTo`** for traceability. The **`posixXsh`** object summarizes those XSH names (via **`bareOsPosixXshOpsCsv()`**). **`socketMsgSurface`** (schema **2**) documents **`sendmsg`** / **`recvmsg`**: with **`BARE_OS_POSIX_SOCKET_FD_BRIDGE`** and **`SOCK_DGRAM`**, **`sendmsg`** flattens bounded **iovec** lists into one datagram and **`recvmsg`** returns **`buf`** plus **`msgHdr.name`** from **`rinfo`**; ancillary control messages and scatter **`recvmsg`** remain **`ENOTSUP`**. **`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`**, it **awaits** the lock up to **`BARE_OS_FCNTL_LOCK_WAIT_MS_MAX`** (default **30000**, max **300000**) then **`ETIMEDOUT`**. 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`**). **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).
**Explicit non-goals**
@@ -43,7 +43,7 @@ Optional **`BARE_OS_SHELL_POSIX_MODE=1`** enables **subshell-free** grouped list
**Authoritative command list:** [`packages/bare-os-coreutils/lib/commands.mjs`](../../packages/bare-os-coreutils/lib/commands.mjs).
Utilities are **Issue 7inspired** JavaScript implementations. High-traffic tools (**`grep`**, **`sed`**, **`awk`**, **`xargs`**, **`expr`**, **`basenc`**) carry **bounded** resource limits via environment variables (see environment appendix). **`getconf`** exposes a **fixed** name table, not live `sysconf`.
Utilities are **Issue 7inspired** JavaScript implementations. High-traffic tools (**`grep`**, **`sed`**, **`awk`**, **`xargs`**, **`expr`**, **`basenc`**) carry **bounded** resource limits via environment variables (see environment appendix). **`getconf`** exposes a **fixed** name table for symbolic constants; when the booter exposes **`ctx.bareOsGetconfSysconf`**, **`getconf -v`** / **`_SC_*`** names may resolve **dynamic** values documented in the environment appendix.
**Delegation:** Some basenames (**`curl`**, **`wget`**, **`git`**, **`systemctl`**, …) run through the **host delegate registry** before `PATH` resolution; `/bin` may contain **parity shims** that should not execute in a correctly configured session (see handbook ch.6).