gitnexus 1.6.5 → 1.6.6-rc.10
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 +2 -2
- package/dist/_shared/index.d.ts.map +1 -1
- package/dist/_shared/index.js.map +1 -1
- package/dist/_shared/scope-resolution/registries/context.d.ts +37 -0
- package/dist/_shared/scope-resolution/registries/context.d.ts.map +1 -1
- package/dist/_shared/scope-resolution/registries/context.js.map +1 -1
- package/dist/_shared/scope-resolution/registries/lookup-core.d.ts +4 -2
- package/dist/_shared/scope-resolution/registries/lookup-core.d.ts.map +1 -1
- package/dist/_shared/scope-resolution/registries/lookup-core.js +8 -23
- package/dist/_shared/scope-resolution/registries/lookup-core.js.map +1 -1
- package/dist/_shared/scope-resolution/symbol-definition.d.ts +20 -0
- package/dist/_shared/scope-resolution/symbol-definition.d.ts.map +1 -1
- package/dist/cli/analyze.js +65 -3
- package/dist/cli/eval-server.d.ts +14 -3
- package/dist/cli/eval-server.js +79 -9
- package/dist/cli/index.js +3 -1
- package/dist/cli/serve.js +6 -1
- package/dist/cli/wiki.d.ts +1 -0
- package/dist/cli/wiki.js +32 -8
- package/dist/core/ingestion/language-provider.d.ts +29 -0
- package/dist/core/ingestion/languages/c-cpp.js +46 -0
- package/dist/core/ingestion/languages/cpp/arity-metadata.d.ts +17 -0
- package/dist/core/ingestion/languages/cpp/arity-metadata.js +51 -2
- package/dist/core/ingestion/languages/cpp/arity.d.ts +4 -1
- package/dist/core/ingestion/languages/cpp/arity.js +4 -1
- package/dist/core/ingestion/languages/cpp/captures.js +73 -0
- package/dist/core/ingestion/languages/cpp/constraint-extractor.d.ts +73 -0
- package/dist/core/ingestion/languages/cpp/constraint-extractor.js +308 -0
- package/dist/core/ingestion/languages/cpp/constraint-filter.d.ts +31 -0
- package/dist/core/ingestion/languages/cpp/constraint-filter.js +135 -0
- package/dist/core/ingestion/languages/cpp/scope-resolver.js +6 -0
- package/dist/core/ingestion/languages/cpp/type-classifier.d.ts +26 -0
- package/dist/core/ingestion/languages/cpp/type-classifier.js +49 -0
- package/dist/core/ingestion/model/field-registry.d.ts +17 -3
- package/dist/core/ingestion/model/field-registry.js +19 -4
- package/dist/core/ingestion/model/owned-members-lookup.d.ts +19 -0
- package/dist/core/ingestion/model/owned-members-lookup.js +43 -0
- package/dist/core/ingestion/model/symbol-table.d.ts +2 -1
- package/dist/core/ingestion/model/symbol-table.js +3 -0
- package/dist/core/ingestion/model/type-registry.d.ts +9 -0
- package/dist/core/ingestion/model/type-registry.js +18 -0
- package/dist/core/ingestion/parsing-processor.js +35 -2
- package/dist/core/ingestion/resolve-references.d.ts +3 -1
- package/dist/core/ingestion/resolve-references.js +5 -1
- package/dist/core/ingestion/scope-extractor.js +63 -0
- package/dist/core/ingestion/scope-resolution/contract/scope-resolver.d.ts +21 -1
- package/dist/core/ingestion/scope-resolution/graph-bridge/ids.d.ts +1 -0
- package/dist/core/ingestion/scope-resolution/graph-bridge/ids.js +14 -0
- package/dist/core/ingestion/scope-resolution/graph-bridge/node-lookup.js +12 -0
- package/dist/core/ingestion/scope-resolution/passes/free-call-fallback.d.ts +11 -1
- package/dist/core/ingestion/scope-resolution/passes/free-call-fallback.js +83 -28
- package/dist/core/ingestion/scope-resolution/passes/overload-narrowing.d.ts +30 -7
- package/dist/core/ingestion/scope-resolution/passes/overload-narrowing.js +49 -18
- package/dist/core/ingestion/scope-resolution/passes/receiver-bound-calls.d.ts +1 -1
- package/dist/core/ingestion/scope-resolution/passes/receiver-bound-calls.js +10 -4
- package/dist/core/ingestion/scope-resolution/pipeline/reconcile-ownership.d.ts +4 -2
- package/dist/core/ingestion/scope-resolution/pipeline/reconcile-ownership.js +48 -9
- package/dist/core/ingestion/scope-resolution/pipeline/run.js +3 -0
- package/dist/core/ingestion/utils/template-arguments.d.ts +19 -0
- package/dist/core/ingestion/utils/template-arguments.js +30 -0
- package/dist/core/ingestion/workers/parse-worker.d.ts +2 -1
- package/dist/core/ingestion/workers/parse-worker.js +1 -0
- package/dist/core/lbug/lbug-adapter.d.ts +3 -1
- package/dist/core/lbug/lbug-adapter.js +33 -19
- package/dist/core/lbug/lbug-config.d.ts +1 -1
- package/dist/core/lbug/lbug-config.js +1 -1
- package/dist/core/lbug/pool-adapter.d.ts +0 -7
- package/dist/core/lbug/pool-adapter.js +10 -35
- package/dist/core/lbug/query-params.d.ts +1 -0
- package/dist/core/lbug/query-params.js +21 -0
- package/dist/core/search/bm25-index.js +4 -6
- package/dist/core/wiki/generator.d.ts +13 -0
- package/dist/core/wiki/generator.js +45 -4
- package/dist/core/wiki/llm-client.d.ts +1 -1
- package/dist/core/wiki/llm-client.js +23 -6
- package/dist/mcp/local/local-backend.d.ts +18 -3
- package/dist/mcp/local/local-backend.js +105 -11
- package/dist/mcp/tools.js +10 -0
- package/dist/server/api.d.ts +3 -0
- package/dist/server/api.js +36 -24
- package/package.json +1 -1
package/dist/_shared/index.d.ts
CHANGED
|
@@ -5,7 +5,7 @@ export { SupportedLanguages } from './languages.js';
|
|
|
5
5
|
export { getLanguageFromFilename, getSyntaxLanguageFromFilename } from './language-detection.js';
|
|
6
6
|
export type { MroStrategy } from './mro-strategy.js';
|
|
7
7
|
export type { PipelinePhase, PipelineProgress } from './pipeline.js';
|
|
8
|
-
export type { SymbolDefinition } from './scope-resolution/symbol-definition.js';
|
|
8
|
+
export type { ParameterTypeClass, SymbolDefinition } from './scope-resolution/symbol-definition.js';
|
|
9
9
|
export type { ScopeId, DefId, ScopeKind, Range, Capture, CaptureMatch, BindingRef, ImportEdge, TypeRef, Scope, ResolutionEvidence, Resolution, Reference, ReferenceIndex, LookupParams, RegistryContributor, ParsedImport, ParsedTypeBinding, WorkspaceIndex, Callsite, ScopeLookup, } from './scope-resolution/types.js';
|
|
10
10
|
export { EvidenceWeights, typeBindingWeightAtDepth } from './scope-resolution/evidence-weights.js';
|
|
11
11
|
export { ORIGIN_PRIORITY } from './scope-resolution/origin-priority.js';
|
|
@@ -41,7 +41,7 @@ export type { RawSignals } from './scope-resolution/registries/evidence.js';
|
|
|
41
41
|
export { compareByConfidenceWithTiebreaks, CONFIDENCE_EPSILON, } from './scope-resolution/registries/tie-breaks.js';
|
|
42
42
|
export type { TieBreakKey } from './scope-resolution/registries/tie-breaks.js';
|
|
43
43
|
export { CLASS_KINDS, METHOD_KINDS, FIELD_KINDS } from './scope-resolution/registries/context.js';
|
|
44
|
-
export type { RegistryContext, RegistryProviders, OwnerScopedContributor, ArityVerdict, } from './scope-resolution/registries/context.js';
|
|
44
|
+
export type { RegistryContext, RegistryProviders, OwnedMembersByOwnerLookup, OwnerScopedContributor, ArityVerdict, ConstraintContext, } from './scope-resolution/registries/context.js';
|
|
45
45
|
export { makeScopeId, clearScopeIdInternPool } from './scope-resolution/scope-id.js';
|
|
46
46
|
export type { ScopeIdInput } from './scope-resolution/scope-id.js';
|
|
47
47
|
export { buildScopeTree, canParentScope, 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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OAAO,EAAE,cAAc,EAAE,gBAAgB,EAAE,UAAU,EAAE,MAAM,mCAAmC,CAAC;AAEjG,OAAO,EACL,cAAc,EACd,4BAA4B,EAC5B,kBAAkB,EAClB,eAAe,GAChB,MAAM,mCAAmC,CAAC;AAG3C,mDAAmD;AACnD,OAAO,EACL,+BAA+B,EAC/B,6BAA6B,EAC7B,4BAA4B,EAC5B,sBAAsB,EACtB,gBAAgB,EAChB,wBAAwB,EACxB,cAAc,GACf,MAAM,sCAAsC,CAAC;AAG9C,gEAAgE;AAChE,OAAO,EAAE,eAAe,EAAE,MAAM,mCAAmC,CAAC;AAMpE,OAAO,EAAE,cAAc,EAAE,MAAM,wCAAwC,CAAC"}
|
|
@@ -26,8 +26,35 @@ export interface RegistryProviders {
|
|
|
26
26
|
* when absent, every candidate receives `'unknown'` (neutral signal).
|
|
27
27
|
*/
|
|
28
28
|
arityCompatibility?(callsite: Callsite, def: SymbolDefinition): ArityVerdict;
|
|
29
|
+
/**
|
|
30
|
+
* Language-specific constraint compatibility between a callsite and a
|
|
31
|
+
* candidate `def`. Mirrors `arityCompatibility` and shares its three-valued
|
|
32
|
+
* verdict shape; the third value `'unknown'` MUST keep the candidate
|
|
33
|
+
* (monotonicity: adding a predicate can only narrow correctly, never
|
|
34
|
+
* produce a wrong edge). Consulted by `narrowOverloadCandidates` after
|
|
35
|
+
* arity + type filters when a candidate carries `templateConstraints`.
|
|
36
|
+
*
|
|
37
|
+
* Optional; when absent the constraint filter is a pass-through. Languages
|
|
38
|
+
* with no constrained-overload semantics leave this undefined.
|
|
39
|
+
*/
|
|
40
|
+
constraintCompatibility?(callsite: Callsite, def: SymbolDefinition, ctx: ConstraintContext): ArityVerdict;
|
|
29
41
|
}
|
|
30
42
|
export type ArityVerdict = 'compatible' | 'unknown' | 'incompatible';
|
|
43
|
+
/**
|
|
44
|
+
* Context threaded into `constraintCompatibility`. Kept minimal in the
|
|
45
|
+
* Tier-A scope (only `argumentTypes`, riding here until a separate
|
|
46
|
+
* `Callsite`-widening refactor moves them onto the call site directly).
|
|
47
|
+
* Future Tier-B graph-aware predicates (`is_base_of_v`, etc.) will widen
|
|
48
|
+
* this interface with `lookupTypeByName` and similar helpers.
|
|
49
|
+
*/
|
|
50
|
+
export interface ConstraintContext {
|
|
51
|
+
/**
|
|
52
|
+
* Per-slot argument types at the call site, normalized per the language
|
|
53
|
+
* adapter. Empty string means unknown. Same convention as
|
|
54
|
+
* `narrowOverloadCandidates`' `argTypes` parameter.
|
|
55
|
+
*/
|
|
56
|
+
readonly argumentTypes?: readonly string[];
|
|
57
|
+
}
|
|
31
58
|
/**
|
|
32
59
|
* Per-owner membership view plugged into `LookupParams.ownerScopedContributor`.
|
|
33
60
|
*
|
|
@@ -51,11 +78,21 @@ export interface OwnerScopedContributor {
|
|
|
51
78
|
*/
|
|
52
79
|
byName(name: string): readonly SymbolDefinition[];
|
|
53
80
|
}
|
|
81
|
+
/**
|
|
82
|
+
* Required owner-keyed lookup hook for Step 2 receiver/MRO member walks.
|
|
83
|
+
* Production callers wire this to the SemanticModel's authoritative
|
|
84
|
+
* method/field/nested-type registries so each `(ownerDefId, memberName)`
|
|
85
|
+
* probe is O(1). Implementations MUST return `[]` on an indexed miss —
|
|
86
|
+
* Step 2 treats `[]` as authoritative and does not consult `defs` for a
|
|
87
|
+
* fallback scan.
|
|
88
|
+
*/
|
|
89
|
+
export type OwnedMembersByOwnerLookup = (ownerDefId: DefId, memberName: string) => readonly SymbolDefinition[];
|
|
54
90
|
export interface RegistryContext {
|
|
55
91
|
readonly scopes: ScopeTree;
|
|
56
92
|
readonly defs: DefIndex;
|
|
57
93
|
readonly qualifiedNames: QualifiedNameIndex;
|
|
58
94
|
readonly moduleScopes: ModuleScopeIndex;
|
|
95
|
+
readonly ownedMembersByOwner: OwnedMembersByOwnerLookup;
|
|
59
96
|
/**
|
|
60
97
|
* Method-dispatch index; required for method/field registries that
|
|
61
98
|
* honor `useReceiverTypeBinding`. Omit for class-only lookups.
|
|
@@ -1 +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;
|
|
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,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AAE,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"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"context.js","sourceRoot":"","sources":["../../../src/scope-resolution/registries/context.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;
|
|
1
|
+
{"version":3,"file":"context.js","sourceRoot":"","sources":["../../../src/scope-resolution/registries/context.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAgHH,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"}
|
|
@@ -27,8 +27,10 @@
|
|
|
27
27
|
* is true, resolve the receiver's type at `startScope` (from
|
|
28
28
|
* `scope.typeBindings`), then walk the MRO via
|
|
29
29
|
* `MethodDispatchIndex.mroFor(ownerDefId)`. Membership per owner comes
|
|
30
|
-
* through `RegistryContext.
|
|
31
|
-
* `
|
|
30
|
+
* through an optional `RegistryContext.ownedMembersByOwner` hook when
|
|
31
|
+
* supplied (`undefined` → fall back to `defs.byId`; `[]` → indexed
|
|
32
|
+
* miss), otherwise via the compatibility fallback scan over
|
|
33
|
+
* `defs.byId`; each hit records a raw signal with the owner's
|
|
32
34
|
* MRO depth.
|
|
33
35
|
*
|
|
34
36
|
* **Step 3 — Owner-scoped contributor.** When
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lookup-core.d.ts","sourceRoot":"","sources":["../../../src/scope-resolution/registries/lookup-core.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"lookup-core.d.ts","sourceRoot":"","sources":["../../../src/scope-resolution/registries/lookup-core.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmEG;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"}
|
|
@@ -27,8 +27,10 @@
|
|
|
27
27
|
* is true, resolve the receiver's type at `startScope` (from
|
|
28
28
|
* `scope.typeBindings`), then walk the MRO via
|
|
29
29
|
* `MethodDispatchIndex.mroFor(ownerDefId)`. Membership per owner comes
|
|
30
|
-
* through `RegistryContext.
|
|
31
|
-
* `
|
|
30
|
+
* through an optional `RegistryContext.ownedMembersByOwner` hook when
|
|
31
|
+
* supplied (`undefined` → fall back to `defs.byId`; `[]` → indexed
|
|
32
|
+
* miss), otherwise via the compatibility fallback scan over
|
|
33
|
+
* `defs.byId`; each hit records a raw signal with the owner's
|
|
32
34
|
* MRO depth.
|
|
33
35
|
*
|
|
34
36
|
* **Step 3 — Owner-scoped contributor.** When
|
|
@@ -170,14 +172,15 @@ function walkReceiverTypeBinding(name, startScope, acceptedKinds, params, ctx, p
|
|
|
170
172
|
return;
|
|
171
173
|
// Walk the owner itself at depth 0, then its MRO chain.
|
|
172
174
|
const walk = [ownerDefId, ...ctx.methodDispatch.mroFor(ownerDefId)];
|
|
173
|
-
|
|
174
|
-
|
|
175
|
+
let mroDepth = 0;
|
|
176
|
+
for (const currentOwnerId of walk) {
|
|
175
177
|
const members = collectOwnedMembers(currentOwnerId, name, ctx);
|
|
176
178
|
for (const def of members) {
|
|
177
179
|
if (!acceptedKinds.has(def.type))
|
|
178
180
|
continue;
|
|
179
181
|
recordTypeBindingHit(perCandidate, def, mroDepth, ownerDefId);
|
|
180
182
|
}
|
|
183
|
+
mroDepth++;
|
|
181
184
|
}
|
|
182
185
|
}
|
|
183
186
|
function resolveReceiverOwner(startScope, params, ctx) {
|
|
@@ -226,25 +229,7 @@ function lookupReceiverType(startScope, receiverName, ctx) {
|
|
|
226
229
|
return undefined;
|
|
227
230
|
}
|
|
228
231
|
function collectOwnedMembers(ownerDefId, memberName, ctx) {
|
|
229
|
-
|
|
230
|
-
// simple name matches `memberName`. We iterate `defs.byId` — O(D) per
|
|
231
|
-
// call today. A future by-owner index would make this O(K); tracked as
|
|
232
|
-
// a follow-up optimization before Ring 3 flips go production.
|
|
233
|
-
const out = [];
|
|
234
|
-
for (const def of ctx.defs.byId.values()) {
|
|
235
|
-
if (def.ownerId !== ownerDefId)
|
|
236
|
-
continue;
|
|
237
|
-
if (simpleNameOf(def) !== memberName)
|
|
238
|
-
continue;
|
|
239
|
-
out.push(def);
|
|
240
|
-
}
|
|
241
|
-
return out;
|
|
242
|
-
}
|
|
243
|
-
function simpleNameOf(def) {
|
|
244
|
-
if (def.qualifiedName === undefined || def.qualifiedName.length === 0)
|
|
245
|
-
return undefined;
|
|
246
|
-
const dot = def.qualifiedName.lastIndexOf('.');
|
|
247
|
-
return dot === -1 ? def.qualifiedName : def.qualifiedName.slice(dot + 1);
|
|
232
|
+
return ctx.ownedMembersByOwner(ownerDefId, memberName);
|
|
248
233
|
}
|
|
249
234
|
function recordTypeBindingHit(perCandidate, def, mroDepth, receiverOwner) {
|
|
250
235
|
const state = ensureCandidate(perCandidate, def);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lookup-core.js","sourceRoot":"","sources":["../../../src/scope-resolution/registries/lookup-core.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"lookup-core.js","sourceRoot":"","sources":["../../../src/scope-resolution/registries/lookup-core.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmEG;AAcH,OAAO,EAAE,eAAe,EAAE,sBAAsB,EAAmB,MAAM,eAAe,CAAC;AACzF,OAAO,EAAE,gCAAgC,EAAoB,MAAM,iBAAiB,CAAC;AACrF,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAYxD;;;;GAIG;AACH,MAAM,UAAU,UAAU,CACxB,IAAY,EACZ,UAAmB,EACnB,MAAwB,EACxB,GAAoB;IAEpB,MAAM,aAAa,GAAG,IAAI,GAAG,CAAY,MAAM,CAAC,aAAa,CAAC,CAAC;IAC/D,MAAM,YAAY,GAAG,IAAI,GAAG,EAAyB,CAAC;IAEtD,yEAAyE;IACzE,MAAM,eAAe,GAAG,gBAAgB,CAAC,IAAI,EAAE,UAAU,EAAE,aAAa,EAAE,GAAG,EAAE,YAAY,CAAC,CAAC;IAE7F,yEAAyE;I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,CAAC,KAAK,EAAE,KAAK,CAAC,IAAI,YAAY,EAAE,CAAC;QAC1C,IAAI,KAAK,CAAC,OAAO,CAAC,YAAY,KAAK,cAAc,EAAE,CAAC;YAClD,YAAY,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;QAC7B,CAAC;IACH,CAAC;AACH,CAAC;AAED,8EAA8E;AAE9E,SAAS,cAAc,CAAC,YAAwC;IAC9D,MAAM,WAAW,GAAiB,EAAE,CAAC;IACrC,MAAM,OAAO,GAAG,IAAI,GAAG,EAAuB,CAAC;IAE/C,KAAK,MAAM,KAAK,IAAI,YAAY,CAAC,MAAM,EAAE,EAAE,CAAC;QAC1C,MAAM,QAAQ,GAAG,eAAe,CAAC,KAAK,CAAC,OAAqB,CAAC,CAAC;QAC9D,MAAM,UAAU,GAAG,sBAAsB,CAAC,QAAQ,CAAC,CAAC;QACpD,WAAW,CAAC,IAAI,CAAC,EAAE,GAAG,EAAE,KAAK,CAAC,GAAG,EAAE,UAAU,EAAE,QAAQ,EAAE,CAAC,CAAC;QAC3D,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,MAAM,EAAE,EAAE,GAAG,KAAK,CAAC,WAAW,EAAE,CAAC,CAAC;IAC1D,CAAC;IAED,WAAW,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,gCAAgC,CAAC,CAAC,EAAE,CAAC,EAAE,OAAO,CAAC,CAAC,CAAC;IAC5E,OAAO,MAAM,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC;AACpC,CAAC;AAED,+EAA+E;AAE/E,MAAM,KAAK,GAA0B,MAAM,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC"}
|
|
@@ -9,6 +9,16 @@
|
|
|
9
9
|
* Shape is unchanged from the prior local definition.
|
|
10
10
|
*/
|
|
11
11
|
import type { NodeLabel } from '../graph/types.js';
|
|
12
|
+
export interface ParameterTypeClass {
|
|
13
|
+
/** Normalized base type, matching the coarse `parameterTypes` vocabulary when known. */
|
|
14
|
+
base: string;
|
|
15
|
+
/** Top-level cv signal preserved from the original C++ parameter spelling. */
|
|
16
|
+
cv: 'none' | 'const' | 'volatile' | 'const volatile' | 'unknown';
|
|
17
|
+
/** Coarse value/reference/pointer shape. */
|
|
18
|
+
indirection: 'value' | 'lvalue-ref' | 'rvalue-ref' | 'pointer' | 'unknown';
|
|
19
|
+
/** Number of pointer markers when indirection is `pointer`; otherwise 0. */
|
|
20
|
+
pointerDepth: number;
|
|
21
|
+
}
|
|
12
22
|
export interface SymbolDefinition {
|
|
13
23
|
nodeId: string;
|
|
14
24
|
filePath: string;
|
|
@@ -24,12 +34,22 @@ export interface SymbolDefinition {
|
|
|
24
34
|
/** Per-parameter type names for overload disambiguation (e.g. ['int', 'String']).
|
|
25
35
|
* Populated when parameter types are resolvable from AST (any typed language). */
|
|
26
36
|
parameterTypes?: string[];
|
|
37
|
+
/** Additive per-parameter type shape sidecar for languages that need cv/ref/pointer distinctions.
|
|
38
|
+
* Does not participate in graph node identity unless a resolver explicitly opts in. */
|
|
39
|
+
parameterTypeClasses?: ParameterTypeClass[];
|
|
27
40
|
/** Raw return type text extracted from AST (e.g. 'User', 'Promise<User>') */
|
|
28
41
|
returnType?: string;
|
|
29
42
|
/** Declared type for non-callable symbols — fields/properties (e.g. 'Address', 'List<User>') */
|
|
30
43
|
declaredType?: string;
|
|
31
44
|
/** Generic/template specialization arguments for class-like symbols (e.g. ['User'], ['T*']). */
|
|
32
45
|
templateArguments?: string[];
|
|
46
|
+
/** Per-language constraint payload for template / generic overloads
|
|
47
|
+
* (e.g. C++ `enable_if_t<P, T>` predicate trees, C++20 `requires` clauses).
|
|
48
|
+
* Opaque to shared code — the producing language adapter owns the shape
|
|
49
|
+
* and is the only consumer. Read via the optional
|
|
50
|
+
* `ScopeResolver.constraintCompatibility` hook during overload narrowing.
|
|
51
|
+
* Absent for symbols that have no constraints (the common case). */
|
|
52
|
+
templateConstraints?: unknown;
|
|
33
53
|
/** Links Method/Constructor/Property to owning Class/Struct/Trait nodeId */
|
|
34
54
|
ownerId?: string;
|
|
35
55
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"symbol-definition.d.ts","sourceRoot":"","sources":["../../src/scope-resolution/symbol-definition.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAEnD,MAAM,WAAW,gBAAgB;IAC/B,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,SAAS,CAAC;IAChB;;+FAE2F;IAC3F,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB;iHAC6G;IAC7G,sBAAsB,CAAC,EAAE,MAAM,CAAC;IAChC;uFACmF;IACnF,cAAc,CAAC,EAAE,MAAM,EAAE,CAAC;IAC1B,6EAA6E;IAC7E,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,gGAAgG;IAChG,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,gGAAgG;IAChG,iBAAiB,CAAC,EAAE,MAAM,EAAE,CAAC;IAC7B,4EAA4E;IAC5E,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB"}
|
|
1
|
+
{"version":3,"file":"symbol-definition.d.ts","sourceRoot":"","sources":["../../src/scope-resolution/symbol-definition.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAEnD,MAAM,WAAW,kBAAkB;IACjC,wFAAwF;IACxF,IAAI,EAAE,MAAM,CAAC;IACb,8EAA8E;IAC9E,EAAE,EAAE,MAAM,GAAG,OAAO,GAAG,UAAU,GAAG,gBAAgB,GAAG,SAAS,CAAC;IACjE,4CAA4C;IAC5C,WAAW,EAAE,OAAO,GAAG,YAAY,GAAG,YAAY,GAAG,SAAS,GAAG,SAAS,CAAC;IAC3E,4EAA4E;IAC5E,YAAY,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,WAAW,gBAAgB;IAC/B,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,SAAS,CAAC;IAChB;;+FAE2F;IAC3F,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB;iHAC6G;IAC7G,sBAAsB,CAAC,EAAE,MAAM,CAAC;IAChC;uFACmF;IACnF,cAAc,CAAC,EAAE,MAAM,EAAE,CAAC;IAC1B;4FACwF;IACxF,oBAAoB,CAAC,EAAE,kBAAkB,EAAE,CAAC;IAC5C,6EAA6E;IAC7E,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,gGAAgG;IAChG,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,gGAAgG;IAChG,iBAAiB,CAAC,EAAE,MAAM,EAAE,CAAC;IAC7B;;;;;yEAKqE;IACrE,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC9B,4EAA4E;IAC5E,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB"}
|
package/dist/cli/analyze.js
CHANGED
|
@@ -12,6 +12,7 @@ import { execFileSync } from 'child_process';
|
|
|
12
12
|
import v8 from 'v8';
|
|
13
13
|
import cliProgress from 'cli-progress';
|
|
14
14
|
import { closeLbug } from '../core/lbug/lbug-adapter.js';
|
|
15
|
+
import { isWalCorruptionError, WAL_RECOVERY_SUGGESTION } from '../core/lbug/lbug-config.js';
|
|
15
16
|
import { getStoragePaths, getGlobalRegistryPath, RegistryNameCollisionError, AnalysisNotFinalizedError, assertAnalysisFinalized, } from '../storage/repo-manager.js';
|
|
16
17
|
import { getGitRoot, hasGitDir } from '../storage/git.js';
|
|
17
18
|
import { runFullAnalysis } from '../core/run-analyze.js';
|
|
@@ -57,12 +58,55 @@ const installFatalHandlers = () => {
|
|
|
57
58
|
process.exit(1);
|
|
58
59
|
});
|
|
59
60
|
};
|
|
60
|
-
const HEAP_MB =
|
|
61
|
-
const
|
|
61
|
+
const HEAP_MB = 16384;
|
|
62
|
+
const TEST_RESPAWN_HEAP_MB = Number(process.env.GITNEXUS_TEST_RESPAWN_HEAP_MB);
|
|
63
|
+
const RESPAWN_HEAP_MB = Number.isFinite(TEST_RESPAWN_HEAP_MB) && TEST_RESPAWN_HEAP_MB > 0
|
|
64
|
+
? Math.floor(TEST_RESPAWN_HEAP_MB)
|
|
65
|
+
: HEAP_MB;
|
|
66
|
+
const HEAP_FLAG = `--max-old-space-size=${RESPAWN_HEAP_MB}`;
|
|
62
67
|
/** Increase default stack size (KB) to prevent stack overflow on deep class hierarchies. */
|
|
63
68
|
const STACK_KB = 4096;
|
|
64
69
|
const STACK_FLAG = `--stack-size=${STACK_KB}`;
|
|
65
|
-
/**
|
|
70
|
+
/**
|
|
71
|
+
* Heuristic for "child re-exec likely died from V8 OOM".
|
|
72
|
+
*
|
|
73
|
+
* Platform-independent detection is best-effort: V8/Node usually emit
|
|
74
|
+
* stable heap-exhaustion phrases in stderr/message across Linux/macOS/Windows
|
|
75
|
+
* (for example "JavaScript heap out of memory" or "Reached heap limit"),
|
|
76
|
+
* while some environments only expose status/signal (e.g. 134/SIGABRT).
|
|
77
|
+
* We combine both text signatures and process-exit signatures.
|
|
78
|
+
*/
|
|
79
|
+
const childProcessLikelyOom = (err) => {
|
|
80
|
+
if (!err || typeof err !== 'object')
|
|
81
|
+
return false;
|
|
82
|
+
const e = err;
|
|
83
|
+
const hasHeapOomSignature = (v) => {
|
|
84
|
+
const text = (Buffer.isBuffer(v) ? v.toString('utf8') : typeof v === 'string' ? v : '').toLowerCase();
|
|
85
|
+
if (!text)
|
|
86
|
+
return false;
|
|
87
|
+
return (text.includes('javascript heap out of memory') ||
|
|
88
|
+
text.includes('reached heap limit') ||
|
|
89
|
+
text.includes('allocation failed - javascript heap out of memory') ||
|
|
90
|
+
text.includes('fatalprocessoutofmemory'));
|
|
91
|
+
};
|
|
92
|
+
const fields = [e.message, e.stderr, e.stdout];
|
|
93
|
+
if (fields.some((v) => hasHeapOomSignature(v)))
|
|
94
|
+
return true;
|
|
95
|
+
const hasAnyChildOutput = [e.stderr, e.stdout].some((v) => (Buffer.isBuffer(v) && v.length > 0) || (typeof v === 'string' && v.length > 0));
|
|
96
|
+
if (hasAnyChildOutput)
|
|
97
|
+
return false;
|
|
98
|
+
return e.status === 134 || e.signal === 'SIGABRT';
|
|
99
|
+
};
|
|
100
|
+
const forceHeapOOMForTestIfEnabled = () => {
|
|
101
|
+
if (process.env.GITNEXUS_TEST_FORCE_HEAP_OOM !== '1')
|
|
102
|
+
return;
|
|
103
|
+
// Allocate JS strings (not Buffers) so pressure lands on V8 heap itself.
|
|
104
|
+
// Buffers can allocate off-heap, which makes OOM triggering less reliable.
|
|
105
|
+
const chunks = [];
|
|
106
|
+
for (;;)
|
|
107
|
+
chunks.push('x'.repeat(1024 * 1024));
|
|
108
|
+
};
|
|
109
|
+
/** Re-exec the process with a 16GB heap and larger stack if we're currently below that. */
|
|
66
110
|
function ensureHeap() {
|
|
67
111
|
const nodeOpts = process.env.NODE_OPTIONS || '';
|
|
68
112
|
if (nodeOpts.includes('--max-old-space-size'))
|
|
@@ -82,6 +126,13 @@ function ensureHeap() {
|
|
|
82
126
|
});
|
|
83
127
|
}
|
|
84
128
|
catch (e) {
|
|
129
|
+
if (childProcessLikelyOom(e)) {
|
|
130
|
+
cliError(` Analysis likely ran out of memory.\n` +
|
|
131
|
+
` Retry with a larger heap if your machine allows it:\n` +
|
|
132
|
+
` NODE_OPTIONS="--max-old-space-size=24576" gitnexus analyze [your-args]\n` +
|
|
133
|
+
` (Windows: set NODE_OPTIONS=--max-old-space-size=24576 && gitnexus analyze [your-args])\n` +
|
|
134
|
+
` If this persists, it may be a native crash unrelated to heap size.\n`, { recoveryHint: 'heap-oom-respawn' });
|
|
135
|
+
}
|
|
85
136
|
process.exitCode = e.status ?? 1;
|
|
86
137
|
}
|
|
87
138
|
return true;
|
|
@@ -103,6 +154,7 @@ export const shouldGenerateCommunitySkillFiles = (options, pipelineResult) => Bo
|
|
|
103
154
|
export const analyzeCommand = async (inputPath, options) => {
|
|
104
155
|
if (ensureHeap())
|
|
105
156
|
return;
|
|
157
|
+
forceHeapOOMForTestIfEnabled();
|
|
106
158
|
// Install fatal handlers immediately after re-exec resolution so any
|
|
107
159
|
// async error that escapes the try/catch below (#1169) surfaces with
|
|
108
160
|
// a stack trace and a non-zero exit code instead of a silent exit 0.
|
|
@@ -468,6 +520,16 @@ export const analyzeCommand = async (inputPath, options) => {
|
|
|
468
520
|
process.exitCode = 1;
|
|
469
521
|
return;
|
|
470
522
|
}
|
|
523
|
+
// WAL corruption — the index file is unreadable. Give a clear recovery
|
|
524
|
+
// path without a confusing stack trace (the native error message alone
|
|
525
|
+
// is enough signal).
|
|
526
|
+
if (isWalCorruptionError(err) || msg.includes('LadybugDB WAL corruption')) {
|
|
527
|
+
cliError(` The GitNexus index has a corrupted WAL file.\n` +
|
|
528
|
+
` This usually happens when a previous analysis was interrupted mid-write.\n` +
|
|
529
|
+
` ${WAL_RECOVERY_SUGGESTION}\n`, { recoveryHint: 'wal-corruption' });
|
|
530
|
+
process.exitCode = 1;
|
|
531
|
+
return;
|
|
532
|
+
}
|
|
471
533
|
// HF download failure — show clean guidance without the raw stack trace.
|
|
472
534
|
// Checked before writeFatalToStderr so the user sees one focused message
|
|
473
535
|
// rather than a stack-trace dump followed by a second remediation block.
|
|
@@ -14,9 +14,14 @@
|
|
|
14
14
|
* Agent bash cmd → curl localhost:PORT/tool/query → eval-server → LocalBackend → format → text
|
|
15
15
|
*
|
|
16
16
|
* Usage:
|
|
17
|
-
* gitnexus eval-server
|
|
18
|
-
* gitnexus eval-server --port 4848
|
|
19
|
-
* gitnexus eval-server --
|
|
17
|
+
* gitnexus eval-server # default port 4848, binds 127.0.0.1
|
|
18
|
+
* gitnexus eval-server --port 4848 # explicit port
|
|
19
|
+
* gitnexus eval-server --host 0.0.0.0 # reachable from other VMs / containers
|
|
20
|
+
* gitnexus eval-server --idle-timeout 300 # auto-shutdown after 300s idle
|
|
21
|
+
*
|
|
22
|
+
* READY signal format: GITNEXUS_EVAL_SERVER_READY:<host>:<port>
|
|
23
|
+
* IPv4: GITNEXUS_EVAL_SERVER_READY:127.0.0.1:4848
|
|
24
|
+
* IPv6: GITNEXUS_EVAL_SERVER_READY:[::1]:4848
|
|
20
25
|
*
|
|
21
26
|
* API:
|
|
22
27
|
* POST /tool/:name — Call a tool. Body is JSON arguments. Returns formatted text.
|
|
@@ -25,8 +30,14 @@
|
|
|
25
30
|
*/
|
|
26
31
|
export interface EvalServerOptions {
|
|
27
32
|
port?: string;
|
|
33
|
+
host?: string;
|
|
28
34
|
idleTimeout?: string;
|
|
29
35
|
}
|
|
36
|
+
/**
|
|
37
|
+
* Validate the --host value. Accepts IPv4, IPv6, or "localhost".
|
|
38
|
+
* Returns the normalised host string, or null if invalid.
|
|
39
|
+
*/
|
|
40
|
+
export declare function validateHost(raw: string): string | null;
|
|
30
41
|
export declare function formatQueryResult(result: any): string;
|
|
31
42
|
export declare function formatContextResult(result: any): string;
|
|
32
43
|
export declare function formatImpactResult(result: any): string;
|
package/dist/cli/eval-server.js
CHANGED
|
@@ -14,9 +14,14 @@
|
|
|
14
14
|
* Agent bash cmd → curl localhost:PORT/tool/query → eval-server → LocalBackend → format → text
|
|
15
15
|
*
|
|
16
16
|
* Usage:
|
|
17
|
-
* gitnexus eval-server
|
|
18
|
-
* gitnexus eval-server --port 4848
|
|
19
|
-
* gitnexus eval-server --
|
|
17
|
+
* gitnexus eval-server # default port 4848, binds 127.0.0.1
|
|
18
|
+
* gitnexus eval-server --port 4848 # explicit port
|
|
19
|
+
* gitnexus eval-server --host 0.0.0.0 # reachable from other VMs / containers
|
|
20
|
+
* gitnexus eval-server --idle-timeout 300 # auto-shutdown after 300s idle
|
|
21
|
+
*
|
|
22
|
+
* READY signal format: GITNEXUS_EVAL_SERVER_READY:<host>:<port>
|
|
23
|
+
* IPv4: GITNEXUS_EVAL_SERVER_READY:127.0.0.1:4848
|
|
24
|
+
* IPv6: GITNEXUS_EVAL_SERVER_READY:[::1]:4848
|
|
20
25
|
*
|
|
21
26
|
* API:
|
|
22
27
|
* POST /tool/:name — Call a tool. Body is JSON arguments. Returns formatted text.
|
|
@@ -24,10 +29,22 @@
|
|
|
24
29
|
* POST /shutdown — Graceful shutdown.
|
|
25
30
|
*/
|
|
26
31
|
import http from 'http';
|
|
32
|
+
import { isIPv4, isIPv6 } from 'node:net';
|
|
27
33
|
import { writeSync } from 'node:fs';
|
|
28
34
|
import { LocalBackend } from '../mcp/local/local-backend.js';
|
|
29
35
|
import { logger } from '../core/logger.js';
|
|
30
|
-
import { cliInfo, cliWarn } from './cli-message.js';
|
|
36
|
+
import { cliInfo, cliWarn, cliError } from './cli-message.js';
|
|
37
|
+
/**
|
|
38
|
+
* Validate the --host value. Accepts IPv4, IPv6, or "localhost".
|
|
39
|
+
* Returns the normalised host string, or null if invalid.
|
|
40
|
+
*/
|
|
41
|
+
export function validateHost(raw) {
|
|
42
|
+
if (raw === 'localhost')
|
|
43
|
+
return '127.0.0.1';
|
|
44
|
+
if (isIPv4(raw) || isIPv6(raw))
|
|
45
|
+
return raw;
|
|
46
|
+
return null;
|
|
47
|
+
}
|
|
31
48
|
// ─── Text Formatters ──────────────────────────────────────────────────
|
|
32
49
|
// Convert structured JSON results into compact, LLM-friendly text.
|
|
33
50
|
// Design: minimize tokens, maximize actionability.
|
|
@@ -273,6 +290,18 @@ function getNextStepHint(toolName) {
|
|
|
273
290
|
export async function evalServerCommand(options) {
|
|
274
291
|
const port = parseInt(options?.port || '4848');
|
|
275
292
|
const idleTimeoutSec = parseInt(options?.idleTimeout || '0');
|
|
293
|
+
const rawHost = options?.host ?? '127.0.0.1';
|
|
294
|
+
const host = validateHost(rawHost);
|
|
295
|
+
if (!host) {
|
|
296
|
+
cliError(`Invalid --host value "${rawHost}":\n` +
|
|
297
|
+
` Must be an IP address or "localhost".\n\n` +
|
|
298
|
+
` Examples:\n` +
|
|
299
|
+
` gitnexus eval-server --host 127.0.0.1 (loopback only, default)\n` +
|
|
300
|
+
` gitnexus eval-server --host 0.0.0.0 (all network interfaces)\n` +
|
|
301
|
+
` gitnexus eval-server --host 192.168.1.5 (specific interface)\n` +
|
|
302
|
+
` gitnexus eval-server --host localhost (OS-resolved loopback)\n`, { flag: '--host', value: rawHost });
|
|
303
|
+
process.exit(1);
|
|
304
|
+
}
|
|
276
305
|
const backend = new LocalBackend();
|
|
277
306
|
const ok = await backend.init();
|
|
278
307
|
if (!ok) {
|
|
@@ -357,12 +386,52 @@ export async function evalServerCommand(options) {
|
|
|
357
386
|
res.end(`Error: ${err.message || 'Internal error'}`);
|
|
358
387
|
}
|
|
359
388
|
});
|
|
360
|
-
server.
|
|
389
|
+
server.on('error', (err) => {
|
|
390
|
+
if (err.code === 'EADDRINUSE') {
|
|
391
|
+
cliError(`\nGitNexus eval-server failed to start:\n` +
|
|
392
|
+
` Port ${port} is already in use.\n\n` +
|
|
393
|
+
` Either:\n` +
|
|
394
|
+
` 1. Stop the process already using port ${port}\n` +
|
|
395
|
+
` 2. Use a different port: gitnexus eval-server --port 4849\n`, { code: err.code, port, host });
|
|
396
|
+
}
|
|
397
|
+
else if (err.code === 'EADDRNOTAVAIL') {
|
|
398
|
+
const isIPv6Host = isIPv6(host);
|
|
399
|
+
cliError(`\nGitNexus eval-server failed to start:\n` +
|
|
400
|
+
` Address ${host} is not available on this machine.\n\n` +
|
|
401
|
+
(isIPv6Host
|
|
402
|
+
? ` IPv6 address ${host} is not reachable — IPv6 may be disabled on this system or container.\n` +
|
|
403
|
+
` Docker containers and many CI environments disable IPv6 by default.\n\n`
|
|
404
|
+
: ` The --host value must be an IP assigned to a local network interface.\n` +
|
|
405
|
+
` Run \`ip addr\` (Linux) or \`ipconfig\` (Windows) to list available addresses.\n\n`) +
|
|
406
|
+
` Common fixes:\n` +
|
|
407
|
+
` gitnexus eval-server --host 127.0.0.1 (loopback, this machine only)\n` +
|
|
408
|
+
` gitnexus eval-server --host 0.0.0.0 (all interfaces, reachable from other VMs)\n`, { code: err.code, port, host });
|
|
409
|
+
}
|
|
410
|
+
else if (err.code === 'EACCES') {
|
|
411
|
+
cliError(`\nGitNexus eval-server failed to start:\n` +
|
|
412
|
+
` Permission denied binding to port ${port}.\n\n` +
|
|
413
|
+
` Ports below 1024 require elevated privileges.\n` +
|
|
414
|
+
` Use a port above 1024: gitnexus eval-server --port 4848\n`, { code: err.code, port, host });
|
|
415
|
+
}
|
|
416
|
+
else {
|
|
417
|
+
cliError(`\nGitNexus eval-server failed to start:\n ${err.message}\n`, {
|
|
418
|
+
code: err.code,
|
|
419
|
+
port,
|
|
420
|
+
host,
|
|
421
|
+
});
|
|
422
|
+
}
|
|
423
|
+
process.exit(1);
|
|
424
|
+
});
|
|
425
|
+
server.listen(port, host, () => {
|
|
361
426
|
// Plain-text banner for the human watching stderr; structured record
|
|
362
427
|
// for log aggregation (split into two so the user sees a real banner
|
|
363
428
|
// not `{"level":30,"msg":"...","port":4747,"endpoints":[...]}`).
|
|
429
|
+
// Use server.address().port so --port 0 (OS-assigned) emits the real port.
|
|
430
|
+
const addr = server.address();
|
|
431
|
+
const boundPort = typeof addr === 'object' && addr !== null ? addr.port : port;
|
|
432
|
+
const displayHost = host.includes(':') ? `[${host}]` : host;
|
|
364
433
|
const bannerLines = [
|
|
365
|
-
`GitNexus eval-server: listening on http
|
|
434
|
+
`GitNexus eval-server: listening on http://${displayHost}:${boundPort}`,
|
|
366
435
|
` POST /tool/query — search execution flows`,
|
|
367
436
|
` POST /tool/context — 360-degree symbol view`,
|
|
368
437
|
` POST /tool/impact — blast radius analysis`,
|
|
@@ -374,8 +443,8 @@ export async function evalServerCommand(options) {
|
|
|
374
443
|
bannerLines.push(` Auto-shutdown after ${idleTimeoutSec}s idle`);
|
|
375
444
|
}
|
|
376
445
|
cliInfo(bannerLines.join('\n'), {
|
|
377
|
-
port,
|
|
378
|
-
host
|
|
446
|
+
port: boundPort,
|
|
447
|
+
host,
|
|
379
448
|
idleTimeoutSec: idleTimeoutSec > 0 ? idleTimeoutSec : undefined,
|
|
380
449
|
endpoints: [
|
|
381
450
|
'POST /tool/query',
|
|
@@ -388,7 +457,8 @@ export async function evalServerCommand(options) {
|
|
|
388
457
|
});
|
|
389
458
|
try {
|
|
390
459
|
// Use fd 1 directly — LadybugDB captures process.stdout (#324)
|
|
391
|
-
|
|
460
|
+
const readyHost = host.includes(':') ? `[${host}]` : host;
|
|
461
|
+
writeSync(1, `GITNEXUS_EVAL_SERVER_READY:${readyHost}:${boundPort}\n`);
|
|
392
462
|
}
|
|
393
463
|
catch {
|
|
394
464
|
// stdout may not be available (e.g., broken pipe)
|
package/dist/cli/index.js
CHANGED
|
@@ -103,11 +103,12 @@ program
|
|
|
103
103
|
.option('--reasoning-model', 'Mark deployment as reasoning model (o1/o3/o4-mini) — strips temperature, uses max_completion_tokens')
|
|
104
104
|
.option('--no-reasoning-model', 'Disable reasoning model mode (overrides saved config)')
|
|
105
105
|
.option('--concurrency <n>', 'Parallel LLM calls (default: 3)', '3')
|
|
106
|
-
.option('--timeout <seconds>', '
|
|
106
|
+
.option('--timeout <seconds>', 'LLM request timeout in seconds (default: disabled)')
|
|
107
107
|
.option('--retries <n>', 'Max LLM retry attempts per request (default: 3)')
|
|
108
108
|
.option('--gist', 'Publish wiki as a public GitHub Gist after generation')
|
|
109
109
|
.option('-v, --verbose', 'Enable verbose output (show LLM commands and responses)')
|
|
110
110
|
.option('--review', 'Stop after grouping to review module structure before generating pages')
|
|
111
|
+
.option('--lang <lang>', 'Output language for generated documentation (e.g. english, chinese, spanish, japanese)')
|
|
111
112
|
.action(createLazyAction(() => import('./wiki.js'), 'wikiCommand'));
|
|
112
113
|
program
|
|
113
114
|
.command('augment <pattern>')
|
|
@@ -167,6 +168,7 @@ program
|
|
|
167
168
|
.command('eval-server')
|
|
168
169
|
.description('Start lightweight HTTP server for fast tool calls during evaluation')
|
|
169
170
|
.option('-p, --port <port>', 'Port number', '4848')
|
|
171
|
+
.option('--host <host>', 'Bind address (default: 127.0.0.1, use 0.0.0.0 to expose to all interfaces)')
|
|
170
172
|
.option('--idle-timeout <seconds>', 'Auto-shutdown after N seconds idle (0 = disabled)', '0')
|
|
171
173
|
.action(createLazyAction(() => import('./eval-server.js'), 'evalServerCommand'));
|
|
172
174
|
registerGroupCommands(program);
|
package/dist/cli/serve.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { createServer } from '../server/api.js';
|
|
2
2
|
import { logger, flushLoggerSync } from '../core/logger.js';
|
|
3
3
|
import { cliError } from './cli-message.js';
|
|
4
|
+
import { isWalCorruptionError, WAL_RECOVERY_SUGGESTION } from '../core/lbug/lbug-config.js';
|
|
4
5
|
// Catch anything that would cause a silent exit. Pino v10's default
|
|
5
6
|
// destination is `sync: false` (SonicBoom buffered) — call
|
|
6
7
|
// `flushLoggerSync()` between the log and `process.exit(1)` so the crash
|
|
@@ -32,7 +33,11 @@ export const serveCommand = async (options) => {
|
|
|
32
33
|
await createServer(port, host);
|
|
33
34
|
}
|
|
34
35
|
catch (err) {
|
|
35
|
-
if (err
|
|
36
|
+
if (isWalCorruptionError(err)) {
|
|
37
|
+
cliError(`\nGitNexus server could not start: the index has a corrupted WAL file.\n` +
|
|
38
|
+
` ${WAL_RECOVERY_SUGGESTION}\n`, { recoveryHint: 'wal-corruption' });
|
|
39
|
+
}
|
|
40
|
+
else if (err.code === 'EADDRINUSE') {
|
|
36
41
|
cliError(`\nFailed to start GitNexus server:\n` +
|
|
37
42
|
` ${err.message || err}\n\n` +
|
|
38
43
|
` Port ${port} is already in use. Either:\n` +
|