{"record":{"id":"d90ab020a0a8c25b","repo":"EveryInc/compound-engineering-plugin","slug":"ignoring-unreadable-install-manifest-at-manifest","errorCode":null,"errorMessage":"Ignoring unreadable install manifest at ${manifestPath}.","messagePattern":"Ignoring unreadable install manifest at (.+?)\\.","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"src/targets/managed-artifacts.ts","lineNumber":138,"sourceCode":"      const safeGroups: Record<string, string[]> = {}\n      for (const [group, entries] of Object.entries(parsed.groups)) {\n        const safe: string[] = []\n        for (const entry of entries as unknown[]) {\n          if (isSafeManagedPath(managedDir, entry)) {\n            safe.push(entry)\n          } else {\n            console.warn(\n              `Dropping unsafe install-manifest entry in ${manifestPath} (group \"${group}\"): ${JSON.stringify(entry)}`,\n            )\n          }\n        }\n        safeGroups[group] = safe\n      }\n      return { version: 1, pluginName, groups: safeGroups }\n    }\n  } catch (err) {\n    if ((err as NodeJS.ErrnoException).code !== \"ENOENT\") {\n      console.warn(`Ignoring unreadable install manifest at ${manifestPath}.`)\n    }\n  }\n  return null\n}\n\nexport async function writeManagedInstallManifest(\n  managedDir: string,\n  manifest: ManagedInstallManifest,\n): Promise<void> {\n  await writeJson(path.join(managedDir, MANAGED_INSTALL_MANIFEST), manifest)\n}\n\nexport async function cleanupRemovedManagedDirectories(\n  rootDir: string,\n  manifest: ManagedInstallManifest | null,\n  group: string,\n  currentEntries: string[],\n): Promise<void> {","sourceCodeStart":120,"sourceCodeEnd":156,"githubUrl":"https://github.com/EveryInc/compound-engineering-plugin/blob/c9c10f8c75412c7232cb2bd663e5fd1cea98d84e/src/targets/managed-artifacts.ts#L120-L156","documentation":"This warning is emitted by readManagedInstallManifest when the managed install manifest file exists but cannot be parsed or read (any error other than ENOENT). The library treats a corrupt/unreadable manifest as absent and returns null, warning instead of throwing so installation can proceed with a fresh manifest. It exists because users may hand-edit or partially delete the manifest.","triggerScenarios":"Calling readManagedInstallManifest (or readManagedInstallManifestWithLegacyFallback / owned / current) when the manifest at manifestPath exists but contains invalid JSON, has wrong permissions, or the read fails with an I/O error other than ENOENT.","commonSituations":"A partially written manifest after a crashed install; manual editing that broke JSON; permission changes on ~/.config paths; a manifest written by an older incompatible version of the tool.","solutions":["Delete the corrupt manifest file so the next run treats it as absent (ENOENT) and writes a fresh one.","Check file permissions on manifestPath so the current user can read it.","Validate the JSON content of the manifest with a JSON parser and fix syntax errors.","Reinstall the plugin to regenerate a valid manifest."],"exampleFix":"// before\ncat ~/.mytool/manifest.json   // truncated JSON -> warning\n// after\nrm ~/.mytool/manifest.json    // treated as ENOENT, manifest regenerated\n","handlingStrategy":"fallback","validationCode":"import { readFile } from \"node:fs/promises\";\nasync function manifestReadable(path: string) {\n  try {\n    const raw = await readFile(path, \"utf8\");\n    JSON.parse(raw);\n    return true;\n  } catch (err: any) {\n    if (err?.code === \"ENOENT\") return true; // absent is fine\n    return false;\n  }\n}","typeGuard":"function isManifestJson(v: unknown): v is { version: number; groups: Record<string, unknown> } {\n  return (\n    typeof v === \"object\" && v !== null &&\n    \"version\" in v && typeof (v as any).version === \"number\"\n  );\n}","tryCatchPattern":"// readManagedInstallManifest never throws; it returns null on unreadable manifests\nconst manifest = await readManagedInstallManifest(manifestPath);\nif (manifest === null) {\n  // absent or corrupt: proceed as fresh install; expect writeManagedInstallManifest to recreate it\n}","preventionTips":["Do not hand-edit the install manifest; let the tool write it.","Avoid interrupting installs mid-write (no Ctrl-C during install).","Keep ~/.config paths owned and readable by the running user.","Delete a corrupt manifest rather than partially repairing it."],"tags":["manifest","filesystem","warning"],"backgroundTag":"corrupt-manifest-file","analyzedSha":"c9c10f8c75412c7232cb2bd663e5fd1cea98d84e","analyzedAt":"2026-08-31T15:18:07.959Z","schemaVersion":2},"datasetVersion":"2026-08-31T19:17:28.585Z"}