{"record":{"id":"92efdcd6efff9aae","repo":"paperclipai/paperclip","slug":"git-install-cannot-stage-workspace-dependency-pa","errorCode":null,"errorMessage":"Git install cannot stage workspace dependency ${packageName}; it is missing from scripts/release-package-manifest.json.","messagePattern":"Git install cannot stage workspace dependency (.+?); it is missing from scripts/release-package-manifest\\.json\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"cli/src/commands/install.ts","lineNumber":67,"sourceCode":"      : \"\";\n    if (!stderr || (error instanceof Error && error.message.includes(stderr))) throw error;\n    throw new Error(`${error instanceof Error ? error.message : String(error)}\\n${stderr}`, { cause: error });\n  }\n}\n\nexport function resolveGitInstallWorkspacePackages(checkoutPath: string): ReleasePackageEntry[] {\n  const manifestPath = path.join(checkoutPath, \"scripts\", \"release-package-manifest.json\");\n  const manifest = JSON.parse(fs.readFileSync(manifestPath, \"utf8\")) as ReleasePackageEntry[];\n  const packageByName = new Map(manifest.map((entry) => [entry.name, entry]));\n  const visiting = new Set<string>();\n  const visited = new Set<string>();\n  const ordered: ReleasePackageEntry[] = [];\n\n  const visit = (packageName: string): void => {\n    if (visited.has(packageName)) return;\n    if (visiting.has(packageName)) throw new Error(`Circular workspace dependency while staging ${packageName}.`);\n    const entry = packageByName.get(packageName);\n    if (!entry) throw new Error(`Git install cannot stage workspace dependency ${packageName}; it is missing from scripts/release-package-manifest.json.`);\n    visiting.add(packageName);\n    const packageJson = JSON.parse(fs.readFileSync(path.join(checkoutPath, entry.dir, \"package.json\"), \"utf8\")) as Record<string, unknown>;\n    for (const section of [\"dependencies\", \"optionalDependencies\", \"peerDependencies\"] as const) {\n      const dependencies = packageJson[section];\n      if (!dependencies || typeof dependencies !== \"object\") continue;\n      for (const dependencyName of Object.keys(dependencies)) {\n        if (dependencyName.startsWith(\"@paperclipai/\")) visit(dependencyName);\n      }\n    }\n    visiting.delete(packageName);\n    visited.add(packageName);\n    ordered.push(entry);\n  };\n\n  visit(\"@paperclipai/server\");\n  return ordered;\n}\n","sourceCodeStart":49,"sourceCodeEnd":85,"githubUrl":"https://github.com/paperclipai/paperclip/blob/67001ec6eb96ae601aa27bc91d9b2415d665334a/cli/src/commands/install.ts#L49-L85","documentation":"Thrown by resolveGitInstallWorkspacePackages (install.ts:67) when a @paperclipai/* dependency referenced from another package's dependencies is not present in scripts/release-package-manifest.json. The git installer stages only packages declared in that manifest; an undeclared workspace dep cannot be staged.","triggerScenarios":"Adding a new @paperclipai package and depending on it from another package without registering it in scripts/release-package-manifest.json, or renaming a package without updating the manifest.","commonSituations":"New package added during feature work but the release manifest was not updated; manifest drifted from the actual workspace layout.","solutions":["Add the missing package entry (dir + name) to scripts/release-package-manifest.json.","Confirm the dir matches the package's actual location in the workspace.","Re-run the git install."],"exampleFix":"// before: manifest missing @paperclipai/newpkg\n// after: add to scripts/release-package-manifest.json\n{ \"dir\": \"packages/newpkg\", \"name\": \"@paperclipai/newpkg\" }","handlingStrategy":"validation","validationCode":"function assertManifestCoversDeps(manifest: ReleasePackageEntry[], checkoutPath: string): void {\n  const names = new Set(manifest.map((e) => e.name));\n  for (const entry of manifest) {\n    const pkg = JSON.parse(fs.readFileSync(path.join(checkoutPath, entry.dir, 'package.json'), 'utf8'));\n    for (const section of ['dependencies', 'optionalDependencies', 'peerDependencies']) {\n      const deps = pkg[section] || {};\n      for (const dep of Object.keys(deps)) {\n        if (dep.startsWith('@paperclipai/') && !names.has(dep)) {\n          throw new Error(`${dep} is referenced by ${entry.name} but missing from the release manifest.`);\n        }\n      }\n    }\n  }\n}","typeGuard":null,"tryCatchPattern":"try {\n  const ordered = resolveGitInstallWorkspacePackages(checkoutPath);\n} catch (err) {\n  if (err instanceof Error && err.message.includes('missing from scripts/release-package-manifest.json')) {\n    console.error('A @paperclipai dep is not in the release manifest; add it and retry.');\n  }\n  throw err;\n}","preventionTips":["Whenever you add a @paperclipai package, register it in scripts/release-package-manifest.json in the same PR.","Add a CI check that the manifest covers all @paperclipai workspace deps.","Re-run the manifest sync when renaming or moving packages."],"tags":["cli","install","workspace","manifest","release"],"backgroundTag":null,"analyzedSha":"67001ec6eb96ae601aa27bc91d9b2415d665334a","analyzedAt":"2026-08-12T12:05:45.408Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}