gitnexus 1.6.3-rc.8 → 1.6.3-rc.9
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.
- package/dist/_shared/index.d.ts +16 -0
- package/dist/_shared/index.d.ts.map +1 -1
- package/dist/_shared/index.js +9 -0
- package/dist/_shared/index.js.map +1 -1
- package/dist/_shared/scope-resolution/registries/class-registry.d.ts +27 -0
- package/dist/_shared/scope-resolution/registries/class-registry.d.ts.map +1 -0
- package/dist/_shared/scope-resolution/registries/class-registry.js +30 -0
- package/dist/_shared/scope-resolution/registries/class-registry.js.map +1 -0
- package/dist/_shared/scope-resolution/registries/context.d.ts +69 -0
- package/dist/_shared/scope-resolution/registries/context.d.ts.map +1 -0
- package/dist/_shared/scope-resolution/registries/context.js +44 -0
- package/dist/_shared/scope-resolution/registries/context.js.map +1 -0
- package/dist/_shared/scope-resolution/registries/evidence.d.ts +56 -0
- package/dist/_shared/scope-resolution/registries/evidence.d.ts.map +1 -0
- package/dist/_shared/scope-resolution/registries/evidence.js +145 -0
- package/dist/_shared/scope-resolution/registries/evidence.js.map +1 -0
- package/dist/_shared/scope-resolution/registries/field-registry.d.ts +26 -0
- package/dist/_shared/scope-resolution/registries/field-registry.d.ts.map +1 -0
- package/dist/_shared/scope-resolution/registries/field-registry.js +31 -0
- package/dist/_shared/scope-resolution/registries/field-registry.js.map +1 -0
- package/dist/_shared/scope-resolution/registries/lookup-core.d.ts +81 -0
- package/dist/_shared/scope-resolution/registries/lookup-core.d.ts.map +1 -0
- package/dist/_shared/scope-resolution/registries/lookup-core.js +316 -0
- package/dist/_shared/scope-resolution/registries/lookup-core.js.map +1 -0
- package/dist/_shared/scope-resolution/registries/lookup-qualified.d.ts +33 -0
- package/dist/_shared/scope-resolution/registries/lookup-qualified.d.ts.map +1 -0
- package/dist/_shared/scope-resolution/registries/lookup-qualified.js +56 -0
- package/dist/_shared/scope-resolution/registries/lookup-qualified.js.map +1 -0
- package/dist/_shared/scope-resolution/registries/method-registry.d.ts +36 -0
- package/dist/_shared/scope-resolution/registries/method-registry.d.ts.map +1 -0
- package/dist/_shared/scope-resolution/registries/method-registry.js +32 -0
- package/dist/_shared/scope-resolution/registries/method-registry.js.map +1 -0
- package/dist/_shared/scope-resolution/registries/tie-breaks.d.ts +43 -0
- package/dist/_shared/scope-resolution/registries/tie-breaks.d.ts.map +1 -0
- package/dist/_shared/scope-resolution/registries/tie-breaks.js +60 -0
- package/dist/_shared/scope-resolution/registries/tie-breaks.js.map +1 -0
- package/package.json +1 -1
package/dist/_shared/index.d.ts
CHANGED
|
@@ -24,6 +24,22 @@ export { buildMethodDispatchIndex } from './scope-resolution/method-dispatch-ind
|
|
|
24
24
|
export type { MethodDispatchIndex, MethodDispatchInput, } from './scope-resolution/method-dispatch-index.js';
|
|
25
25
|
export { finalize } from './scope-resolution/finalize-algorithm.js';
|
|
26
26
|
export type { FinalizeInput, FinalizeFile, FinalizeHooks, FinalizeOutput, FinalizedScc, FinalizeStats, } from './scope-resolution/finalize-algorithm.js';
|
|
27
|
+
export { buildClassRegistry } from './scope-resolution/registries/class-registry.js';
|
|
28
|
+
export type { ClassRegistry } from './scope-resolution/registries/class-registry.js';
|
|
29
|
+
export { buildMethodRegistry } from './scope-resolution/registries/method-registry.js';
|
|
30
|
+
export type { MethodRegistry, MethodLookupOptions, } from './scope-resolution/registries/method-registry.js';
|
|
31
|
+
export { buildFieldRegistry } from './scope-resolution/registries/field-registry.js';
|
|
32
|
+
export type { FieldRegistry, FieldLookupOptions, } from './scope-resolution/registries/field-registry.js';
|
|
33
|
+
export { lookupCore } from './scope-resolution/registries/lookup-core.js';
|
|
34
|
+
export type { CoreLookupParams } from './scope-resolution/registries/lookup-core.js';
|
|
35
|
+
export { lookupQualified } from './scope-resolution/registries/lookup-qualified.js';
|
|
36
|
+
export type { LookupQualifiedParams } from './scope-resolution/registries/lookup-qualified.js';
|
|
37
|
+
export { composeEvidence, confidenceFromEvidence } from './scope-resolution/registries/evidence.js';
|
|
38
|
+
export type { RawSignals } from './scope-resolution/registries/evidence.js';
|
|
39
|
+
export { compareByConfidenceWithTiebreaks, CONFIDENCE_EPSILON, } from './scope-resolution/registries/tie-breaks.js';
|
|
40
|
+
export type { TieBreakKey } from './scope-resolution/registries/tie-breaks.js';
|
|
41
|
+
export { CLASS_KINDS, METHOD_KINDS, FIELD_KINDS } from './scope-resolution/registries/context.js';
|
|
42
|
+
export type { RegistryContext, RegistryProviders, OwnerScopedContributor, ArityVerdict, } from './scope-resolution/registries/context.js';
|
|
27
43
|
export { makeScopeId, clearScopeIdInternPool } from './scope-resolution/scope-id.js';
|
|
28
44
|
export type { ScopeIdInput } from './scope-resolution/scope-id.js';
|
|
29
45
|
export { buildScopeTree, ScopeTreeInvariantError } from './scope-resolution/scope-tree.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,YAAY,EAAE,aAAa,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AAIrE,YAAY,EAAE,gBAAgB,EAAE,MAAM,yCAAyC,CAAC;AAChF,YAAY,EACV,OAAO,EACP,KAAK,EACL,SAAS,EACT,KAAK,EACL,OAAO,EACP,YAAY,EACZ,UAAU,EACV,UAAU,EACV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CAAC;AAG1E,OAAO,EAAE,eAAe,EAAE,MAAM,mCAAmC,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"}
|
package/dist/_shared/index.js
CHANGED
|
@@ -18,6 +18,15 @@ export { resolveTypeRef } from './scope-resolution/resolve-type-ref.js';
|
|
|
18
18
|
export { buildMethodDispatchIndex } from './scope-resolution/method-dispatch-index.js';
|
|
19
19
|
// SCC-aware cross-file finalize (RFC §3.2 Phase 2; Ring 2 SHARED #915)
|
|
20
20
|
export { finalize } from './scope-resolution/finalize-algorithm.js';
|
|
21
|
+
// Scope-aware registries + 7-step lookup (RFC §4; Ring 2 SHARED #917)
|
|
22
|
+
export { buildClassRegistry } from './scope-resolution/registries/class-registry.js';
|
|
23
|
+
export { buildMethodRegistry } from './scope-resolution/registries/method-registry.js';
|
|
24
|
+
export { buildFieldRegistry } from './scope-resolution/registries/field-registry.js';
|
|
25
|
+
export { lookupCore } from './scope-resolution/registries/lookup-core.js';
|
|
26
|
+
export { lookupQualified } from './scope-resolution/registries/lookup-qualified.js';
|
|
27
|
+
export { composeEvidence, confidenceFromEvidence } from './scope-resolution/registries/evidence.js';
|
|
28
|
+
export { compareByConfidenceWithTiebreaks, CONFIDENCE_EPSILON, } from './scope-resolution/registries/tie-breaks.js';
|
|
29
|
+
export { CLASS_KINDS, METHOD_KINDS, FIELD_KINDS } from './scope-resolution/registries/context.js';
|
|
21
30
|
// Scope tree spine + position lookup (RFC §2.2 + §3.1; Ring 2 SHARED #912)
|
|
22
31
|
export { makeScopeId, clearScopeIdInternPool } from './scope-resolution/scope-id.js';
|
|
23
32
|
export { buildScopeTree, ScopeTreeInvariantError } from './scope-resolution/scope-tree.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
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AgC,EAChC,kBAAkB,GACnB,MAAM,6CAA6C,CAAC;AAErD,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,0CAA0C,CAAC;AAQlG,2EAA2E;AAC3E,OAAO,EAAE,WAAW,EAAE,sBAAsB,EAAE,MAAM,gCAAgC,CAAC;AAErF,OAAO,EAAE,cAAc,EAAE,uBAAuB,EAAE,MAAM,kCAAkC,CAAC;AAE3F,OAAO,EAAE,kBAAkB,EAAE,MAAM,sCAAsC,CAAC;AAG1E,gEAAgE;AAChE,OAAO,EAAE,eAAe,EAAE,MAAM,mCAAmC,CAAC;AAMpE,OAAO,EAAE,cAAc,EAAE,MAAM,wCAAwC,CAAC"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `ClassRegistry` — scope-aware lookup for class-like symbols
|
|
3
|
+
* (RFC §4.4; Ring 2 SHARED #917).
|
|
4
|
+
*
|
|
5
|
+
* Thin wrapper over `lookupCore`, specialized for class kinds:
|
|
6
|
+
*
|
|
7
|
+
* - `acceptedKinds` = Class / Interface / Enum / Struct / Union /
|
|
8
|
+
* Trait / TypeAlias / Typedef / Record / Delegate / Annotation /
|
|
9
|
+
* Template / Namespace.
|
|
10
|
+
* - `useReceiverTypeBinding` is **false** — classes are resolved by
|
|
11
|
+
* name through the lexical chain + global qualified fallback, not
|
|
12
|
+
* via a receiver type.
|
|
13
|
+
* - Arity filter is not applicable (classes are not called with
|
|
14
|
+
* argument counts at lookup time).
|
|
15
|
+
*/
|
|
16
|
+
import type { Resolution, ScopeId } from '../types.js';
|
|
17
|
+
import { type RegistryContext } from './context.js';
|
|
18
|
+
export interface ClassRegistry {
|
|
19
|
+
/**
|
|
20
|
+
* Look up a class-like symbol by simple or dotted name anchored at
|
|
21
|
+
* `scope`. Returns a confidence-ranked `Resolution[]`; consume `[0]`
|
|
22
|
+
* for the best answer.
|
|
23
|
+
*/
|
|
24
|
+
lookup(name: string, scope: ScopeId): readonly Resolution[];
|
|
25
|
+
}
|
|
26
|
+
export declare function buildClassRegistry(ctx: RegistryContext): ClassRegistry;
|
|
27
|
+
//# sourceMappingURL=class-registry.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"class-registry.d.ts","sourceRoot":"","sources":["../../../src/scope-resolution/registries/class-registry.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAEvD,OAAO,EAAe,KAAK,eAAe,EAAE,MAAM,cAAc,CAAC;AAEjE,MAAM,WAAW,aAAa;IAC5B;;;;OAIG;IACH,MAAM,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,GAAG,SAAS,UAAU,EAAE,CAAC;CAC7D;AAED,wBAAgB,kBAAkB,CAAC,GAAG,EAAE,eAAe,GAAG,aAAa,CAWtE"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `ClassRegistry` — scope-aware lookup for class-like symbols
|
|
3
|
+
* (RFC §4.4; Ring 2 SHARED #917).
|
|
4
|
+
*
|
|
5
|
+
* Thin wrapper over `lookupCore`, specialized for class kinds:
|
|
6
|
+
*
|
|
7
|
+
* - `acceptedKinds` = Class / Interface / Enum / Struct / Union /
|
|
8
|
+
* Trait / TypeAlias / Typedef / Record / Delegate / Annotation /
|
|
9
|
+
* Template / Namespace.
|
|
10
|
+
* - `useReceiverTypeBinding` is **false** — classes are resolved by
|
|
11
|
+
* name through the lexical chain + global qualified fallback, not
|
|
12
|
+
* via a receiver type.
|
|
13
|
+
* - Arity filter is not applicable (classes are not called with
|
|
14
|
+
* argument counts at lookup time).
|
|
15
|
+
*/
|
|
16
|
+
import { lookupCore } from './lookup-core.js';
|
|
17
|
+
import { CLASS_KINDS } from './context.js';
|
|
18
|
+
export function buildClassRegistry(ctx) {
|
|
19
|
+
const params = {
|
|
20
|
+
acceptedKinds: CLASS_KINDS,
|
|
21
|
+
useReceiverTypeBinding: false,
|
|
22
|
+
ownerScopedContributor: null,
|
|
23
|
+
};
|
|
24
|
+
return {
|
|
25
|
+
lookup(name, scope) {
|
|
26
|
+
return lookupCore(name, scope, params, ctx);
|
|
27
|
+
},
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
//# sourceMappingURL=class-registry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"class-registry.js","sourceRoot":"","sources":["../../../src/scope-resolution/registries/class-registry.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAGH,OAAO,EAAE,UAAU,EAAyB,MAAM,kBAAkB,CAAC;AACrE,OAAO,EAAE,WAAW,EAAwB,MAAM,cAAc,CAAC;AAWjE,MAAM,UAAU,kBAAkB,CAAC,GAAoB;IACrD,MAAM,MAAM,GAAqB;QAC/B,aAAa,EAAE,WAAW;QAC1B,sBAAsB,EAAE,KAAK;QAC7B,sBAAsB,EAAE,IAAI;KAC7B,CAAC;IACF,OAAO;QACL,MAAM,CAAC,IAAY,EAAE,KAAc;YACjC,OAAO,UAAU,CAAC,IAAI,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,CAAC,CAAC;QAC9C,CAAC;KACF,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `RegistryContext` — the injected state required by the scope-aware
|
|
3
|
+
* registry lookups (RFC §4; Ring 2 SHARED #917).
|
|
4
|
+
*
|
|
5
|
+
* Bundles every Ring 2 index + every provider hook the 7-step algorithm
|
|
6
|
+
* might consult. Threaded through `lookupCore` and the three public
|
|
7
|
+
* registries unchanged; construction is the caller's responsibility
|
|
8
|
+
* (typically once per workspace-indexing pass in Ring 2 PKG).
|
|
9
|
+
*
|
|
10
|
+
* The design intent is **pure-logic in `gitnexus-shared`, data + hooks
|
|
11
|
+
* supplied by the caller**. Nothing here loads files, parses AST, or
|
|
12
|
+
* reaches into the CLI package.
|
|
13
|
+
*/
|
|
14
|
+
import type { NodeLabel } from '../../graph/types.js';
|
|
15
|
+
import type { SymbolDefinition } from '../symbol-definition.js';
|
|
16
|
+
import type { Callsite, DefId } from '../types.js';
|
|
17
|
+
import type { DefIndex } from '../def-index.js';
|
|
18
|
+
import type { QualifiedNameIndex } from '../qualified-name-index.js';
|
|
19
|
+
import type { ModuleScopeIndex } from '../module-scope-index.js';
|
|
20
|
+
import type { ScopeTree } from '../scope-tree.js';
|
|
21
|
+
import type { MethodDispatchIndex } from '../method-dispatch-index.js';
|
|
22
|
+
export interface RegistryProviders {
|
|
23
|
+
/**
|
|
24
|
+
* Language-specific arity compatibility between a callsite and a candidate
|
|
25
|
+
* `def`. Mirrors `LanguageProvider.arityCompatibility` from #911. Optional:
|
|
26
|
+
* when absent, every candidate receives `'unknown'` (neutral signal).
|
|
27
|
+
*/
|
|
28
|
+
arityCompatibility?(callsite: Callsite, def: SymbolDefinition): ArityVerdict;
|
|
29
|
+
}
|
|
30
|
+
export type ArityVerdict = 'compatible' | 'unknown' | 'incompatible';
|
|
31
|
+
/**
|
|
32
|
+
* Per-owner membership view plugged into `LookupParams.ownerScopedContributor`.
|
|
33
|
+
*
|
|
34
|
+
* When the caller knows a receiver is of type `Owner` (e.g., after
|
|
35
|
+
* resolving an explicit receiver or via `self`), it can supply the
|
|
36
|
+
* `Owner`'s own member bucket here. `lookupCore` treats hits from this
|
|
37
|
+
* contributor as `origin: 'local'` inside the owner's body scope —
|
|
38
|
+
* strongest-visibility evidence, unaffected by the scope-chain hop
|
|
39
|
+
* deduction that punishes outer-scope hits.
|
|
40
|
+
*
|
|
41
|
+
* Ring 1's `RegistryContributor = unknown` opaque placeholder is narrowed
|
|
42
|
+
* to this concrete shape here in Ring 2 SHARED (#917).
|
|
43
|
+
*/
|
|
44
|
+
export interface OwnerScopedContributor {
|
|
45
|
+
/** The owner (class/struct/trait/interface) that bounds this view. */
|
|
46
|
+
readonly ownerDefId: DefId;
|
|
47
|
+
/**
|
|
48
|
+
* Methods / fields directly declared on the owner, keyed by simple name.
|
|
49
|
+
* Return empty array on miss; implementations should NOT walk the MRO —
|
|
50
|
+
* that's `MethodDispatchIndex`'s job, handled in the type-binding step.
|
|
51
|
+
*/
|
|
52
|
+
byName(name: string): readonly SymbolDefinition[];
|
|
53
|
+
}
|
|
54
|
+
export interface RegistryContext {
|
|
55
|
+
readonly scopes: ScopeTree;
|
|
56
|
+
readonly defs: DefIndex;
|
|
57
|
+
readonly qualifiedNames: QualifiedNameIndex;
|
|
58
|
+
readonly moduleScopes: ModuleScopeIndex;
|
|
59
|
+
/**
|
|
60
|
+
* Method-dispatch index; required for method/field registries that
|
|
61
|
+
* honor `useReceiverTypeBinding`. Omit for class-only lookups.
|
|
62
|
+
*/
|
|
63
|
+
readonly methodDispatch?: MethodDispatchIndex;
|
|
64
|
+
readonly providers: RegistryProviders;
|
|
65
|
+
}
|
|
66
|
+
export declare const CLASS_KINDS: readonly NodeLabel[];
|
|
67
|
+
export declare const METHOD_KINDS: readonly NodeLabel[];
|
|
68
|
+
export declare const FIELD_KINDS: readonly NodeLabel[];
|
|
69
|
+
//# sourceMappingURL=context.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../../../src/scope-resolution/registries/context.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AACtD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAChE,OAAO,KAAK,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AACnD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AACrE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AACjE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,6BAA6B,CAAC;AAIvE,MAAM,WAAW,iBAAiB;IAChC;;;;OAIG;IACH,kBAAkB,CAAC,CAAC,QAAQ,EAAE,QAAQ,EAAE,GAAG,EAAE,gBAAgB,GAAG,YAAY,CAAC;CAC9E;AAED,MAAM,MAAM,YAAY,GAAG,YAAY,GAAG,SAAS,GAAG,cAAc,CAAC;AAIrE;;;;;;;;;;;;GAYG;AACH,MAAM,WAAW,sBAAsB;IACrC,sEAAsE;IACtE,QAAQ,CAAC,UAAU,EAAE,KAAK,CAAC;IAC3B;;;;OAIG;IACH,MAAM,CAAC,IAAI,EAAE,MAAM,GAAG,SAAS,gBAAgB,EAAE,CAAC;CACnD;AAID,MAAM,WAAW,eAAe;IAC9B,QAAQ,CAAC,MAAM,EAAE,SAAS,CAAC;IAC3B,QAAQ,CAAC,IAAI,EAAE,QAAQ,CAAC;IACxB,QAAQ,CAAC,cAAc,EAAE,kBAAkB,CAAC;IAC5C,QAAQ,CAAC,YAAY,EAAE,gBAAgB,CAAC;IACxC;;;OAGG;IACH,QAAQ,CAAC,cAAc,CAAC,EAAE,mBAAmB,CAAC;IAC9C,QAAQ,CAAC,SAAS,EAAE,iBAAiB,CAAC;CACvC;AAOD,eAAO,MAAM,WAAW,EAAE,SAAS,SAAS,EAc1C,CAAC;AAEH,eAAO,MAAM,YAAY,EAAE,SAAS,SAAS,EAI3C,CAAC;AAEH,eAAO,MAAM,WAAW,EAAE,SAAS,SAAS,EAK1C,CAAC"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `RegistryContext` — the injected state required by the scope-aware
|
|
3
|
+
* registry lookups (RFC §4; Ring 2 SHARED #917).
|
|
4
|
+
*
|
|
5
|
+
* Bundles every Ring 2 index + every provider hook the 7-step algorithm
|
|
6
|
+
* might consult. Threaded through `lookupCore` and the three public
|
|
7
|
+
* registries unchanged; construction is the caller's responsibility
|
|
8
|
+
* (typically once per workspace-indexing pass in Ring 2 PKG).
|
|
9
|
+
*
|
|
10
|
+
* The design intent is **pure-logic in `gitnexus-shared`, data + hooks
|
|
11
|
+
* supplied by the caller**. Nothing here loads files, parses AST, or
|
|
12
|
+
* reaches into the CLI package.
|
|
13
|
+
*/
|
|
14
|
+
// ─── Per-kind default `acceptedKinds` sets ─────────────────────────────────
|
|
15
|
+
//
|
|
16
|
+
// Exported so the three public registries stay declarative (each one just
|
|
17
|
+
// points at the right constant + passes it to `lookupCore`).
|
|
18
|
+
export const CLASS_KINDS = Object.freeze([
|
|
19
|
+
'Class',
|
|
20
|
+
'Interface',
|
|
21
|
+
'Enum',
|
|
22
|
+
'Struct',
|
|
23
|
+
'Union',
|
|
24
|
+
'Trait',
|
|
25
|
+
'TypeAlias',
|
|
26
|
+
'Typedef',
|
|
27
|
+
'Record',
|
|
28
|
+
'Delegate',
|
|
29
|
+
'Annotation',
|
|
30
|
+
'Template',
|
|
31
|
+
'Namespace',
|
|
32
|
+
]);
|
|
33
|
+
export const METHOD_KINDS = Object.freeze([
|
|
34
|
+
'Method',
|
|
35
|
+
'Function',
|
|
36
|
+
'Constructor',
|
|
37
|
+
]);
|
|
38
|
+
export const FIELD_KINDS = Object.freeze([
|
|
39
|
+
'Variable',
|
|
40
|
+
'Property',
|
|
41
|
+
'Const',
|
|
42
|
+
'Static',
|
|
43
|
+
]);
|
|
44
|
+
//# sourceMappingURL=context.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"context.js","sourceRoot":"","sources":["../../../src/scope-resolution/registries/context.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAiEH,8EAA8E;AAC9E,EAAE;AACF,0EAA0E;AAC1E,6DAA6D;AAE7D,MAAM,CAAC,MAAM,WAAW,GAAyB,MAAM,CAAC,MAAM,CAAC;IAC7D,OAAO;IACP,WAAW;IACX,MAAM;IACN,QAAQ;IACR,OAAO;IACP,OAAO;IACP,WAAW;IACX,SAAS;IACT,QAAQ;IACR,UAAU;IACV,YAAY;IACZ,UAAU;IACV,WAAW;CACZ,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,YAAY,GAAyB,MAAM,CAAC,MAAM,CAAC;IAC9D,QAAQ;IACR,UAAU;IACV,aAAa;CACd,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,WAAW,GAAyB,MAAM,CAAC,MAAM,CAAC;IAC7D,UAAU;IACV,UAAU;IACV,OAAO;IACP,QAAQ;CACT,CAAC,CAAC"}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `composeEvidence` — translate accumulated raw signals per candidate
|
|
3
|
+
* into a `ResolutionEvidence[]` using the authoritative `EvidenceWeights`
|
|
4
|
+
* map (RFC §4.3 + Appendix A; Ring 2 SHARED #917).
|
|
5
|
+
*
|
|
6
|
+
* Each `RawSignals` record describes what was observed about a candidate
|
|
7
|
+
* during the 7-step walk: where it was found, at what depth, whether
|
|
8
|
+
* anything corroborates it. This module turns those raw facts into the
|
|
9
|
+
* typed evidence list attached to the outgoing `Resolution`.
|
|
10
|
+
*
|
|
11
|
+
* **Every weight comes from `EvidenceWeights`.** No inline magic numbers.
|
|
12
|
+
* Extends issue #429 (centralize hardcoded confidence values).
|
|
13
|
+
*
|
|
14
|
+
* **Confidence compose rule.** Signals add; the sum is capped at 1.0 at
|
|
15
|
+
* the call site (inside `lookupCore`). This module only emits the list;
|
|
16
|
+
* it does NOT compute the capped sum so callers can inspect per-signal
|
|
17
|
+
* contributions for debugging.
|
|
18
|
+
*/
|
|
19
|
+
import type { BindingRef, ResolutionEvidence } from '../types.js';
|
|
20
|
+
/**
|
|
21
|
+
* Raw signals observed for a single candidate during the 7-step walk.
|
|
22
|
+
* Optional fields encode "this signal did not fire"; presence encodes
|
|
23
|
+
* "emit an evidence record".
|
|
24
|
+
*/
|
|
25
|
+
export interface RawSignals {
|
|
26
|
+
/** Visibility origin of the binding that produced this candidate. */
|
|
27
|
+
readonly origin?: BindingRef['origin'] | 'global-qualified' | 'global-name';
|
|
28
|
+
/** Depth at which the binding was found (hops up from start scope). */
|
|
29
|
+
readonly scopeChainDepth?: number;
|
|
30
|
+
/** `ImportEdge` that brought the name in; present when origin is a non-local. */
|
|
31
|
+
readonly viaUnlinkedImport?: boolean;
|
|
32
|
+
/** Set when the candidate came via the receiver's type-binding MRO walk. */
|
|
33
|
+
readonly typeBindingMroDepth?: number;
|
|
34
|
+
/** `def.ownerId === resolvedReceiver.def.nodeId`. */
|
|
35
|
+
readonly ownerMatch?: boolean;
|
|
36
|
+
/** Always fires for candidates that pass `acceptedKinds`; weight 0. */
|
|
37
|
+
readonly kindMatch: true;
|
|
38
|
+
readonly arityVerdict?: 'compatible' | 'unknown' | 'incompatible';
|
|
39
|
+
/** Candidate flows through a `kind: 'dynamic-unresolved'` ImportEdge. */
|
|
40
|
+
readonly dynamicUnresolved?: boolean;
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Compose the raw signals into a stable `ResolutionEvidence[]` list.
|
|
44
|
+
*
|
|
45
|
+
* Emission order mirrors the `EvidenceWeights` layout: where-found →
|
|
46
|
+
* type-binding → corroborators → arity → degraded. Stable order makes
|
|
47
|
+
* the per-signal contributions easy to reason about in tests and in the
|
|
48
|
+
* shadow-mode parity dashboard.
|
|
49
|
+
*/
|
|
50
|
+
export declare function composeEvidence(signals: RawSignals): readonly ResolutionEvidence[];
|
|
51
|
+
/**
|
|
52
|
+
* Sum evidence weights and clamp to `[0, 1]`. Separate from `composeEvidence`
|
|
53
|
+
* so tests and the parity dashboard can inspect the raw evidence list.
|
|
54
|
+
*/
|
|
55
|
+
export declare function confidenceFromEvidence(evidence: readonly ResolutionEvidence[]): number;
|
|
56
|
+
//# sourceMappingURL=evidence.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"evidence.d.ts","sourceRoot":"","sources":["../../../src/scope-resolution/registries/evidence.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AAGlE;;;;GAIG;AACH,MAAM,WAAW,UAAU;IAEzB,qEAAqE;IACrE,QAAQ,CAAC,MAAM,CAAC,EAAE,UAAU,CAAC,QAAQ,CAAC,GAAG,kBAAkB,GAAG,aAAa,CAAC;IAC5E,uEAAuE;IACvE,QAAQ,CAAC,eAAe,CAAC,EAAE,MAAM,CAAC;IAClC,iFAAiF;IACjF,QAAQ,CAAC,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAGrC,4EAA4E;IAC5E,QAAQ,CAAC,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAGtC,qDAAqD;IACrD,QAAQ,CAAC,UAAU,CAAC,EAAE,OAAO,CAAC;IAC9B,uEAAuE;IACvE,QAAQ,CAAC,SAAS,EAAE,IAAI,CAAC;IAGzB,QAAQ,CAAC,YAAY,CAAC,EAAE,YAAY,GAAG,SAAS,GAAG,cAAc,CAAC;IAGlE,yEAAyE;IACzE,QAAQ,CAAC,iBAAiB,CAAC,EAAE,OAAO,CAAC;CACtC;AAED;;;;;;;GAOG;AACH,wBAAgB,eAAe,CAAC,OAAO,EAAE,UAAU,GAAG,SAAS,kBAAkB,EAAE,CA6ElF;AAED;;;GAGG;AACH,wBAAgB,sBAAsB,CAAC,QAAQ,EAAE,SAAS,kBAAkB,EAAE,GAAG,MAAM,CAMtF"}
|
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `composeEvidence` — translate accumulated raw signals per candidate
|
|
3
|
+
* into a `ResolutionEvidence[]` using the authoritative `EvidenceWeights`
|
|
4
|
+
* map (RFC §4.3 + Appendix A; Ring 2 SHARED #917).
|
|
5
|
+
*
|
|
6
|
+
* Each `RawSignals` record describes what was observed about a candidate
|
|
7
|
+
* during the 7-step walk: where it was found, at what depth, whether
|
|
8
|
+
* anything corroborates it. This module turns those raw facts into the
|
|
9
|
+
* typed evidence list attached to the outgoing `Resolution`.
|
|
10
|
+
*
|
|
11
|
+
* **Every weight comes from `EvidenceWeights`.** No inline magic numbers.
|
|
12
|
+
* Extends issue #429 (centralize hardcoded confidence values).
|
|
13
|
+
*
|
|
14
|
+
* **Confidence compose rule.** Signals add; the sum is capped at 1.0 at
|
|
15
|
+
* the call site (inside `lookupCore`). This module only emits the list;
|
|
16
|
+
* it does NOT compute the capped sum so callers can inspect per-signal
|
|
17
|
+
* contributions for debugging.
|
|
18
|
+
*/
|
|
19
|
+
import { EvidenceWeights, typeBindingWeightAtDepth } from '../evidence-weights.js';
|
|
20
|
+
/**
|
|
21
|
+
* Compose the raw signals into a stable `ResolutionEvidence[]` list.
|
|
22
|
+
*
|
|
23
|
+
* Emission order mirrors the `EvidenceWeights` layout: where-found →
|
|
24
|
+
* type-binding → corroborators → arity → degraded. Stable order makes
|
|
25
|
+
* the per-signal contributions easy to reason about in tests and in the
|
|
26
|
+
* shadow-mode parity dashboard.
|
|
27
|
+
*/
|
|
28
|
+
export function composeEvidence(signals) {
|
|
29
|
+
const out = [];
|
|
30
|
+
// ── Where-found visibility ─────────────────────────────────────────────
|
|
31
|
+
if (signals.origin !== undefined) {
|
|
32
|
+
const baseWeight = getOriginWeight(signals.origin);
|
|
33
|
+
const capped = signals.viaUnlinkedImport
|
|
34
|
+
? baseWeight * EvidenceWeights.unlinkedImportMultiplier
|
|
35
|
+
: baseWeight;
|
|
36
|
+
const evidenceKind = whereFoundEvidenceKind(signals.origin);
|
|
37
|
+
out.push({
|
|
38
|
+
kind: evidenceKind,
|
|
39
|
+
weight: capped,
|
|
40
|
+
...(signals.viaUnlinkedImport
|
|
41
|
+
? { note: `via unresolved import (${EvidenceWeights.unlinkedImportMultiplier}× cap)` }
|
|
42
|
+
: {}),
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
// ── Scope-chain depth deduction (per-hop, only meaningful for lexical
|
|
46
|
+
// hits where scopeChainDepth ≥ 1). Depth 0 = no deduction; depth N ≥ 1
|
|
47
|
+
// emits a single `scope-chain` evidence with the accumulated penalty.
|
|
48
|
+
if (signals.scopeChainDepth !== undefined && signals.scopeChainDepth > 0) {
|
|
49
|
+
out.push({
|
|
50
|
+
kind: 'scope-chain',
|
|
51
|
+
weight: EvidenceWeights.scopeChainPerDepth * signals.scopeChainDepth,
|
|
52
|
+
note: `depth=${signals.scopeChainDepth}`,
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
// ── Type-binding / MRO path ────────────────────────────────────────────
|
|
56
|
+
if (signals.typeBindingMroDepth !== undefined) {
|
|
57
|
+
out.push({
|
|
58
|
+
kind: 'type-binding',
|
|
59
|
+
weight: typeBindingWeightAtDepth(signals.typeBindingMroDepth),
|
|
60
|
+
note: `mroDepth=${signals.typeBindingMroDepth}`,
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
// ── Owner match (explanatory for debug) ────────────────────────────────
|
|
64
|
+
if (signals.ownerMatch === true) {
|
|
65
|
+
out.push({
|
|
66
|
+
kind: 'owner-match',
|
|
67
|
+
weight: EvidenceWeights.ownerMatch,
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
// ── Kind match (always present; weight 0; retained for debuggability) ──
|
|
71
|
+
out.push({
|
|
72
|
+
kind: 'kind-match',
|
|
73
|
+
weight: EvidenceWeights.kindMatch,
|
|
74
|
+
});
|
|
75
|
+
// ── Arity ──────────────────────────────────────────────────────────────
|
|
76
|
+
if (signals.arityVerdict !== undefined) {
|
|
77
|
+
const weight = signals.arityVerdict === 'compatible'
|
|
78
|
+
? EvidenceWeights.arityMatchCompatible
|
|
79
|
+
: signals.arityVerdict === 'incompatible'
|
|
80
|
+
? EvidenceWeights.arityMatchIncompatible
|
|
81
|
+
: EvidenceWeights.arityMatchUnknown;
|
|
82
|
+
out.push({
|
|
83
|
+
kind: 'arity-match',
|
|
84
|
+
weight,
|
|
85
|
+
note: signals.arityVerdict,
|
|
86
|
+
});
|
|
87
|
+
}
|
|
88
|
+
// ── Dynamic-unresolved (degraded signal) ───────────────────────────────
|
|
89
|
+
if (signals.dynamicUnresolved === true) {
|
|
90
|
+
out.push({
|
|
91
|
+
kind: 'dynamic-import-unresolved',
|
|
92
|
+
weight: EvidenceWeights.dynamicImportUnresolved,
|
|
93
|
+
});
|
|
94
|
+
}
|
|
95
|
+
return out;
|
|
96
|
+
}
|
|
97
|
+
/**
|
|
98
|
+
* Sum evidence weights and clamp to `[0, 1]`. Separate from `composeEvidence`
|
|
99
|
+
* so tests and the parity dashboard can inspect the raw evidence list.
|
|
100
|
+
*/
|
|
101
|
+
export function confidenceFromEvidence(evidence) {
|
|
102
|
+
let sum = 0;
|
|
103
|
+
for (const e of evidence)
|
|
104
|
+
sum += e.weight;
|
|
105
|
+
if (sum < 0)
|
|
106
|
+
return 0;
|
|
107
|
+
if (sum > 1)
|
|
108
|
+
return 1;
|
|
109
|
+
return sum;
|
|
110
|
+
}
|
|
111
|
+
// ─── Internal ───────────────────────────────────────────────────────────────
|
|
112
|
+
function getOriginWeight(origin) {
|
|
113
|
+
switch (origin) {
|
|
114
|
+
case 'local':
|
|
115
|
+
return EvidenceWeights.local;
|
|
116
|
+
case 'import':
|
|
117
|
+
return EvidenceWeights.import;
|
|
118
|
+
case 'reexport':
|
|
119
|
+
return EvidenceWeights.reexport;
|
|
120
|
+
case 'namespace':
|
|
121
|
+
return EvidenceWeights.namespace;
|
|
122
|
+
case 'wildcard':
|
|
123
|
+
return EvidenceWeights.wildcard;
|
|
124
|
+
case 'global-qualified':
|
|
125
|
+
return EvidenceWeights.globalQualified;
|
|
126
|
+
case 'global-name':
|
|
127
|
+
return EvidenceWeights.globalName;
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
function whereFoundEvidenceKind(origin) {
|
|
131
|
+
switch (origin) {
|
|
132
|
+
case 'local':
|
|
133
|
+
return 'local';
|
|
134
|
+
case 'import':
|
|
135
|
+
case 'reexport':
|
|
136
|
+
case 'namespace':
|
|
137
|
+
case 'wildcard':
|
|
138
|
+
return 'import';
|
|
139
|
+
case 'global-qualified':
|
|
140
|
+
return 'global-qualified';
|
|
141
|
+
case 'global-name':
|
|
142
|
+
return 'global-name';
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
//# sourceMappingURL=evidence.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"evidence.js","sourceRoot":"","sources":["../../../src/scope-resolution/registries/evidence.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAGH,OAAO,EAAE,eAAe,EAAE,wBAAwB,EAAE,MAAM,wBAAwB,CAAC;AAkCnF;;;;;;;GAOG;AACH,MAAM,UAAU,eAAe,CAAC,OAAmB;IACjD,MAAM,GAAG,GAAyB,EAAE,CAAC;IAErC,0EAA0E;IAC1E,IAAI,OAAO,CAAC,MAAM,KAAK,SAAS,EAAE,CAAC;QACjC,MAAM,UAAU,GAAG,eAAe,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;QACnD,MAAM,MAAM,GAAG,OAAO,CAAC,iBAAiB;YACtC,CAAC,CAAC,UAAU,GAAG,eAAe,CAAC,wBAAwB;YACvD,CAAC,CAAC,UAAU,CAAC;QACf,MAAM,YAAY,GAAG,sBAAsB,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;QAC5D,GAAG,CAAC,IAAI,CAAC;YACP,IAAI,EAAE,YAAY;YAClB,MAAM,EAAE,MAAM;YACd,GAAG,CAAC,OAAO,CAAC,iBAAiB;gBAC3B,CAAC,CAAC,EAAE,IAAI,EAAE,0BAA0B,eAAe,CAAC,wBAAwB,QAAQ,EAAE;gBACtF,CAAC,CAAC,EAAE,CAAC;SACR,CAAC,CAAC;IACL,CAAC;IAED,uEAAuE;IACvE,uEAAuE;IACvE,sEAAsE;IACtE,IAAI,OAAO,CAAC,eAAe,KAAK,SAAS,IAAI,OAAO,CAAC,eAAe,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K,kBAAkB;YACrB,OAAO,kBAAkB,CAAC;QAC5B,KAAK,aAAa;YAChB,OAAO,aAAa,CAAC;IACzB,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `FieldRegistry` — scope-aware lookup for field / property / variable
|
|
3
|
+
* access (RFC §4.4; Ring 2 SHARED #917).
|
|
4
|
+
*
|
|
5
|
+
* Thin wrapper over `lookupCore`, specialized for data-member kinds:
|
|
6
|
+
*
|
|
7
|
+
* - `acceptedKinds` = Variable / Property / Const / Static.
|
|
8
|
+
* - `useReceiverTypeBinding` is **true** — fields are resolved against
|
|
9
|
+
* the receiver type's MRO first, then via the lexical chain for
|
|
10
|
+
* free variables.
|
|
11
|
+
* - `callsite` is not meaningful for field access (no arity), but the
|
|
12
|
+
* `explicitReceiver` and `ownerScopedContributor` knobs are.
|
|
13
|
+
*/
|
|
14
|
+
import type { Resolution, ScopeId } from '../types.js';
|
|
15
|
+
import type { OwnerScopedContributor, RegistryContext } from './context.js';
|
|
16
|
+
export interface FieldLookupOptions {
|
|
17
|
+
readonly explicitReceiver?: {
|
|
18
|
+
readonly name: string;
|
|
19
|
+
};
|
|
20
|
+
readonly ownerScopedContributor?: OwnerScopedContributor;
|
|
21
|
+
}
|
|
22
|
+
export interface FieldRegistry {
|
|
23
|
+
lookup(name: string, scope: ScopeId, options?: FieldLookupOptions): readonly Resolution[];
|
|
24
|
+
}
|
|
25
|
+
export declare function buildFieldRegistry(ctx: RegistryContext): FieldRegistry;
|
|
26
|
+
//# sourceMappingURL=field-registry.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"field-registry.d.ts","sourceRoot":"","sources":["../../../src/scope-resolution/registries/field-registry.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAEvD,OAAO,KAAK,EAAE,sBAAsB,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAG5E,MAAM,WAAW,kBAAkB;IACjC,QAAQ,CAAC,gBAAgB,CAAC,EAAE;QAAE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC;IACtD,QAAQ,CAAC,sBAAsB,CAAC,EAAE,sBAAsB,CAAC;CAC1D;AAED,MAAM,WAAW,aAAa;IAC5B,MAAM,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,EAAE,OAAO,CAAC,EAAE,kBAAkB,GAAG,SAAS,UAAU,EAAE,CAAC;CAC3F;AAED,wBAAgB,kBAAkB,CAAC,GAAG,EAAE,eAAe,GAAG,aAAa,CActE"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `FieldRegistry` — scope-aware lookup for field / property / variable
|
|
3
|
+
* access (RFC §4.4; Ring 2 SHARED #917).
|
|
4
|
+
*
|
|
5
|
+
* Thin wrapper over `lookupCore`, specialized for data-member kinds:
|
|
6
|
+
*
|
|
7
|
+
* - `acceptedKinds` = Variable / Property / Const / Static.
|
|
8
|
+
* - `useReceiverTypeBinding` is **true** — fields are resolved against
|
|
9
|
+
* the receiver type's MRO first, then via the lexical chain for
|
|
10
|
+
* free variables.
|
|
11
|
+
* - `callsite` is not meaningful for field access (no arity), but the
|
|
12
|
+
* `explicitReceiver` and `ownerScopedContributor` knobs are.
|
|
13
|
+
*/
|
|
14
|
+
import { lookupCore } from './lookup-core.js';
|
|
15
|
+
import { FIELD_KINDS } from './context.js';
|
|
16
|
+
export function buildFieldRegistry(ctx) {
|
|
17
|
+
return {
|
|
18
|
+
lookup(name, scope, options = {}) {
|
|
19
|
+
const params = {
|
|
20
|
+
acceptedKinds: FIELD_KINDS,
|
|
21
|
+
useReceiverTypeBinding: true,
|
|
22
|
+
ownerScopedContributor: options.ownerScopedContributor ?? null,
|
|
23
|
+
...(options.explicitReceiver !== undefined
|
|
24
|
+
? { explicitReceiver: options.explicitReceiver }
|
|
25
|
+
: {}),
|
|
26
|
+
};
|
|
27
|
+
return lookupCore(name, scope, params, ctx);
|
|
28
|
+
},
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
//# sourceMappingURL=field-registry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"field-registry.js","sourceRoot":"","sources":["../../../src/scope-resolution/registries/field-registry.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAGH,OAAO,EAAE,UAAU,EAAyB,MAAM,kBAAkB,CAAC;AAErE,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAW3C,MAAM,UAAU,kBAAkB,CAAC,GAAoB;IACrD,OAAO;QACL,MAAM,CAAC,IAAY,EAAE,KAAc,EAAE,UAA8B,EAAE;YACnE,MAAM,MAAM,GAAqB;gBAC/B,aAAa,EAAE,WAAW;gBAC1B,sBAAsB,EAAE,IAAI;gBAC5B,sBAAsB,EAAE,OAAO,CAAC,sBAAsB,IAAI,IAAI;gBAC9D,GAAG,CAAC,OAAO,CAAC,gBAAgB,KAAK,SAAS;oBACxC,CAAC,CAAC,EAAE,gBAAgB,EAAE,OAAO,CAAC,gBAAgB,EAAE;oBAChD,CAAC,CAAC,EAAE,CAAC;aACR,CAAC;YACF,OAAO,UAAU,CAAC,IAAI,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,CAAC,CAAC;QAC9C,CAAC;KACF,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `lookupCore` — the shared 7-step canonical resolution algorithm
|
|
3
|
+
* (RFC §4.2; Ring 2 SHARED #917).
|
|
4
|
+
*
|
|
5
|
+
* Pure function. Given a name, a starting scope, and per-kind parameters,
|
|
6
|
+
* walks lexical scopes + optional type-binding MRO + optional owner
|
|
7
|
+
* contributor + global qualified-name fallback, and returns a ranked
|
|
8
|
+
* `Resolution[]` with per-candidate evidence.
|
|
9
|
+
*
|
|
10
|
+
* All three public registries (`ClassRegistry` / `MethodRegistry` /
|
|
11
|
+
* `FieldRegistry`) dispatch into this function, differing only in the
|
|
12
|
+
* parameters they pass. The CHOICE of which steps fire is expressed
|
|
13
|
+
* through `LookupParams`, not through different algorithms per kind.
|
|
14
|
+
*
|
|
15
|
+
* ## Algorithm (RFC §4.2, verbatim names)
|
|
16
|
+
*
|
|
17
|
+
* **Step 1 — Lexical scope-chain walk.** From `startScope`, walk
|
|
18
|
+
* parent-ward. At each scope, consult `scope.bindings.get(name)`:
|
|
19
|
+
* - Filter candidates whose `def.type ∈ acceptedKinds`.
|
|
20
|
+
* - For each surviving candidate, record a raw signal with the
|
|
21
|
+
* binding's origin + the current scope-chain depth.
|
|
22
|
+
* - **Hard shadow.** If `bindings.get(name)` is non-empty (including
|
|
23
|
+
* non-kind-matching candidates), stop walking. The name is
|
|
24
|
+
* lexically bound here; outer scopes are not consulted.
|
|
25
|
+
*
|
|
26
|
+
* **Step 2 — Type-binding resolution.** When `useReceiverTypeBinding`
|
|
27
|
+
* is true, resolve the receiver's type at `startScope` (from
|
|
28
|
+
* `scope.typeBindings`), then walk the MRO via
|
|
29
|
+
* `MethodDispatchIndex.mroFor(ownerDefId)`. Membership per owner comes
|
|
30
|
+
* through `RegistryContext.methodDispatch` + owner lookups into
|
|
31
|
+
* `scope.ownedDefs`; each hit records a raw signal with the owner's
|
|
32
|
+
* MRO depth.
|
|
33
|
+
*
|
|
34
|
+
* **Step 3 — Owner-scoped contributor.** When
|
|
35
|
+
* `params.ownerScopedContributor` is present, merge its `byName(name)`
|
|
36
|
+
* hits with `origin: 'local'` (they are declared directly on the
|
|
37
|
+
* receiver). Distinct from Step 2 — Step 2 walks the MRO; Step 3 only
|
|
38
|
+
* looks at the directly-declared owner members.
|
|
39
|
+
*
|
|
40
|
+
* **Step 4 — Kind filter (emit `kind-match` evidence).** Already
|
|
41
|
+
* applied during Steps 1-3; this step just adds a `kind-match` signal
|
|
42
|
+
* at weight 0 to every candidate for debuggability (so the evidence
|
|
43
|
+
* array is self-describing).
|
|
44
|
+
*
|
|
45
|
+
* **Step 5 — Arity filter.** Call `providers.arityCompatibility(callsite,
|
|
46
|
+
* def)` per surviving candidate. Verdicts: `compatible` / `unknown` /
|
|
47
|
+
* `incompatible`. If at least one candidate is `compatible`, drop
|
|
48
|
+
* `incompatible` ones. Otherwise keep all (the penalty weight alone
|
|
49
|
+
* will rank them lower but they remain in the result).
|
|
50
|
+
*
|
|
51
|
+
* **Step 6 — Global fallback.** When Steps 1-3 produced **no**
|
|
52
|
+
* candidates and the name contains a `.`, consult the
|
|
53
|
+
* `QualifiedNameIndex` via `lookupQualified` — see §4.5. The `scope`
|
|
54
|
+
* argument is NOT passed here because global lookup is scope-agnostic.
|
|
55
|
+
*
|
|
56
|
+
* **Step 7 — Rank + tie-break.** Compose evidence, compute confidence
|
|
57
|
+
* (sum capped at 1.0), sort by the RFC Appendix B cascade.
|
|
58
|
+
*
|
|
59
|
+
* ## What this module does NOT do
|
|
60
|
+
*
|
|
61
|
+
* - No AST reads (pure data in, pure data out).
|
|
62
|
+
* - No `gitnexus/` imports.
|
|
63
|
+
* - No language switches. Language-specific behavior flows exclusively
|
|
64
|
+
* through `providers.*` and the `params` object.
|
|
65
|
+
* - No caching. Callers that want memoization can wrap this function.
|
|
66
|
+
*/
|
|
67
|
+
import type { Callsite, LookupParams, Resolution, ScopeId } from '../types.js';
|
|
68
|
+
import type { OwnerScopedContributor, RegistryContext } from './context.js';
|
|
69
|
+
/** Extended `LookupParams` narrowing `ownerScopedContributor` to the concrete shape. */
|
|
70
|
+
export interface CoreLookupParams extends Omit<LookupParams, 'ownerScopedContributor'> {
|
|
71
|
+
readonly ownerScopedContributor: OwnerScopedContributor | null;
|
|
72
|
+
/** Call-site description forwarded to `arityCompatibility`. Optional — for non-call lookups. */
|
|
73
|
+
readonly callsite?: Callsite;
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* Run the 7-step lookup. Returns a non-empty `Resolution[]` when any
|
|
77
|
+
* candidate was found; an empty array otherwise. Callers consume `[0]`
|
|
78
|
+
* for the best answer and optionally inspect the rest for alternates.
|
|
79
|
+
*/
|
|
80
|
+
export declare function lookupCore(name: string, startScope: ScopeId, params: CoreLookupParams, ctx: RegistryContext): readonly Resolution[];
|
|
81
|
+
//# sourceMappingURL=lookup-core.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lookup-core.d.ts","sourceRoot":"","sources":["../../../src/scope-resolution/registries/lookup-core.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiEG;AAIH,OAAO,KAAK,EAEV,QAAQ,EAER,YAAY,EACZ,UAAU,EAEV,OAAO,EACR,MAAM,aAAa,CAAC;AAKrB,OAAO,KAAK,EAAgB,sBAAsB,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAI1F,wFAAwF;AACxF,MAAM,WAAW,gBAAiB,SAAQ,IAAI,CAAC,YAAY,EAAE,wBAAwB,CAAC;IACpF,QAAQ,CAAC,sBAAsB,EAAE,sBAAsB,GAAG,IAAI,CAAC;IAC/D,gGAAgG;IAChG,QAAQ,CAAC,QAAQ,CAAC,EAAE,QAAQ,CAAC;CAC9B;AAED;;;;GAIG;AACH,wBAAgB,UAAU,CACxB,IAAI,EAAE,MAAM,EACZ,UAAU,EAAE,OAAO,EACnB,MAAM,EAAE,gBAAgB,EACxB,GAAG,EAAE,eAAe,GACnB,SAAS,UAAU,EAAE,CAwCvB"}
|