{"record":{"id":"727d94e7f53d83df","repo":"stablyai/orca","slug":"name-must-be-a-positive-integer-received-val-727d94","errorCode":null,"errorMessage":"${name} must be a positive integer, received ${value}","messagePattern":"(.+?) must be a positive integer, received (.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"config/scripts/mobile-agent-status-projection-benchmark.mjs","lineNumber":42,"sourceCode":")\n\nconst bucketMatch = GRAPH_SOURCE.match(/AGENT_STATUS_SYNC_UPDATED_AT_BUCKET_MS = ([0-9_]+)/)\nif (!bucketMatch) {\n  throw new Error(\n    'sync-runtime-graph.ts no longer defines the updatedAt bucket; re-sync this benchmark.'\n  )\n}\nconst BUCKET_MS = Number(bucketMatch[1].replaceAll('_', ''))\n\nconst ITERATIONS = Number.parseInt(process.env.ORCA_AGENT_PROJECTION_BENCH_ITERATIONS ?? '400', 10)\nconst WARMUP = Number.parseInt(process.env.ORCA_AGENT_PROJECTION_BENCH_WARMUP ?? '60', 10)\n\nfor (const [name, value] of [\n  ['ORCA_AGENT_PROJECTION_BENCH_ITERATIONS', ITERATIONS],\n  ['ORCA_AGENT_PROJECTION_BENCH_WARMUP', WARMUP]\n]) {\n  if (!Number.isInteger(value) || value <= 0) {\n    throw new Error(`${name} must be a positive integer, received ${value}`)\n  }\n}\n\nfunction toRow(paneKey, entry) {\n  return {\n    paneKey,\n    entryPaneKey: entry.paneKey,\n    state: entry.state,\n    prompt: entry.prompt,\n    updatedAtBucket: Math.floor(entry.updatedAt / BUCKET_MS),\n    stateStartedAt: entry.stateStartedAt,\n    agentType: entry.agentType ?? null,\n    terminalTitle: entry.terminalTitle ?? null,\n    stateHistory: entry.stateHistory.map((history) => ({\n      state: history.state,\n      prompt: history.prompt,\n      startedAt: history.startedAt,\n      interrupted: history.interrupted ?? null","sourceCodeStart":24,"sourceCodeEnd":60,"githubUrl":"https://github.com/stablyai/orca/blob/1136503c6a231a16dce8f921f6fadb63d181e8db/config/scripts/mobile-agent-status-projection-benchmark.mjs#L24-L60","documentation":"Startup guard in the mobile agent-status projection benchmark. Same positive-integer pattern as 148/150 but for ORCA_AGENT_PROJECTION_BENCH_ITERATIONS and _WARMUP (defaults 400/60). Rejects NaN, zero, and negatives, naming the bad var.","triggerScenarios":"Either ORCA_AGENT_PROJECTION_BENCH_ITERATIONS or _WARMUP set to non-numeric, empty, zero, or negative.","commonSituations":"CI exporting the var with shell quoting that yields empty; a matrix entry of 0 to 'skip warmup'; typo in the var name.","solutions":["Unset the offending var to fall back to 400 iterations / 60 warmup","Set a positive integer: ORCA_AGENT_PROJECTION_BENCH_ITERATIONS=1000 node mobile-agent-status-projection-benchmark.mjs","Check for whitespace/quoting: printf '%s' \"$ORCA_AGENT_PROJECTION_BENCH_ITERATIONS\" | od -c","Validate in CI scripts before exporting"],"exampleFix":"# before\nexport ORCA_AGENT_PROJECTION_BENCH_WARMUP=' '\n\n# after\nunset ORCA_AGENT_PROJECTION_BENCH_WARMUP","handlingStrategy":"validation","validationCode":"function positiveIntEnv(name, fallback) {\n  const raw = process.env[name]\n  if (raw === undefined) return fallback\n  if (!/^[1-9][0-9]*$/.test(raw)) {\n    throw new Error(`${name} must be a positive integer, received ${raw}`)\n  }\n  return Number.parseInt(raw, 10)\n}","typeGuard":"function isPositiveInt(v) {\n  return Number.isInteger(v) && v > 0\n}","tryCatchPattern":null,"preventionTips":["Validate in CI before exporting with ^[1-9][0-9]*$","Unset to fall back to 400/60 rather than passing empty values","Inspect quoting with printf '%s' \"$VAR\" | od -c"],"tags":["env-validation","configuration","benchmark","startup-guard"],"backgroundTag":null,"analyzedSha":"1136503c6a231a16dce8f921f6fadb63d181e8db","analyzedAt":"2026-08-12T23:15:58.167Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}