@harness-engineering/graph 0.5.0 → 0.6.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 +139 -14
- package/dist/index.d.ts +139 -14
- package/dist/index.js +1364 -704
- package/dist/index.mjs +1362 -704
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -252,7 +252,17 @@ interface SerializedGraph {
|
|
|
252
252
|
readonly edges: readonly GraphEdge[];
|
|
253
253
|
}
|
|
254
254
|
declare function saveGraph(dirPath: string, nodes: readonly GraphNode[], edges: readonly GraphEdge[]): Promise<void>;
|
|
255
|
-
|
|
255
|
+
type LoadGraphResult = {
|
|
256
|
+
status: 'loaded';
|
|
257
|
+
graph: SerializedGraph;
|
|
258
|
+
} | {
|
|
259
|
+
status: 'not_found';
|
|
260
|
+
} | {
|
|
261
|
+
status: 'schema_mismatch';
|
|
262
|
+
found: number;
|
|
263
|
+
expected: number;
|
|
264
|
+
};
|
|
265
|
+
declare function loadGraph(dirPath: string): Promise<LoadGraphResult>;
|
|
256
266
|
|
|
257
267
|
/**
|
|
258
268
|
* Minimal PackedEnvelope shape -- avoids circular dep on @harness-engineering/core.
|
|
@@ -449,6 +459,22 @@ declare class BusinessKnowledgeIngestor {
|
|
|
449
459
|
private findMarkdownFiles;
|
|
450
460
|
}
|
|
451
461
|
|
|
462
|
+
/**
|
|
463
|
+
* Ingests ADR files from docs/knowledge/decisions/ into the knowledge graph.
|
|
464
|
+
*
|
|
465
|
+
* Parses YAML frontmatter with fields: number, title, date, status, tier,
|
|
466
|
+
* source, supersedes. Creates `decision` type graph nodes with `decided`
|
|
467
|
+
* edges to code nodes mentioned in the body.
|
|
468
|
+
*/
|
|
469
|
+
declare class DecisionIngestor {
|
|
470
|
+
private readonly store;
|
|
471
|
+
constructor(store: GraphStore);
|
|
472
|
+
ingest(decisionsDir: string): Promise<IngestResult>;
|
|
473
|
+
private parseFrontmatter;
|
|
474
|
+
private linkToCode;
|
|
475
|
+
private findDecisionFiles;
|
|
476
|
+
}
|
|
477
|
+
|
|
452
478
|
declare class RequirementIngestor {
|
|
453
479
|
private readonly store;
|
|
454
480
|
constructor(store: GraphStore);
|
|
@@ -539,13 +565,25 @@ interface StagedEntry {
|
|
|
539
565
|
readonly contentHash: string;
|
|
540
566
|
readonly timestamp: string;
|
|
541
567
|
}
|
|
568
|
+
interface GapEntry {
|
|
569
|
+
readonly nodeId: string;
|
|
570
|
+
readonly name: string;
|
|
571
|
+
readonly nodeType: NodeType;
|
|
572
|
+
readonly source: string;
|
|
573
|
+
readonly hasContent: boolean;
|
|
574
|
+
}
|
|
542
575
|
interface DomainCoverage {
|
|
543
576
|
readonly domain: string;
|
|
544
577
|
readonly entryCount: number;
|
|
578
|
+
readonly extractedCount: number;
|
|
579
|
+
readonly gapCount: number;
|
|
580
|
+
readonly gapEntries: readonly GapEntry[];
|
|
545
581
|
}
|
|
546
582
|
interface GapReport {
|
|
547
583
|
readonly domains: readonly DomainCoverage[];
|
|
548
584
|
readonly totalEntries: number;
|
|
585
|
+
readonly totalExtracted: number;
|
|
586
|
+
readonly totalGaps: number;
|
|
549
587
|
readonly generatedAt: string;
|
|
550
588
|
}
|
|
551
589
|
interface AggregateResult {
|
|
@@ -555,7 +593,8 @@ declare class KnowledgeStagingAggregator {
|
|
|
555
593
|
private readonly projectDir;
|
|
556
594
|
constructor(projectDir: string);
|
|
557
595
|
aggregate(extractorResults: readonly StagedEntry[], linkerResults: readonly StagedEntry[], diagramResults: readonly StagedEntry[]): Promise<AggregateResult>;
|
|
558
|
-
|
|
596
|
+
private extractDocName;
|
|
597
|
+
generateGapReport(knowledgeDir: string, store?: GraphStore): Promise<GapReport>;
|
|
559
598
|
writeGapReport(report: GapReport): Promise<void>;
|
|
560
599
|
}
|
|
561
600
|
|
|
@@ -601,6 +640,12 @@ declare class ImageAnalysisExtractor {
|
|
|
601
640
|
readonly maxFileSizeBytes: number;
|
|
602
641
|
constructor(options: ImageAnalysisExtractorOptions);
|
|
603
642
|
analyze(store: GraphStore, imagePaths: readonly string[]): Promise<IngestResult>;
|
|
643
|
+
/** Analyze a single image and add annotation + concept nodes to the store. */
|
|
644
|
+
private processImage;
|
|
645
|
+
/** Link annotation to its source file node if it exists. Returns 1 if linked, 0 otherwise. */
|
|
646
|
+
private linkToFileNode;
|
|
647
|
+
/** Create a business_concept node for a design pattern and link it. Returns edges added. */
|
|
648
|
+
private addDesignPatternConcept;
|
|
604
649
|
}
|
|
605
650
|
|
|
606
651
|
type ConflictType = 'value_mismatch' | 'definition_conflict' | 'status_divergence' | 'temporal_conflict';
|
|
@@ -650,6 +695,48 @@ declare class CoverageScorer {
|
|
|
650
695
|
private domainFromPath;
|
|
651
696
|
}
|
|
652
697
|
|
|
698
|
+
/**
|
|
699
|
+
* Knowledge Document Materializer
|
|
700
|
+
*
|
|
701
|
+
* Takes GapEntry[] from the differential gap report and creates
|
|
702
|
+
* docs/knowledge/{domain}/*.md files from graph nodes.
|
|
703
|
+
* Frontmatter is compatible with BusinessKnowledgeIngestor's parseFrontmatter().
|
|
704
|
+
*/
|
|
705
|
+
|
|
706
|
+
interface MaterializeOptions {
|
|
707
|
+
readonly projectDir: string;
|
|
708
|
+
readonly dryRun: boolean;
|
|
709
|
+
readonly maxDocs?: number;
|
|
710
|
+
}
|
|
711
|
+
interface MaterializeResult {
|
|
712
|
+
readonly created: readonly MaterializedDoc[];
|
|
713
|
+
readonly skipped: readonly SkippedEntry[];
|
|
714
|
+
}
|
|
715
|
+
interface MaterializedDoc {
|
|
716
|
+
readonly filePath: string;
|
|
717
|
+
readonly nodeId: string;
|
|
718
|
+
readonly domain: string;
|
|
719
|
+
readonly name: string;
|
|
720
|
+
}
|
|
721
|
+
interface SkippedEntry {
|
|
722
|
+
readonly nodeId: string;
|
|
723
|
+
readonly name: string;
|
|
724
|
+
readonly reason: 'no_content' | 'no_domain' | 'already_documented' | 'dry_run' | 'cap_reached';
|
|
725
|
+
}
|
|
726
|
+
declare class KnowledgeDocMaterializer {
|
|
727
|
+
private readonly store;
|
|
728
|
+
constructor(store: GraphStore);
|
|
729
|
+
materialize(gapEntries: readonly GapEntry[], options: MaterializeOptions): Promise<MaterializeResult>;
|
|
730
|
+
private resolveEntry;
|
|
731
|
+
inferDomain(node: GraphNode): string | null;
|
|
732
|
+
generateFilename(name: string): string;
|
|
733
|
+
resolveCollision(dir: string, basename: string): Promise<string>;
|
|
734
|
+
formatDoc(node: GraphNode, domain: string): string;
|
|
735
|
+
/** Check if a doc with a matching title already exists in the domain directory. */
|
|
736
|
+
private hasExistingDoc;
|
|
737
|
+
mapNodeType(node: GraphNode): NodeType;
|
|
738
|
+
}
|
|
739
|
+
|
|
653
740
|
/**
|
|
654
741
|
* KnowledgePipelineRunner — 4-phase convergence loop for knowledge extraction,
|
|
655
742
|
* reconciliation, drift detection, and remediation.
|
|
@@ -677,6 +764,7 @@ interface ExtractionCounts {
|
|
|
677
764
|
readonly diagrams: number;
|
|
678
765
|
readonly linkerFacts: number;
|
|
679
766
|
readonly businessKnowledge: number;
|
|
767
|
+
readonly decisions: number;
|
|
680
768
|
readonly images: number;
|
|
681
769
|
}
|
|
682
770
|
interface KnowledgePipelineResult {
|
|
@@ -689,11 +777,16 @@ interface KnowledgePipelineResult {
|
|
|
689
777
|
readonly remediations: readonly string[];
|
|
690
778
|
readonly contradictions: ContradictionResult;
|
|
691
779
|
readonly coverage: CoverageReport;
|
|
780
|
+
readonly materialization?: MaterializeResult;
|
|
692
781
|
}
|
|
693
782
|
declare class KnowledgePipelineRunner {
|
|
694
783
|
private readonly store;
|
|
695
784
|
constructor(store: GraphStore);
|
|
696
785
|
run(options: KnowledgePipelineOptions): Promise<KnowledgePipelineResult>;
|
|
786
|
+
/** Run the remediation convergence loop; returns iteration count and accumulated materialization. */
|
|
787
|
+
private runRemediationLoop;
|
|
788
|
+
/** Assemble the final pipeline result. */
|
|
789
|
+
private buildResult;
|
|
697
790
|
private extract;
|
|
698
791
|
private buildSnapshot;
|
|
699
792
|
private reconcile;
|
|
@@ -705,12 +798,8 @@ declare class KnowledgePipelineRunner {
|
|
|
705
798
|
}
|
|
706
799
|
|
|
707
800
|
/**
|
|
708
|
-
*
|
|
709
|
-
*
|
|
710
|
-
* Extracts entities and relationships from diagram files (Mermaid, D2, PlantUML)
|
|
711
|
-
* and maps them to the knowledge graph.
|
|
801
|
+
* Shared types for diagram format parsers.
|
|
712
802
|
*/
|
|
713
|
-
|
|
714
803
|
interface DiagramEntity {
|
|
715
804
|
readonly id: string;
|
|
716
805
|
readonly label: string;
|
|
@@ -733,29 +822,59 @@ interface DiagramFormatParser {
|
|
|
733
822
|
canParse(content: string, ext: string): boolean;
|
|
734
823
|
parse(content: string, filePath: string): DiagramParseResult;
|
|
735
824
|
}
|
|
825
|
+
|
|
826
|
+
/**
|
|
827
|
+
* Mermaid diagram format parser.
|
|
828
|
+
*
|
|
829
|
+
* Handles .mmd and .mermaid files, supporting flowchart and sequence diagram types.
|
|
830
|
+
*/
|
|
831
|
+
|
|
736
832
|
declare class MermaidParser implements DiagramFormatParser {
|
|
737
833
|
canParse(_content: string, ext: string): boolean;
|
|
738
834
|
parse(content: string, _filePath: string): DiagramParseResult;
|
|
739
|
-
private detectDiagramType;
|
|
740
|
-
private parseFlowchart;
|
|
741
|
-
private isDecisionNode;
|
|
742
|
-
private parseSequence;
|
|
743
835
|
}
|
|
836
|
+
|
|
837
|
+
/**
|
|
838
|
+
* D2 diagram format parser.
|
|
839
|
+
*
|
|
840
|
+
* Handles .d2 files, extracting entities and connections from D2 architecture diagrams.
|
|
841
|
+
*/
|
|
842
|
+
|
|
744
843
|
declare class D2Parser implements DiagramFormatParser {
|
|
745
844
|
canParse(_content: string, ext: string): boolean;
|
|
746
845
|
parse(content: string, _filePath: string): DiagramParseResult;
|
|
747
846
|
}
|
|
847
|
+
|
|
848
|
+
/**
|
|
849
|
+
* PlantUML diagram format parser.
|
|
850
|
+
*
|
|
851
|
+
* Handles .puml and .plantuml files, supporting class and component diagram types.
|
|
852
|
+
*/
|
|
853
|
+
|
|
748
854
|
declare class PlantUmlParser implements DiagramFormatParser {
|
|
749
855
|
canParse(_content: string, ext: string): boolean;
|
|
750
856
|
parse(content: string, _filePath: string): DiagramParseResult;
|
|
751
|
-
private detectDiagramType;
|
|
752
857
|
}
|
|
858
|
+
|
|
859
|
+
/**
|
|
860
|
+
* Diagram-as-code parser orchestrator.
|
|
861
|
+
*
|
|
862
|
+
* Delegates to format-specific parsers (Mermaid, D2, PlantUML) and maps
|
|
863
|
+
* extracted entities/relationships to the knowledge graph.
|
|
864
|
+
*
|
|
865
|
+
* Format-specific implementations live in ./parsers/.
|
|
866
|
+
*/
|
|
867
|
+
|
|
753
868
|
declare class DiagramParser {
|
|
754
869
|
private readonly store;
|
|
755
870
|
private readonly parsers;
|
|
756
871
|
constructor(store: GraphStore);
|
|
757
872
|
parse(content: string, filePath: string): DiagramParseResult;
|
|
758
873
|
ingest(projectDir: string): Promise<IngestResult>;
|
|
874
|
+
/** Map diagram entities to business_concept graph nodes. */
|
|
875
|
+
private addEntityNodes;
|
|
876
|
+
/** Map diagram relationships to references graph edges. */
|
|
877
|
+
private addRelationshipEdges;
|
|
759
878
|
private findDiagramFiles;
|
|
760
879
|
}
|
|
761
880
|
|
|
@@ -852,6 +971,12 @@ declare class FigmaConnector implements GraphConnector {
|
|
|
852
971
|
constructor(httpClient?: HttpClient);
|
|
853
972
|
ingest(store: GraphStore, config: ConnectorConfig): Promise<IngestResult>;
|
|
854
973
|
private processFile;
|
|
974
|
+
private ingestStyles;
|
|
975
|
+
private processStyle;
|
|
976
|
+
private ingestComponents;
|
|
977
|
+
private processComponent;
|
|
978
|
+
private addComponentIntent;
|
|
979
|
+
private addComponentConstraint;
|
|
855
980
|
}
|
|
856
981
|
|
|
857
982
|
declare class MiroConnector implements GraphConnector {
|
|
@@ -1700,6 +1825,6 @@ declare class CascadeSimulator {
|
|
|
1700
1825
|
private buildResult;
|
|
1701
1826
|
}
|
|
1702
1827
|
|
|
1703
|
-
declare const VERSION = "0.
|
|
1828
|
+
declare const VERSION = "0.6.0";
|
|
1704
1829
|
|
|
1705
|
-
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, DesignConstraintAdapter, DesignIngestor, type DesignStrictness, type DesignViolation, type DetectedElement, type DiagramEntity, type DiagramFormatParser, type DiagramParseResult, DiagramParser, type DiagramRelationship, type DomainCoverage, type DomainCoverageScore, 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 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, KnowledgeIngestor, type KnowledgePipelineOptions, type KnowledgePipelineResult, KnowledgePipelineRunner, type KnowledgeSnapshot, type KnowledgeSnapshotEntry, KnowledgeStagingAggregator, type Language, type LinkResult, 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, 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, linkToCode, loadGraph, normalizeIntent, project, queryTraceability, saveGraph };
|
|
1830
|
+
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, DecisionIngestor, DesignConstraintAdapter, DesignIngestor, type DesignStrictness, type DesignViolation, type DetectedElement, type DiagramEntity, type DiagramFormatParser, type DiagramParseResult, DiagramParser, type DiagramRelationship, type DomainCoverage, type DomainCoverageScore, 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, linkToCode, loadGraph, normalizeIntent, project, queryTraceability, saveGraph };
|
package/dist/index.d.ts
CHANGED
|
@@ -252,7 +252,17 @@ interface SerializedGraph {
|
|
|
252
252
|
readonly edges: readonly GraphEdge[];
|
|
253
253
|
}
|
|
254
254
|
declare function saveGraph(dirPath: string, nodes: readonly GraphNode[], edges: readonly GraphEdge[]): Promise<void>;
|
|
255
|
-
|
|
255
|
+
type LoadGraphResult = {
|
|
256
|
+
status: 'loaded';
|
|
257
|
+
graph: SerializedGraph;
|
|
258
|
+
} | {
|
|
259
|
+
status: 'not_found';
|
|
260
|
+
} | {
|
|
261
|
+
status: 'schema_mismatch';
|
|
262
|
+
found: number;
|
|
263
|
+
expected: number;
|
|
264
|
+
};
|
|
265
|
+
declare function loadGraph(dirPath: string): Promise<LoadGraphResult>;
|
|
256
266
|
|
|
257
267
|
/**
|
|
258
268
|
* Minimal PackedEnvelope shape -- avoids circular dep on @harness-engineering/core.
|
|
@@ -449,6 +459,22 @@ declare class BusinessKnowledgeIngestor {
|
|
|
449
459
|
private findMarkdownFiles;
|
|
450
460
|
}
|
|
451
461
|
|
|
462
|
+
/**
|
|
463
|
+
* Ingests ADR files from docs/knowledge/decisions/ into the knowledge graph.
|
|
464
|
+
*
|
|
465
|
+
* Parses YAML frontmatter with fields: number, title, date, status, tier,
|
|
466
|
+
* source, supersedes. Creates `decision` type graph nodes with `decided`
|
|
467
|
+
* edges to code nodes mentioned in the body.
|
|
468
|
+
*/
|
|
469
|
+
declare class DecisionIngestor {
|
|
470
|
+
private readonly store;
|
|
471
|
+
constructor(store: GraphStore);
|
|
472
|
+
ingest(decisionsDir: string): Promise<IngestResult>;
|
|
473
|
+
private parseFrontmatter;
|
|
474
|
+
private linkToCode;
|
|
475
|
+
private findDecisionFiles;
|
|
476
|
+
}
|
|
477
|
+
|
|
452
478
|
declare class RequirementIngestor {
|
|
453
479
|
private readonly store;
|
|
454
480
|
constructor(store: GraphStore);
|
|
@@ -539,13 +565,25 @@ interface StagedEntry {
|
|
|
539
565
|
readonly contentHash: string;
|
|
540
566
|
readonly timestamp: string;
|
|
541
567
|
}
|
|
568
|
+
interface GapEntry {
|
|
569
|
+
readonly nodeId: string;
|
|
570
|
+
readonly name: string;
|
|
571
|
+
readonly nodeType: NodeType;
|
|
572
|
+
readonly source: string;
|
|
573
|
+
readonly hasContent: boolean;
|
|
574
|
+
}
|
|
542
575
|
interface DomainCoverage {
|
|
543
576
|
readonly domain: string;
|
|
544
577
|
readonly entryCount: number;
|
|
578
|
+
readonly extractedCount: number;
|
|
579
|
+
readonly gapCount: number;
|
|
580
|
+
readonly gapEntries: readonly GapEntry[];
|
|
545
581
|
}
|
|
546
582
|
interface GapReport {
|
|
547
583
|
readonly domains: readonly DomainCoverage[];
|
|
548
584
|
readonly totalEntries: number;
|
|
585
|
+
readonly totalExtracted: number;
|
|
586
|
+
readonly totalGaps: number;
|
|
549
587
|
readonly generatedAt: string;
|
|
550
588
|
}
|
|
551
589
|
interface AggregateResult {
|
|
@@ -555,7 +593,8 @@ declare class KnowledgeStagingAggregator {
|
|
|
555
593
|
private readonly projectDir;
|
|
556
594
|
constructor(projectDir: string);
|
|
557
595
|
aggregate(extractorResults: readonly StagedEntry[], linkerResults: readonly StagedEntry[], diagramResults: readonly StagedEntry[]): Promise<AggregateResult>;
|
|
558
|
-
|
|
596
|
+
private extractDocName;
|
|
597
|
+
generateGapReport(knowledgeDir: string, store?: GraphStore): Promise<GapReport>;
|
|
559
598
|
writeGapReport(report: GapReport): Promise<void>;
|
|
560
599
|
}
|
|
561
600
|
|
|
@@ -601,6 +640,12 @@ declare class ImageAnalysisExtractor {
|
|
|
601
640
|
readonly maxFileSizeBytes: number;
|
|
602
641
|
constructor(options: ImageAnalysisExtractorOptions);
|
|
603
642
|
analyze(store: GraphStore, imagePaths: readonly string[]): Promise<IngestResult>;
|
|
643
|
+
/** Analyze a single image and add annotation + concept nodes to the store. */
|
|
644
|
+
private processImage;
|
|
645
|
+
/** Link annotation to its source file node if it exists. Returns 1 if linked, 0 otherwise. */
|
|
646
|
+
private linkToFileNode;
|
|
647
|
+
/** Create a business_concept node for a design pattern and link it. Returns edges added. */
|
|
648
|
+
private addDesignPatternConcept;
|
|
604
649
|
}
|
|
605
650
|
|
|
606
651
|
type ConflictType = 'value_mismatch' | 'definition_conflict' | 'status_divergence' | 'temporal_conflict';
|
|
@@ -650,6 +695,48 @@ declare class CoverageScorer {
|
|
|
650
695
|
private domainFromPath;
|
|
651
696
|
}
|
|
652
697
|
|
|
698
|
+
/**
|
|
699
|
+
* Knowledge Document Materializer
|
|
700
|
+
*
|
|
701
|
+
* Takes GapEntry[] from the differential gap report and creates
|
|
702
|
+
* docs/knowledge/{domain}/*.md files from graph nodes.
|
|
703
|
+
* Frontmatter is compatible with BusinessKnowledgeIngestor's parseFrontmatter().
|
|
704
|
+
*/
|
|
705
|
+
|
|
706
|
+
interface MaterializeOptions {
|
|
707
|
+
readonly projectDir: string;
|
|
708
|
+
readonly dryRun: boolean;
|
|
709
|
+
readonly maxDocs?: number;
|
|
710
|
+
}
|
|
711
|
+
interface MaterializeResult {
|
|
712
|
+
readonly created: readonly MaterializedDoc[];
|
|
713
|
+
readonly skipped: readonly SkippedEntry[];
|
|
714
|
+
}
|
|
715
|
+
interface MaterializedDoc {
|
|
716
|
+
readonly filePath: string;
|
|
717
|
+
readonly nodeId: string;
|
|
718
|
+
readonly domain: string;
|
|
719
|
+
readonly name: string;
|
|
720
|
+
}
|
|
721
|
+
interface SkippedEntry {
|
|
722
|
+
readonly nodeId: string;
|
|
723
|
+
readonly name: string;
|
|
724
|
+
readonly reason: 'no_content' | 'no_domain' | 'already_documented' | 'dry_run' | 'cap_reached';
|
|
725
|
+
}
|
|
726
|
+
declare class KnowledgeDocMaterializer {
|
|
727
|
+
private readonly store;
|
|
728
|
+
constructor(store: GraphStore);
|
|
729
|
+
materialize(gapEntries: readonly GapEntry[], options: MaterializeOptions): Promise<MaterializeResult>;
|
|
730
|
+
private resolveEntry;
|
|
731
|
+
inferDomain(node: GraphNode): string | null;
|
|
732
|
+
generateFilename(name: string): string;
|
|
733
|
+
resolveCollision(dir: string, basename: string): Promise<string>;
|
|
734
|
+
formatDoc(node: GraphNode, domain: string): string;
|
|
735
|
+
/** Check if a doc with a matching title already exists in the domain directory. */
|
|
736
|
+
private hasExistingDoc;
|
|
737
|
+
mapNodeType(node: GraphNode): NodeType;
|
|
738
|
+
}
|
|
739
|
+
|
|
653
740
|
/**
|
|
654
741
|
* KnowledgePipelineRunner — 4-phase convergence loop for knowledge extraction,
|
|
655
742
|
* reconciliation, drift detection, and remediation.
|
|
@@ -677,6 +764,7 @@ interface ExtractionCounts {
|
|
|
677
764
|
readonly diagrams: number;
|
|
678
765
|
readonly linkerFacts: number;
|
|
679
766
|
readonly businessKnowledge: number;
|
|
767
|
+
readonly decisions: number;
|
|
680
768
|
readonly images: number;
|
|
681
769
|
}
|
|
682
770
|
interface KnowledgePipelineResult {
|
|
@@ -689,11 +777,16 @@ interface KnowledgePipelineResult {
|
|
|
689
777
|
readonly remediations: readonly string[];
|
|
690
778
|
readonly contradictions: ContradictionResult;
|
|
691
779
|
readonly coverage: CoverageReport;
|
|
780
|
+
readonly materialization?: MaterializeResult;
|
|
692
781
|
}
|
|
693
782
|
declare class KnowledgePipelineRunner {
|
|
694
783
|
private readonly store;
|
|
695
784
|
constructor(store: GraphStore);
|
|
696
785
|
run(options: KnowledgePipelineOptions): Promise<KnowledgePipelineResult>;
|
|
786
|
+
/** Run the remediation convergence loop; returns iteration count and accumulated materialization. */
|
|
787
|
+
private runRemediationLoop;
|
|
788
|
+
/** Assemble the final pipeline result. */
|
|
789
|
+
private buildResult;
|
|
697
790
|
private extract;
|
|
698
791
|
private buildSnapshot;
|
|
699
792
|
private reconcile;
|
|
@@ -705,12 +798,8 @@ declare class KnowledgePipelineRunner {
|
|
|
705
798
|
}
|
|
706
799
|
|
|
707
800
|
/**
|
|
708
|
-
*
|
|
709
|
-
*
|
|
710
|
-
* Extracts entities and relationships from diagram files (Mermaid, D2, PlantUML)
|
|
711
|
-
* and maps them to the knowledge graph.
|
|
801
|
+
* Shared types for diagram format parsers.
|
|
712
802
|
*/
|
|
713
|
-
|
|
714
803
|
interface DiagramEntity {
|
|
715
804
|
readonly id: string;
|
|
716
805
|
readonly label: string;
|
|
@@ -733,29 +822,59 @@ interface DiagramFormatParser {
|
|
|
733
822
|
canParse(content: string, ext: string): boolean;
|
|
734
823
|
parse(content: string, filePath: string): DiagramParseResult;
|
|
735
824
|
}
|
|
825
|
+
|
|
826
|
+
/**
|
|
827
|
+
* Mermaid diagram format parser.
|
|
828
|
+
*
|
|
829
|
+
* Handles .mmd and .mermaid files, supporting flowchart and sequence diagram types.
|
|
830
|
+
*/
|
|
831
|
+
|
|
736
832
|
declare class MermaidParser implements DiagramFormatParser {
|
|
737
833
|
canParse(_content: string, ext: string): boolean;
|
|
738
834
|
parse(content: string, _filePath: string): DiagramParseResult;
|
|
739
|
-
private detectDiagramType;
|
|
740
|
-
private parseFlowchart;
|
|
741
|
-
private isDecisionNode;
|
|
742
|
-
private parseSequence;
|
|
743
835
|
}
|
|
836
|
+
|
|
837
|
+
/**
|
|
838
|
+
* D2 diagram format parser.
|
|
839
|
+
*
|
|
840
|
+
* Handles .d2 files, extracting entities and connections from D2 architecture diagrams.
|
|
841
|
+
*/
|
|
842
|
+
|
|
744
843
|
declare class D2Parser implements DiagramFormatParser {
|
|
745
844
|
canParse(_content: string, ext: string): boolean;
|
|
746
845
|
parse(content: string, _filePath: string): DiagramParseResult;
|
|
747
846
|
}
|
|
847
|
+
|
|
848
|
+
/**
|
|
849
|
+
* PlantUML diagram format parser.
|
|
850
|
+
*
|
|
851
|
+
* Handles .puml and .plantuml files, supporting class and component diagram types.
|
|
852
|
+
*/
|
|
853
|
+
|
|
748
854
|
declare class PlantUmlParser implements DiagramFormatParser {
|
|
749
855
|
canParse(_content: string, ext: string): boolean;
|
|
750
856
|
parse(content: string, _filePath: string): DiagramParseResult;
|
|
751
|
-
private detectDiagramType;
|
|
752
857
|
}
|
|
858
|
+
|
|
859
|
+
/**
|
|
860
|
+
* Diagram-as-code parser orchestrator.
|
|
861
|
+
*
|
|
862
|
+
* Delegates to format-specific parsers (Mermaid, D2, PlantUML) and maps
|
|
863
|
+
* extracted entities/relationships to the knowledge graph.
|
|
864
|
+
*
|
|
865
|
+
* Format-specific implementations live in ./parsers/.
|
|
866
|
+
*/
|
|
867
|
+
|
|
753
868
|
declare class DiagramParser {
|
|
754
869
|
private readonly store;
|
|
755
870
|
private readonly parsers;
|
|
756
871
|
constructor(store: GraphStore);
|
|
757
872
|
parse(content: string, filePath: string): DiagramParseResult;
|
|
758
873
|
ingest(projectDir: string): Promise<IngestResult>;
|
|
874
|
+
/** Map diagram entities to business_concept graph nodes. */
|
|
875
|
+
private addEntityNodes;
|
|
876
|
+
/** Map diagram relationships to references graph edges. */
|
|
877
|
+
private addRelationshipEdges;
|
|
759
878
|
private findDiagramFiles;
|
|
760
879
|
}
|
|
761
880
|
|
|
@@ -852,6 +971,12 @@ declare class FigmaConnector implements GraphConnector {
|
|
|
852
971
|
constructor(httpClient?: HttpClient);
|
|
853
972
|
ingest(store: GraphStore, config: ConnectorConfig): Promise<IngestResult>;
|
|
854
973
|
private processFile;
|
|
974
|
+
private ingestStyles;
|
|
975
|
+
private processStyle;
|
|
976
|
+
private ingestComponents;
|
|
977
|
+
private processComponent;
|
|
978
|
+
private addComponentIntent;
|
|
979
|
+
private addComponentConstraint;
|
|
855
980
|
}
|
|
856
981
|
|
|
857
982
|
declare class MiroConnector implements GraphConnector {
|
|
@@ -1700,6 +1825,6 @@ declare class CascadeSimulator {
|
|
|
1700
1825
|
private buildResult;
|
|
1701
1826
|
}
|
|
1702
1827
|
|
|
1703
|
-
declare const VERSION = "0.
|
|
1828
|
+
declare const VERSION = "0.6.0";
|
|
1704
1829
|
|
|
1705
|
-
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, DesignConstraintAdapter, DesignIngestor, type DesignStrictness, type DesignViolation, type DetectedElement, type DiagramEntity, type DiagramFormatParser, type DiagramParseResult, DiagramParser, type DiagramRelationship, type DomainCoverage, type DomainCoverageScore, 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 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, KnowledgeIngestor, type KnowledgePipelineOptions, type KnowledgePipelineResult, KnowledgePipelineRunner, type KnowledgeSnapshot, type KnowledgeSnapshotEntry, KnowledgeStagingAggregator, type Language, type LinkResult, 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, 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, linkToCode, loadGraph, normalizeIntent, project, queryTraceability, saveGraph };
|
|
1830
|
+
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, DecisionIngestor, DesignConstraintAdapter, DesignIngestor, type DesignStrictness, type DesignViolation, type DetectedElement, type DiagramEntity, type DiagramFormatParser, type DiagramParseResult, DiagramParser, type DiagramRelationship, type DomainCoverage, type DomainCoverageScore, 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, linkToCode, loadGraph, normalizeIntent, project, queryTraceability, saveGraph };
|