From b32ba5f8cba0719023817c6a30d74853ecf1fbce Mon Sep 17 00:00:00 2001 From: OpenClaw Date: Tue, 7 Apr 2026 17:42:10 +0530 Subject: [PATCH] fix: skip singleton_class in sequential parser to match worker behavior --- gitnexus/src/core/ingestion/parsing-processor.ts | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/gitnexus/src/core/ingestion/parsing-processor.ts b/gitnexus/src/core/ingestion/parsing-processor.ts index 5feddd29f..1cf2ef6dc 100644 --- a/gitnexus/src/core/ingestion/parsing-processor.ts +++ b/gitnexus/src/core/ingestion/parsing-processor.ts @@ -239,7 +239,16 @@ const seqMethodMapCache = new Map< function seqFindEnclosingClassNode(node: SyntaxNode): SyntaxNode | null { let current = node.parent; while (current) { - if (CLASS_CONTAINER_TYPES.has(current.type)) return current; + if (CLASS_CONTAINER_TYPES.has(current.type)) { + // Ruby singleton_class (class << self) has no name field u2014 skip it and + // continue walking up to find the actual class/module container. + // This matches the behavior in parse-worker.ts findEnclosingClassNode(). + if (current.type === 'singleton_class') { + current = current.parent; + continue; + } + return current; + } current = current.parent; } return null;