gitnexus 1.6.3-rc.4 → 1.6.3-rc.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -12,6 +12,12 @@ export { ORIGIN_PRIORITY } from './scope-resolution/origin-priority.js';
12
12
  export type { OriginForTieBreak } from './scope-resolution/origin-priority.js';
13
13
  export { LanguageClassifications, isProductionLanguage, } from './scope-resolution/language-classification.js';
14
14
  export type { LanguageClassification } from './scope-resolution/language-classification.js';
15
+ export { buildDefIndex } from './scope-resolution/def-index.js';
16
+ export type { DefIndex } from './scope-resolution/def-index.js';
17
+ export { buildModuleScopeIndex } from './scope-resolution/module-scope-index.js';
18
+ export type { ModuleScopeIndex, ModuleScopeEntry } from './scope-resolution/module-scope-index.js';
19
+ export { buildQualifiedNameIndex } from './scope-resolution/qualified-name-index.js';
20
+ export type { QualifiedNameIndex } from './scope-resolution/qualified-name-index.js';
15
21
  export { diffResolutions } from './scope-resolution/shadow/diff.js';
16
22
  export type { ShadowAgreement, ShadowCallsite, ShadowDiff, } from './scope-resolution/shadow/diff.js';
17
23
  export { aggregateDiffs } from './scope-resolution/shadow/aggregate.js';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,YAAY,EACV,SAAS,EACT,cAAc,EACd,gBAAgB,EAChB,SAAS,EACT,iBAAiB,GAClB,MAAM,kBAAkB,CAAC;AAG1B,OAAO,EACL,WAAW,EACX,cAAc,EACd,SAAS,EACT,oBAAoB,GACrB,MAAM,4BAA4B,CAAC;AACpC,YAAY,EAAE,aAAa,EAAE,OAAO,EAAE,MAAM,4BAA4B,CAAC;AAGzE,OAAO,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AACpD,OAAO,EAAE,uBAAuB,EAAE,6BAA6B,EAAE,MAAM,yBAAyB,CAAC;AACjG,YAAY,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAGrD,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AAmC,CAAC;AACpE,YAAY,EACV,eAAe,EACf,cAAc,EACd,UAAU,GACX,MAAM,mCAAmC,CAAC;AAC3C,OAAO,EAAE,cAAc,EAAE,MAAM,wCAAwC,CAAC;AACxE,YAAY,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,MAAM,wCAAwC,CAAC"}
@@ -8,6 +8,10 @@ export { EvidenceWeights, typeBindingWeightAtDepth } from './scope-resolution/ev
8
8
  export { ORIGIN_PRIORITY } from './scope-resolution/origin-priority.js';
9
9
  // Language classification (RFC §6.1 Ring 3/4 governance)
10
10
  export { LanguageClassifications, isProductionLanguage, } from './scope-resolution/language-classification.js';
11
+ // Core indexes over per-file artifacts (RFC §3.1; Ring 2 SHARED #913)
12
+ export { buildDefIndex } from './scope-resolution/def-index.js';
13
+ export { buildModuleScopeIndex } from './scope-resolution/module-scope-index.js';
14
+ export { buildQualifiedNameIndex } from './scope-resolution/qualified-name-index.js';
11
15
  // Shadow-mode diff + aggregation (RFC §6.3; Ring 2 SHARED #918)
12
16
  export { diffResolutions } from './scope-resolution/shadow/diff.js';
