Implement the 20-task Bare OS POSIX + P2P roadmap: holepunch lockfile drift

reporting and audit:holepunch-clones docs; placeholder baseline automation;
maintainer kernel-image sync script; protomux schema coupling in protocol
tests; disk.os RPC hints (replication_operator_sketch, hyperblobs/blind v3);
union/mirror VFS + warm-cache selective eviction tests; extension resolver
coverage; curl/wget fall through PATH when BARE_OS_DELEGATE_ALLOW excludes
delegates (kernel-runner) with handbook/ctx docs; socket contract / Wasm /
boot budget strict path / hrpc allowlist tests; subprocess bridge meta;
shell until gate + tar stat metadata; POSIX profile triplet pretest verifier;
regenerate kernel bundle, seeder parity, and audit artifacts as needed.

Covers KERNEL_CONTRACT, POSIX_DECLARED_PROFILE, handbook, developer-guide,
scripts/README, and related reference docs.
This commit is contained in:
Raven Scott
2026-04-05 02:21:07 -04:00
parent 7f4279d315
commit ae6f1cf8ac
44 changed files with 1404 additions and 422 deletions
+36 -2
View File
@@ -35,6 +35,7 @@
* BARE_OS_KERNEL_STARTUP_CLASS: `critical` | `system` | `interactive` | `deferred` (default **interactive**); exposed as **`ctx.bareOsKernelStartupClass`** for extensions/initd.
* BARE_OS_BOOT_BUDGET_MS_COLD: optional cold-boot wall-time warning threshold (ms) after **`bareOsPublishBootReady`**.
* BARE_OS_BOOT_BUDGET_MS_BARE_STDLIB: optional wall-time budget (ms) for booter **`ctx.bare`** drive merge + host resolve (**`BARE_OS_BOOT_BARE_STDLIB_RESOLUTION_MS`**, set by the stock booter); guest logs and **`boot-perf.json`** when exceeded.
* BARE_OS_BOOT_BUDGET_STRICT=1 with **BARE_OS_BOOT_POLICY_STRICT**: exit via **`bareOsRequestBooterExit(1)`** when either budget is exceeded (after **`boot-transaction.ndjson`** row **`bootBudgetViolation`** when journaling is on).
* BARE_OS_BOOT_CAPABILITY_CONTRACT_DEBUG=1: log capability-contract merge diagnostics (strict builds).
* BARE_OS_BOOT_EXT_RESOLUTION_TRACE=1 with **BARE_OS_BOOT_POLICY_STRICT**: write **`/run/bare-os/kernel-ext-resolution.json`** (extension load order / cycle ids).
* BARE_OS_BOOT_RC_RESOLUTION_TRACE=1 with **BARE_OS_BOOT_POLICY_STRICT**: write **`/run/bare-os/rc-d-resolution.json`** and **`/run/bare-os/kernel-d-resolution.json`** (lexicographic execution order after filters).
@@ -3450,6 +3451,14 @@ async function start(ctx) {
}
}
{
const budgetStrict =
ctx.env?.BARE_OS_BOOT_BUDGET_STRICT === '1' ||
ctx.env?.BARE_OS_BOOT_BUDGET_STRICT === 'true'
const polStrict =
ctx.env?.BARE_OS_BOOT_POLICY_STRICT === '1' ||
ctx.env?.BARE_OS_BOOT_POLICY_STRICT === 'true'
let coldExceeded = false
let stdlibExceeded = false
const budget = Number.parseInt(
String(ctx.env?.BARE_OS_BOOT_BUDGET_MS_COLD || ''),
10
@@ -3457,6 +3466,7 @@ async function start(ctx) {
if (Number.isFinite(budget) && budget > 0) {
const wall = Date.now() - bootT0
if (wall > budget) {
coldExceeded = true
bootStructuredLog(
ctx,
'error',
@@ -3470,8 +3480,6 @@ async function start(ctx) {
}
}
}
}
{
const sb = Number.parseInt(
String(ctx.env?.BARE_OS_BOOT_BUDGET_MS_BARE_STDLIB || ''),
10
@@ -3482,6 +3490,7 @@ async function start(ctx) {
10
)
if (Number.isFinite(sw) && sw > sb) {
stdlibExceeded = true
bootStructuredLog(
ctx,
'error',
@@ -3495,6 +3504,31 @@ async function start(ctx) {
}
}
}
if (coldExceeded || stdlibExceeded) {
await maybeAppendBootTransactionJournal(ctx, {
phase: 'boot.budget',
stage: 'boot.budget',
bootStage: 'budget',
ms: 0,
ok: false,
bootBudgetViolation: true,
bootBudgetSchemaVersion: 1,
coldBudgetExceeded: coldExceeded,
bareStdlibBudgetExceeded: stdlibExceeded,
transactionState: BARE_OS_BOOT_TXN_STATE.STAGE_COMMITTED
})
}
if (budgetStrict && polStrict && (coldExceeded || stdlibExceeded)) {
bootStructuredLog(
ctx,
'error',
'bootBudgetStrictAbort',
'[boot] BARE_OS_BOOT_BUDGET_STRICT with BARE_OS_BOOT_POLICY_STRICT: exiting after budget violation'
)
if (typeof ctx.bareOsRequestBooterExit === 'function')
ctx.bareOsRequestBooterExit(1)
return
}
}
while (true) {
const line = await readLine('')