{"record":{"id":"8729cac68b16033c","repo":"santifer/career-ops","slug":"installation-requires-explicit-confirmation-re-run-with-node","errorCode":null,"errorMessage":"Installation requires explicit confirmation. Re-run with `node update-system.mjs apply${updateForce ? ' --force' : ''} --confirm`. A scheduled update check never installs files.","messagePattern":"Installation requires explicit confirmation\\. Re-run with `node update-system\\.mjs apply(.+?) --confirm`\\. A scheduled update check never installs files\\.","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"update-system.mjs","lineNumber":2099,"sourceCode":"  assertOwnGitToplevel();\n  const local = localVersion();\n  // Environment variables are a private one-use channel for the self-reexec;\n  // they must not authorize the initial invocation (#2866).\n  const legacyReexec = isLegacyReexec();\n  const isReexec = consumeReexecMarker() || legacyReexec ||\n    (process.argv.includes('--confirm') && process.env.CAREER_OPS_UPDATE_REEXEC === '1');\n  const updateForce = process.argv.includes('--force') ||\n    (isReexec && process.env.CAREER_OPS_UPDATE_FORCE === '1');\n  const updateConfirmed = process.argv.includes('--confirm') ||\n    (isReexec && (process.env.CAREER_OPS_UPDATE_CONFIRM === '1' || legacyReexec));\n  const initialStatusPaths = new Set(gitStatusEntries().map(entry => entry.path));\n  // Backups created by this apply run are expected updater output, not user\n  // files the checkout modified. Record only successful copies so an unrelated\n  // pre-existing .bak can never receive this exemption.\n  const generatedBackupPaths = new Set();\n\n  if (!updateConfirmed) {\n    throw new Error(\n      `Installation requires explicit confirmation. Re-run with ` +\n      `\\`node update-system.mjs apply${updateForce ? ' --force' : ''} --confirm\\`. ` +\n      'A scheduled update check never installs files.',\n    );\n  }\n\n  // Check for lock\n  const lockFile = join(ROOT, '.update-lock');\n  if (existsSync(lockFile) && !isReexec) {\n    console.error('Update already in progress (.update-lock exists). If stuck, delete it manually.');\n    process.exit(1);\n  }\n\n  // Create lock\n  if (!isReexec) {\n    writeFileSync(lockFile, new Date().toISOString());\n  }\n","sourceCodeStart":2081,"sourceCodeEnd":2117,"githubUrl":"https://github.com/santifer/career-ops/blob/e7abd431fce9348a95261acac9e0c14779c35df8/update-system.mjs#L2081-L2117","documentation":"The apply path of update-system.mjs refuses to modify working-tree files without an explicit --confirm flag. This guards against a scheduled or automatic update check silently installing files; installation must always be a deliberate human action. The error message echoes the exact command to run, including --force if that flag was already present.","triggerScenarios":"Running `node update-system.mjs apply` (or `apply --force`) without `--confirm`, or an automated/scheduled update-check flow reaching the install step without confirmation.","commonSituations":"User ran apply directly instead of answering the interactive prompt; a cron job or scheduled check invoked apply instead of check; scripted automation copied the docs command but dropped --confirm.","solutions":["Re-run the intended command with --confirm: `node update-system.mjs apply --confirm` (or `apply --force --confirm`).","If this came from a scheduled job, change it to run `check` only; checks never install files.","Review pending changes first (`node update-system.mjs check`) before confirming."],"exampleFix":"// before\nnode update-system.mjs apply\n// after\nnode update-system.mjs apply --confirm","handlingStrategy":"validation","validationCode":"const args = process.argv.slice(2);\nif (args.includes('apply') && !args.includes('--confirm')) {\n  console.error('apply requires --confirm; nothing installed.');\n  process.exit(2);\n}","typeGuard":null,"tryCatchPattern":"try {\n  applyUpdate();\n} catch (e) {\n  if (e.message.includes('requires explicit confirmation')) {\n    console.error('Re-run with: node update-system.mjs apply --confirm');\n  } else throw e;\n}","preventionTips":["Never schedule `apply`; schedule only `check`.","Make non-interactive wrappers always pass --confirm explicitly and deliberately.","Run `check` first and review the diff before confirming."],"tags":["cli","safety-guard","confirmation"],"backgroundTag":"missing-required-flag","analyzedSha":"e7abd431fce9348a95261acac9e0c14779c35df8","analyzedAt":"2026-09-16T06:35:29.214Z","contentChangedAt":"2026-09-16T06:35:29.214Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}