13
17
  export { aggregateDiffs } from './scope-resolution/shadow/aggregate.js';
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AASA,mBAAmB;AACnB,OAAO,EACL,WAAW,EACX,cAAc,EACd,SAAS,EACT,oBAAoB,GACrB,MAAM,4BAA4B,CAAC;AAGpC,mBAAmB;AACnB,OAAO,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AACpD,OAAO,EAAE,uBAAuB,EAAE,6BAA6B,EAAE,MAAM,yBAAyB,CAAC;AAiCjG,8DAA8D;AAC9D,OAAO,EAAE,eAAe,EAAE,wBAAwB,EAAE,MAAM,wCAAwC,CAAC;AACnG,OAAO,EAAE,eAAe,EAAE,MAAM,uCAAuC,CAAC;AAGxE,yDAAyD;AACzD,OAAO,EACL,uBAAuB,EACvB,oBAAoB,GACrB,MAAM,+CAA+C,CAAC;AAGvD,gEAAgE;AAChE,OAAO,EAAE,eAAe,EAAE,MAAM,mCAAmC,CAAC;AAMpE,OAAO,EAAE,cAAc,EAAE,MAAM,wCAAwC,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AASA,mBAAmB;AACnB,OAAO,EACL,WAAW,EACX,cAAc,EACd,SAAS,EACT,oBAAoB,GACrB,MAAM,4BAA4B,CAAC;AAGpC,mBAAmB;AACnB,OAAO,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AACpD,OAAO,EAAE,uBAAuB,EAAE,6BAA6B,EAAE,MAAM,yBAAyB,CAAC;AAiCjG,8DAA8D;AAC9D,OAAO,EAAE,eAAe,EAAE,wBAAwB,EAAE,MAAM,wCAAwC,CAAC;AACnG,OAAO,EAAE,eAAe,EAAE,MAAM,uCAAuC,CAAC;AAGxE,yDAAyD;AACzD,OAAO,EACL,uBAAuB,EACvB,oBAAoB,GACrB,MAAM,+CAA+C,CAAC;AAGvD,sEAAsE;AACtE,OAAO,EAAE,aAAa,EAAE,MAAM,iCAAiC,CAAC;AAEhE,OAAO,EAAE,qBAAqB,EAAE,MAAM,0CAA0C,CAAC;AAEjF,OAAO,EAAE,uBAAuB,EAAE,MAAM,4CAA4C,CAAC;AAGrF,gEAAgE;AAChE,OAAO,EAAE,eAAe,EAAE,MAAM,mCAAmC,CAAC;AAMpE,OAAO,EAAE,cAAc,EAAE,MAAM,wCAAwC,CAAC"}
@@ -0,0 +1,36 @@
1
+ /**
2
+ * `DefIndex` — O(1) `DefId → SymbolDefinition` materialization.
3
+ *
4
+ * The global "what is this id?" lookup. Every per-kind registry (ClassRegistry,
5
+ * MethodRegistry, FieldRegistry) returns `DefId[]` and resolves them back to
6
+ * full `SymbolDefinition` records through this index — one central hash map,
7
+ * one allocation per def.
8
+ *
9
+ * Part of RFC #909 Ring 2 SHARED — #913.
10
+ *
11
+ * Consumed by: #917 (`Registry.lookup` implementations), #915 (SCC finalize).
12
+ */
13
+ import type { SymbolDefinition } from './symbol-definition.js';
14
+ import type { DefId } from './types.js';
15
+ export interface DefIndex {
16
+ readonly byId: ReadonlyMap<DefId, SymbolDefinition>;
17
+ readonly size: number;
18
+ get(id: DefId): SymbolDefinition | undefined;
19
+ has(id: DefId): boolean;
20
+ }
21
+ /**
22
+ * Build a `DefIndex` from a flat list of `SymbolDefinition` records.
23
+ *
24
+ * **Collision policy: first-write-wins.** `DefId` is meant to be unique
25
+ * (`nodeId` is the stable graph identifier), so a collision indicates an
26
+ * upstream bug — most likely the same symbol parsed twice or a duplicate
27
+ * commit into the pipeline. Rather than silently overwriting with a later
28
+ * definition that may be partial or wrong, the first record wins and
29
+ * subsequent records for the same id are dropped. Pipeline bugs surface
30
+ * later as `has(id) === true` but the def looking older than expected,
31
+ * which is easier to debug than a silent overwrite.
32
+ *
33
+ * Pure function — safe to call repeatedly; no side effects.
34
+ */
35
+ export declare function buildDefIndex(defs: readonly SymbolDefinition[]): DefIndex;
36
+ //# sourceMappingURL=def-index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"def-index.d.ts","sourceRoot":"","sources":["../../src/scope-resolution/def-index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAC/D,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AAExC,MAAM,WAAW,QAAQ;IACvB,QAAQ,CAAC,IAAI,EAAE,WAAW,CAAC,KAAK,EAAE,gBAAgB,CAAC,CAAC;IACpD,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,GAAG,CAAC,EAAE,EAAE,KAAK,GAAG,gBAAgB,GAAG,SAAS,CAAC;IAC7C,GAAG,CAAC,EAAE,EAAE,KAAK,GAAG,OAAO,CAAC;CACzB;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,aAAa,CAAC,IAAI,EAAE,SAAS,gBAAgB,EAAE,GAAG,QAAQ,CAOzE"}
@@ -0,0 +1,51 @@
1
+ /**
2
+ * `DefIndex` — O(1) `DefId → SymbolDefinition` materialization.
3
+ *
4
+ * The global "what is this id?" lookup. Every per-kind registry (ClassRegistry,
5
+ * MethodRegistry, FieldRegistry) returns `DefId[]` and resolves them back to
6
+ * full `SymbolDefinition` records through this index — one central hash map,
7
+ * one allocation per def.
8
+ *
9
+ * Part of RFC #909 Ring 2 SHARED — #913.
10
+ *
11
+ * Consumed by: #917 (`Registry.lookup` implementations), #915 (SCC finalize).
12
+ */
13
+ /**
14
+ * Build a `DefIndex` from a flat list of `SymbolDefinition` records.
15
+ *
16
+ * **Collision policy: first-write-wins.** `DefId` is meant to be unique
17
+ * (`nodeId` is the stable graph identifier), so a collision indicates an
18
+ * upstream bug — most likely the same symbol parsed twice or a duplicate
19
+ * commit into the pipeline. Rather than silently overwriting with a later
20
+ * definition that may be partial or wrong, the first record wins and
21
+ * subsequent records for the same id are dropped. Pipeline bugs surface
22
+ * later as `has(id) === true` but the def looking older than expected,
23
+ * which is easier to debug than a silent overwrite.
24
+ *
25
+ * Pure function — safe to call repeatedly; no side effects.
26
+ */
27
+ export function buildDefIndex(defs) {
28
+ const byId = new Map();
29
+ for (const def of defs) {
30
+ if (byId.has(def.nodeId))
31
+ continue; // first-write-wins
32
+ byId.set(def.nodeId, def);
33
+ }
34
+ return freezeIndex(byId);
35
+ }
36
+ // ─── Internal ───────────────────────────────────────────────────────────────
37
+ function freezeIndex(byId) {
38
+ return {
39
+ byId,
40
+ get size() {
41
+ return byId.size;
42
+ },
43
+ get(id) {
44
+ return byId.get(id);
45
+ },
46
+ has(id) {
47
+ return byId.has(id);
48
+ },
49
+ };
50
+ }
51
+ //# sourceMappingURL=def-index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"def-index.js","sourceRoot":"","sources":["../../src/scope-resolution/def-index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAYH;;;;;;;;;;;;;GAaG;AACH,MAAM,UAAU,aAAa,CAAC,IAAiC;IAC7D,MAAM,IAAI,GAAG,IAAI,GAAG,EAA2B,CAAC;IAChD,KAAK,MAAM,GAAG,IAAI,IAAI,EAAE,CAAC;QACvB,IAAI,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,MAAM,CAAC;YAAE,SAAS,CAAC,mBAAmB;QACvD,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAC5B,CAAC;IACD,OAAO,WAAW,CAAC,IAAI,CAAC,CAAC;AAC3B,CAAC;AAED,+EAA+E;AAE/E,SAAS,WAAW,CAAC,IAAkC;IACrD,OAAO;QACL,IAAI;QACJ,IAAI,IAAI;YACN,OAAO,IAAI,CAAC,IAAI,CAAC;QACnB,CAAC;QACD,GAAG,CAAC,EAAS;YACX,OAAO,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;QACtB,CAAC;QACD,GAAG,CAAC,EAAS;YACX,OAAO,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;QACtB,CAAC;KACF,CAAC;AACJ,CAAC"}
@@ -0,0 +1,38 @@
1
+ /**
2
+ * `ModuleScopeIndex` — O(1) `filePath → moduleScopeId` lookup.
3
+ *
4
+ * Every file parsed produces exactly one `Module` scope at its root. The
5
+ * finalize algorithm needs to resolve `ImportEdge.targetFile` to a concrete
6
+ * module scope id in constant time during the link pass; this index is that
7
+ * mapping.
8
+ *
9
+ * Part of RFC #909 Ring 2 SHARED — #913.
10
+ *
11
+ * Consumed by: #915 (SCC finalize link pass), #923 (shadow harness when
12
+ * resolving callsite file → enclosing module).
13
+ */
14
+ import type { ScopeId } from './types.js';
15
+ export interface ModuleScopeIndex {
16
+ readonly byFilePath: ReadonlyMap<string, ScopeId>;
17
+ readonly size: number;
18
+ get(filePath: string): ScopeId | undefined;
19
+ has(filePath: string): boolean;
20
+ }
21
+ export interface ModuleScopeEntry {
22
+ readonly filePath: string;
23
+ readonly moduleScopeId: ScopeId;
24
+ }
25
+ /**
26
+ * Build a `ModuleScopeIndex` from a flat list of `{ filePath, moduleScopeId }`
27
+ * pairs.
28
+ *
29
+ * **Collision policy: first-write-wins.** A file should appear exactly once
30
+ * in a single ingestion run; collisions indicate the same file was parsed
31
+ * twice or a `filePath` normalization bug upstream. Dropping the later
32
+ * entry preserves the first-stable id the rest of the pipeline may already
33
+ * have registered against.
34
+ *
35
+ * Pure function — safe to call repeatedly; no side effects.
36
+ */
37
+ export declare function buildModuleScopeIndex(entries: readonly ModuleScopeEntry[]): ModuleScopeIndex;
38
+ //# sourceMappingURL=module-scope-index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"module-scope-index.d.ts","sourceRoot":"","sources":["../../src/scope-resolution/module-scope-index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAE1C,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,CAAC,UAAU,EAAE,WAAW,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAClD,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,GAAG,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,GAAG,SAAS,CAAC;IAC3C,GAAG,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC;CAChC;AAED,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,aAAa,EAAE,OAAO,CAAC;CACjC;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,SAAS,gBAAgB,EAAE,GAAG,gBAAgB,CAO5F"}
@@ -0,0 +1,50 @@
1
+ /**
2
+ * `ModuleScopeIndex` — O(1) `filePath → moduleScopeId` lookup.
3
+ *
4
+ * Every file parsed produces exactly one `Module` scope at its root. The
5
+ * finalize algorithm needs to resolve `ImportEdge.targetFile` to a concrete
6
+ * module scope id in constant time during the link pass; this index is that
7
+ * mapping.
8
+ *
9
+ * Part of RFC #909 Ring 2 SHARED — #913.
10
+ *
11
+ * Consumed by: #915 (SCC finalize link pass), #923 (shadow harness when
12
+ * resolving callsite file → enclosing module).
13
+ */
14
+ /**
15
+ * Build a `ModuleScopeIndex` from a flat list of `{ filePath, moduleScopeId }`
16
+ * pairs.
17
+ *
18
+ * **Collision policy: first-write-wins.** A file should appear exactly once
19
+ * in a single ingestion run; collisions indicate the same file was parsed
20
+ * twice or a `filePath` normalization bug upstream. Dropping the later
21
+ * entry preserves the first-stable id the rest of the pipeline may already
22
+ * have registered against.
23
+ *
24
+ * Pure function — safe to call repeatedly; no side effects.
25
+ */
26
+ export function buildModuleScopeIndex(entries) {
27
+ const byFilePath = new Map();
28
+ for (const { filePath, moduleScopeId } of entries) {
29
+ if (byFilePath.has(filePath))
30
+ continue; // first-write-wins
31
+ byFilePath.set(filePath, moduleScopeId);
32
+ }
33
+ return freezeIndex(byFilePath);
34
+ }
35
+ // ─── Internal ───────────────────────────────────────────────────────────────
36
+ function freezeIndex(byFilePath) {
37
+ return {
38
+ byFilePath,
39
+ get size() {
40
+ return byFilePath.size;
41
+ },
42
+ get(filePath) {
43
+ return byFilePath.get(filePath);
44
+ },
45
+ has(filePath) {
46
+ return byFilePath.has(filePath);
47
+ },
48
+ };
49
+ }
50
+ //# sourceMappingURL=module-scope-index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"module-scope-index.js","sourceRoot":"","sources":["../../src/scope-resolution/module-scope-index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAgBH;;;;;;;;;;;GAWG;AACH,MAAM,UAAU,qBAAqB,CAAC,OAAoC;IACxE,MAAM,UAAU,GAAG,IAAI,GAAG,EAAmB,CAAC;IAC9C,KAAK,MAAM,EAAE,QAAQ,EAAE,aAAa,EAAE,IAAI,OAAO,EAAE,CAAC;QAClD,IAAI,UAAU,CAAC,GAAG,CAAC,QAAQ,CAAC;YAAE,SAAS,CAAC,mBAAmB;QAC3D,UAAU,CAAC,GAAG,CAAC,QAAQ,EAAE,aAAa,CAAC,CAAC;IAC1C,CAAC;IACD,OAAO,WAAW,CAAC,UAAU,CAAC,CAAC;AACjC,CAAC;AAED,+EAA+E;AAE/E,SAAS,WAAW,CAAC,UAAgC;IACnD,OAAO;QACL,UAAU;QACV,IAAI,IAAI;YACN,OAAO,UAAU,CAAC,IAAI,CAAC;QACzB,CAAC;QACD,GAAG,CAAC,QAAgB;YAClB,OAAO,UAAU,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;QAClC,CAAC;QACD,GAAG,CAAC,QAAgB;YAClB,OAAO,UAAU,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;QAClC,CAAC;KACF,CAAC;AACJ,CAAC"}
@@ -0,0 +1,44 @@
1
+ /**
2
+ * `QualifiedNameIndex` — O(1) `qualifiedName → DefId[]` lookup across all kinds.
3
+ *
4
+ * Cross-kind fast path for qualified-name resolution
5
+ * (`lookupQualified(qname, scope, params)` in RFC §4.5). Class, method,
6
+ * field, and namespace defs all contribute to a single index here; consumers
7
+ * filter the returned `DefId[]` by `p.acceptedKinds` at the call site.
8
+ *
9
+ * Returns `DefId[]` (not a single `DefId`) because multiple defs can legally
10
+ * share a qualified name — partial classes in C#, method overloads, or
11
+ * accidental cross-kind collisions. The lookup caller filters to the expected
12
+ * kind(s) and ranks the survivors.
13
+ *
14
+ * Part of RFC #909 Ring 2 SHARED — #913.
15
+ *
16
+ * Consumed by: #917 (`Registry.lookup` qualified fast path, `resolveTypeRef`
17
+ * dotted fallback via #916).
18
+ */
19
+ import type { SymbolDefinition } from './symbol-definition.js';
20
+ import type { DefId } from './types.js';
21
+ export interface QualifiedNameIndex {
22
+ readonly byQualifiedName: ReadonlyMap<string, readonly DefId[]>;
23
+ readonly size: number;
24
+ /** Returns all `DefId`s registered under this qualified name; empty frozen
25
+ * array on miss so callers can iterate without null checks. */
26
+ get(qualifiedName: string): readonly DefId[];
27
+ has(qualifiedName: string): boolean;
28
+ }
29
+ /**
30
+ * Build a `QualifiedNameIndex` from a flat list of `SymbolDefinition` records.
31
+ *
32
+ * Only defs with a non-empty `qualifiedName` contribute; defs without one are
33
+ * silently skipped (not every kind carries a qualified name — anonymous or
34
+ * top-level symbols, dynamic-unresolved imports, etc.).
35
+ *
36
+ * **Duplicate policy: appended in input order.** Each unique `(qname, DefId)`
37
+ * pair contributes at most once — repeated entries for the same pair are
38
+ * deduplicated. Distinct `DefId`s sharing a `qname` accumulate in insertion
39
+ * order (stable output for deterministic lookup ranking at the call site).
40
+ *
41
+ * Pure function — safe to call repeatedly; no side effects.
42
+ */
43
+ export declare function buildQualifiedNameIndex(defs: readonly SymbolDefinition[]): QualifiedNameIndex;
44
+ //# sourceMappingURL=qualified-name-index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"qualified-name-index.d.ts","sourceRoot":"","sources":["../../src/scope-resolution/qualified-name-index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAC/D,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AAExC,MAAM,WAAW,kBAAkB;IACjC,QAAQ,CAAC,eAAe,EAAE,WAAW,CAAC,MAAM,EAAE,SAAS,KAAK,EAAE,CAAC,CAAC;IAChE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB;oEACgE;IAChE,GAAG,CAAC,aAAa,EAAE,MAAM,GAAG,SAAS,KAAK,EAAE,CAAC;IAC7C,GAAG,CAAC,aAAa,EAAE,MAAM,GAAG,OAAO,CAAC;CACrC;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,uBAAuB,CAAC,IAAI,EAAE,SAAS,gBAAgB,EAAE,GAAG,kBAAkB,CA2B7F"}
@@ -0,0 +1,75 @@
1
+ /**
2
+ * `QualifiedNameIndex` — O(1) `qualifiedName → DefId[]` lookup across all kinds.
3
+ *
4
+ * Cross-kind fast path for qualified-name resolution
5
+ * (`lookupQualified(qname, scope, params)` in RFC §4.5). Class, method,
6
+ * field, and namespace defs all contribute to a single index here; consumers
7
+ * filter the returned `DefId[]` by `p.acceptedKinds` at the call site.
8
+ *
9
+ * Returns `DefId[]` (not a single `DefId`) because multiple defs can legally
10
+ * share a qualified name — partial classes in C#, method overloads, or
11
+ * accidental cross-kind collisions. The lookup caller filters to the expected
12
+ * kind(s) and ranks the survivors.
13
+ *
14
+ * Part of RFC #909 Ring 2 SHARED — #913.
15
+ *
16
+ * Consumed by: #917 (`Registry.lookup` qualified fast path, `resolveTypeRef`
17
+ * dotted fallback via #916).
18
+ */
19
+ /**
20
+ * Build a `QualifiedNameIndex` from a flat list of `SymbolDefinition` records.
21
+ *
22
+ * Only defs with a non-empty `qualifiedName` contribute; defs without one are
23
+ * silently skipped (not every kind carries a qualified name — anonymous or
24
+ * top-level symbols, dynamic-unresolved imports, etc.).
25
+ *
26
+ * **Duplicate policy: appended in input order.** Each unique `(qname, DefId)`
27
+ * pair contributes at most once — repeated entries for the same pair are
28
+ * deduplicated. Distinct `DefId`s sharing a `qname` accumulate in insertion
29
+ * order (stable output for deterministic lookup ranking at the call site).
30
+ *
31
+ * Pure function — safe to call repeatedly; no side effects.
32
+ */
33
+ export function buildQualifiedNameIndex(defs) {
34
+ const byQualifiedName = new Map();
35
+ const seenPairs = new Set();
36
+ for (const def of defs) {
37
+ const qname = def.qualifiedName;
38
+ if (qname === undefined || qname.length === 0)
39
+ continue;
40
+ const pairKey = `${qname}\0${def.nodeId}`;
41
+ if (seenPairs.has(pairKey))
42
+ continue;
43
+ seenPairs.add(pairKey);
44
+ const bucket = byQualifiedName.get(qname);
45
+ if (bucket === undefined) {
46
+ byQualifiedName.set(qname, [def.nodeId]);
47
+ }
48
+ else {
49
+ bucket.push(def.nodeId);
50
+ }
51
+ }
52
+ // Freeze bucket arrays so consumers can't mutate the index.
53
+ const frozen = new Map();
54
+ for (const [k, v] of byQualifiedName) {
55
+ frozen.set(k, Object.freeze(v.slice()));
56
+ }
57
+ return freezeIndex(frozen);
58
+ }
59
+ // ─── Internal ───────────────────────────────────────────────────────────────
60
+ const EMPTY = Object.freeze([]);
61
+ function freezeIndex(byQualifiedName) {
62
+ return {
63
+ byQualifiedName,
64
+ get size() {
65
+ return byQualifiedName.size;
66
+ },
67
+ get(qualifiedName) {
68
+ return byQualifiedName.get(qualifiedName) ?? EMPTY;
69
+ },
70
+ has(qualifiedName) {
71
+ return byQualifiedName.has(qualifiedName);
72
+ },
73
+ };
74
+ }
75
+ //# sourceMappingURL=qualified-name-index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"qualified-name-index.js","sourceRoot":"","sources":["../../src/scope-resolution/qualified-name-index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAcH;;;;;;;;;;;;;GAaG;AACH,MAAM,UAAU,uBAAuB,CAAC,IAAiC;IACvE,MAAM,eAAe,GAAG,IAAI,GAAG,EAAmB,CAAC;IACnD,MAAM,SAAS,GAAG,IAAI,GAAG,EAAU,CAAC;IAEpC,KAAK,MAAM,GAAG,IAAI,IAAI,EAAE,CAAC;QACvB,MAAM,KAAK,GAAG,GAAG,CAAC,aAAa,CAAC;QAChC,IAAI,KAAK,KAAK,SAAS,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC;YAAE,SAAS;QAExD,MAAM,OAAO,GAAG,GAAG,KAAK,KAAK,GAAG,CAAC,MAAM,EAAE,CAAC;QAC1C,IAAI,SAAS,CAAC,GAAG,CAAC,OAAO,CAAC;YAAE,SAAS;QACrC,SAAS,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;QAEvB,MAAM,MAAM,GAAG,eAAe,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;QAC1C,IAAI,MAAM,KAAK,SAAS,EAAE,CAAC;YACzB,eAAe,CAAC,GAAG,CAAC,KAAK,EAAE,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC;QAC3C,CAAC;aAAM,CAAC;YACN,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;QAC1B,CAAC;IACH,CAAC;IAED,4DAA4D;IAC5D,MAAM,MAAM,GAAG,IAAI,GAAG,EAA4B,CAAC;IACnD,KAAK,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,IAAI,eAAe,EAAE,CAAC;QACrC,MAAM,CAAC,GAAG,CAAC,CAAC,EAAE,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC;IAC1C,CAAC;IAED,OAAO,WAAW,CAAC,MAAM,CAAC,CAAC;AAC7B,CAAC;AAED,+EAA+E;AAE/E,MAAM,KAAK,GAAqB,MAAM,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;AAElD,SAAS,WAAW,CAAC,eAA8C;IACjE,OAAO;QACL,eAAe;QACf,IAAI,IAAI;YACN,OAAO,eAAe,CAAC,IAAI,CAAC;QAC9B,CAAC;QACD,GAAG,CAAC,aAAqB;YACvB,OAAO,eAAe,CAAC,GAAG,CAAC,aAAa,CAAC,IAAI,KAAK,CAAC;QACrD,CAAC;QACD,GAAG,CAAC,aAAqB;YACvB,OAAO,eAAe,CAAC,GAAG,CAAC,aAAa,CAAC,CAAC;QAC5C,CAAC;KACF,CAAC;AACJ,CAAC"}
@@ -1447,7 +1447,14 @@ export class LocalBackend {
1447
1447
  }
