{"record":{"id":"d13dcc20d1b4b45f","repo":"stablyai/orca","slug":"verify-skills-cli-runtime-a-dry-run-reported-exe","errorCode":null,"errorMessage":"[verify-skills-cli-runtime] a dry-run reported execution","messagePattern":"\\[verify-skills-cli-runtime\\] a dry-run reported execution","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"critical","filePath":"config/scripts/verify-skills-cli-runtime.cjs","lineNumber":210,"sourceCode":"  const install = parseJson(\n    'skills install --dry-run',\n    runCli(absoluteOutDir, [\n      'skills',\n      'install',\n      '--skill',\n      'orca-cli',\n      '--agent',\n      'codex',\n      '--dry-run',\n      '--json'\n    ])\n  )\n  const update = parseJson(\n    'skills update --dry-run',\n    runCli(absoluteOutDir, ['skills', 'update', '--skill', 'orca-cli', '--dry-run', '--json'])\n  )\n  if (install.executed !== false || update.executed !== false) {\n    throw new Error('[verify-skills-cli-runtime] a dry-run reported execution')\n  }\n\n  return { closureFiles: closure.length, commands: 5 }\n}\n\nif (require.main === module) {\n  try {\n    const result = verifySkillsCliRuntime(process.argv[2] ?? 'out')\n    console.log(\n      `[verify-skills-cli-runtime] ${result.closureFiles} closure files and ` +\n        `${result.commands} commands passed`\n    )\n  } catch (error) {\n    console.error(error instanceof Error ? error.message : error)\n    process.exitCode = 1\n  }\n}\n","sourceCodeStart":192,"sourceCodeEnd":228,"githubUrl":"https://github.com/stablyai/orca/blob/1136503c6a231a16dce8f921f6fadb63d181e8db/config/scripts/verify-skills-cli-runtime.cjs#L192-L228","documentation":"Thrown by verifySkillsCliRuntime() when a skills install --dry-run or skills update --dry-run command reports executed !== false. The script asserts that dry-run mode does not perform any filesystem mutation — both install.executed and update.executed must be exactly false. This catches dry-run leaks where a code path performs real writes despite the --dry-run flag.","triggerScenarios":"parseJson of the --dry-run --json output yields an object where install.executed !== false or update.executed !== false. Caused by: the dry-run flag not being propagated to the write logic; executed defaulting to true or undefined; the install/update command performing the operation before checking the flag.","commonSituations":"A refactor that moves the dry-run check after the write; a new code path added without a dry-run guard; executed being set based on a condition that is true in the test environment (e.g. a file already exists); the JSON schema changing so executed is reported under a different key.","solutions":["Run skills install --skill orca-cli --agent codex --dry-run --json and inspect the executed field — confirm whether it is true, undefined, or under a different key.","Trace the --dry-run flag through the install/update code path to the point where files would be written; ensure the guard short-circuits before any mutation.","If the JSON schema changed (e.g. 'executed' → 'didExecute'), update the assertion in the verifier.","Ensure executed is explicitly set to false in dry-run mode, not left undefined."],"exampleFix":"// before: dry-run flag checked after write\nawait fs.writeFile(path, content)\nif (options.dryRun) return { executed: false }\n\n// after: guard before any mutation\nif (options.dryRun) return { executed: false }\nawait fs.writeFile(path, content)","handlingStrategy":"validation","validationCode":"function assertDryRun(result, label) {\n  if (result.executed !== false) {\n    throw new Error(\n      `${label} dry-run reported executed=${String(result.executed)} (expected false)`\n    )\n  }\n}","typeGuard":"function isDryRunResult(value) {\n  return value !== null && typeof value === 'object' &&\n    'executed' in value && typeof value.executed === 'boolean'\n}","tryCatchPattern":"try {\n  const install = parseJson('skills install --dry-run', installOutput)\n  const update = parseJson('skills update --dry-run', updateOutput)\n  assertDryRun(install, 'install')\n  assertDryRun(update, 'update')\n} catch (err) {\n  // A dry-run writing files is a correctness bug — fail the build\n  throw err\n}","preventionTips":["Gate all filesystem writes behind an `if (!options.dryRun)` check at the earliest point.","Add a unit test that runs dry-run against a temp dir and asserts no files were created.","Audit new code paths added to install/update for missing dry-run guards."],"tags":["ci","skills-cli","dry-run","side-effects","verification"],"backgroundTag":null,"analyzedSha":"1136503c6a231a16dce8f921f6fadb63d181e8db","analyzedAt":"2026-08-12T23:15:58.167Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}