@harness-engineering/graph 0.4.1 → 0.4.2

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/index.d.mts CHANGED
@@ -179,6 +179,8 @@ declare class GraphStore {
179
179
  /** Pick the most selective index to start from. */
180
180
  private selectCandidates;
181
181
  getNeighbors(nodeId: string, direction?: 'outbound' | 'inbound' | 'both'): GraphNode[];
182
+ private collectNeighborIds;
183
+ private resolveNodes;
182
184
  get nodeCount(): number;
183
185
  get edgeCount(): number;
184
186
  clear(): void;
@@ -325,8 +327,16 @@ declare class GitIngestor {
325
327
  private readonly gitRunner?;
326
328
  constructor(store: GraphStore, gitRunner?: GitRunner | undefined);
327
329
  ingest(rootDir: string): Promise<IngestResult>;
330
+ private ingestCommit;
331
+ private ingestCoChanges;
328
332
  private runGit;
329
333
  private parseGitLog;
334
+ /**
335
+ * Process one line from git log output, updating the in-progress commit builder
336
+ * and flushing completed commits into the accumulator.
337
+ * Returns the updated current builder (null if flushed and not replaced).
338
+ */
339
+ private processLogLine;
330
340
  private computeCoChanges;
331
341
  }
332
342
 
@@ -368,10 +378,22 @@ declare class RequirementIngestor {
368
378
  * and create requirement nodes with convention-based edges.
369
379
  */
370
380
  ingestSpecs(specsDir: string): Promise<IngestResult>;
381
+ private ingestFeatureDir;
382
+ private ingestSpec;
383
+ private ingestRequirement;
371
384
  /**
372
385
  * Parse markdown content and extract numbered items from recognized sections.
373
386
  */
374
387
  private extractRequirements;
388
+ /**
389
+ * Check if a line is a section heading and return updated section state,
390
+ * or return null if the line is not a heading.
391
+ */
392
+ private processHeadingLine;
393
+ /**
394
+ * Build a requirement GraphNode from a matched numbered-item line.
395
+ */
396
+ private buildRequirementNode;
375
397
  /**
376
398
  * Convention-based linking: match requirement to code/test files
377
399
  * by feature name in their path.
@@ -434,6 +456,7 @@ declare class JiraConnector implements GraphConnector {
434
456
  private readonly httpClient;
435
457
  constructor(httpClient?: HttpClient);
436
458
  ingest(store: GraphStore, config: ConnectorConfig): Promise<IngestResult>;
459
+ private fetchAllIssues;
437
460
  private processIssue;
438
461
  }
439
462
 
@@ -452,6 +475,7 @@ declare class ConfluenceConnector implements GraphConnector {
452
475
  private readonly httpClient;
453
476
  constructor(httpClient?: HttpClient);
454
477
  ingest(store: GraphStore, config: ConnectorConfig): Promise<IngestResult>;
478
+ private fetchAllPagesHandled;
455
479
  private fetchAllPages;
456
480
  private processPage;
457
481
  }
@@ -462,6 +486,7 @@ declare class CIConnector implements GraphConnector {
462
486
  private readonly httpClient;
463
487
  constructor(httpClient?: HttpClient);
464
488
  ingest(store: GraphStore, config: ConnectorConfig): Promise<IngestResult>;
489
+ private fetchAndIngestRuns;
465
490
  }
466
491
 
467
492
  interface FusionResult {
@@ -480,6 +505,9 @@ declare class FusionLayer {
480
505
  private readonly semanticWeight;
481
506
  constructor(store: GraphStore, vectorStore?: VectorStore, keywordWeight?: number, semanticWeight?: number);
482
507
  search(query: string, topK?: number, queryEmbedding?: readonly number[]): FusionResult[];
508
+ private buildSemanticScores;
509
+ private resolveWeights;
510
+ private scoreNodes;
483
511
  private extractKeywords;
484
512
  private keywordScore;
485
513
  private singleKeywordScore;
@@ -524,6 +552,7 @@ declare class GraphEntropyAdapter {
524
552
  * 4. If target exists -> compare lastModified timestamps to determine staleness
525
553
  */
526
554
  computeDriftData(): GraphDriftData;
555
+ private classifyDocEdge;
527
556
  /**
528
557
  * BFS from entry points to find reachable vs unreachable code nodes.
529
558
  *
@@ -645,6 +674,9 @@ declare class GraphAnomalyAdapter {
645
674
  private readonly store;
646
675
  constructor(store: GraphStore);
647
676
  detect(options?: AnomalyDetectionOptions): AnomalyReport;
677
+ private filterMetrics;
678
+ private computeAllOutliers;
679
+ private computeOverlap;
648
680
  private collectMetricValues;
649
681
  private computeZScoreOutliers;
650
682
  private findArticulationPoints;
@@ -741,6 +773,14 @@ declare class EntityExtractor {
741
773
  * @returns Array of raw entity strings in priority order, deduplicated
742
774
  */
743
775
  extract(query: string): readonly string[];
776
+ /** Strategy 1: Quoted strings. Returns the set of consumed tokens. */
777
+ private extractQuoted;
778
+ /** Strategy 2: PascalCase/camelCase tokens. Returns the set of consumed tokens. */
779
+ private extractCasing;
780
+ /** Strategy 3: File paths. Returns the set of consumed tokens. */
781
+ private extractPaths;
782
+ /** Strategy 4: Remaining significant nouns after stop-word and intent-keyword removal. */
783
+ private extractNouns;
744
784
  }
745
785
 
746
786
  /**
@@ -828,17 +868,17 @@ declare class Assembler {
828
868
  assembleContext(intent: string, tokenBudget?: number): AssembledContext;
829
869
  private expandSearchResults;
830
870
  private truncateToFit;
831
- /**
832
- * Compute a token budget allocation across node types.
833
- */
871
+ private countNodesByType;
872
+ private computeModuleDensity;
873
+ private computeTypeWeights;
874
+ private allocateProportionally;
834
875
  computeBudget(totalTokens: number, phase?: string): GraphBudget;
835
876
  /**
836
877
  * Filter graph nodes relevant to a development phase.
837
878
  */
838
879
  filterForPhase(phase: string): GraphFilterResult;
839
- /**
840
- * Generate a markdown repository map from graph structure.
841
- */
880
+ private buildModuleLines;
881
+ private buildEntryPointLines;
842
882
  generateMap(): string;
843
883
  /**
844
884
  * Check documentation coverage of code nodes.
@@ -905,6 +945,8 @@ declare class GraphConstraintAdapter {
905
945
  private readonly store;
906
946
  constructor(store: GraphStore);
907
947
  computeDependencyGraph(): GraphDependencyData;
948
+ private collectFileNodePaths;
949
+ private collectImportEdges;
908
950
  computeLayerViolations(layers: LayerDef[], rootDir: string): GraphLayerViolation[];
909
951
  private resolveLayer;
910
952
  }
@@ -958,7 +1000,10 @@ declare class GraphFeedbackAdapter {
958
1000
  private readonly store;
959
1001
  constructor(store: GraphStore);
960
1002
  computeImpactData(changedFiles: string[]): GraphImpactData;
1003
+ private collectFileImpact;
961
1004
  computeHarnessCheckData(): GraphHarnessCheckData;
1005
+ private countUndocumentedFiles;
1006
+ private countUnreachableNodes;
962
1007
  }
963
1008
 
964
1009
  interface TaskDefinition {
@@ -993,6 +1038,8 @@ declare class TaskIndependenceAnalyzer {
993
1038
  private readonly store;
994
1039
  constructor(store?: GraphStore);
995
1040
  analyze(params: IndependenceCheckParams): IndependenceResult;
1041
+ private buildFileSets;
1042
+ private computeAllPairs;
996
1043
  private validate;
997
1044
  private expandViaGraph;
998
1045
  private computePairOverlap;
@@ -1027,6 +1074,10 @@ declare class ConflictPredictor {
1027
1074
  private readonly store;
1028
1075
  constructor(store?: GraphStore);
1029
1076
  predict(params: IndependenceCheckParams): ConflictPrediction;
1077
+ private buildMetricMaps;
1078
+ private classifyConflicts;
1079
+ private countBySeverity;
1080
+ private classifyTransitiveOverlap;
1030
1081
  private classifyPair;
1031
1082
  private severityRank;
1032
1083
  private computePercentile;
@@ -1120,6 +1171,6 @@ declare class CascadeSimulator {
1120
1171
  private buildResult;
1121
1172
  }
1122
1173
 
1123
- declare const VERSION = "0.4.0";
1174
+ declare const VERSION = "0.4.1";
1124
1175
 
1125
1176
  export { type AnomalyDetectionOptions, type AnomalyReport, type ArticulationPoint, type AskGraphResult, type AssembledContext, Assembler, CIConnector, CURRENT_SCHEMA_VERSION, type CascadeLayer, type CascadeNode, type CascadeResult, type CascadeSimulationOptions, CascadeSimulator, type ClassificationResult, CodeIngestor, CompositeProbabilityStrategy, type ConflictDetail, type ConflictPrediction, ConflictPredictor, type ConflictSeverity, ConfluenceConnector, type ConnectorConfig, ContextQL, type ContextQLParams, type ContextQLResult, DesignConstraintAdapter, DesignIngestor, type DesignStrictness, type DesignViolation, EDGE_TYPES, type EdgeQuery, type EdgeType, EntityExtractor, EntityResolver, FusionLayer, type FusionResult, GitIngestor, type GitRunner, GraphAnomalyAdapter, type GraphBudget, GraphComplexityAdapter, type GraphComplexityHotspot, type GraphComplexityResult, type GraphConnector, GraphConstraintAdapter, GraphCouplingAdapter, type GraphCouplingFileData, type GraphCouplingResult, type GraphCoverageReport, type GraphDeadCodeData, type GraphDependencyData, type GraphDriftData, type GraphEdge, GraphEdgeSchema, GraphEntropyAdapter, GraphFeedbackAdapter, type GraphFilterResult, type GraphHarnessCheckData, type GraphImpactData, type GraphLayerViolation, type GraphMetadata, type GraphNode, GraphNodeSchema, type GraphSnapshotSummary, GraphStore, type HttpClient, INTENTS, type ImpactGroups, type IndependenceCheckParams, type IndependenceResult, type IngestResult, type Intent, IntentClassifier, JiraConnector, KnowledgeIngestor, type LinkResult, NODE_TYPES, type NodeCategory, type NodeQuery, type NodeType, OBSERVABILITY_TYPES, type OverlapDetail, type PairResult, type ProbabilityStrategy, type ProjectionSpec, type RequirementCoverage, RequirementIngestor, type ResolvedEntity, ResponseFormatter, SlackConnector, type SourceLocation, type StatisticalOutlier, SyncManager, type SyncMetadata, type TaskDefinition, TaskIndependenceAnalyzer, TopologicalLinker, type TraceabilityOptions, type TraceabilityResult, type TracedFile, VERSION, type VectorSearchResult, VectorStore, askGraph, classifyNodeCategory, groupNodesByImpact, linkToCode, loadGraph, project, queryTraceability, saveGraph };
package/dist/index.d.ts CHANGED
@@ -179,6 +179,8 @@ declare class GraphStore {
179
179
  /** Pick the most selective index to start from. */
180
180
  private selectCandidates;
181
181
  getNeighbors(nodeId: string, direction?: 'outbound' | 'inbound' | 'both'): GraphNode[];
182
+ private collectNeighborIds;
183
+ private resolveNodes;
182
184
  get nodeCount(): number;
183
185
  get edgeCount(): number;
184
186
  clear(): void;
@@ -325,8 +327,16 @@ declare class GitIngestor {
325
327
  private readonly gitRunner?;
326
328
  constructor(store: GraphStore, gitRunner?: GitRunner | undefined);
327
329
  ingest(rootDir: string): Promise<IngestResult>;
330
+ private ingestCommit;
331
+ private ingestCoChanges;
328
332
  private runGit;
329
333
  private parseGitLog;
334
+ /**
335
+ * Process one line from git log output, updating the in-progress commit builder
336
+ * and flushing completed commits into the accumulator.
337
+ * Returns the updated current builder (null if flushed and not replaced).
338
+ */
339
+ private processLogLine;
330
340
  private computeCoChanges;
331
341
  }
332
342
 
@@ -368,10 +378,22 @@ declare class RequirementIngestor {
368
378
  * and create requirement nodes with convention-based edges.
369
379
  */
370
380
  ingestSpecs(specsDir: string): Promise<IngestResult>;
381
+ private ingestFeatureDir;
382
+ private ingestSpec;
383
+ private ingestRequirement;
371
384
  /**
372
385
  * Parse markdown content and extract numbered items from recognized sections.
373
386
  */
374
387
  private extractRequirements;
388
+ /**
389
+ * Check if a line is a section heading and return updated section state,
390
+ * or return null if the line is not a heading.
391
+ */
392
+ private processHeadingLine;
393
+ /**
394
+ * Build a requirement GraphNode from a matched numbered-item line.
395
+ */
396
+ private buildRequirementNode;
375
397
  /**
376
398
  * Convention-based linking: match requirement to code/test files
377
399
  * by feature name in their path.
@@ -434,6 +456,7 @@ declare class JiraConnector implements GraphConnector {
434
456
  private readonly httpClient;
435
457
  constructor(httpClient?: HttpClient);
436
458
  ingest(store: GraphStore, config: ConnectorConfig): Promise<IngestResult>;
459
+ private fetchAllIssues;
437
460
  private processIssue;
438
461
  }
439
462
 
@@ -452,6 +475,7 @@ declare class ConfluenceConnector implements GraphConnector {
452
475
  private readonly httpClient;
453
476
  constructor(httpClient?: HttpClient);
454
477
  ingest(store: GraphStore, config: ConnectorConfig): Promise<IngestResult>;
478
+ private fetchAllPagesHandled;
455
479
  private fetchAllPages;
456
480
  private processPage;
457
481
  }
@@ -462,6 +486,7 @@ declare class CIConnector implements GraphConnector {
462
486
  private readonly httpClient;
463
487
  constructor(httpClient?: HttpClient);
464
488
  ingest(store: GraphStore, config: ConnectorConfig): Promise<IngestResult>;
489
+ private fetchAndIngestRuns;
465
490
  }
466
491
 
467
492
  interface FusionResult {
@@ -480,6 +505,9 @@ declare class FusionLayer {
480
505
  private readonly semanticWeight;
481
506
  constructor(store: GraphStore, vectorStore?: VectorStore, keywordWeight?: number, semanticWeight?: number);
482
507
  search(query: string, topK?: number, queryEmbedding?: readonly number[]): FusionResult[];
508
+ private buildSemanticScores;
509
+ private resolveWeights;
510
+ private scoreNodes;
483
511
  private extractKeywords;
484
512
  private keywordScore;
485
513
  private singleKeywordScore;
@@ -524,6 +552,7 @@ declare class GraphEntropyAdapter {
524
552
  * 4. If target exists -> compare lastModified timestamps to determine staleness
525
553
  */
526
554
  computeDriftData(): GraphDriftData;
555
+ private classifyDocEdge;
527
556
  /**
528
557
  * BFS from entry points to find reachable vs unreachable code nodes.
529
558
  *
@@ -645,6 +674,9 @@ declare class GraphAnomalyAdapter {
645
674
  private readonly store;
646
675
  constructor(store: GraphStore);
647
676
  detect(options?: AnomalyDetectionOptions): AnomalyReport;
677
+ private filterMetrics;
678
+ private computeAllOutliers;
679
+ private computeOverlap;
648
680
  private collectMetricValues;
649
681
  private computeZScoreOutliers;
650
682
  private findArticulationPoints;
@@ -741,6 +773,14 @@ declare class EntityExtractor {
741
773
  * @returns Array of raw entity strings in priority order, deduplicated
742
774
  */
743
775
  extract(query: string): readonly string[];
776
+ /** Strategy 1: Quoted strings. Returns the set of consumed tokens. */
777
+ private extractQuoted;
778
+ /** Strategy 2: PascalCase/camelCase tokens. Returns the set of consumed tokens. */
779
+ private extractCasing;
780
+ /** Strategy 3: File paths. Returns the set of consumed tokens. */
781
+ private extractPaths;
782
+ /** Strategy 4: Remaining significant nouns after stop-word and intent-keyword removal. */
783
+ private extractNouns;
744
784
  }
745
785
 
746
786
  /**
@@ -828,17 +868,17 @@ declare class Assembler {
828
868
  assembleContext(intent: string, tokenBudget?: number): AssembledContext;
829
869
  private expandSearchResults;
830
870
  private truncateToFit;
831
- /**
832
- * Compute a token budget allocation across node types.
833
- */
871
+ private countNodesByType;
872
+ private computeModuleDensity;
873
+ private computeTypeWeights;
874
+ private allocateProportionally;
834
875
  computeBudget(totalTokens: number, phase?: string): GraphBudget;
835
876
  /**
836
877
  * Filter graph nodes relevant to a development phase.
837
878
  */
838
879
  filterForPhase(phase: string): GraphFilterResult;
839
- /**
840
- * Generate a markdown repository map from graph structure.
841
- */
880
+ private buildModuleLines;
881
+ private buildEntryPointLines;
842
882
  generateMap(): string;
843
883
  /**
844
884
  * Check documentation coverage of code nodes.
@@ -905,6 +945,8 @@ declare class GraphConstraintAdapter {
905
945
  private readonly store;
906
946
  constructor(store: GraphStore);
907
947
  computeDependencyGraph(): GraphDependencyData;
948
+ private collectFileNodePaths;
949
+ private collectImportEdges;
908
950
  computeLayerViolations(layers: LayerDef[], rootDir: string): GraphLayerViolation[];
909
951
  private resolveLayer;
910
952
  }
@@ -958,7 +1000,10 @@ declare class GraphFeedbackAdapter {
958
1000
  private readonly store;
959
1001
  constructor(store: GraphStore);
960
1002
  computeImpactData(changedFiles: string[]): GraphImpactData;
1003
+ private collectFileImpact;
961
1004
  computeHarnessCheckData(): GraphHarnessCheckData;
1005
+ private countUndocumentedFiles;
1006
+ private countUnreachableNodes;
962
1007
  }
963
1008
 
964
1009
  interface TaskDefinition {
@@ -993,6 +1038,8 @@ declare class TaskIndependenceAnalyzer {
993
1038
  private readonly store;
994
1039
  constructor(store?: GraphStore);
995
1040
  analyze(params: IndependenceCheckParams): IndependenceResult;
1041
+ private buildFileSets;
1042
+ private computeAllPairs;
996
1043
  private validate;
997
1044
  private expandViaGraph;
998
1045
  private computePairOverlap;
@@ -1027,6 +1074,10 @@ declare class ConflictPredictor {
1027
1074
  private readonly store;
1028
1075
  constructor(store?: GraphStore);
1029
1076
  predict(params: IndependenceCheckParams): ConflictPrediction;
1077
+ private buildMetricMaps;
1078
+ private classifyConflicts;
1079
+ private countBySeverity;
1080
+ private classifyTransitiveOverlap;
1030
1081
  private classifyPair;
1031
1082
  private severityRank;
1032
1083
  private computePercentile;
@@ -1120,6 +1171,6 @@ declare class CascadeSimulator {
1120
1171
  private buildResult;
1121
1172
  }
1122
1173
 
1123
- declare const VERSION = "0.4.0";
1174
+ declare const VERSION = "0.4.1";
1124
1175
 
1125
1176
  export { type AnomalyDetectionOptions, type AnomalyReport, type ArticulationPoint, type AskGraphResult, type AssembledContext, Assembler, CIConnector, CURRENT_SCHEMA_VERSION, type CascadeLayer, type CascadeNode, type CascadeResult, type CascadeSimulationOptions, CascadeSimulator, type ClassificationResult, CodeIngestor, CompositeProbabilityStrategy, type ConflictDetail, type ConflictPrediction, ConflictPredictor, type ConflictSeverity, ConfluenceConnector, type ConnectorConfig, ContextQL, type ContextQLParams, type ContextQLResult, DesignConstraintAdapter, DesignIngestor, type DesignStrictness, type DesignViolation, EDGE_TYPES, type EdgeQuery, type EdgeType, EntityExtractor, EntityResolver, FusionLayer, type FusionResult, GitIngestor, type GitRunner, GraphAnomalyAdapter, type GraphBudget, GraphComplexityAdapter, type GraphComplexityHotspot, type GraphComplexityResult, type GraphConnector, GraphConstraintAdapter, GraphCouplingAdapter, type GraphCouplingFileData, type GraphCouplingResult, type GraphCoverageReport, type GraphDeadCodeData, type GraphDependencyData, type GraphDriftData, type GraphEdge, GraphEdgeSchema, GraphEntropyAdapter, GraphFeedbackAdapter, type GraphFilterResult, type GraphHarnessCheckData, type GraphImpactData, type GraphLayerViolation, type GraphMetadata, type GraphNode, GraphNodeSchema, type GraphSnapshotSummary, GraphStore, type HttpClient, INTENTS, type ImpactGroups, type IndependenceCheckParams, type IndependenceResult, type IngestResult, type Intent, IntentClassifier, JiraConnector, KnowledgeIngestor, type LinkResult, NODE_TYPES, type NodeCategory, type NodeQuery, type NodeType, OBSERVABILITY_TYPES, type OverlapDetail, type PairResult, type ProbabilityStrategy, type ProjectionSpec, type RequirementCoverage, RequirementIngestor, type ResolvedEntity, ResponseFormatter, SlackConnector, type SourceLocation, type StatisticalOutlier, SyncManager, type SyncMetadata, type TaskDefinition, TaskIndependenceAnalyzer, TopologicalLinker, type TraceabilityOptions, type TraceabilityResult, type TracedFile, VERSION, type VectorSearchResult, VectorStore, askGraph, classifyNodeCategory, groupNodesByImpact, linkToCode, loadGraph, project, queryTraceability, saveGraph };