fix: harden daemon and large-index recovery paths (#1562)
* fix: harden indexing recovery and daemon liveness * test: cover daemon and recovery review gaps * test: pin that a failure marker never blocks a later successful parse (#1557 retry-discard guard) Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> --------- Co-authored-by: danusha2345 <ewidusoc498@gmail.com> Co-authored-by: Colby McHenry <me@colbymchenry.com> Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Fable 5
danusha2345
Colby McHenry
parent
d8f2eeaddf
commit
81e1f4a92f
@@ -1209,7 +1209,7 @@ export async function cFnPointerDispatchEdges(
|
||||
// ---- receiver-type resolution within a function's source ----
|
||||
// `(?:struct )?TYPE [*]recv` declared in the params or body → TYPE (if a known
|
||||
// fn-pointer-bearing struct).
|
||||
const recvReCache = new Map<string, RegExp>();
|
||||
const recvReCache = new LRUCache<string, RegExp>(4096);
|
||||
const recvTypeIn = (fnSrc: string, recv: string): string | null => {
|
||||
let re = recvReCache.get(recv);
|
||||
if (!re) {
|
||||
@@ -1228,7 +1228,7 @@ export async function cFnPointerDispatchEdges(
|
||||
// structs (the base of a chained receiver needn't carry a fn pointer itself).
|
||||
// Falls back to a file-scope table variable (`cmdnames` in `cmdnames[i].fn()`).
|
||||
const escapeRe = (x: string): string => x.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
|
||||
const varReCache = new Map<string, RegExp>();
|
||||
const varReCache = new LRUCache<string, RegExp>(4096);
|
||||
const varTypeIn = (fnSrc: string, v: string): string | null => {
|
||||
let re = varReCache.get(v);
|
||||
if (!re) {
|
||||
|
||||
@@ -1241,7 +1241,12 @@ async function reactJsxChildEdges(ctx: ResolutionContext, onYield: MaybeYield):
|
||||
if ((++scanned & 255) === 0) await onYield(); // #1091: yield mid-scan on huge graphs
|
||||
const content = ctx.readFile(file);
|
||||
if (!content || (!content.includes('</') && !content.includes('/>'))) continue; // JSX-file gate
|
||||
const parents = ctx.getNodesInFile(file).filter((n) => PARENT_KINDS.has(n.kind));
|
||||
// File-level language gate, not merely a project-level one: mixed C/JS
|
||||
// monorepos must not interpret `"<Foo/>"` inside C as JSX (#1560).
|
||||
const parents = ctx.getNodesInFile(file).filter(
|
||||
(n) => PARENT_KINDS.has(n.kind) && JS_FAMILY.includes(n.language)
|
||||
);
|
||||
if (parents.length === 0) continue;
|
||||
for (const parent of parents) {
|
||||
const src = sliceLines(content, parent.startLine, parent.endLine);
|
||||
if (!src || (!src.includes('</') && !src.includes('/>'))) continue;
|
||||
@@ -3533,7 +3538,7 @@ export const SYNTH_PASSES: SynthPassDef[] = [
|
||||
{ name: 'closureCollEdges', gate: ALWAYS, run: (q, c, y) => closureCollectionEdges(q, c, y) },
|
||||
{ name: 'emitterEdges', gate: ALWAYS, run: (_q, c, y) => eventEmitterEdges(c, y) },
|
||||
{ name: 'renderEdges', gate: ALWAYS, run: (q, c, y) => reactRenderEdges(q, c, y) },
|
||||
{ name: 'jsxEdges', gate: ALWAYS, run: (_q, c, y) => reactJsxChildEdges(c, y) },
|
||||
{ name: 'jsxEdges', gate: (has) => has(...JS_FAMILY), run: (_q, c, y) => reactJsxChildEdges(c, y) },
|
||||
{ name: 'vueEdges', gate: (has) => has('vue'), run: (_q, c, y) => vueTemplateEdges(c, y) },
|
||||
{ name: 'svelteKitEdges', gate: (has) => has('svelte'), run: (_q, c, y) => svelteKitLoadEdges(c, y) },
|
||||
{ name: 'pascalEdges', gate: ALWAYS, run: (_q, c, y) => pascalFormEdges(c, y) },
|
||||
|
||||
Reference in New Issue
Block a user