feat(booter): POSIX/P2P roadmap — profile 1.0.14, ctx 1.50.0, docs & tests
- Sync declared POSIX profile, compliance matrix, syscalls examples, dashboard - Extend holepunch clone sync reporting; bump protomux/hyperswarm lock fixture schema - Optional shell read builtin (BARE_OS_SHELL_READ_*); host env passthrough - Expand bareOsGetconfSysconf / getconf; pathconf for acct/union/mirror - Wasm optional bare_os_monotonic_ms; replication live snapshot hints schema - Socket bridge SO_RCVBUF/SO_SNDBUF; mq priority + FIFO ordering + tests - Extract cooperative fcntl lock helpers; FIFO waiter drain tests - Peer admission audit helpers, rate limit + redaction tests; security_posture schema - CI: verify-ctx requires CHANGELOG row, d.ts version mention, compatibility matrix - Warm-cache microbench (vfs suite); boot budget / metrics cohesion (prior work) - Handbook, KERNEL_CONTRACT, kernel-program, env appendix, README, users-manual, schemas Kernel bundle + seeder rsync + coreutils build verified via npm test.
This commit is contained in:
@@ -68,6 +68,20 @@ const CONF = {
|
||||
_SC_THREAD_DESTRUCTOR_ITERATIONS: '4',
|
||||
_SC_TTY_NAME_MAX: '32',
|
||||
_SC_LOGIN_NAME_MAX: '256',
|
||||
/** Defaults; live session: **`ctx.bareOsGetconfSysconf`** (pipeline limits, swarm caps, …). */
|
||||
_SC_BARE_OS_PIPELINE_MAX_BYTES: '2097152',
|
||||
_SC_BARE_OS_PIPELINE_MAX_LINES: '50000',
|
||||
_SC_BARE_OS_PIPELINE_MAX_STAGES: '32',
|
||||
_SC_BARE_OS_GLOB_MAX_MATCHES: '4096',
|
||||
_SC_BARE_OS_SHELL_LOOP_MAX: '10000',
|
||||
_SC_BARE_OS_EXEC_MAX_DEPTH: '64',
|
||||
_SC_BARE_OS_XARGS_MAX_PROCS: '8',
|
||||
_SC_BARE_OS_SWARM_MAX_PEERS: '512',
|
||||
_SC_BARE_OS_SWARM_MAX_CLIENT_CONNECTIONS: '256',
|
||||
_SC_BARE_OS_SWARM_MAX_SERVER_CONNECTIONS: '256',
|
||||
_SC_BARE_OS_SWARM_MAX_PARALLEL: '64',
|
||||
_SC_BARE_OS_DGRAM_RECVQ_MAX: '256',
|
||||
_SC_BARE_OS_ACCEPT_QUEUE_MAX: '64',
|
||||
_PC_PATH_MAX: '4096',
|
||||
_PC_NAME_MAX: '255',
|
||||
_PC_CHOWN_RESTRICTED: '1',
|
||||
|
||||
@@ -38,6 +38,12 @@ function bareOsPathconfFromIndexLogic(shellEnv, vfs) {
|
||||
.filter((x) => x.startsWith('/'))
|
||||
.some((pre) => p === pre || p.startsWith(pre + '/'))
|
||||
const underMirror = p === '/mirror' || p.startsWith('/mirror/')
|
||||
const acctOn =
|
||||
shellEnv.BARE_OS_PERSONAL_ACCT_PREFIX === '1' ||
|
||||
shellEnv.BARE_OS_PERSONAL_ACCT_PREFIX === 'true'
|
||||
const underPersonalAcct =
|
||||
acctOn &&
|
||||
(p === '/.bare-os/acct' || p.startsWith('/.bare-os/acct/'))
|
||||
const table = {
|
||||
_PC_NAME_MAX: 255,
|
||||
_PC_NO_TRUNC: 1,
|
||||
@@ -47,7 +53,8 @@ function bareOsPathconfFromIndexLogic(shellEnv, vfs) {
|
||||
if (underMirror) return 0
|
||||
return 1
|
||||
}
|
||||
if (k === '_PC_NO_TRUNC' && (underMirror || underUnion)) return 0
|
||||
if (k === '_PC_NO_TRUNC' && (underMirror || (underUnion && !underPersonalAcct)))
|
||||
return 0
|
||||
if (table[k] === undefined) throw new Error('unknown: ' + k)
|
||||
return table[k]
|
||||
}
|
||||
@@ -137,3 +144,60 @@ test('getconf _SC_NPROCESSORS_ONLN delegates to bareOsGetconfSysconf', async (t)
|
||||
t.is(ctx.exitCode, 0)
|
||||
t.is(logs[0], '8')
|
||||
})
|
||||
|
||||
test('getconf _SC_BARE_OS_PIPELINE_MAX_BYTES uses bareOsGetconfSysconf', async (t) => {
|
||||
const run = await loadBin('getconf')
|
||||
const logs = []
|
||||
const ctx = {
|
||||
b4a,
|
||||
exitCode: 0,
|
||||
env: {},
|
||||
console: {
|
||||
log(s) {
|
||||
logs.push(String(s))
|
||||
},
|
||||
error(s) {
|
||||
logs.push(String(s))
|
||||
}
|
||||
},
|
||||
bareOsGetconfSysconf(name) {
|
||||
if (name === '_SC_BARE_OS_PIPELINE_MAX_BYTES') return '999999'
|
||||
return null
|
||||
}
|
||||
}
|
||||
await run(ctx, ['getconf', '_SC_BARE_OS_PIPELINE_MAX_BYTES'])
|
||||
t.is(ctx.exitCode, 0)
|
||||
t.is(logs[0], '999999')
|
||||
})
|
||||
|
||||
test('pathconf _PC_NO_TRUNC stays 1 under union when personal acct prefix path', async (t) => {
|
||||
const run = await loadBin('getconf')
|
||||
const logs = []
|
||||
const shellEnv = {
|
||||
BARE_OS_VFS_UNION_PREFIXES: '/.bare-os',
|
||||
BARE_OS_PERSONAL_ACCT_PREFIX: '1'
|
||||
}
|
||||
const vfs = {
|
||||
resolveLogical(p) {
|
||||
return String(p || '/')
|
||||
}
|
||||
}
|
||||
const ctx = {
|
||||
b4a,
|
||||
exitCode: 0,
|
||||
env: shellEnv,
|
||||
vfs,
|
||||
bareOsPathconf: bareOsPathconfFromIndexLogic(shellEnv, vfs),
|
||||
console: {
|
||||
log(s) {
|
||||
logs.push(String(s))
|
||||
},
|
||||
error(s) {
|
||||
logs.push(String(s))
|
||||
}
|
||||
}
|
||||
}
|
||||
await run(ctx, ['getconf', '_PC_NO_TRUNC', '/.bare-os/acct/x/home'])
|
||||
t.is(ctx.exitCode, 0)
|
||||
t.is(logs.pop(), '1')
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user