@harness-engineering/graph 0.7.1 → 0.8.0
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 +108 -3
- package/dist/index.d.ts +108 -3
- package/dist/index.js +389 -26
- package/dist/index.mjs +387 -27
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -66,8 +66,29 @@ interface GraphMetadata {
|
|
|
66
66
|
readonly lastScanTimestamp: string;
|
|
67
67
|
readonly nodeCount: number;
|
|
68
68
|
readonly edgeCount: number;
|
|
69
|
+
/**
|
|
70
|
+
* Per-NodeType counts. Populated at save time so `harness graph status`
|
|
71
|
+
* (and other summary callers) can render counts without loading graph.json.
|
|
72
|
+
* Optional for forward compatibility with older v2 metadata files written
|
|
73
|
+
* before this field was added.
|
|
74
|
+
*/
|
|
75
|
+
readonly nodesByType?: Readonly<Record<string, number>>;
|
|
69
76
|
}
|
|
70
|
-
|
|
77
|
+
/**
|
|
78
|
+
* On-disk graph format version.
|
|
79
|
+
*
|
|
80
|
+
* - v1 (legacy): `graph.json` was a single JSON object (`{"nodes":[...],"edges":[...]}`)
|
|
81
|
+
* — read by slurping the whole file, which crashed with `RangeError: Invalid string length`
|
|
82
|
+
* on graphs > ~512 MB (V8's hard string cap). See issue #276.
|
|
83
|
+
* - v2 (current): `graph.json` is NDJSON — one node or edge per line, each line a
|
|
84
|
+
* self-contained JSON object with a `kind` discriminator (`"node"` or `"edge"`).
|
|
85
|
+
* Reader streams the file and never builds a buffer larger than one line, so the
|
|
86
|
+
* string cap no longer applies to graph size.
|
|
87
|
+
*
|
|
88
|
+
* Old v1 graphs trigger `schema_mismatch` in `loadGraph` and are rebuilt on the
|
|
89
|
+
* next scan via {@link GraphStore.load}'s existing schema-mismatch handling.
|
|
90
|
+
*/
|
|
91
|
+
declare const CURRENT_SCHEMA_VERSION = 2;
|
|
71
92
|
/** Stability classification for prompt caching -- mirrors StabilityTier from @harness-engineering/types. */
|
|
72
93
|
type GraphStabilityTier = 'static' | 'session' | 'ephemeral';
|
|
73
94
|
/**
|
|
@@ -262,6 +283,25 @@ type LoadGraphResult = {
|
|
|
262
283
|
found: number;
|
|
263
284
|
expected: number;
|
|
264
285
|
};
|
|
286
|
+
type LoadMetadataResult = {
|
|
287
|
+
status: 'loaded';
|
|
288
|
+
metadata: GraphMetadata;
|
|
289
|
+
} | {
|
|
290
|
+
status: 'not_found';
|
|
291
|
+
} | {
|
|
292
|
+
status: 'schema_mismatch';
|
|
293
|
+
found: number;
|
|
294
|
+
expected: number;
|
|
295
|
+
};
|
|
296
|
+
/**
|
|
297
|
+
* Read just `metadata.json` — fast-path for callers that only need counts/timestamps
|
|
298
|
+
* (e.g. `harness graph status`). Avoids the streaming graph.json read entirely.
|
|
299
|
+
*
|
|
300
|
+
* Returns `not_found` when the metadata file is missing or unreadable.
|
|
301
|
+
* Returns `schema_mismatch` when the graph was written by a different schema version,
|
|
302
|
+
* letting callers either rebuild or surface the version skew without loading nodes.
|
|
303
|
+
*/
|
|
304
|
+
declare function loadGraphMetadata(dirPath: string): Promise<LoadMetadataResult>;
|
|
265
305
|
declare function loadGraph(dirPath: string): Promise<LoadGraphResult>;
|
|
266
306
|
|
|
267
307
|
/**
|
|
@@ -331,17 +371,49 @@ interface ImpactGroups {
|
|
|
331
371
|
*/
|
|
332
372
|
declare function groupNodesByImpact(nodes: readonly GraphNode[], excludeId?: string): ImpactGroups;
|
|
333
373
|
|
|
374
|
+
/**
|
|
375
|
+
* Options controlling which files {@link CodeIngestor} walks. Each field is optional;
|
|
376
|
+
* defaults skip standard build artifacts, package-manager caches, AI agent sandboxes,
|
|
377
|
+
* and IDE metadata (see {@link DEFAULT_SKIP_DIRS}).
|
|
378
|
+
*/
|
|
379
|
+
interface CodeIngestorOptions {
|
|
380
|
+
/** Replace the default skip-dirs set entirely. Use sparingly — defaults are broad on purpose. */
|
|
381
|
+
readonly skipDirs?: Iterable<string>;
|
|
382
|
+
/** Add directory names to the default skip-dirs set. The common extension point. */
|
|
383
|
+
readonly additionalSkipDirs?: Iterable<string>;
|
|
384
|
+
/** Glob patterns (minimatch syntax) to exclude paths from ingestion. Evaluated against the relative POSIX-style path. */
|
|
385
|
+
readonly excludePatterns?: readonly string[];
|
|
386
|
+
/** When true, parse `<rootDir>/.gitignore` and use it as additional exclude patterns. Default: true. */
|
|
387
|
+
readonly respectGitignore?: boolean;
|
|
388
|
+
}
|
|
334
389
|
/**
|
|
335
390
|
* Ingests source files into the graph via regex-based parsing.
|
|
336
391
|
* Supports TypeScript, JavaScript, Python, Go, Rust, and Java.
|
|
337
392
|
*/
|
|
338
393
|
declare class CodeIngestor {
|
|
339
394
|
private readonly store;
|
|
340
|
-
|
|
395
|
+
private readonly skipDirs;
|
|
396
|
+
private readonly excludePatterns;
|
|
397
|
+
private readonly respectGitignore;
|
|
398
|
+
constructor(store: GraphStore, options?: CodeIngestorOptions);
|
|
341
399
|
ingest(rootDir: string): Promise<IngestResult>;
|
|
342
400
|
private processFile;
|
|
343
401
|
private trackCallable;
|
|
402
|
+
/**
|
|
403
|
+
* Walk `rootDir` iteratively (BFS via an explicit queue) and return absolute paths
|
|
404
|
+
* of every supported source file that is not excluded by the configured filters.
|
|
405
|
+
*
|
|
406
|
+
* Iterative on purpose: a recursive walker burns one stack frame per nested
|
|
407
|
+
* directory and crashes with `Maximum call stack size exceeded` on deeply nested
|
|
408
|
+
* monorepos (issue #274). The queue-based form keeps memory bounded by the
|
|
409
|
+
* frontier size rather than the deepest path.
|
|
410
|
+
*/
|
|
344
411
|
private findSourceFiles;
|
|
412
|
+
/**
|
|
413
|
+
* Compose the exclude matchers from `excludePatterns` and (optionally) `.gitignore`.
|
|
414
|
+
* Returns a list of minimatch-compatible patterns; an empty list means "no excludes".
|
|
415
|
+
*/
|
|
416
|
+
private buildExcludeMatchers;
|
|
345
417
|
private extractSymbols;
|
|
346
418
|
private processSymbolLine;
|
|
347
419
|
private matchFunction;
|
|
@@ -394,6 +466,38 @@ declare class CodeIngestor {
|
|
|
394
466
|
private extractReqAnnotationsForFile;
|
|
395
467
|
}
|
|
396
468
|
|
|
469
|
+
/**
|
|
470
|
+
* Default directory names skipped during source-file walking.
|
|
471
|
+
*
|
|
472
|
+
* Walking into these on a populated monorepo (e.g. .turbo or .claude/worktrees)
|
|
473
|
+
* inflates the walked-file count by orders of magnitude and is the root cause
|
|
474
|
+
* of the recursion-depth and heap-OOM crashes reported in
|
|
475
|
+
* https://github.com/Intense-Visions/harness-engineering/issues/274.
|
|
476
|
+
*
|
|
477
|
+
* Categories covered:
|
|
478
|
+
* - VCS / repo metadata
|
|
479
|
+
* - Package-manager caches and stores
|
|
480
|
+
* - JS/TS framework build & dev caches
|
|
481
|
+
* - Test, coverage, and reporter outputs
|
|
482
|
+
* - Python virtualenvs and bytecode caches
|
|
483
|
+
* - JVM build outputs
|
|
484
|
+
* - IDE / editor metadata
|
|
485
|
+
* - AI agent sandbox directories (Claude Code worktrees, Cursor, Codex, etc.)
|
|
486
|
+
*
|
|
487
|
+
* Consumers may extend or replace this set via {@link CodeIngestorOptions}
|
|
488
|
+
* or the project-level `ingest.skipDirs` / `ingest.additionalSkipDirs` config.
|
|
489
|
+
*/
|
|
490
|
+
declare const DEFAULT_SKIP_DIRS: ReadonlySet<string>;
|
|
491
|
+
/**
|
|
492
|
+
* Build an effective skip-dirs Set from optional caller overrides.
|
|
493
|
+
* - If `skipDirs` is provided, it replaces the defaults entirely.
|
|
494
|
+
* - If `additionalSkipDirs` is provided, it extends the defaults (or the override).
|
|
495
|
+
*/
|
|
496
|
+
declare function resolveSkipDirs(options?: {
|
|
497
|
+
skipDirs?: Iterable<string>;
|
|
498
|
+
additionalSkipDirs?: Iterable<string>;
|
|
499
|
+
}): ReadonlySet<string>;
|
|
500
|
+
|
|
397
501
|
type GitRunner = (rootDir: string, args: string[]) => Promise<string>;
|
|
398
502
|
/**
|
|
399
503
|
* Ingests git history into the graph, creating commit nodes,
|
|
@@ -451,6 +555,7 @@ declare class BusinessKnowledgeIngestor {
|
|
|
451
555
|
private readonly store;
|
|
452
556
|
constructor(store: GraphStore);
|
|
453
557
|
ingest(knowledgeDir: string): Promise<IngestResult>;
|
|
558
|
+
ingestSolutions(solutionsDir: string): Promise<IngestResult>;
|
|
454
559
|
private createNodes;
|
|
455
560
|
private parseAndAddNode;
|
|
456
561
|
private createEdges;
|
|
@@ -1866,4 +1971,4 @@ declare class CascadeSimulator {
|
|
|
1866
1971
|
|
|
1867
1972
|
declare const VERSION = "0.6.0";
|
|
1868
1973
|
|
|
1869
|
-
export { ALL_EXTRACTORS, type AggregateResult, type AnomalyDetectionOptions, type AnomalyReport, ApiPathExtractor, type ArticulationPoint, type AskGraphResult, type AssembledContext, Assembler, BusinessKnowledgeIngestor, CIConnector, CURRENT_SCHEMA_VERSION, type PackedEnvelope as CacheableEnvelope, type CascadeLayer, type CascadeNode, type CascadeResult, type CascadeSimulationOptions, CascadeSimulator, type ClassificationResult, CodeIngestor, CompositeProbabilityStrategy, type ConflictDetail, type ConflictPrediction, ConflictPredictor, type ConflictSeverity, type ConflictType, ConfluenceConnector, type ConnectorConfig, ContextQL, type ContextQLParams, type ContextQLResult, type Contradiction, ContradictionDetector, type ContradictionEntry, type ContradictionResult, type CoverageReport, CoverageScorer, D2Parser, DEFAULT_BLOCKLIST, DEFAULT_PATTERNS, DecisionIngestor, DesignConstraintAdapter, DesignIngestor, type DesignStrictness, type DesignViolation, type DetectedElement, type DiagramEntity, type DiagramFormatParser, type DiagramParseResult, DiagramParser, type DiagramRelationship, type DomainCoverage, type DomainCoverageScore, type DomainInferenceOptions, type DriftClassification, type DriftDetector, type DriftFinding, type DriftResult, EDGE_TYPES, type EdgeQuery, type EdgeType, EntityExtractor, EntityResolver, EnumConstantExtractor, type ExtractionCounts, type ExtractionRecord, ExtractionRunner, FigmaConnector, FusionLayer, type FusionResult, type GapEntry, type GapReport, 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, type GraphStabilityTier, GraphStore, type HttpClient, INTENTS, ImageAnalysisExtractor, type ImageAnalysisExtractorOptions, type AnalysisProvider as ImageAnalysisProvider, type ImageAnalysisResult, type ImpactGroups, type IndependenceCheckParams, type IndependenceResult, type IngestResult, type Intent, IntentClassifier, JiraConnector, KnowledgeDocMaterializer, KnowledgeIngestor, type KnowledgePipelineOptions, type KnowledgePipelineResult, KnowledgePipelineRunner, type KnowledgeSnapshot, type KnowledgeSnapshotEntry, KnowledgeStagingAggregator, type Language, type LinkResult, type LoadGraphResult, type MaterializeOptions, type MaterializeResult, type MaterializedDoc, MermaidParser, MiroConnector, NODE_STABILITY, NODE_TYPES, type NodeCategory, type NodeQuery, type NodeType, OBSERVABILITY_TYPES, type OverlapDetail, PackedSummaryCache, type PairResult, PlantUmlParser, type ProbabilityStrategy, type ProjectionSpec, type RequirementCoverage, RequirementIngestor, type ResolvedEntity, ResponseFormatter, type SignalExtractor, type SkippedEntry, SlackConnector, type SourceLocation, type StagedEntry, type StatisticalOutlier, StructuralDriftDetector, SyncManager, type SyncMetadata, type TaskDefinition, TaskIndependenceAnalyzer, TestDescriptionExtractor, TopologicalLinker, type TraceabilityOptions, type TraceabilityResult, type TracedFile, VERSION, ValidationRuleExtractor, type VectorSearchResult, VectorStore, askGraph, classifyNodeCategory, createExtractionRunner, detectLanguage, groupNodesByImpact, inferDomain, linkToCode, loadGraph, normalizeIntent, project, queryTraceability, saveGraph };
|
|
1974
|
+
export { ALL_EXTRACTORS, type AggregateResult, type AnomalyDetectionOptions, type AnomalyReport, ApiPathExtractor, type ArticulationPoint, type AskGraphResult, type AssembledContext, Assembler, BusinessKnowledgeIngestor, CIConnector, CURRENT_SCHEMA_VERSION, type PackedEnvelope as CacheableEnvelope, type CascadeLayer, type CascadeNode, type CascadeResult, type CascadeSimulationOptions, CascadeSimulator, type ClassificationResult, CodeIngestor, type CodeIngestorOptions, CompositeProbabilityStrategy, type ConflictDetail, type ConflictPrediction, ConflictPredictor, type ConflictSeverity, type ConflictType, ConfluenceConnector, type ConnectorConfig, ContextQL, type ContextQLParams, type ContextQLResult, type Contradiction, ContradictionDetector, type ContradictionEntry, type ContradictionResult, type CoverageReport, CoverageScorer, D2Parser, DEFAULT_BLOCKLIST, DEFAULT_PATTERNS, DEFAULT_SKIP_DIRS, DecisionIngestor, DesignConstraintAdapter, DesignIngestor, type DesignStrictness, type DesignViolation, type DetectedElement, type DiagramEntity, type DiagramFormatParser, type DiagramParseResult, DiagramParser, type DiagramRelationship, type DomainCoverage, type DomainCoverageScore, type DomainInferenceOptions, type DriftClassification, type DriftDetector, type DriftFinding, type DriftResult, EDGE_TYPES, type EdgeQuery, type EdgeType, EntityExtractor, EntityResolver, EnumConstantExtractor, type ExtractionCounts, type ExtractionRecord, ExtractionRunner, FigmaConnector, FusionLayer, type FusionResult, type GapEntry, type GapReport, 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, type GraphStabilityTier, GraphStore, type HttpClient, INTENTS, ImageAnalysisExtractor, type ImageAnalysisExtractorOptions, type AnalysisProvider as ImageAnalysisProvider, type ImageAnalysisResult, type ImpactGroups, type IndependenceCheckParams, type IndependenceResult, type IngestResult, type Intent, IntentClassifier, JiraConnector, KnowledgeDocMaterializer, KnowledgeIngestor, type KnowledgePipelineOptions, type KnowledgePipelineResult, KnowledgePipelineRunner, type KnowledgeSnapshot, type KnowledgeSnapshotEntry, KnowledgeStagingAggregator, type Language, type LinkResult, type LoadGraphResult, type LoadMetadataResult, type MaterializeOptions, type MaterializeResult, type MaterializedDoc, MermaidParser, MiroConnector, NODE_STABILITY, NODE_TYPES, type NodeCategory, type NodeQuery, type NodeType, OBSERVABILITY_TYPES, type OverlapDetail, PackedSummaryCache, type PairResult, PlantUmlParser, type ProbabilityStrategy, type ProjectionSpec, type RequirementCoverage, RequirementIngestor, type ResolvedEntity, ResponseFormatter, type SignalExtractor, type SkippedEntry, SlackConnector, type SourceLocation, type StagedEntry, type StatisticalOutlier, StructuralDriftDetector, SyncManager, type SyncMetadata, type TaskDefinition, TaskIndependenceAnalyzer, TestDescriptionExtractor, TopologicalLinker, type TraceabilityOptions, type TraceabilityResult, type TracedFile, VERSION, ValidationRuleExtractor, type VectorSearchResult, VectorStore, askGraph, classifyNodeCategory, createExtractionRunner, detectLanguage, groupNodesByImpact, inferDomain, linkToCode, loadGraph, loadGraphMetadata, normalizeIntent, project, queryTraceability, resolveSkipDirs, saveGraph };
|
package/dist/index.d.ts
CHANGED
|
@@ -66,8 +66,29 @@ interface GraphMetadata {
|
|
|
66
66
|
readonly lastScanTimestamp: string;
|
|
67
67
|
readonly nodeCount: number;
|
|
68
68
|
readonly edgeCount: number;
|
|
69
|
+
/**
|
|
70
|
+
* Per-NodeType counts. Populated at save time so `harness graph status`
|
|
71
|
+
* (and other summary callers) can render counts without loading graph.json.
|
|
72
|
+
* Optional for forward compatibility with older v2 metadata files written
|
|
73
|
+
* before this field was added.
|
|
74
|
+
*/
|
|
75
|
+
readonly nodesByType?: Readonly<Record<string, number>>;
|
|
69
76
|
}
|
|
70
|
-
|
|
77
|
+
/**
|
|
78
|
+
* On-disk graph format version.
|
|
79
|
+
*
|
|
80
|
+
* - v1 (legacy): `graph.json` was a single JSON object (`{"nodes":[...],"edges":[...]}`)
|
|
81
|
+
* — read by slurping the whole file, which crashed with `RangeError: Invalid string length`
|
|
82
|
+
* on graphs > ~512 MB (V8's hard string cap). See issue #276.
|
|
83
|
+
* - v2 (current): `graph.json` is NDJSON — one node or edge per line, each line a
|
|
84
|
+
* self-contained JSON object with a `kind` discriminator (`"node"` or `"edge"`).
|
|
85
|
+
* Reader streams the file and never builds a buffer larger than one line, so the
|
|
86
|
+
* string cap no longer applies to graph size.
|
|
87
|
+
*
|
|
88
|
+
* Old v1 graphs trigger `schema_mismatch` in `loadGraph` and are rebuilt on the
|
|
89
|
+
* next scan via {@link GraphStore.load}'s existing schema-mismatch handling.
|
|
90
|
+
*/
|
|
91
|
+
declare const CURRENT_SCHEMA_VERSION = 2;
|
|
71
92
|
/** Stability classification for prompt caching -- mirrors StabilityTier from @harness-engineering/types. */
|
|
72
93
|
type GraphStabilityTier = 'static' | 'session' | 'ephemeral';
|
|
73
94
|
/**
|
|
@@ -262,6 +283,25 @@ type LoadGraphResult = {
|
|
|
262
283
|
found: number;
|
|
263
284
|
expected: number;
|
|
264
285
|
};
|
|
286
|
+
type LoadMetadataResult = {
|
|
287
|
+
status: 'loaded';
|
|
288
|
+
metadata: GraphMetadata;
|
|
289
|
+
} | {
|
|
290
|
+
status: 'not_found';
|
|
291
|
+
} | {
|
|
292
|
+
status: 'schema_mismatch';
|
|
293
|
+
found: number;
|
|
294
|
+
expected: number;
|
|
295
|
+
};
|
|
296
|
+
/**
|
|
297
|
+
* Read just `metadata.json` — fast-path for callers that only need counts/timestamps
|
|
298
|
+
* (e.g. `harness graph status`). Avoids the streaming graph.json read entirely.
|
|
299
|
+
*
|
|
300
|
+
* Returns `not_found` when the metadata file is missing or unreadable.
|
|
301
|
+
* Returns `schema_mismatch` when the graph was written by a different schema version,
|
|
302
|
+
* letting callers either rebuild or surface the version skew without loading nodes.
|
|
303
|
+
*/
|
|
304
|
+
declare function loadGraphMetadata(dirPath: string): Promise<LoadMetadataResult>;
|
|
265
305
|
declare function loadGraph(dirPath: string): Promise<LoadGraphResult>;
|
|
266
306
|
|
|
267
307
|
/**
|
|
@@ -331,17 +371,49 @@ interface ImpactGroups {
|
|
|
331
371
|
*/
|
|
332
372
|
declare function groupNodesByImpact(nodes: readonly GraphNode[], excludeId?: string): ImpactGroups;
|
|
333
373
|
|
|
374
|
+
/**
|
|
375
|
+
* Options controlling which files {@link CodeIngestor} walks. Each field is optional;
|
|
376
|
+
* defaults skip standard build artifacts, package-manager caches, AI agent sandboxes,
|
|
377
|
+
* and IDE metadata (see {@link DEFAULT_SKIP_DIRS}).
|
|
378
|
+
*/
|
|
379
|
+
interface CodeIngestorOptions {
|
|
380
|
+
/** Replace the default skip-dirs set entirely. Use sparingly — defaults are broad on purpose. */
|
|
381
|
+
readonly skipDirs?: Iterable<string>;
|
|
382
|
+
/** Add directory names to the default skip-dirs set. The common extension point. */
|
|
383
|
+
readonly additionalSkipDirs?: Iterable<string>;
|
|
384
|
+
/** Glob patterns (minimatch syntax) to exclude paths from ingestion. Evaluated against the relative POSIX-style path. */
|
|
385
|
+
readonly excludePatterns?: readonly string[];
|
|
386
|
+
/** When true, parse `<rootDir>/.gitignore` and use it as additional exclude patterns. Default: true. */
|
|
387
|
+
readonly respectGitignore?: boolean;
|
|
388
|
+
}
|
|
334
389
|
/**
|
|
335
390
|
* Ingests source files into the graph via regex-based parsing.
|
|
336
391
|
* Supports TypeScript, JavaScript, Python, Go, Rust, and Java.
|
|
337
392
|
*/
|
|
338
393
|
declare class CodeIngestor {
|
|
339
394
|
private readonly store;
|
|
340
|
-
|
|
395
|
+
private readonly skipDirs;
|
|
396
|
+
private readonly excludePatterns;
|
|
397
|
+
private readonly respectGitignore;
|
|
398
|
+
constructor(store: GraphStore, options?: CodeIngestorOptions);
|
|
341
399
|
ingest(rootDir: string): Promise<IngestResult>;
|
|
342
400
|
private processFile;
|
|
343
401
|
private trackCallable;
|
|
402
|
+
/**
|
|
403
|
+
* Walk `rootDir` iteratively (BFS via an explicit queue) and return absolute paths
|
|
404
|
+
* of every supported source file that is not excluded by the configured filters.
|
|
405
|
+
*
|
|
406
|
+
* Iterative on purpose: a recursive walker burns one stack frame per nested
|
|
407
|
+
* directory and crashes with `Maximum call stack size exceeded` on deeply nested
|
|
408
|
+
* monorepos (issue #274). The queue-based form keeps memory bounded by the
|
|
409
|
+
* frontier size rather than the deepest path.
|
|
410
|
+
*/
|
|
344
411
|
private findSourceFiles;
|
|
412
|
+
/**
|
|
413
|
+
* Compose the exclude matchers from `excludePatterns` and (optionally) `.gitignore`.
|
|
414
|
+
* Returns a list of minimatch-compatible patterns; an empty list means "no excludes".
|
|
415
|
+
*/
|
|
416
|
+
private buildExcludeMatchers;
|
|
345
417
|
private extractSymbols;
|
|
346
418
|
private processSymbolLine;
|
|
347
419
|
private matchFunction;
|
|
@@ -394,6 +466,38 @@ declare class CodeIngestor {
|
|
|
394
466
|
private extractReqAnnotationsForFile;
|
|
395
467
|
}
|
|
396
468
|
|
|
469
|
+
/**
|
|
470
|
+
* Default directory names skipped during source-file walking.
|
|
471
|
+
*
|
|
472
|
+
* Walking into these on a populated monorepo (e.g. .turbo or .claude/worktrees)
|
|
473
|
+
* inflates the walked-file count by orders of magnitude and is the root cause
|
|
474
|
+
* of the recursion-depth and heap-OOM crashes reported in
|
|
475
|
+
* https://github.com/Intense-Visions/harness-engineering/issues/274.
|
|
476
|
+
*
|
|
477
|
+
* Categories covered:
|
|
478
|
+
* - VCS / repo metadata
|
|
479
|
+
* - Package-manager caches and stores
|
|
480
|
+
* - JS/TS framework build & dev caches
|
|
481
|
+
* - Test, coverage, and reporter outputs
|
|
482
|
+
* - Python virtualenvs and bytecode caches
|
|
483
|
+
* - JVM build outputs
|
|
484
|
+
* - IDE / editor metadata
|
|
485
|
+
* - AI agent sandbox directories (Claude Code worktrees, Cursor, Codex, etc.)
|
|
486
|
+
*
|
|
487
|
+
* Consumers may extend or replace this set via {@link CodeIngestorOptions}
|
|
488
|
+
* or the project-level `ingest.skipDirs` / `ingest.additionalSkipDirs` config.
|
|
489
|
+
*/
|
|
490
|
+
declare const DEFAULT_SKIP_DIRS: ReadonlySet<string>;
|
|
491
|
+
/**
|
|
492
|
+
* Build an effective skip-dirs Set from optional caller overrides.
|
|
493
|
+
* - If `skipDirs` is provided, it replaces the defaults entirely.
|
|
494
|
+
* - If `additionalSkipDirs` is provided, it extends the defaults (or the override).
|
|
495
|
+
*/
|
|
496
|
+
declare function resolveSkipDirs(options?: {
|
|
497
|
+
skipDirs?: Iterable<string>;
|
|
498
|
+
additionalSkipDirs?: Iterable<string>;
|
|
499
|
+
}): ReadonlySet<string>;
|
|
500
|
+
|
|
397
501
|
type GitRunner = (rootDir: string, args: string[]) => Promise<string>;
|
|
398
502
|
/**
|
|
399
503
|
* Ingests git history into the graph, creating commit nodes,
|
|
@@ -451,6 +555,7 @@ declare class BusinessKnowledgeIngestor {
|
|
|
451
555
|
private readonly store;
|
|
452
556
|
constructor(store: GraphStore);
|
|
453
557
|
ingest(knowledgeDir: string): Promise<IngestResult>;
|
|
558
|
+
ingestSolutions(solutionsDir: string): Promise<IngestResult>;
|
|
454
559
|
private createNodes;
|
|
455
560
|
private parseAndAddNode;
|
|
456
561
|
private createEdges;
|
|
@@ -1866,4 +1971,4 @@ declare class CascadeSimulator {
|
|
|
1866
1971
|
|
|
1867
1972
|
declare const VERSION = "0.6.0";
|
|
1868
1973
|
|
|
1869
|
-
export { ALL_EXTRACTORS, type AggregateResult, type AnomalyDetectionOptions, type AnomalyReport, ApiPathExtractor, type ArticulationPoint, type AskGraphResult, type AssembledContext, Assembler, BusinessKnowledgeIngestor, CIConnector, CURRENT_SCHEMA_VERSION, type PackedEnvelope as CacheableEnvelope, type CascadeLayer, type CascadeNode, type CascadeResult, type CascadeSimulationOptions, CascadeSimulator, type ClassificationResult, CodeIngestor, CompositeProbabilityStrategy, type ConflictDetail, type ConflictPrediction, ConflictPredictor, type ConflictSeverity, type ConflictType, ConfluenceConnector, type ConnectorConfig, ContextQL, type ContextQLParams, type ContextQLResult, type Contradiction, ContradictionDetector, type ContradictionEntry, type ContradictionResult, type CoverageReport, CoverageScorer, D2Parser, DEFAULT_BLOCKLIST, DEFAULT_PATTERNS, DecisionIngestor, DesignConstraintAdapter, DesignIngestor, type DesignStrictness, type DesignViolation, type DetectedElement, type DiagramEntity, type DiagramFormatParser, type DiagramParseResult, DiagramParser, type DiagramRelationship, type DomainCoverage, type DomainCoverageScore, type DomainInferenceOptions, type DriftClassification, type DriftDetector, type DriftFinding, type DriftResult, EDGE_TYPES, type EdgeQuery, type EdgeType, EntityExtractor, EntityResolver, EnumConstantExtractor, type ExtractionCounts, type ExtractionRecord, ExtractionRunner, FigmaConnector, FusionLayer, type FusionResult, type GapEntry, type GapReport, 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, type GraphStabilityTier, GraphStore, type HttpClient, INTENTS, ImageAnalysisExtractor, type ImageAnalysisExtractorOptions, type AnalysisProvider as ImageAnalysisProvider, type ImageAnalysisResult, type ImpactGroups, type IndependenceCheckParams, type IndependenceResult, type IngestResult, type Intent, IntentClassifier, JiraConnector, KnowledgeDocMaterializer, KnowledgeIngestor, type KnowledgePipelineOptions, type KnowledgePipelineResult, KnowledgePipelineRunner, type KnowledgeSnapshot, type KnowledgeSnapshotEntry, KnowledgeStagingAggregator, type Language, type LinkResult, type LoadGraphResult, type MaterializeOptions, type MaterializeResult, type MaterializedDoc, MermaidParser, MiroConnector, NODE_STABILITY, NODE_TYPES, type NodeCategory, type NodeQuery, type NodeType, OBSERVABILITY_TYPES, type OverlapDetail, PackedSummaryCache, type PairResult, PlantUmlParser, type ProbabilityStrategy, type ProjectionSpec, type RequirementCoverage, RequirementIngestor, type ResolvedEntity, ResponseFormatter, type SignalExtractor, type SkippedEntry, SlackConnector, type SourceLocation, type StagedEntry, type StatisticalOutlier, StructuralDriftDetector, SyncManager, type SyncMetadata, type TaskDefinition, TaskIndependenceAnalyzer, TestDescriptionExtractor, TopologicalLinker, type TraceabilityOptions, type TraceabilityResult, type TracedFile, VERSION, ValidationRuleExtractor, type VectorSearchResult, VectorStore, askGraph, classifyNodeCategory, createExtractionRunner, detectLanguage, groupNodesByImpact, inferDomain, linkToCode, loadGraph, normalizeIntent, project, queryTraceability, saveGraph };
|
|
1974
|
+
export { ALL_EXTRACTORS, type AggregateResult, type AnomalyDetectionOptions, type AnomalyReport, ApiPathExtractor, type ArticulationPoint, type AskGraphResult, type AssembledContext, Assembler, BusinessKnowledgeIngestor, CIConnector, CURRENT_SCHEMA_VERSION, type PackedEnvelope as CacheableEnvelope, type CascadeLayer, type CascadeNode, type CascadeResult, type CascadeSimulationOptions, CascadeSimulator, type ClassificationResult, CodeIngestor, type CodeIngestorOptions, CompositeProbabilityStrategy, type ConflictDetail, type ConflictPrediction, ConflictPredictor, type ConflictSeverity, type ConflictType, ConfluenceConnector, type ConnectorConfig, ContextQL, type ContextQLParams, type ContextQLResult, type Contradiction, ContradictionDetector, type ContradictionEntry, type ContradictionResult, type CoverageReport, CoverageScorer, D2Parser, DEFAULT_BLOCKLIST, DEFAULT_PATTERNS, DEFAULT_SKIP_DIRS, DecisionIngestor, DesignConstraintAdapter, DesignIngestor, type DesignStrictness, type DesignViolation, type DetectedElement, type DiagramEntity, type DiagramFormatParser, type DiagramParseResult, DiagramParser, type DiagramRelationship, type DomainCoverage, type DomainCoverageScore, type DomainInferenceOptions, type DriftClassification, type DriftDetector, type DriftFinding, type DriftResult, EDGE_TYPES, type EdgeQuery, type EdgeType, EntityExtractor, EntityResolver, EnumConstantExtractor, type ExtractionCounts, type ExtractionRecord, ExtractionRunner, FigmaConnector, FusionLayer, type FusionResult, type GapEntry, type GapReport, 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, type GraphStabilityTier, GraphStore, type HttpClient, INTENTS, ImageAnalysisExtractor, type ImageAnalysisExtractorOptions, type AnalysisProvider as ImageAnalysisProvider, type ImageAnalysisResult, type ImpactGroups, type IndependenceCheckParams, type IndependenceResult, type IngestResult, type Intent, IntentClassifier, JiraConnector, KnowledgeDocMaterializer, KnowledgeIngestor, type KnowledgePipelineOptions, type KnowledgePipelineResult, KnowledgePipelineRunner, type KnowledgeSnapshot, type KnowledgeSnapshotEntry, KnowledgeStagingAggregator, type Language, type LinkResult, type LoadGraphResult, type LoadMetadataResult, type MaterializeOptions, type MaterializeResult, type MaterializedDoc, MermaidParser, MiroConnector, NODE_STABILITY, NODE_TYPES, type NodeCategory, type NodeQuery, type NodeType, OBSERVABILITY_TYPES, type OverlapDetail, PackedSummaryCache, type PairResult, PlantUmlParser, type ProbabilityStrategy, type ProjectionSpec, type RequirementCoverage, RequirementIngestor, type ResolvedEntity, ResponseFormatter, type SignalExtractor, type SkippedEntry, SlackConnector, type SourceLocation, type StagedEntry, type StatisticalOutlier, StructuralDriftDetector, SyncManager, type SyncMetadata, type TaskDefinition, TaskIndependenceAnalyzer, TestDescriptionExtractor, TopologicalLinker, type TraceabilityOptions, type TraceabilityResult, type TracedFile, VERSION, ValidationRuleExtractor, type VectorSearchResult, VectorStore, askGraph, classifyNodeCategory, createExtractionRunner, detectLanguage, groupNodesByImpact, inferDomain, linkToCode, loadGraph, loadGraphMetadata, normalizeIntent, project, queryTraceability, resolveSkipDirs, saveGraph };
|