{"record":{"id":"cc9f4f94320d398f","repo":"affaan-m/ECC","slug":"install-manifests-not-found-under-reporoot","errorCode":null,"errorMessage":"Install manifests not found under ${repoRoot}","messagePattern":"Install manifests not found under (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"critical","filePath":"scripts/lib/install-manifests.js","lineNumber":308,"sourceCode":"  return SUPPORTED_INSTALL_TARGETS.filter(target => (\n    modules.every(module => Array.isArray(module.targets) && module.targets.includes(target))\n  ));\n}\n\nfunction getManifestPaths(repoRoot = DEFAULT_REPO_ROOT) {\n  return {\n    modulesPath: path.join(repoRoot, 'manifests', 'install-modules.json'),\n    profilesPath: path.join(repoRoot, 'manifests', 'install-profiles.json'),\n    componentsPath: path.join(repoRoot, 'manifests', 'install-components.json'),\n  };\n}\n\nfunction loadInstallManifests(options = {}) {\n  const repoRoot = options.repoRoot || DEFAULT_REPO_ROOT;\n  const { modulesPath, profilesPath, componentsPath } = getManifestPaths(repoRoot);\n\n  if (!fs.existsSync(modulesPath) || !fs.existsSync(profilesPath)) {\n    throw new Error(`Install manifests not found under ${repoRoot}`);\n  }\n\n  const modulesData = readJson(modulesPath, 'install-modules.json');\n  const profilesData = readJson(profilesPath, 'install-profiles.json');\n  const componentsData = fs.existsSync(componentsPath)\n    ? readJson(componentsPath, 'install-components.json')\n    : { version: null, components: [] };\n  const modules = Array.isArray(modulesData.modules) ? modulesData.modules.slice() : [];\n  const profiles = profilesData && typeof profilesData.profiles === 'object'\n    ? profilesData.profiles\n    : {};\n  const components = Array.isArray(componentsData.components) ? componentsData.components.slice() : [];\n\n  addSyntheticSkillComponents({ repoRoot, modules, components });\n\n  for (const module of modules) {\n    readModuleTargetsOrThrow(module);\n  }","sourceCodeStart":290,"sourceCodeEnd":326,"githubUrl":"https://github.com/affaan-m/ECC/blob/8321021c54d670126ce3b2969d5deb880b4b0c2a/scripts/lib/install-manifests.js#L290-L326","documentation":"Thrown by loadInstallManifests when the required manifest files (install-modules.json or install-profiles.json) do not exist under the resolved repo root. getManifestPaths(repoRoot) derives expected locations; fs.existsSync is checked before any reads. It signals that the install-manifest system cannot be bootstrapped in this checkout.","triggerScenarios":"Calling loadInstallManifests() (or consumers like the manifests CLI or runTests) when manifests/install-modules.json or manifests/install-profiles.json is missing, or when passing options.repoRoot pointing at a directory without them.","commonSituations":"Running the script from a shallow/partial clone or exported archive without manifests/; invoking from a subdirectory with an incorrect repoRoot override; deleting or moving manifests during refactoring; calling the library from a package installed without its files field including manifests/.","solutions":["Verify manifests/install-modules.json and manifests/install-profiles.json exist at the repo root; restore them from git (git checkout -- manifests/).","Run the script from the repository root, or pass the correct options.repoRoot.","If invoking from an installed package, ensure manifests are included in the package files allowlist and reinstall.","For a fresh clone, re-clone the full repository (avoid shallow/exported copies missing manifests/).","Confirm path resolution by logging getManifestPaths(repoRoot) if a custom repoRoot is used."],"exampleFix":"// before\nloadInstallManifests({ repoRoot: './scripts' }) // manifests not here\n\n// after\nloadInstallManifests({ repoRoot: '/path/to/ECC' }) // contains manifests/","handlingStrategy":"try-catch","validationCode":"const fs = require('fs');\nconst path = require('path');\nconst repoRoot = process.cwd();\nconst ok = fs.existsSync(path.join(repoRoot, 'manifests/install-modules.json')) &&\n  fs.existsSync(path.join(repoRoot, 'manifests/install-profiles.json'));\nif (!ok) throw new Error(`Run from ECC repo root; manifests missing under ${repoRoot}`);","typeGuard":null,"tryCatchPattern":"try {\n  const manifests = loadInstallManifests({ repoRoot });\n} catch (err) {\n  if (err.message.startsWith('Install manifests not found under')) {\n    console.error(`Manifests missing at ${repoRoot}. Run from the ECC repo root or restore manifests/.`);\n    process.exit(1);\n  }\n  throw err;\n}","preventionTips":["Always run manifest-consuming scripts from the repository root; do not pass ad-hoc repoRoot overrides.","Keep manifests/ files tracked in git; restore with git checkout -- manifests/ if deleted.","If packaging the library, include manifests/ in the files allowlist so installs are complete.","Add a startup existence check for the two required manifest paths before doing other work."],"tags":["filesystem","missing-file","install-manifests","config"],"backgroundTag":"config-file-not-found","analyzedSha":"8321021c54d670126ce3b2969d5deb880b4b0c2a","analyzedAt":"2026-09-16T10:08:13.343Z","contentChangedAt":"2026-09-16T10:08:13.343Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}