- Bump BARE_OS_CTX_API_VERSION to 1.41.0; align syscalls.example, compat matrix, POSIX dashboard, and doc-contract verifier - Stock hrpc: BARE_OS_HRPC_AUDIT chain rows; BARE_OS_HRPC_EMIT_UNLISTED for bare-os:hrpc-request; document seed/hrpc boundaries in KERNEL_CONTRACT + protocol CHANGELOG - VFS: bareOsEvictWarmReadPrefixes; BARE_OS_VFS_WARM_CACHE_PREFIX_INVALIDATE + replicationLive schema 2; warm cache stats schema 2; hyperblobs gate metrics + failed-write counter - maybeMergeBareFromDrive: BARE_OS_BARE_STDLIB_RESOLVE_CONCURRENCY (parallel reads, manifest order preserved) - Word-7 proc: pear_runtime_channel.json + vfs maps/tests; host env passthrough - Coreutils: export bareAwkRun for tests; build strips export in shipped awk; nextfile smoke test; getconf _SC_PAGESIZE test; man/hawk handbook tweaks - Security/docs: vault AEAD tamper test in test.identity.js; vault threat model + users-manual; scripts/verify-doc-contracts.mjs in pretest - Fix /proc readdir golden list order for new proc node; sync seeder kernel
60 lines
1.7 KiB
JavaScript
60 lines
1.7 KiB
JavaScript
/**
|
|
* `/proc/bare_os/protomux_extensions.json` — policy-gated operator view of Protomux
|
|
* channel hints for kernel extensions (no wire secrets).
|
|
*/
|
|
|
|
/**
|
|
* @param {Record<string, string | undefined>} env
|
|
*/
|
|
function protomuxExtensionsRegistryExposed(env) {
|
|
const v = String(env?.BARE_OS_PROC_PROTOMUX_EXTENSIONS_REGISTRY ?? '')
|
|
.trim()
|
|
.toLowerCase()
|
|
return v === '1' || v === 'true' || v === 'yes'
|
|
}
|
|
|
|
/**
|
|
* @param {{
|
|
* env?: Record<string, string | undefined> | null,
|
|
* registrySnapshot?: Record<string, unknown> | null,
|
|
* ctxApiVersion?: string
|
|
* }} opts
|
|
*/
|
|
export function buildBareOsProtomuxExtensionsProcJson(opts = {}) {
|
|
const env = opts.env && typeof opts.env === 'object' ? opts.env : {}
|
|
const now = Date.now()
|
|
if (!protomuxExtensionsRegistryExposed(env)) {
|
|
return {
|
|
schema: 1,
|
|
exposed: false,
|
|
note:
|
|
'Set BARE_OS_PROC_PROTOMUX_EXTENSIONS_REGISTRY=1 to expose extension mux hints (alias registry snapshot + stable logical channel names).',
|
|
atMs: now
|
|
}
|
|
}
|
|
const snap =
|
|
opts.registrySnapshot && typeof opts.registrySnapshot === 'object'
|
|
? opts.registrySnapshot
|
|
: {}
|
|
return {
|
|
schemaVersion: 2,
|
|
exposed: true,
|
|
ctxApiVersion: String(opts.ctxApiVersion || ''),
|
|
registry: snap,
|
|
muxWirePackage: 'protomux',
|
|
muxWireMajor: 3,
|
|
extensionLogicalChannels: [
|
|
{
|
|
name: 'bare-os-kernel-ext-handshake',
|
|
note: 'Reserved logical label for extension pairing over Protomux-framed streams (P2P).'
|
|
},
|
|
{
|
|
name: 'bare-os-extension-telemetry',
|
|
note: 'Optional NDJSON-shaped diagnostic channel; host must open explicitly.'
|
|
}
|
|
],
|
|
wireReference: '/proc/bare_os/protomux.json',
|
|
atMs: now
|
|
}
|
|
}
|