{"record":{"id":"e50d7f241e3dc2c3","repo":"JuliusBrussee/caveman","slug":"bold-protected-model-protected","errorCode":null,"errorMessage":"${bold(\"Protected\")}  ${model.protected}","messagePattern":"\\$\\{bold\\(\"Protected\"\\)\\}  \\$\\{model\\.protected\\}","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"packages/cli/src/learn-tui.ts","lineNumber":120,"sourceCode":"export async function renderLearnTui(model: LearnTuiModel): Promise<LearnTuiResult> {\n  p.intro(`${green(bold(\" CAVEMAN \"))} ${dim(\"LEARN / LOCAL SETUP\")}`);\n\n  if (model.score !== null) {\n    p.note(learnScoreBody(model), \"SETUP SCORE\");\n  } else {\n    p.note(learnScoreBody(model), \"LEARN RESULT\");\n  }\n\n  if (model.moves.length > 0) {\n    const moves = model.moves.map((move, index) => {\n      const number = dim(String(index + 1).padStart(2, \"0\"));\n      return `${number}  ${learnMoveBody(move)}`;\n    });\n    p.note(moves.join(\"\\n\\n\"), \"TOP MOVES\");\n  }\n\n  if (model.protected) {\n    p.log.warn(`${bold(\"Protected\")}  ${model.protected}`);\n  }\n\n  const options: Array<{ value: LearnTuiAction; label: string; hint?: string }> = [];\n  if (model.moves.length > 0) {\n    options.push({\n      value: \"implement\",\n      label: \"Implement with agent\",\n      hint: \"Claude Code or Codex · approval before edits\",\n    });\n  }\n  if (model.findings > 0) {\n    options.push({\n      value: \"details\",\n      label: `Show all ${model.findings} findings`,\n      hint: \"full ids, evidence, and suggestions\",\n    });\n  }\n  options.push(","sourceCodeStart":102,"sourceCodeEnd":138,"githubUrl":"https://github.com/JuliusBrussee/caveman/blob/3ee70a102609e550bd2e68004bf5990a9341c851/packages/cli/src/learn-tui.ts#L102-L138","documentation":"In the learn TUI (clack-based), when the model carries a protected flag, renderLearnTui logs a warning line 'Protected  <reason>' via p.log.warn before presenting action options. It is an informational UI message highlighting that something is protected, not a thrown error.","triggerScenarios":"Rendering the learn TUI with a model whose `protected` field is set (non-empty reason string) — e.g. the learned move targets a protected file or protected area of the config.","commonSituations":"Users opening the learn flow after a run marked certain files/pivots as protected; reviewing moves that touch safeguarded config sections.","solutions":["Read the warn text to see why the item is protected and adjust the model data if protection is stale","Proceed with a different (unprotected) move from the TOP MOVES list","Clear the protected flag in the learn model state if protection no longer applies","No code change needed — this is an intentional informational warning"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":"function isProtected(model: LearnTuiModel): model is LearnTuiModel & { protected: string } {\n  return typeof model.protected === 'string' && model.protected.length > 0\n}","tryCatchPattern":"// informational warn, not an error — no catch needed; suppress in tests via clack mock\n// e.g. mock p.log.warn to assert or silence the Protected message","preventionTips":["Treat the Protected warning as a signal to review the flagged move, not to abort","Keep learn-model protection flags up to date","Filter protected moves out of TOP MOVES if you want to avoid the warning entirely"],"tags":["cli","tui","informational"],"backgroundTag":null,"analyzedSha":"3ee70a102609e550bd2e68004bf5990a9341c851","analyzedAt":"2026-09-20T15:53:39.229Z","contentChangedAt":"2026-09-20T15:53:39.229Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}