{"record":{"id":"7d0f21f659785eb3","repo":"santifer/career-ops","slug":"plugin-rejected-result-problems-join","errorCode":null,"errorMessage":"plugin rejected:\n  - ${result.problems.join('\n  - ')}","messagePattern":"plugin rejected:\n  - (.+?)","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"plugin-install.mjs","lineNumber":91,"sourceCode":"  return { ok: true, problems: [], manifest, dir };\n}\n\n/**\n * Install a community plugin from a github repo at a pinned SHA into\n * plugins.local/<id>. Returns { id, manifest, integrity, dir } WITHOUT enabling\n * it (the caller runs the consent gate). Throws on any validation failure.\n */\nexport function installFromRepo(root, { url, sha }) {\n  const { url: safeUrl, id } = parseRepoArg(url);\n  const dest = path.join(root, 'plugins.local', id);\n  if (existsSync(dest)) throw new Error(`plugins.local/${id} already exists — \\`node plugins.mjs remove ${id}\\` first`);\n  let cloned = safeClone(safeUrl, sha);\n  let result;\n  try { result = validateInstall(cloned, id); }\n  catch (e) { rmSync(cloned, { recursive: true, force: true }); throw e; }\n  if (!result.ok) {\n    rmSync(result.dir || cloned, { recursive: true, force: true });\n    throw new Error(`plugin rejected:\\n  - ${result.problems.join('\\n  - ')}`);\n  }\n  mkdirSync(path.join(root, 'plugins.local'), { recursive: true });\n  cpSync(result.dir, dest, { recursive: true });\n  rmSync(result.dir, { recursive: true, force: true });\n  const tree = hashPluginTree(dest);\n  return { id, manifest: { ...result.manifest, dir: dest }, integrity: tree.integrity, files: tree.files, repo: safeUrl, sha };\n}\n\n/**\n * Clone + statically validate a registry entry WITHOUT installing it (used by\n * the registry-validate CI). Executes NO plugin code — manifest is parsed, the\n * audit is static. Returns problems (empty = clean).\n * @returns {string[]}\n */\nexport function auditRegistryEntry(url, sha, expectId) {\n  let parsed;\n  try { parsed = parseRepoArg(url); } catch (e) { return [e.message]; }\n  if (expectId && parsed.id !== expectId) return [`repo \"${url}\" → id \"${parsed.id}\" but registry id is \"${expectId}\"`];","sourceCodeStart":73,"sourceCodeEnd":109,"githubUrl":"https://github.com/santifer/career-ops/blob/aac998c7ed7248ea853b720ceeb1fdbeb322fc5d/plugin-install.mjs#L73-L109","documentation":"installFromRepo clones a plugin repository and runs validateInstall against the clone. When validation reports result.ok === false, the clone is deleted and this error is thrown, joining each validation problem on its own bulleted line so all issues are visible at once. It means the plugin failed the manifest/content checks and was never installed.","triggerScenarios":"Calling installFromRepo(root, id, repoUrl, sha) where the cloned repo's plugin manifest fails validation — e.g. missing or malformed plugin.json, missing declared entry file, invalid permission/manifest fields. validateInstall returns { ok:false, problems:[...] } instead of throwing.","commonSituations":"Installing a third-party plugin whose manifest is outdated or hand-edited; a repo restructured so the manifest no longer matches the layout; typos in manifest fields after a schema change; checking out an old sha predating the current validation rules.","solutions":["Read the bulleted problem list in the error message — each line is a distinct validation failure to fix in the plugin's manifest/files","Fix the plugin manifest (plugin.json) in the source repo, push, and reinstall","Pin a different sha/commit where the plugin passed validation","If you maintain the plugin locally, run its scaffold/validate path (validateNew) to check problems before installing"],"exampleFix":"// before: installing a repo with a manifest missing 'description'\nawait installFromRepo(root, 'my-plugin', 'https://github.com/user/my-plugin.git');\n// Error: plugin rejected:\n//   - manifest.description is required\n// after: fix plugin.json in the repo first\n{ \"id\": \"my-plugin\", \"description\": \"Does X\", ... }","handlingStrategy":"validation","validationCode":"import { validateInstall } from './plugin-install.mjs';\nconst result = validateInstall(clonedDir, id);\nif (!result.ok) console.error('Plugin will be rejected:', result.problems);","typeGuard":"function isValidated(r) { return r && r.ok === true && typeof r.dir === 'string' && r.manifest; }","tryCatchPattern":"try { await installFromRepo(root, id, url, sha); } catch (e) { if (String(e.message).startsWith('plugin rejected:')) { console.error(e.message); /* show each problem to the user */ } else throw e; }","preventionTips":["Validate the plugin locally (validateNew/validateInstall) before attempting install from a repo","Keep plugin manifests in sync with the current schema after system updates","Pin a known-good sha when installing third-party plugins"],"tags":["plugins","validation","manifest"],"backgroundTag":"schema-validation-failed","analyzedSha":"aac998c7ed7248ea853b720ceeb1fdbeb322fc5d","analyzedAt":"2026-09-16T06:35:29.214Z","contentChangedAt":"2026-09-16T06:35:29.214Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}