{"record":{"id":"2ceb648856a82a16","repo":"abhigyanpatwari/GitNexus","slug":"no-registered-repo-matches-target-hint","errorCode":null,"errorMessage":"No registered repo matches \"${target}\".${hint}","messagePattern":"No registered repo matches \"(.+?)\"\\.(.+?)","errorType":"exception","errorClass":"RegistryNotFoundError","httpStatus":null,"severity":"error","filePath":"gitnexus/src/storage/repo-manager.ts","lineNumber":1349,"sourceCode":"  const nameMatches = entries.filter((e) => e.name.toLowerCase() === targetLower);\n  if (nameMatches.length === 1) return nameMatches[0];\n  if (nameMatches.length > 1) {\n    throw new RegistryAmbiguousTargetError(target, nameMatches);\n  }\n\n  // Tier 3: miss. Build the available-names hint ONCE; resolveRepo-style\n  // disambiguated labels (`app (/path)`) are applied when the same name\n  // appears in multiple entries so the user sees the same hint shape as\n  // `-r <name>` errors.\n  const nameCounts = new Map<string, number>();\n  for (const e of entries) {\n    const key = e.name.toLowerCase();\n    nameCounts.set(key, (nameCounts.get(key) ?? 0) + 1);\n  }\n  const availableNames = entries.map((e) =>\n    (nameCounts.get(e.name.toLowerCase()) ?? 0) > 1 ? `${e.name} (${e.path})` : e.name,\n  );\n  throw new RegistryNotFoundError(target, availableNames);\n};\n\n/**\n * List all registered repos from the global registry.\n *\n * With `validate: true`, prunes only entries whose metadata is *provably* gone\n * (fs.access on both gitnexus.json and legacy meta.json fails with ENOENT or\n * ENOTDIR) and persists the result on a best-effort basis: the pruned view is\n * always returned, even when the write fails. Entries that are merely \"not provably\n * absent\" — any other fs.access failure (EIO/EAGAIN/EBUSY/EACCES, etc.) — are\n * KEPT, so a transient I/O storm cannot wipe the registry. A kept entry is\n * therefore \"not confirmed present,\" not \"confirmed present\"; downstream DB\n * opens are independently and lazily guarded.\n */\nexport const listRegisteredRepos = async (opts?: {\n  validate?: boolean;\n}): Promise<RegistryEntry[]> => {\n  const entries = await readRegistry();","sourceCodeStart":1331,"sourceCodeEnd":1367,"githubUrl":"https://github.com/abhigyanpatwari/GitNexus/blob/aac7515d2a8c50a1f8f923c6fb77218b333560d6/gitnexus/src/storage/repo-manager.ts#L1331-L1367","documentation":"Target resolution missed at every tier: no canonical path match and no case-insensitive name match — the registry has no such repo. The error embeds the available names as a hint, with 'name (/path)' disambiguated labels for names that appear in multiple entries, mirroring the hint shape used by -r <name> errors.","triggerScenarios":"`gitnexus remove typo`, or passing -r <name> / an MCP repo argument for a repo that was never analyzed on this machine.","commonSituations":"Fresh machine or CI container where analyze hasn't run yet; typo or renamed directory; different user account (~/.gitnexus is per-user); the entry was pruned earlier by registry validation because its storage went provably missing.","solutions":["Run gitnexus analyze on the repo first, then retry with its name or absolute path","Compare your spelling against the available-names hint embedded in the error (names match case-insensitively)","Use the absolute repo path to sidestep name issues entirely","If the entry was pruned, re-index to re-register it"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"import path from 'node:path';\nconst registered = entries.some(\n  (e) =>\n    path.resolve(e.path) === path.resolve(target) ||\n    e.name.toLowerCase() === target.toLowerCase(),\n);\nif (!registered) {\n  throw new Error(`\"${target}\" is not registered — run gitnexus analyze first`);\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Run gitnexus analyze on the repo before scripting remove/-r commands against it","In fresh CI containers, always index before querying or removing","Use absolute paths and check the available-names hint embedded in the error"],"tags":["registry","cli","not-found"],"backgroundTag":"registry-entry-not-found","analyzedSha":"aac7515d2a8c50a1f8f923c6fb77218b333560d6","analyzedAt":"2026-08-20T23:29:22.980Z","schemaVersion":2},"datasetVersion":"2026-08-22T20:17:22.307Z"}