Add tenth capability word (STOCK_V10), protocol 0.6.0, ctx API 1.19.0, and
strict seed coverage for bits10. Extend seed RPC, replication adjuncts, Wave 10 /proc JSON + proc index schema 6, boot.policy v10 enforcement in kernel/init.js, sysproc:* workers, NDJSON/OTel/audit schema bumps, CI (verify-kernel-roadmap-wave10.mjs) and doc updates across handbook, developer-guide, compatibility matrix, and seeder kernel parity.
This commit is contained in:
+41
-1
@@ -92,12 +92,14 @@ function bareOsEmitRaw(ctx, chunk) {
|
||||
* Limits: stdin 256KiB, 4096 whitespace/null tokens, 128 args per invocation,
|
||||
* 64 invocations per run. Exceeding limits is a fatal error (exit 125).
|
||||
* Supports -0/--null, -n, -I repl (replace repl in utility argv; implies -n 1 unless -n given).
|
||||
* -P N is accepted; stock booter runs sequentially; N is capped at MAX_P_FLAG (4).
|
||||
*/
|
||||
|
||||
const MAX_STDIN = 256 * 1024
|
||||
const MAX_TOKENS = 4096
|
||||
const MAX_PER_INVOCATION = 128
|
||||
const MAX_INVOCATIONS = 64
|
||||
const MAX_P_FLAG = 4
|
||||
|
||||
async function run(ctx, argv) {
|
||||
if (typeof ctx.runBinCommand !== 'function') {
|
||||
@@ -113,6 +115,7 @@ async function run(ctx, argv) {
|
||||
/** @type {string | null} */
|
||||
let repl = null
|
||||
let nExplicit = false
|
||||
let pCap = 1
|
||||
let i = 0
|
||||
|
||||
while (i < args.length && args[i].startsWith('-')) {
|
||||
@@ -126,6 +129,40 @@ async function run(ctx, argv) {
|
||||
i++
|
||||
continue
|
||||
}
|
||||
if (a === '-P' || a === '--max-procs') {
|
||||
const n = args[i + 1]
|
||||
if (n == null || !/^\d+$/.test(n)) {
|
||||
ctx.console.error('xargs: -P requires a non-negative integer')
|
||||
ctx.exitCode = 1
|
||||
return
|
||||
}
|
||||
const raw = Number(n)
|
||||
pCap = Math.min(MAX_P_FLAG, Math.max(1, raw))
|
||||
if (raw > MAX_P_FLAG) {
|
||||
ctx.console.error(
|
||||
'xargs: -P ' +
|
||||
raw +
|
||||
' exceeds Bare OS cap ' +
|
||||
MAX_P_FLAG +
|
||||
' (parallelism hint only; sequential execution)'
|
||||
)
|
||||
}
|
||||
i += 2
|
||||
continue
|
||||
}
|
||||
if (a.startsWith('-P') && a.length > 2 && /^\d+$/.test(a.slice(2))) {
|
||||
const raw = Number(a.slice(2))
|
||||
pCap = Math.min(MAX_P_FLAG, Math.max(1, raw))
|
||||
if (raw > MAX_P_FLAG) {
|
||||
ctx.console.error(
|
||||
'xargs: -P exceeds Bare OS cap ' +
|
||||
MAX_P_FLAG +
|
||||
' (parallelism hint only; sequential execution)'
|
||||
)
|
||||
}
|
||||
i++
|
||||
continue
|
||||
}
|
||||
if (a === '-n' || a === '--max-args') {
|
||||
const n = args[i + 1]
|
||||
if (n == null || !/^\d+$/.test(n) || Number(n) < 1) {
|
||||
@@ -165,7 +202,9 @@ async function run(ctx, argv) {
|
||||
ctx.console.error(
|
||||
'xargs: Bare OS supports: -0/--null, -n N (max ' +
|
||||
MAX_PER_INVOCATION +
|
||||
' per run), -I repl'
|
||||
' per run), -I repl, -P N (max ' +
|
||||
MAX_P_FLAG +
|
||||
', sequential)'
|
||||
)
|
||||
ctx.exitCode = 1
|
||||
return
|
||||
@@ -174,6 +213,7 @@ async function run(ctx, argv) {
|
||||
/** @type {string[]} */
|
||||
let cmd = args.slice(i)
|
||||
if (cmd.length === 0) cmd = ['echo']
|
||||
void pCap
|
||||
|
||||
let text = bareStdin(ctx) || ''
|
||||
if (text.length > MAX_STDIN) {
|
||||
|
||||
Reference in New Issue
Block a user