{"record":{"id":"8664de8e23df9739","repo":"abhigyanpatwari/GitNexus","slug":"parsedfile-store-rejected-shard-entries-at-load","errorCode":null,"errorMessage":"parsedfile-store: rejected shard entries at load (untrusted shape); those files re-extract every run","messagePattern":"parsedfile-store: rejected shard entries at load \\(untrusted shape\\); those files re-extract every run","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"gitnexus/src/storage/parsedfile-store.ts","lineNumber":321,"sourceCode":"        if (flow.dropped === 0 && chains.dropped === 0) {\n          out.set(pf.filePath, pf);\n        } else {\n          droppedSites += flow.dropped;\n          droppedChains += chains.dropped;\n          filesWithDroppedSites++;\n          out.set(pf.filePath, {\n            ...pf,\n            ...(flow.dropped === 0 ? {} : { callableFlowSites: flow.sites }),\n            ...(chains.dropped === 0 ? {} : { referenceSites: chains.sites }),\n          });\n        }\n      }\n    }\n    await maybeYieldAndGc(crossedBudget);\n  }\n  if (droppedSites > 0 || droppedChains > 0) {\n    logger.warn(\n      { droppedSites, droppedChains, files: filesWithDroppedSites },\n      'parsedfile-store: dropped malformed/over-bound sites at load; files retained without those facts',\n    );\n  }\n  if (rejectedFiles > 0) {\n    logger.warn(\n      { rejectedFiles },\n      'parsedfile-store: rejected shard entries at load (untrusted shape); those files re-extract every run',\n    );\n  }\n  return out;\n};\n\nfunction sanitizeCallableFlowSites(\n  value: unknown,\n): { sites: readonly CallableFlowSite[] | undefined; dropped: number } | undefined {\n  if (value === undefined) return { sites: undefined, dropped: 0 };\n  if (!Array.isArray(value)) return undefined;\n  const bounded =","sourceCodeStart":303,"sourceCodeEnd":339,"githubUrl":"https://github.com/abhigyanpatwari/GitNexus/blob/0d1aed942f0e8b5d3bac27519fff441aceea722d/gitnexus/src/storage/parsedfile-store.ts#L303-L339","documentation":"The whole-file counterpart of the per-site drop: shard entries whose overall shape is untrusted are rejected at load, and a rejected file falls back to a fresh extraction on EVERY load — a permanent warm-cache miss that costs real time while saying nothing about why. This warning (with the rejectedFiles count) exists so a writer that keeps minting what this reader refuses becomes visible.","triggerScenarios":"A warm load where whole ParsedFile entries fail shape validation: writer/reader version skew, truncated or partially written shards, corrupted entries. Every subsequent run pays full re-extraction for exactly those files.","commonSituations":"An index written by an older or newer GitNexus with a different shard schema; an interrupted write leaving a partial entry; the observable symptom is analyze wall-time regressing on warm cache with this warning repeating every run.","solutions":["Run a full re-analyze to rewrite the store with the current writer","If the warning reappears on every warm load afterwards, capture writer/reader versions and file an issue: the writer is minting shapes the reader refuses","Check disk health if the corruption has no version-skew explanation"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"// A rejected shard re-extracts EVERY load. If this warning re-fires on each\n// warm load, the store is permanently cold for those files — rewrite it.\nif (warmLoadRejectedAgain) {\n  await fullReanalyze(repoPath);\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["A warning that reappears every warm load is a permanent cache miss, not noise","Run a full re-analyze to rewrite shards with the current writer","Track analyze wall-time regressions alongside this warning"],"tags":["storage","cache","performance","validation","version-skew"],"backgroundTag":"corrupt-cache-entry","analyzedSha":"0d1aed942f0e8b5d3bac27519fff441aceea722d","analyzedAt":"2026-08-20T23:29:22.980Z","contentChangedAt":"2026-08-20T23:29:22.980Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}