1448
1448
  let diffOutput;
1449
1449
  try {
1450
- diffOutput = execFileSync('git', diffArgs, { cwd: repo.repoPath, encoding: 'utf-8' });
1450
+ // maxBuffer raised from Node's 1MB default to 256MB to avoid ENOBUFS on
1451
+ // repos with large unstaged/untracked diffs (e.g. unignored build folders).
1452
+ // See issue: spawnSync git ENOBUFS in detect_changes(scope="unstaged").
1453
+ diffOutput = execFileSync('git', diffArgs, {
1454
+ cwd: repo.repoPath,
1455
+ encoding: 'utf-8',
1456
+ maxBuffer: 256 * 1024 * 1024,
1457
+ });
1451
1458
  }
1452
1459
  catch (err) {
1453
1460
  return { error: `Git diff failed: ${err.message}` };
@@ -1662,6 +1669,8 @@ export class LocalBackend {
1662
1669
  cwd: repo.repoPath,
1663
1670
  encoding: 'utf-8',
1664
1671
  timeout: 5000,
1672
+ // Avoid ENOBUFS on large repos: rg -l can list many files.
1673
+ maxBuffer: 256 * 1024 * 1024,
1665
1674
  });
1666
1675
  const files = output
1667
1676
  .trim()
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gitnexus",
3
- "version": "1.6.3-rc.4",
3
+ "version": "1.6.3-rc.5",
4
4
  "description": "Graph-powered code intelligence for AI agents. Index any codebase, query via MCP or CLI.",
5
5
  "author": "Abhigyan Patwari",
6
6
  "license": "PolyForm-Noncommercial-1.0.0",