From a7ec43dbc61a5bb85ca8bdf9648c16396c4e5d67 Mon Sep 17 00:00:00 2001 From: Mick Cooney Date: Thu, 1 Oct 2026 03:23:46 +0100 Subject: [PATCH] refactor(r): remove five dead patterns from R_QUERIES The S4/R5 contains= (single and c()), R6 inherit= (namespaced and bare) and (comment) patterns capture @heritage*, @comment, which no code reads: such a match has no @name and no @definition.*, so the worker discards it. Inheritance edges come from the R scope query's @reference.inherits. Graph nodes, relationships, properties, resolution outcomes and the raw worker output are byte-identical over the r-* fixtures and probe repos before and after, so no re-analyse and no SCHEMA_BUMP are needed. Also correct the R scope query header, which described the legacy table as having proved the heritage shapes. --- .../src/core/ingestion/languages/r/query.ts | 7 ++- .../src/core/ingestion/tree-sitter-queries.ts | 61 ------------------- 2 files changed, 4 insertions(+), 64 deletions(-) diff --git a/gitnexus/src/core/ingestion/languages/r/query.ts b/gitnexus/src/core/ingestion/languages/r/query.ts index e5dbf20be..725988721 100644 --- a/gitnexus/src/core/ingestion/languages/r/query.ts +++ b/gitnexus/src/core/ingestion/languages/r/query.ts @@ -4,9 +4,10 @@ * R has no dedicated class syntax — R6 classes are `R6Class(...)` calls, S4/R5 * classes are `setClass(...)`/`setRefClass(...)` calls — so this query mirrors * the shapes the legacy `R_QUERIES` (`tree-sitter-queries.ts`) already proved - * queryable for structural extraction, renamed onto the scope-resolution - * capture vocabulary (`@scope.*`, `@declaration.*`, `@reference.*`, - * `@import.*`, `@type-binding.*`). + * queryable for structural extraction (the heritage shapes below have no + * counterpart there), renamed onto the scope-resolution capture vocabulary + * (`@scope.*`, `@declaration.*`, `@reference.*`, `@import.*`, + * `@type-binding.*`). * * R specifics encoded here: * diff --git a/gitnexus/src/core/ingestion/tree-sitter-queries.ts b/gitnexus/src/core/ingestion/tree-sitter-queries.ts index 7ec15bf77..332cc73c5 100644 --- a/gitnexus/src/core/ingestion/tree-sitter-queries.ts +++ b/gitnexus/src/core/ingestion/tree-sitter-queries.ts @@ -3177,64 +3177,6 @@ export const R_QUERIES = ` (argument value: [(identifier) (string)] @import.source))) @import -; ── Heritage: S4 contains= (single parent) ─────────────────────────────────── -(call - function: (identifier) @_fn - (#match? @_fn "^(setClass|setRefClass)$") - arguments: (arguments - . (argument - value: (string - content: (string_content) @heritage.class)) - (argument - name: (identifier) @_arg - (#match? @_arg "^(contains|CONTAINS)$") - value: (string - content: (string_content) @heritage.extends)))) @heritage - -; ── Heritage: S4 contains= (multiple parents via c()) ──────────────────────── -(call - function: (identifier) @_fn2 - (#match? @_fn2 "^(setClass|setRefClass)$") - arguments: (arguments - . (argument - value: (string - content: (string_content) @heritage.class)) - (argument - name: (identifier) @_arg2 - (#match? @_arg2 "^(contains|CONTAINS)$") - value: (call - function: (identifier) @_cfn - (#match? @_cfn "^c$") - arguments: (arguments - (argument - value: (string - content: (string_content) @heritage.extends))))))) @heritage - -; ── Heritage: R6 inherit= via namespace ────────────────────────────────────── -(binary_operator - lhs: (identifier) @heritage.class - rhs: (call - function: (namespace_operator - rhs: (identifier) @_nsfn - (#match? @_nsfn "^R6Class$")) - arguments: (arguments - (argument - name: (identifier) @_arg - (#match? @_arg "^inherit$") - value: (identifier) @heritage.extends)))) @heritage - -; ── Heritage: R6 inherit= via bare call ────────────────────────────────────── -(binary_operator - lhs: (identifier) @heritage.class - rhs: (call - function: (identifier) @_r6fn - (#match? @_r6fn "^R6Class$") - arguments: (arguments - (argument - name: (identifier) @_arg - (#match? @_arg "^inherit$") - value: (identifier) @heritage.extends)))) @heritage - ; ── R6 Fields via namespace (non-function entries in public/private list()) ── (binary_operator lhs: (identifier) @_class @@ -3286,9 +3228,6 @@ export const R_QUERIES = ` arguments: (arguments (argument name: (identifier) @name) @definition.property))))) - -; ── Roxygen2 doc comments ──────────────────────────────────────────────────── -(comment) @comment `; import { SupportedLanguages } from 'gitnexus-shared';