{"record":{"id":"2e6b667f606bf2a1","repo":"stablyai/orca","slug":"insidesessionflag-requires-an-evidence-director","errorCode":null,"errorMessage":"${insideSessionFlag} requires an evidence directory argument","messagePattern":"(.+?) requires an evidence directory argument","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"config/scripts/run-terminal-ibus-hangul-e2e.mjs","lineNumber":300,"sourceCode":"      stdio: 'inherit'\n    }\n  )\n  if (!sessionProcess.pid) {\n    throw new Error('xvfb-run did not return a PID')\n  }\n  console.error(`[terminal-ime] started isolated X11 session PID ${sessionProcess.pid}`)\n  const exitCode = await waitForExit(sessionProcess)\n  const remaining = await stopOwnedProcessGroup(sessionProcess.pid)\n  if (remaining.length > 0) {\n    throw new Error(`Owned X11 session processes survived cleanup: ${remaining.join('; ')}`)\n  }\n  return exitCode\n}\n\nconst insideSession = process.argv[2] === insideSessionFlag\ntry {\n  if (insideSession && !process.argv[3]) {\n    throw new Error(`${insideSessionFlag} requires an evidence directory argument`)\n  }\n  process.exitCode = insideSession ? await runInsideSession(process.argv[3]) : await runOuter()\n} catch (error) {\n  console.error(`[terminal-ime] ${error instanceof Error ? error.message : String(error)}`)\n  process.exitCode = 1\n}\n","sourceCodeStart":282,"sourceCodeEnd":307,"githubUrl":"https://github.com/stablyai/orca/blob/1136503c6a231a16dce8f921f6fadb63d181e8db/config/scripts/run-terminal-ibus-hangul-e2e.mjs#L282-L307","documentation":"The script distinguishes its two modes via process.argv[2] === '--inside-session'. When run in inner-session mode, it requires argv[3] to be the evidence directory path (created by runOuter via mkdtempSync). If the flag is passed without that path, the inner session has nowhere to write logs and would crash later — so it fails fast with this usage error.","triggerScenarios":"Invoking `node run-terminal-ibus-hangul-e2e.mjs --inside-session` without a trailing evidence directory argument. This should never happen in normal use because runOuter() always supplies argv[3]; it occurs only when the script is invoked manually with the flag.","commonSituations":"Manual debugging where a developer copies the inner-session invocation but forgets the temp dir; a wrapper script that passes the flag but not the dir; an arg-parsing regression in a fork.","solutions":["Do not invoke --inside-session directly — let runOuter() spawn the inner session (it passes the evidence dir for you).","If you must debug the inner session, pass a writable temp dir: node run-terminal-ibus-hangul-e2e.mjs --inside-session /tmp/orca-evidence-xxx.","Re-read the bottom of the script (lines ~296-305) to confirm the argv contract before re-invoking."],"exampleFix":"// before\nnode config/scripts/run-terminal-ibus-hangul-e2e.mjs --inside-session\n// after\nnode config/scripts/run-terminal-ibus-hangul-e2e.mjs --inside-session /tmp/orca-terminal-ime-e2e-XXXX","handlingStrategy":"validation","validationCode":"const insideSession = process.argv[2] === '--inside-session'\nconst evidenceDir = process.argv[3]\nif (insideSession && !evidenceDir) {\n  console.error('Usage: run-terminal-ibus-hangul-e2e.mjs --inside-session <evidence-dir>')\n  process.exit(2)\n}","typeGuard":"function hasEvidenceArg(argv: string[]): argv is [string, string, string, string] {\n  return argv[2] === '--inside-session' && typeof argv[3] === 'string' && argv[3].length > 0\n}","tryCatchPattern":null,"preventionTips":["Never invoke --inside-session manually; let runOuter() spawn the inner session.","Print usage to stderr with the expected argv shape on misuse.","Keep the argv contract documented at the bottom of the script."],"tags":["cli","argv","usage","e2e"],"backgroundTag":null,"analyzedSha":"1136503c6a231a16dce8f921f6fadb63d181e8db","analyzedAt":"2026-08-12T23:15:58.167Z","schemaVersion":2},"datasetVersion":"2026-08-13T04:17:16.726Z"}