@harness-engineering/graph 0.9.0 → 0.11.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 +107 -2
- package/dist/index.d.ts +107 -2
- package/dist/index.js +393 -39
- package/dist/index.mjs +396 -42
- package/package.json +3 -2
package/dist/index.d.mts
CHANGED
|
@@ -568,6 +568,22 @@ declare class BusinessKnowledgeIngestor {
|
|
|
568
568
|
constructor(store: GraphStore);
|
|
569
569
|
ingest(knowledgeDir: string): Promise<IngestResult>;
|
|
570
570
|
ingestSolutions(solutionsDir: string): Promise<IngestResult>;
|
|
571
|
+
/**
|
|
572
|
+
* Ingest the repo-root STRATEGY.md anchor as `business_fact` nodes — one per
|
|
573
|
+
* non-empty section. Soft-fails when the file is absent (returns empty result
|
|
574
|
+
* with no errors) so existing projects without a strategy doc keep working.
|
|
575
|
+
*
|
|
576
|
+
* Each emitted node carries `metadata.domain === 'strategy'` and
|
|
577
|
+
* `metadata.source === 'STRATEGY.md'`, making the strategy domain
|
|
578
|
+
* discoverable through the same filters as other business-knowledge nodes.
|
|
579
|
+
*/
|
|
580
|
+
ingestStrategy(strategyPath: string): Promise<IngestResult>;
|
|
581
|
+
/**
|
|
582
|
+
* Build a single STRATEGY.md `business_fact` node from a parsed section.
|
|
583
|
+
* Returns null when the section is unknown, empty, or carries unfilled
|
|
584
|
+
* template placeholder text — callers iterate and skip nulls.
|
|
585
|
+
*/
|
|
586
|
+
private buildStrategyNode;
|
|
571
587
|
private createNodes;
|
|
572
588
|
private parseAndAddNode;
|
|
573
589
|
private createEdges;
|
|
@@ -582,14 +598,51 @@ declare class BusinessKnowledgeIngestor {
|
|
|
582
598
|
* Parses YAML frontmatter with fields: number, title, date, status, tier,
|
|
583
599
|
* source, supersedes. Creates `decision` type graph nodes with `decided`
|
|
584
600
|
* edges to code nodes mentioned in the body.
|
|
601
|
+
*
|
|
602
|
+
* Also supports markdown-style ADRs written by `harness-architecture-advisor`
|
|
603
|
+
* at `docs/architecture/<topic>/ADR-<n>.md` (no YAML frontmatter — fields are
|
|
604
|
+
* `**Date:**`, `**Status:**`, `**Deciders:**` lines). See `ingestArchitecture`.
|
|
585
605
|
*/
|
|
586
606
|
declare class DecisionIngestor {
|
|
587
607
|
private readonly store;
|
|
588
608
|
constructor(store: GraphStore);
|
|
589
609
|
ingest(decisionsDir: string): Promise<IngestResult>;
|
|
610
|
+
/**
|
|
611
|
+
* Ingest ADRs written by `harness-architecture-advisor` from
|
|
612
|
+
* `docs/architecture/<topic>/ADR-<n>.md`. These files do not carry YAML
|
|
613
|
+
* frontmatter — the canonical format is:
|
|
614
|
+
*
|
|
615
|
+
* ```
|
|
616
|
+
* # ADR-<n>: <Title>
|
|
617
|
+
*
|
|
618
|
+
* **Date:** <date>
|
|
619
|
+
* **Status:** Accepted | Proposed | Superseded | Deprecated
|
|
620
|
+
* **Deciders:** <who>
|
|
621
|
+
* ```
|
|
622
|
+
*
|
|
623
|
+
* The first directory under `architectureDir` becomes `metadata.domain`
|
|
624
|
+
* (the "topic"), so projects whose only knowledge substrate is ADRs surface
|
|
625
|
+
* `architecture/<topic>` as a documented domain rather than reporting empty.
|
|
626
|
+
*
|
|
627
|
+
* Soft-fails when the directory is absent (the common case for projects that
|
|
628
|
+
* do not use the architecture-advisor convention).
|
|
629
|
+
*/
|
|
630
|
+
ingestArchitecture(architectureDir: string): Promise<IngestResult>;
|
|
631
|
+
/**
|
|
632
|
+
* Read, parse, and add a single architecture-advisor ADR. Returns the delta
|
|
633
|
+
* the caller should fold into the aggregate counts. Errors are appended to
|
|
634
|
+
* the shared `errors` array rather than thrown, matching the soft-fail
|
|
635
|
+
* contract of `ingest()`.
|
|
636
|
+
*/
|
|
637
|
+
private processArchitectureAdrFile;
|
|
590
638
|
private parseFrontmatter;
|
|
591
639
|
private linkToCode;
|
|
592
640
|
private findDecisionFiles;
|
|
641
|
+
/**
|
|
642
|
+
* Recursively find `ADR-*.md` files under `dir`. Skips default skip dirs
|
|
643
|
+
* (node_modules etc.) to keep the scan bounded on large repos.
|
|
644
|
+
*/
|
|
645
|
+
private findArchitectureAdrFiles;
|
|
593
646
|
}
|
|
594
647
|
|
|
595
648
|
declare class RequirementIngestor {
|
|
@@ -927,6 +980,12 @@ interface KnowledgePipelineResult {
|
|
|
927
980
|
readonly iterations: number;
|
|
928
981
|
readonly findings: DriftResult['summary'];
|
|
929
982
|
readonly extraction: ExtractionCounts;
|
|
983
|
+
/**
|
|
984
|
+
* Aggregated parse/skip errors from every ingestor invoked during phase 1.
|
|
985
|
+
* Surfaces frontmatter validation, malformed-markdown, and per-file read
|
|
986
|
+
* failures that would otherwise be silently dropped (issue #504 §1).
|
|
987
|
+
*/
|
|
988
|
+
readonly errors: readonly string[];
|
|
930
989
|
readonly gaps: GapReport;
|
|
931
990
|
readonly remediations: readonly string[];
|
|
932
991
|
readonly contradictions: ContradictionResult;
|
|
@@ -1778,6 +1837,28 @@ interface DesignViolation {
|
|
|
1778
1837
|
suggestion?: string;
|
|
1779
1838
|
}
|
|
1780
1839
|
type DesignStrictness = 'strict' | 'standard' | 'permissive';
|
|
1840
|
+
/**
|
|
1841
|
+
* Generic finding shape accepted by `recordFindings()` — covers ANAT-*
|
|
1842
|
+
* (audit-component-anatomy, design-pipeline #2) and CRAFT-*
|
|
1843
|
+
* (harness-design-craft, design-pipeline #6) namespaces. Skills convert
|
|
1844
|
+
* their internal finding types into this shape before recording.
|
|
1845
|
+
*/
|
|
1846
|
+
interface CraftFindingRecord {
|
|
1847
|
+
/** Finding code, e.g. "ANAT-D023", "CRAFT-C001", "CRAFT-P001" */
|
|
1848
|
+
code: string;
|
|
1849
|
+
/** Project-relative file path (becomes the `file` node id) */
|
|
1850
|
+
file: string;
|
|
1851
|
+
/** Line number, if known */
|
|
1852
|
+
line?: number;
|
|
1853
|
+
/** Human-readable message */
|
|
1854
|
+
message: string;
|
|
1855
|
+
/** Severity at emission time */
|
|
1856
|
+
severity: 'error' | 'warn' | 'info';
|
|
1857
|
+
/** Optional evidence snippet */
|
|
1858
|
+
evidence?: string;
|
|
1859
|
+
/** Optional run identifier so #4 verifier can detect fixpoint across runs */
|
|
1860
|
+
runId?: string;
|
|
1861
|
+
}
|
|
1781
1862
|
declare class DesignConstraintAdapter {
|
|
1782
1863
|
private readonly store;
|
|
1783
1864
|
constructor(store: GraphStore);
|
|
@@ -1785,6 +1866,30 @@ declare class DesignConstraintAdapter {
|
|
|
1785
1866
|
checkForHardcodedFonts(source: string, file: string, strictness?: DesignStrictness): DesignViolation[];
|
|
1786
1867
|
checkAll(source: string, file: string, strictness?: DesignStrictness): DesignViolation[];
|
|
1787
1868
|
private mapSeverity;
|
|
1869
|
+
/**
|
|
1870
|
+
* Record externally-computed craft findings (audit-component-anatomy,
|
|
1871
|
+
* harness-design-craft, etc.) as graph state. Idempotent — re-running on
|
|
1872
|
+
* the same findings produces no duplicate nodes or edges thanks to
|
|
1873
|
+
* GraphStore's keyed merge semantics.
|
|
1874
|
+
*
|
|
1875
|
+
* Each finding becomes:
|
|
1876
|
+
* • a `design_constraint` node keyed by finding code (created lazily
|
|
1877
|
+
* if absent; metadata merged on re-record so the most recent message
|
|
1878
|
+
* / severity wins)
|
|
1879
|
+
* • a `violates_design` edge from the source file (id = file path) to
|
|
1880
|
+
* the constraint node, with per-finding metadata (line, severity,
|
|
1881
|
+
* message, evidence, runId)
|
|
1882
|
+
*
|
|
1883
|
+
* The file node is NOT created here — it's assumed to already exist in
|
|
1884
|
+
* the graph from a prior ingest. If it does not, the edge will still be
|
|
1885
|
+
* created (graph stores edges by key, not by referential integrity) and
|
|
1886
|
+
* a subsequent ingest will populate the file node.
|
|
1887
|
+
*/
|
|
1888
|
+
recordFindings(findings: readonly CraftFindingRecord[]): {
|
|
1889
|
+
constraintsAdded: number;
|
|
1890
|
+
edgesAdded: number;
|
|
1891
|
+
};
|
|
1892
|
+
private labelForCode;
|
|
1788
1893
|
}
|
|
1789
1894
|
|
|
1790
1895
|
interface GraphImpactData {
|
|
@@ -1981,6 +2086,6 @@ declare class CascadeSimulator {
|
|
|
1981
2086
|
private buildResult;
|
|
1982
2087
|
}
|
|
1983
2088
|
|
|
1984
|
-
declare const VERSION = "0.
|
|
2089
|
+
declare const VERSION = "0.9.0";
|
|
1985
2090
|
|
|
1986
|
-
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, skipDirGlobs };
|
|
2091
|
+
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, type CraftFindingRecord, 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, skipDirGlobs };
|
package/dist/index.d.ts
CHANGED
|
@@ -568,6 +568,22 @@ declare class BusinessKnowledgeIngestor {
|
|
|
568
568
|
constructor(store: GraphStore);
|
|
569
569
|
ingest(knowledgeDir: string): Promise<IngestResult>;
|
|
570
570
|
ingestSolutions(solutionsDir: string): Promise<IngestResult>;
|
|
571
|
+
/**
|
|
572
|
+
* Ingest the repo-root STRATEGY.md anchor as `business_fact` nodes — one per
|
|
573
|
+
* non-empty section. Soft-fails when the file is absent (returns empty result
|
|
574
|
+
* with no errors) so existing projects without a strategy doc keep working.
|
|
575
|
+
*
|
|
576
|
+
* Each emitted node carries `metadata.domain === 'strategy'` and
|
|
577
|
+
* `metadata.source === 'STRATEGY.md'`, making the strategy domain
|
|
578
|
+
* discoverable through the same filters as other business-knowledge nodes.
|
|
579
|
+
*/
|
|
580
|
+
ingestStrategy(strategyPath: string): Promise<IngestResult>;
|
|
581
|
+
/**
|
|
582
|
+
* Build a single STRATEGY.md `business_fact` node from a parsed section.
|
|
583
|
+
* Returns null when the section is unknown, empty, or carries unfilled
|
|
584
|
+
* template placeholder text — callers iterate and skip nulls.
|
|
585
|
+
*/
|
|
586
|
+
private buildStrategyNode;
|
|
571
587
|
private createNodes;
|
|
572
588
|
private parseAndAddNode;
|
|
573
589
|
private createEdges;
|
|
@@ -582,14 +598,51 @@ declare class BusinessKnowledgeIngestor {
|
|
|
582
598
|
* Parses YAML frontmatter with fields: number, title, date, status, tier,
|
|
583
599
|
* source, supersedes. Creates `decision` type graph nodes with `decided`
|
|
584
600
|
* edges to code nodes mentioned in the body.
|
|
601
|
+
*
|
|
602
|
+
* Also supports markdown-style ADRs written by `harness-architecture-advisor`
|
|
603
|
+
* at `docs/architecture/<topic>/ADR-<n>.md` (no YAML frontmatter — fields are
|
|
604
|
+
* `**Date:**`, `**Status:**`, `**Deciders:**` lines). See `ingestArchitecture`.
|
|
585
605
|
*/
|
|
586
606
|
declare class DecisionIngestor {
|
|
587
607
|
private readonly store;
|
|
588
608
|
constructor(store: GraphStore);
|
|
589
609
|
ingest(decisionsDir: string): Promise<IngestResult>;
|
|
610
|
+
/**
|
|
611
|
+
* Ingest ADRs written by `harness-architecture-advisor` from
|
|
612
|
+
* `docs/architecture/<topic>/ADR-<n>.md`. These files do not carry YAML
|
|
613
|
+
* frontmatter — the canonical format is:
|
|
614
|
+
*
|
|
615
|
+
* ```
|
|
616
|
+
* # ADR-<n>: <Title>
|
|
617
|
+
*
|
|
618
|
+
* **Date:** <date>
|
|
619
|
+
* **Status:** Accepted | Proposed | Superseded | Deprecated
|
|
620
|
+
* **Deciders:** <who>
|
|
621
|
+
* ```
|
|
622
|
+
*
|
|
623
|
+
* The first directory under `architectureDir` becomes `metadata.domain`
|
|
624
|
+
* (the "topic"), so projects whose only knowledge substrate is ADRs surface
|
|
625
|
+
* `architecture/<topic>` as a documented domain rather than reporting empty.
|
|
626
|
+
*
|
|
627
|
+
* Soft-fails when the directory is absent (the common case for projects that
|
|
628
|
+
* do not use the architecture-advisor convention).
|
|
629
|
+
*/
|
|
630
|
+
ingestArchitecture(architectureDir: string): Promise<IngestResult>;
|
|
631
|
+
/**
|
|
632
|
+
* Read, parse, and add a single architecture-advisor ADR. Returns the delta
|
|
633
|
+
* the caller should fold into the aggregate counts. Errors are appended to
|
|
634
|
+
* the shared `errors` array rather than thrown, matching the soft-fail
|
|
635
|
+
* contract of `ingest()`.
|
|
636
|
+
*/
|
|
637
|
+
private processArchitectureAdrFile;
|
|
590
638
|
private parseFrontmatter;
|
|
591
639
|
private linkToCode;
|
|
592
640
|
private findDecisionFiles;
|
|
641
|
+
/**
|
|
642
|
+
* Recursively find `ADR-*.md` files under `dir`. Skips default skip dirs
|
|
643
|
+
* (node_modules etc.) to keep the scan bounded on large repos.
|
|
644
|
+
*/
|
|
645
|
+
private findArchitectureAdrFiles;
|
|
593
646
|
}
|
|
594
647
|
|
|
595
648
|
declare class RequirementIngestor {
|
|
@@ -927,6 +980,12 @@ interface KnowledgePipelineResult {
|
|
|
927
980
|
readonly iterations: number;
|
|
928
981
|
readonly findings: DriftResult['summary'];
|
|
929
982
|
readonly extraction: ExtractionCounts;
|
|
983
|
+
/**
|
|
984
|
+
* Aggregated parse/skip errors from every ingestor invoked during phase 1.
|
|
985
|
+
* Surfaces frontmatter validation, malformed-markdown, and per-file read
|
|
986
|
+
* failures that would otherwise be silently dropped (issue #504 §1).
|
|
987
|
+
*/
|
|
988
|
+
readonly errors: readonly string[];
|
|
930
989
|
readonly gaps: GapReport;
|
|
931
990
|
readonly remediations: readonly string[];
|
|
932
991
|
readonly contradictions: ContradictionResult;
|
|
@@ -1778,6 +1837,28 @@ interface DesignViolation {
|
|
|
1778
1837
|
suggestion?: string;
|
|
1779
1838
|
}
|
|
1780
1839
|
type DesignStrictness = 'strict' | 'standard' | 'permissive';
|
|
1840
|
+
/**
|
|
1841
|
+
* Generic finding shape accepted by `recordFindings()` — covers ANAT-*
|
|
1842
|
+
* (audit-component-anatomy, design-pipeline #2) and CRAFT-*
|
|
1843
|
+
* (harness-design-craft, design-pipeline #6) namespaces. Skills convert
|
|
1844
|
+
* their internal finding types into this shape before recording.
|
|
1845
|
+
*/
|
|
1846
|
+
interface CraftFindingRecord {
|
|
1847
|
+
/** Finding code, e.g. "ANAT-D023", "CRAFT-C001", "CRAFT-P001" */
|
|
1848
|
+
code: string;
|
|
1849
|
+
/** Project-relative file path (becomes the `file` node id) */
|
|
1850
|
+
file: string;
|
|
1851
|
+
/** Line number, if known */
|
|
1852
|
+
line?: number;
|
|
1853
|
+
/** Human-readable message */
|
|
1854
|
+
message: string;
|
|
1855
|
+
/** Severity at emission time */
|
|
1856
|
+
severity: 'error' | 'warn' | 'info';
|
|
1857
|
+
/** Optional evidence snippet */
|
|
1858
|
+
evidence?: string;
|
|
1859
|
+
/** Optional run identifier so #4 verifier can detect fixpoint across runs */
|
|
1860
|
+
runId?: string;
|
|
1861
|
+
}
|
|
1781
1862
|
declare class DesignConstraintAdapter {
|
|
1782
1863
|
private readonly store;
|
|
1783
1864
|
constructor(store: GraphStore);
|
|
@@ -1785,6 +1866,30 @@ declare class DesignConstraintAdapter {
|
|
|
1785
1866
|
checkForHardcodedFonts(source: string, file: string, strictness?: DesignStrictness): DesignViolation[];
|
|
1786
1867
|
checkAll(source: string, file: string, strictness?: DesignStrictness): DesignViolation[];
|
|
1787
1868
|
private mapSeverity;
|
|
1869
|
+
/**
|
|
1870
|
+
* Record externally-computed craft findings (audit-component-anatomy,
|
|
1871
|
+
* harness-design-craft, etc.) as graph state. Idempotent — re-running on
|
|
1872
|
+
* the same findings produces no duplicate nodes or edges thanks to
|
|
1873
|
+
* GraphStore's keyed merge semantics.
|
|
1874
|
+
*
|
|
1875
|
+
* Each finding becomes:
|
|
1876
|
+
* • a `design_constraint` node keyed by finding code (created lazily
|
|
1877
|
+
* if absent; metadata merged on re-record so the most recent message
|
|
1878
|
+
* / severity wins)
|
|
1879
|
+
* • a `violates_design` edge from the source file (id = file path) to
|
|
1880
|
+
* the constraint node, with per-finding metadata (line, severity,
|
|
1881
|
+
* message, evidence, runId)
|
|
1882
|
+
*
|
|
1883
|
+
* The file node is NOT created here — it's assumed to already exist in
|
|
1884
|
+
* the graph from a prior ingest. If it does not, the edge will still be
|
|
1885
|
+
* created (graph stores edges by key, not by referential integrity) and
|
|
1886
|
+
* a subsequent ingest will populate the file node.
|
|
1887
|
+
*/
|
|
1888
|
+
recordFindings(findings: readonly CraftFindingRecord[]): {
|
|
1889
|
+
constraintsAdded: number;
|
|
1890
|
+
edgesAdded: number;
|
|
1891
|
+
};
|
|
1892
|
+
private labelForCode;
|
|
1788
1893
|
}
|
|
1789
1894
|
|
|
1790
1895
|
interface GraphImpactData {
|
|
@@ -1981,6 +2086,6 @@ declare class CascadeSimulator {
|
|
|
1981
2086
|
private buildResult;
|
|
1982
2087
|
}
|
|
1983
2088
|
|
|
1984
|
-
declare const VERSION = "0.
|
|
2089
|
+
declare const VERSION = "0.9.0";
|
|
1985
2090
|
|
|
1986
|
-
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, skipDirGlobs };
|
|
2091
|
+
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, type CraftFindingRecord, 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, skipDirGlobs };
|