api-tests-coverage 1.0.12 → 1.0.14
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/dashboard/dist/assets/_basePickBy-CErN2e4K.js +1 -0
- package/dist/dashboard/dist/assets/_baseUniq-DzHorfx6.js +1 -0
- package/dist/dashboard/dist/assets/arc-g03p1JXB.js +1 -0
- package/dist/dashboard/dist/assets/architectureDiagram-VXUJARFQ-CLCqS7Lv.js +36 -0
- package/dist/dashboard/dist/assets/blockDiagram-VD42YOAC-V4vxrfzX.js +122 -0
- package/dist/dashboard/dist/assets/c4Diagram-YG6GDRKO-Bs4R4b6P.js +10 -0
- package/dist/dashboard/dist/assets/channel-BSnIwwuG.js +1 -0
- package/dist/dashboard/dist/assets/chunk-4BX2VUAB-oleArqPu.js +1 -0
- package/dist/dashboard/dist/assets/chunk-55IACEB6-BIFhHB94.js +1 -0
- package/dist/dashboard/dist/assets/chunk-B4BG7PRW-BChq1Wly.js +165 -0
- package/dist/dashboard/dist/assets/chunk-DI55MBZ5-D7eiRvhB.js +220 -0
- package/dist/dashboard/dist/assets/chunk-FMBD7UC4-BgEzYy_c.js +15 -0
- package/dist/dashboard/dist/assets/chunk-QN33PNHL-BNX7uRa_.js +1 -0
- package/dist/dashboard/dist/assets/chunk-QZHKN3VN-mq-zucvn.js +1 -0
- package/dist/dashboard/dist/assets/chunk-TZMSLE5B-DGTVcqTS.js +1 -0
- package/dist/dashboard/dist/assets/classDiagram-2ON5EDUG-Be0F7AG8.js +1 -0
- package/dist/dashboard/dist/assets/classDiagram-v2-WZHVMYZB-Be0F7AG8.js +1 -0
- package/dist/dashboard/dist/assets/clone-B5PF81Z3.js +1 -0
- package/dist/dashboard/dist/assets/cose-bilkent-S5V4N54A-xVw-THr_.js +1 -0
- package/dist/dashboard/dist/assets/dagre-6UL2VRFP-Bjadb8g_.js +4 -0
- package/dist/dashboard/dist/assets/diagram-PSM6KHXK-BPFtplp4.js +24 -0
- package/dist/dashboard/dist/assets/diagram-QEK2KX5R-CYxueP7U.js +43 -0
- package/dist/dashboard/dist/assets/diagram-S2PKOQOG-CRUXUQeh.js +24 -0
- package/dist/dashboard/dist/assets/erDiagram-Q2GNP2WA-DvI8ycM6.js +60 -0
- package/dist/dashboard/dist/assets/flowDiagram-NV44I4VS-BAHshMEg.js +162 -0
- package/dist/dashboard/dist/assets/ganttDiagram-JELNMOA3-BS4JnN-M.js +267 -0
- package/dist/dashboard/dist/assets/gitGraphDiagram-V2S2FVAM-Uz3nRdju.js +65 -0
- package/dist/dashboard/dist/assets/graph-Cwn7jgQS.js +1 -0
- package/dist/dashboard/dist/assets/index-D3_88Gr5.js +777 -0
- package/dist/dashboard/dist/assets/index-D_begBP0.css +1 -0
- package/dist/dashboard/dist/assets/infoDiagram-HS3SLOUP-HLwGZBHJ.js +2 -0
- package/dist/dashboard/dist/assets/journeyDiagram-XKPGCS4Q-CFgbI9OH.js +139 -0
- package/dist/dashboard/dist/assets/kanban-definition-3W4ZIXB7-D3u5Ov-5.js +89 -0
- package/dist/dashboard/dist/assets/layout-DgtRACDS.js +1 -0
- package/dist/dashboard/dist/assets/mindmap-definition-VGOIOE7T-BJ5xCmsL.js +68 -0
- package/dist/dashboard/dist/assets/pieDiagram-ADFJNKIX-BIOVbZG_.js +30 -0
- package/dist/dashboard/dist/assets/quadrantDiagram-AYHSOK5B-Crgu5WqK.js +7 -0
- package/dist/dashboard/dist/assets/requirementDiagram-UZGBJVZJ-ClNSNeYe.js +64 -0
- package/dist/dashboard/dist/assets/sankeyDiagram-TZEHDZUN-VcdyPlVE.js +10 -0
- package/dist/dashboard/dist/assets/sequenceDiagram-WL72ISMW-97qjzqIO.js +145 -0
- package/dist/dashboard/dist/assets/stateDiagram-FKZM4ZOC-BWqoDymf.js +1 -0
- package/dist/dashboard/dist/assets/stateDiagram-v2-4FDKWEC3-K_qkvHaB.js +1 -0
- package/dist/dashboard/dist/assets/timeline-definition-IT6M3QCI-DR6HNny6.js +61 -0
- package/dist/dashboard/dist/assets/treemap-GDKQZRPO-MpQr6tee.js +162 -0
- package/dist/dashboard/dist/assets/xychartDiagram-PRI3JC2R-bS40I4IT.js +7 -0
- package/dist/dashboard/dist/index.html +2 -2
- package/dist/src/ast/astAnalysisOrchestrator.d.ts +28 -0
- package/dist/src/ast/astAnalysisOrchestrator.d.ts.map +1 -1
- package/dist/src/ast/astAnalysisOrchestrator.js +97 -27
- package/dist/src/languages/javascript/httpInteractionExtractor.js +10 -4
- package/dist/src/pipeline/confidence.d.ts +70 -0
- package/dist/src/pipeline/confidence.d.ts.map +1 -0
- package/dist/src/pipeline/confidence.js +198 -0
- package/dist/src/pipeline/graph.d.ts +58 -0
- package/dist/src/pipeline/graph.d.ts.map +1 -0
- package/dist/src/pipeline/graph.js +199 -0
- package/dist/src/pipeline/index.d.ts +24 -0
- package/dist/src/pipeline/index.d.ts.map +1 -0
- package/dist/src/pipeline/index.js +41 -0
- package/dist/src/pipeline/orchestrator.d.ts +42 -0
- package/dist/src/pipeline/orchestrator.d.ts.map +1 -0
- package/dist/src/pipeline/orchestrator.js +115 -0
- package/dist/src/pipeline/stageInterface.d.ts +45 -0
- package/dist/src/pipeline/stageInterface.d.ts.map +1 -0
- package/dist/src/pipeline/stageInterface.js +17 -0
- package/dist/src/pipeline/stages/ast/abstractLayerTraversal.d.ts +38 -0
- package/dist/src/pipeline/stages/ast/abstractLayerTraversal.d.ts.map +1 -0
- package/dist/src/pipeline/stages/ast/abstractLayerTraversal.js +203 -0
- package/dist/src/pipeline/stages/ast/astStage.d.ts +19 -0
- package/dist/src/pipeline/stages/ast/astStage.d.ts.map +1 -0
- package/dist/src/pipeline/stages/ast/astStage.js +238 -0
- package/dist/src/pipeline/stages/ast/crossFileResolver.d.ts +23 -0
- package/dist/src/pipeline/stages/ast/crossFileResolver.d.ts.map +1 -0
- package/dist/src/pipeline/stages/ast/crossFileResolver.js +183 -0
- package/dist/src/pipeline/stages/ast/graphBuilder.d.ts +15 -0
- package/dist/src/pipeline/stages/ast/graphBuilder.d.ts.map +1 -0
- package/dist/src/pipeline/stages/ast/graphBuilder.js +268 -0
- package/dist/src/pipeline/stages/ast/importResolver.d.ts +22 -0
- package/dist/src/pipeline/stages/ast/importResolver.d.ts.map +1 -0
- package/dist/src/pipeline/stages/ast/importResolver.js +186 -0
- package/dist/src/pipeline/stages/ast/types.d.ts +85 -0
- package/dist/src/pipeline/stages/ast/types.d.ts.map +1 -0
- package/dist/src/pipeline/stages/ast/types.js +5 -0
- package/dist/src/pipeline/stages/dast/conflictEmitter.d.ts +25 -0
- package/dist/src/pipeline/stages/dast/conflictEmitter.d.ts.map +1 -0
- package/dist/src/pipeline/stages/dast/conflictEmitter.js +90 -0
- package/dist/src/pipeline/stages/dast/dastStage.d.ts +17 -0
- package/dist/src/pipeline/stages/dast/dastStage.d.ts.map +1 -0
- package/dist/src/pipeline/stages/dast/dastStage.js +203 -0
- package/dist/src/pipeline/stages/dast/types.d.ts +49 -0
- package/dist/src/pipeline/stages/dast/types.d.ts.map +1 -0
- package/dist/src/pipeline/stages/dast/types.js +9 -0
- package/dist/src/pipeline/stages/iast/iastStage.d.ts +17 -0
- package/dist/src/pipeline/stages/iast/iastStage.d.ts.map +1 -0
- package/dist/src/pipeline/stages/iast/iastStage.js +191 -0
- package/dist/src/pipeline/stages/iast/types.d.ts +48 -0
- package/dist/src/pipeline/stages/iast/types.d.ts.map +1 -0
- package/dist/src/pipeline/stages/iast/types.js +8 -0
- package/dist/src/pipeline/stages/merge/conflictDetector.d.ts +17 -0
- package/dist/src/pipeline/stages/merge/conflictDetector.d.ts.map +1 -0
- package/dist/src/pipeline/stages/merge/conflictDetector.js +60 -0
- package/dist/src/pipeline/stages/merge/coverageMappingBuilder.d.ts +15 -0
- package/dist/src/pipeline/stages/merge/coverageMappingBuilder.d.ts.map +1 -0
- package/dist/src/pipeline/stages/merge/coverageMappingBuilder.js +141 -0
- package/dist/src/pipeline/stages/merge/mergeRules.d.ts +39 -0
- package/dist/src/pipeline/stages/merge/mergeRules.d.ts.map +1 -0
- package/dist/src/pipeline/stages/merge/mergeRules.js +90 -0
- package/dist/src/pipeline/stages/merge/mergeStage.d.ts +20 -0
- package/dist/src/pipeline/stages/merge/mergeStage.d.ts.map +1 -0
- package/dist/src/pipeline/stages/merge/mergeStage.js +145 -0
- package/dist/src/pipeline/stages/merge/summaryComputer.d.ts +11 -0
- package/dist/src/pipeline/stages/merge/summaryComputer.d.ts.map +1 -0
- package/dist/src/pipeline/stages/merge/summaryComputer.js +46 -0
- package/dist/src/pipeline/stages/sca/ciDetector.d.ts +15 -0
- package/dist/src/pipeline/stages/sca/ciDetector.d.ts.map +1 -0
- package/dist/src/pipeline/stages/sca/ciDetector.js +87 -0
- package/dist/src/pipeline/stages/sca/dependencyClassification.d.ts +31 -0
- package/dist/src/pipeline/stages/sca/dependencyClassification.d.ts.map +1 -0
- package/dist/src/pipeline/stages/sca/dependencyClassification.js +296 -0
- package/dist/src/pipeline/stages/sca/dependencyDetector.d.ts +25 -0
- package/dist/src/pipeline/stages/sca/dependencyDetector.d.ts.map +1 -0
- package/dist/src/pipeline/stages/sca/dependencyDetector.js +416 -0
- package/dist/src/pipeline/stages/sca/scaStage.d.ts +21 -0
- package/dist/src/pipeline/stages/sca/scaStage.d.ts.map +1 -0
- package/dist/src/pipeline/stages/sca/scaStage.js +208 -0
- package/dist/src/pipeline/stages/sca/types.d.ts +61 -0
- package/dist/src/pipeline/stages/sca/types.d.ts.map +1 -0
- package/dist/src/pipeline/stages/sca/types.js +9 -0
- package/dist/src/pipeline/stages/tia/mockBoundaryDetector.d.ts +19 -0
- package/dist/src/pipeline/stages/tia/mockBoundaryDetector.d.ts.map +1 -0
- package/dist/src/pipeline/stages/tia/mockBoundaryDetector.js +118 -0
- package/dist/src/pipeline/stages/tia/parameterizedTestExpander.d.ts +20 -0
- package/dist/src/pipeline/stages/tia/parameterizedTestExpander.d.ts.map +1 -0
- package/dist/src/pipeline/stages/tia/parameterizedTestExpander.js +238 -0
- package/dist/src/pipeline/stages/tia/testEndpointMapper.d.ts +22 -0
- package/dist/src/pipeline/stages/tia/testEndpointMapper.d.ts.map +1 -0
- package/dist/src/pipeline/stages/tia/testEndpointMapper.js +134 -0
- package/dist/src/pipeline/stages/tia/testLayerClassifier.d.ts +16 -0
- package/dist/src/pipeline/stages/tia/testLayerClassifier.d.ts.map +1 -0
- package/dist/src/pipeline/stages/tia/testLayerClassifier.js +191 -0
- package/dist/src/pipeline/stages/tia/tiaStage.d.ts +20 -0
- package/dist/src/pipeline/stages/tia/tiaStage.d.ts.map +1 -0
- package/dist/src/pipeline/stages/tia/tiaStage.js +215 -0
- package/dist/src/pipeline/stages/tia/types.d.ts +52 -0
- package/dist/src/pipeline/stages/tia/types.d.ts.map +1 -0
- package/dist/src/pipeline/stages/tia/types.js +5 -0
- package/dist/src/pipeline/types.d.ts +128 -0
- package/dist/src/pipeline/types.d.ts.map +1 -0
- package/dist/src/pipeline/types.js +9 -0
- package/package.json +1 -1
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Coverage Knowledge Graph — the central data structure for the pipeline.
|
|
3
|
+
*
|
|
4
|
+
* Stores typed nodes and edges accumulated across all 6 pipeline stages.
|
|
5
|
+
* Provides lookup, traversal, merge, and serialization operations.
|
|
6
|
+
*/
|
|
7
|
+
import type { GraphNode, GraphEdge, GraphNodeType, GraphEdgeType, ConflictNode, StageName } from './types';
|
|
8
|
+
export declare class CoverageKnowledgeGraph {
|
|
9
|
+
private nodes;
|
|
10
|
+
private edges;
|
|
11
|
+
addNode(node: GraphNode): void;
|
|
12
|
+
getNode(id: string): GraphNode | undefined;
|
|
13
|
+
hasNode(id: string): boolean;
|
|
14
|
+
removeNode(id: string): boolean;
|
|
15
|
+
getNodesByType(type: GraphNodeType): GraphNode[];
|
|
16
|
+
getNodesByStage(stage: StageName): GraphNode[];
|
|
17
|
+
getAllNodes(): GraphNode[];
|
|
18
|
+
get nodeCount(): number;
|
|
19
|
+
addEdge(edge: GraphEdge): void;
|
|
20
|
+
getEdge(id: string): GraphEdge | undefined;
|
|
21
|
+
hasEdge(id: string): boolean;
|
|
22
|
+
removeEdge(id: string): boolean;
|
|
23
|
+
/** Get all edges originating from a given node. */
|
|
24
|
+
getEdgesFrom(nodeId: string): GraphEdge[];
|
|
25
|
+
/** Get all edges pointing to a given node. */
|
|
26
|
+
getEdgesTo(nodeId: string): GraphEdge[];
|
|
27
|
+
/** Get all edges between two specific nodes (in either direction). */
|
|
28
|
+
getEdgesBetween(nodeIdA: string, nodeIdB: string): GraphEdge[];
|
|
29
|
+
/** Get all edges of a specific type. */
|
|
30
|
+
getEdgesByType(type: GraphEdgeType): GraphEdge[];
|
|
31
|
+
getAllEdges(): GraphEdge[];
|
|
32
|
+
get edgeCount(): number;
|
|
33
|
+
/**
|
|
34
|
+
* Get all nodes reachable from `startId` by following edges of the given types.
|
|
35
|
+
* BFS traversal, returns nodes in visit order. Cycle-safe.
|
|
36
|
+
*/
|
|
37
|
+
getReachableNodes(startId: string, edgeTypes?: GraphEdgeType[]): GraphNode[];
|
|
38
|
+
/**
|
|
39
|
+
* Check whether a path from `startId` to `endId` passes through any node
|
|
40
|
+
* of the given type. Used by confidence scoring to detect mock boundaries.
|
|
41
|
+
*/
|
|
42
|
+
hasNodeTypeOnPath(startId: string, endId: string, nodeType: GraphNodeType): boolean;
|
|
43
|
+
/**
|
|
44
|
+
* Merge another graph into this one. Returns conflicts for any nodes
|
|
45
|
+
* that exist in both graphs with different types (RULE: stage-disagreement).
|
|
46
|
+
*/
|
|
47
|
+
merge(other: CoverageKnowledgeGraph): ConflictNode[];
|
|
48
|
+
toSerializable(): {
|
|
49
|
+
nodes: GraphNode[];
|
|
50
|
+
edges: GraphEdge[];
|
|
51
|
+
};
|
|
52
|
+
static fromSerializable(data: {
|
|
53
|
+
nodes: GraphNode[];
|
|
54
|
+
edges: GraphEdge[];
|
|
55
|
+
}): CoverageKnowledgeGraph;
|
|
56
|
+
clear(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,CAAC,IAAI,EAAE,aAAa,GAAG,SAAS,EAAE;IAIhD,WAAW,IAAI,SAAS,EAAE;IAI1B,IAAI,SAAS,IAAI,MAAM,CAEtB;IAID;;;OAGG;IACH,iBAAiB,CAAC,OAAO,EAAE,MAAM,EAAE,SAAS,CAAC,EAAE,aAAa,EAAE,GAAG,SAAS,EAAE;IA4B5E;;;OAGG;IACH,iBAAiB,CACf,OAAO,EAAE,MAAM,EACf,KAAK,EAAE,MAAM,EACb,QAAQ,EAAE,aAAa,GACtB,OAAO;IAiCV;;;OAGG;IACH,KAAK,CAAC,KAAK,EAAE,sBAAsB,GAAG,YAAY,EAAE;IAwCpD,cAAc,IAAI;QAAE,KAAK,EAAE,SAAS,EAAE,CAAC;QAAC,KAAK,EAAE,SAAS,EAAE,CAAA;KAAE;IAO5D,MAAM,CAAC,gBAAgB,CAAC,IAAI,EAAE;QAAE,KAAK,EAAE,SAAS,EAAE,CAAC;QAAC,KAAK,EAAE,SAAS,EAAE,CAAA;KAAE,GAAG,sBAAsB;IAajG,KAAK,IAAI,IAAI;CAId"}
|
|
@@ -0,0 +1,199 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Coverage Knowledge Graph — the central data structure for the pipeline.
|
|
4
|
+
*
|
|
5
|
+
* Stores typed nodes and edges accumulated across all 6 pipeline stages.
|
|
6
|
+
* Provides lookup, traversal, merge, and serialization operations.
|
|
7
|
+
*/
|
|
8
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
+
exports.CoverageKnowledgeGraph = void 0;
|
|
10
|
+
class CoverageKnowledgeGraph {
|
|
11
|
+
constructor() {
|
|
12
|
+
this.nodes = new Map();
|
|
13
|
+
this.edges = new Map();
|
|
14
|
+
}
|
|
15
|
+
// ─── Node operations ────────────────────────────────────────────────
|
|
16
|
+
addNode(node) {
|
|
17
|
+
this.nodes.set(node.id, node);
|
|
18
|
+
}
|
|
19
|
+
getNode(id) {
|
|
20
|
+
return this.nodes.get(id);
|
|
21
|
+
}
|
|
22
|
+
hasNode(id) {
|
|
23
|
+
return this.nodes.has(id);
|
|
24
|
+
}
|
|
25
|
+
removeNode(id) {
|
|
26
|
+
return this.nodes.delete(id);
|
|
27
|
+
}
|
|
28
|
+
getNodesByType(type) {
|
|
29
|
+
return Array.from(this.nodes.values()).filter((n) => n.type === type);
|
|
30
|
+
}
|
|
31
|
+
getNodesByStage(stage) {
|
|
32
|
+
return Array.from(this.nodes.values()).filter((n) => n.sourceStage === stage);
|
|
33
|
+
}
|
|
34
|
+
getAllNodes() {
|
|
35
|
+
return Array.from(this.nodes.values());
|
|
36
|
+
}
|
|
37
|
+
get nodeCount() {
|
|
38
|
+
return this.nodes.size;
|
|
39
|
+
}
|
|
40
|
+
// ─── Edge operations ────────────────────────────────────────────────
|
|
41
|
+
addEdge(edge) {
|
|
42
|
+
this.edges.set(edge.id, edge);
|
|
43
|
+
}
|
|
44
|
+
getEdge(id) {
|
|
45
|
+
return this.edges.get(id);
|
|
46
|
+
}
|
|
47
|
+
hasEdge(id) {
|
|
48
|
+
return this.edges.has(id);
|
|
49
|
+
}
|
|
50
|
+
removeEdge(id) {
|
|
51
|
+
return this.edges.delete(id);
|
|
52
|
+
}
|
|
53
|
+
/** Get all edges originating from a given node. */
|
|
54
|
+
getEdgesFrom(nodeId) {
|
|
55
|
+
return Array.from(this.edges.values()).filter((e) => e.sourceNodeId === nodeId);
|
|
56
|
+
}
|
|
57
|
+
/** Get all edges pointing to a given node. */
|
|
58
|
+
getEdgesTo(nodeId) {
|
|
59
|
+
return Array.from(this.edges.values()).filter((e) => e.targetNodeId === nodeId);
|
|
60
|
+
}
|
|
61
|
+
/** Get all edges between two specific nodes (in either direction). */
|
|
62
|
+
getEdgesBetween(nodeIdA, nodeIdB) {
|
|
63
|
+
return Array.from(this.edges.values()).filter((e) => (e.sourceNodeId === nodeIdA && e.targetNodeId === nodeIdB) ||
|
|
64
|
+
(e.sourceNodeId === nodeIdB && e.targetNodeId === nodeIdA));
|
|
65
|
+
}
|
|
66
|
+
/** Get all edges of a specific type. */
|
|
67
|
+
getEdgesByType(type) {
|
|
68
|
+
return Array.from(this.edges.values()).filter((e) => e.type === type);
|
|
69
|
+
}
|
|
70
|
+
getAllEdges() {
|
|
71
|
+
return Array.from(this.edges.values());
|
|
72
|
+
}
|
|
73
|
+
get edgeCount() {
|
|
74
|
+
return this.edges.size;
|
|
75
|
+
}
|
|
76
|
+
// ─── Traversal helpers ──────────────────────────────────────────────
|
|
77
|
+
/**
|
|
78
|
+
* Get all nodes reachable from `startId` by following edges of the given types.
|
|
79
|
+
* BFS traversal, returns nodes in visit order. Cycle-safe.
|
|
80
|
+
*/
|
|
81
|
+
getReachableNodes(startId, edgeTypes) {
|
|
82
|
+
const visited = new Set();
|
|
83
|
+
const queue = [startId];
|
|
84
|
+
const result = [];
|
|
85
|
+
while (queue.length > 0) {
|
|
86
|
+
const currentId = queue.shift();
|
|
87
|
+
if (visited.has(currentId))
|
|
88
|
+
continue;
|
|
89
|
+
visited.add(currentId);
|
|
90
|
+
const node = this.nodes.get(currentId);
|
|
91
|
+
if (node && currentId !== startId) {
|
|
92
|
+
result.push(node);
|
|
93
|
+
}
|
|
94
|
+
const outEdges = this.getEdgesFrom(currentId);
|
|
95
|
+
for (const edge of outEdges) {
|
|
96
|
+
if (!edgeTypes || edgeTypes.includes(edge.type)) {
|
|
97
|
+
if (!visited.has(edge.targetNodeId)) {
|
|
98
|
+
queue.push(edge.targetNodeId);
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
return result;
|
|
104
|
+
}
|
|
105
|
+
/**
|
|
106
|
+
* Check whether a path from `startId` to `endId` passes through any node
|
|
107
|
+
* of the given type. Used by confidence scoring to detect mock boundaries.
|
|
108
|
+
*/
|
|
109
|
+
hasNodeTypeOnPath(startId, endId, nodeType) {
|
|
110
|
+
const visited = new Set();
|
|
111
|
+
const queue = [[startId]];
|
|
112
|
+
while (queue.length > 0) {
|
|
113
|
+
const path = queue.shift();
|
|
114
|
+
const currentId = path[path.length - 1];
|
|
115
|
+
if (visited.has(currentId))
|
|
116
|
+
continue;
|
|
117
|
+
visited.add(currentId);
|
|
118
|
+
if (currentId === endId) {
|
|
119
|
+
// Check interior nodes (not start or end)
|
|
120
|
+
for (let i = 1; i < path.length - 1; i++) {
|
|
121
|
+
const node = this.nodes.get(path[i]);
|
|
122
|
+
if ((node === null || node === void 0 ? void 0 : node.type) === nodeType)
|
|
123
|
+
return true;
|
|
124
|
+
}
|
|
125
|
+
return false;
|
|
126
|
+
}
|
|
127
|
+
const outEdges = this.getEdgesFrom(currentId);
|
|
128
|
+
for (const edge of outEdges) {
|
|
129
|
+
if (!visited.has(edge.targetNodeId)) {
|
|
130
|
+
queue.push([...path, edge.targetNodeId]);
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
return false;
|
|
135
|
+
}
|
|
136
|
+
// ─── Merge ──────────────────────────────────────────────────────────
|
|
137
|
+
/**
|
|
138
|
+
* Merge another graph into this one. Returns conflicts for any nodes
|
|
139
|
+
* that exist in both graphs with different types (RULE: stage-disagreement).
|
|
140
|
+
*/
|
|
141
|
+
merge(other) {
|
|
142
|
+
const conflicts = [];
|
|
143
|
+
let conflictCounter = 0;
|
|
144
|
+
for (const node of other.getAllNodes()) {
|
|
145
|
+
const existing = this.nodes.get(node.id);
|
|
146
|
+
if (existing) {
|
|
147
|
+
if (existing.type !== node.type) {
|
|
148
|
+
conflicts.push({
|
|
149
|
+
conflictId: `conflict-merge-${conflictCounter++}`,
|
|
150
|
+
nodeId: node.id,
|
|
151
|
+
type: 'stage-disagreement',
|
|
152
|
+
stages: [existing.sourceStage, node.sourceStage],
|
|
153
|
+
stageOutputs: {
|
|
154
|
+
[existing.sourceStage]: { type: existing.type, label: existing.label },
|
|
155
|
+
[node.sourceStage]: { type: node.type, label: node.label },
|
|
156
|
+
},
|
|
157
|
+
detail: `Node '${node.id}' has type '${existing.type}' from stage '${existing.sourceStage}' but type '${node.type}' from stage '${node.sourceStage}'`,
|
|
158
|
+
suggestedAction: `Review both stage outputs for node '${node.id}' and determine the correct classification. Check if the node serves dual roles (e.g., a service that also defines endpoints).`,
|
|
159
|
+
severity: 'warning',
|
|
160
|
+
});
|
|
161
|
+
}
|
|
162
|
+
// Merge metadata from the newer stage
|
|
163
|
+
existing.metadata = { ...existing.metadata, ...node.metadata };
|
|
164
|
+
}
|
|
165
|
+
else {
|
|
166
|
+
this.nodes.set(node.id, { ...node });
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
for (const edge of other.getAllEdges()) {
|
|
170
|
+
if (!this.edges.has(edge.id)) {
|
|
171
|
+
this.edges.set(edge.id, { ...edge });
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
return conflicts;
|
|
175
|
+
}
|
|
176
|
+
// ─── Serialization ──────────────────────────────────────────────────
|
|
177
|
+
toSerializable() {
|
|
178
|
+
return {
|
|
179
|
+
nodes: this.getAllNodes(),
|
|
180
|
+
edges: this.getAllEdges(),
|
|
181
|
+
};
|
|
182
|
+
}
|
|
183
|
+
static fromSerializable(data) {
|
|
184
|
+
const graph = new CoverageKnowledgeGraph();
|
|
185
|
+
for (const node of data.nodes) {
|
|
186
|
+
graph.addNode(node);
|
|
187
|
+
}
|
|
188
|
+
for (const edge of data.edges) {
|
|
189
|
+
graph.addEdge(edge);
|
|
190
|
+
}
|
|
191
|
+
return graph;
|
|
192
|
+
}
|
|
193
|
+
// ─── Clear ──────────────────────────────────────────────────────────
|
|
194
|
+
clear() {
|
|
195
|
+
this.nodes.clear();
|
|
196
|
+
this.edges.clear();
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
exports.CoverageKnowledgeGraph = CoverageKnowledgeGraph;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Pipeline module — Cascaded Multi-Stage Coverage Mapping Engine.
|
|
3
|
+
*
|
|
4
|
+
* Public API for the 6-stage pipeline: SCA → AST → TIA → IAST → DAST → Merge.
|
|
5
|
+
*/
|
|
6
|
+
export type { PipelineConfidence, StageName, TestLayer, CoverageClass, AssertionSource, UrlResolution, ConflictType, ConflictSeverity, GraphNodeType, GraphEdgeType, GraphNode, GraphEdge, MockType, MockBoundary, ConflictNode, CoverageMapping, CoverageMappingItemType, StageDiagnostics, SkippedFile, PipelineSummary, PipelineSections, PipelineOutput, ConfidenceEvidence, } from './types';
|
|
7
|
+
export type { PipelineConfig, PipelineContext, PipelineStage } from './stageInterface';
|
|
8
|
+
export { DEFAULT_PIPELINE_CONFIG } from './stageInterface';
|
|
9
|
+
export { CoverageKnowledgeGraph } from './graph';
|
|
10
|
+
export { computeConfidence, computeBaseConfidence, applyConfidenceCaps, capConfidence, compareConfidence, minConfidence, hasMockBoundaryOnPath, hasPartialResolution, buildConfidenceEvidence, } from './confidence';
|
|
11
|
+
export { runPipeline, createPipelineContext } from './orchestrator';
|
|
12
|
+
export type { PipelineRunOptions, PipelineRunResult } from './orchestrator';
|
|
13
|
+
export { ScaStage } from './stages/sca/scaStage';
|
|
14
|
+
export { AstStage } from './stages/ast/astStage';
|
|
15
|
+
export { TiaStage } from './stages/tia/tiaStage';
|
|
16
|
+
export { IastStage } from './stages/iast/iastStage';
|
|
17
|
+
export { DastStage } from './stages/dast/dastStage';
|
|
18
|
+
export { MergeStage } from './stages/merge/mergeStage';
|
|
19
|
+
export type { ScaOutput } from './stages/sca/types';
|
|
20
|
+
export type { AstStageOutput } from './stages/ast/types';
|
|
21
|
+
export type { TiaOutput } from './stages/tia/types';
|
|
22
|
+
export type { IastOutput, IastEvent } from './stages/iast/types';
|
|
23
|
+
export type { DastOutput, DastProbeResult } from './stages/dast/types';
|
|
24
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/pipeline/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;A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AoB,CAAC;AACpD,YAAY,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AACjE,YAAY,EAAE,UAAU,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Pipeline module — Cascaded Multi-Stage Coverage Mapping Engine.
|
|
4
|
+
*
|
|
5
|
+
* Public API for the 6-stage pipeline: SCA → AST → TIA → IAST → DAST → Merge.
|
|
6
|
+
*/
|
|
7
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
+
exports.MergeStage = exports.DastStage = exports.IastStage = exports.TiaStage = exports.AstStage = exports.ScaStage = exports.createPipelineContext = exports.runPipeline = exports.buildConfidenceEvidence = exports.hasPartialResolution = exports.hasMockBoundaryOnPath = exports.minConfidence = exports.compareConfidence = exports.capConfidence = exports.applyConfidenceCaps = exports.computeBaseConfidence = exports.computeConfidence = exports.CoverageKnowledgeGraph = exports.DEFAULT_PIPELINE_CONFIG = void 0;
|
|
9
|
+
var stageInterface_1 = require("./stageInterface");
|
|
10
|
+
Object.defineProperty(exports, "DEFAULT_PIPELINE_CONFIG", { enumerable: true, get: function () { return stageInterface_1.DEFAULT_PIPELINE_CONFIG; } });
|
|
11
|
+
// ─── Graph ───────────────────────────────────────────────────────────────────
|
|
12
|
+
var graph_1 = require("./graph");
|
|
13
|
+
Object.defineProperty(exports, "CoverageKnowledgeGraph", { enumerable: true, get: function () { return graph_1.CoverageKnowledgeGraph; } });
|
|
14
|
+
// ─── Confidence ──────────────────────────────────────────────────────────────
|
|
15
|
+
var confidence_1 = require("./confidence");
|
|
16
|
+
Object.defineProperty(exports, "computeConfidence", { enumerable: true, get: function () { return confidence_1.computeConfidence; } });
|
|
17
|
+
Object.defineProperty(exports, "computeBaseConfidence", { enumerable: true, get: function () { return confidence_1.computeBaseConfidence; } });
|
|
18
|
+
Object.defineProperty(exports, "applyConfidenceCaps", { enumerable: true, get: function () { return confidence_1.applyConfidenceCaps; } });
|
|
19
|
+
Object.defineProperty(exports, "capConfidence", { enumerable: true, get: function () { return confidence_1.capConfidence; } });
|
|
20
|
+
Object.defineProperty(exports, "compareConfidence", { enumerable: true, get: function () { return confidence_1.compareConfidence; } });
|
|
21
|
+
Object.defineProperty(exports, "minConfidence", { enumerable: true, get: function () { return confidence_1.minConfidence; } });
|
|
22
|
+
Object.defineProperty(exports, "hasMockBoundaryOnPath", { enumerable: true, get: function () { return confidence_1.hasMockBoundaryOnPath; } });
|
|
23
|
+
Object.defineProperty(exports, "hasPartialResolution", { enumerable: true, get: function () { return confidence_1.hasPartialResolution; } });
|
|
24
|
+
Object.defineProperty(exports, "buildConfidenceEvidence", { enumerable: true, get: function () { return confidence_1.buildConfidenceEvidence; } });
|
|
25
|
+
// ─── Orchestrator ────────────────────────────────────────────────────────────
|
|
26
|
+
var orchestrator_1 = require("./orchestrator");
|
|
27
|
+
Object.defineProperty(exports, "runPipeline", { enumerable: true, get: function () { return orchestrator_1.runPipeline; } });
|
|
28
|
+
Object.defineProperty(exports, "createPipelineContext", { enumerable: true, get: function () { return orchestrator_1.createPipelineContext; } });
|
|
29
|
+
// ─── Stage classes ───────────────────────────────────────────────────────────
|
|
30
|
+
var scaStage_1 = require("./stages/sca/scaStage");
|
|
31
|
+
Object.defineProperty(exports, "ScaStage", { enumerable: true, get: function () { return scaStage_1.ScaStage; } });
|
|
32
|
+
var astStage_1 = require("./stages/ast/astStage");
|
|
33
|
+
Object.defineProperty(exports, "AstStage", { enumerable: true, get: function () { return astStage_1.AstStage; } });
|
|
34
|
+
var tiaStage_1 = require("./stages/tia/tiaStage");
|
|
35
|
+
Object.defineProperty(exports, "TiaStage", { enumerable: true, get: function () { return tiaStage_1.TiaStage; } });
|
|
36
|
+
var iastStage_1 = require("./stages/iast/iastStage");
|
|
37
|
+
Object.defineProperty(exports, "IastStage", { enumerable: true, get: function () { return iastStage_1.IastStage; } });
|
|
38
|
+
var dastStage_1 = require("./stages/dast/dastStage");
|
|
39
|
+
Object.defineProperty(exports, "DastStage", { enumerable: true, get: function () { return dastStage_1.DastStage; } });
|
|
40
|
+
var mergeStage_1 = require("./stages/merge/mergeStage");
|
|
41
|
+
Object.defineProperty(exports, "MergeStage", { enumerable: true, get: function () { return mergeStage_1.MergeStage; } });
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Pipeline orchestrator — chains the 6 stages (SCA → AST → TIA → IAST → DAST → Merge)
|
|
3
|
+
* and executes them in sequence, threading the PipelineContext through each stage.
|
|
4
|
+
*
|
|
5
|
+
* Optional stages (IAST, DAST) are skipped gracefully when disabled or when
|
|
6
|
+
* their data files are missing. The orchestrator catches per-stage errors
|
|
7
|
+
* and records them in diagnostics (RULE-02: never skip a file entirely on error).
|
|
8
|
+
*/
|
|
9
|
+
import type { PipelineConfig, PipelineContext } from './stageInterface';
|
|
10
|
+
import type { PipelineOutput, StageName } from './types';
|
|
11
|
+
/**
|
|
12
|
+
* Options for running the pipeline.
|
|
13
|
+
*/
|
|
14
|
+
export interface PipelineRunOptions {
|
|
15
|
+
/** Project root directory */
|
|
16
|
+
projectRoot: string;
|
|
17
|
+
/** Pipeline configuration (partial — defaults are merged) */
|
|
18
|
+
config?: Partial<Omit<PipelineConfig, 'projectRoot'>>;
|
|
19
|
+
/** If true, suppress console output */
|
|
20
|
+
silent?: boolean;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Result of a pipeline run.
|
|
24
|
+
*/
|
|
25
|
+
export interface PipelineRunResult {
|
|
26
|
+
output: PipelineOutput;
|
|
27
|
+
context: PipelineContext;
|
|
28
|
+
durationMs: number;
|
|
29
|
+
stagesDurationMs: Record<StageName, number>;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Run the full 6-stage coverage pipeline.
|
|
33
|
+
*
|
|
34
|
+
* @param options - Pipeline run options
|
|
35
|
+
* @returns PipelineRunResult with the final output, context, and timing information
|
|
36
|
+
*/
|
|
37
|
+
export declare function runPipeline(options: PipelineRunOptions): Promise<PipelineRunResult>;
|
|
38
|
+
/**
|
|
39
|
+
* Create a pipeline context for testing or manual usage.
|
|
40
|
+
*/
|
|
41
|
+
export declare function createPipelineContext(projectRoot: string, configOverrides?: Partial<Omit<PipelineConfig, 'projectRoot'>>): PipelineContext;
|
|
42
|
+
//# sourceMappingURL=orchestrator.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"orchestrator.d.ts","sourceRoot":"","sources":["../../../src/pipeline/orchestrator.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAE,eAAe,EAAiB,MAAM,kBAAkB,CAAC;AACvF,OAAO,KAAK,EAAE,cAAc,EAAE,SAAS,EAAoB,MAAM,SAAS,CAAC;AAU3E;;GAEG;AACH,MAAM,WAAW,kBAAkB;IACjC,6BAA6B;IAC7B,WAAW,EAAE,MAAM,CAAC;IACpB,6DAA6D;IAC7D,MAAM,CAAC,EAAE,OAAO,CAAC,IAAI,CAAC,cAAc,EAAE,aAAa,CAAC,CAAC,CAAC;IACtD,uCAAuC;IACvC,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB;AAED;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAChC,MAAM,EAAE,cAAc,CAAC;IACvB,OAAO,EAAE,eAAe,CAAC;IACzB,UAAU,EAAE,MAAM,CAAC;IACnB,gBAAgB,EAAE,MAAM,CAAC,SAAS,EAAE,MAAM,CAAC,CAAC;CAC7C;AAED;;;;;GAKG;AACH,wBAAsB,WAAW,CAAC,OAAO,EAAE,kBAAkB,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAoFzF;AAED;;GAEG;AACH,wBAAgB,qBAAqB,CACnC,WAAW,EAAE,MAAM,EACnB,eAAe,CAAC,EAAE,OAAO,CAAC,IAAI,CAAC,cAAc,EAAE,aAAa,CAAC,CAAC,GAC7D,eAAe,CAcjB"}
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Pipeline orchestrator — chains the 6 stages (SCA → AST → TIA → IAST → DAST → Merge)
|
|
4
|
+
* and executes them in sequence, threading the PipelineContext through each stage.
|
|
5
|
+
*
|
|
6
|
+
* Optional stages (IAST, DAST) are skipped gracefully when disabled or when
|
|
7
|
+
* their data files are missing. The orchestrator catches per-stage errors
|
|
8
|
+
* and records them in diagnostics (RULE-02: never skip a file entirely on error).
|
|
9
|
+
*/
|
|
10
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
11
|
+
exports.runPipeline = runPipeline;
|
|
12
|
+
exports.createPipelineContext = createPipelineContext;
|
|
13
|
+
const graph_1 = require("./graph");
|
|
14
|
+
const stageInterface_1 = require("./stageInterface");
|
|
15
|
+
const scaStage_1 = require("./stages/sca/scaStage");
|
|
16
|
+
const astStage_1 = require("./stages/ast/astStage");
|
|
17
|
+
const tiaStage_1 = require("./stages/tia/tiaStage");
|
|
18
|
+
const iastStage_1 = require("./stages/iast/iastStage");
|
|
19
|
+
const dastStage_1 = require("./stages/dast/dastStage");
|
|
20
|
+
const mergeStage_1 = require("./stages/merge/mergeStage");
|
|
21
|
+
/**
|
|
22
|
+
* Run the full 6-stage coverage pipeline.
|
|
23
|
+
*
|
|
24
|
+
* @param options - Pipeline run options
|
|
25
|
+
* @returns PipelineRunResult with the final output, context, and timing information
|
|
26
|
+
*/
|
|
27
|
+
async function runPipeline(options) {
|
|
28
|
+
const startTime = Date.now();
|
|
29
|
+
// Build full config with defaults
|
|
30
|
+
const config = {
|
|
31
|
+
projectRoot: options.projectRoot,
|
|
32
|
+
...stageInterface_1.DEFAULT_PIPELINE_CONFIG,
|
|
33
|
+
...options.config,
|
|
34
|
+
};
|
|
35
|
+
// Initialize context
|
|
36
|
+
const context = {
|
|
37
|
+
projectRoot: options.projectRoot,
|
|
38
|
+
config,
|
|
39
|
+
graph: new graph_1.CoverageKnowledgeGraph(),
|
|
40
|
+
diagnostics: new Map(),
|
|
41
|
+
stageOutputs: new Map(),
|
|
42
|
+
};
|
|
43
|
+
// Build stage pipeline
|
|
44
|
+
const stages = [
|
|
45
|
+
new scaStage_1.ScaStage(),
|
|
46
|
+
new astStage_1.AstStage(),
|
|
47
|
+
new tiaStage_1.TiaStage(),
|
|
48
|
+
];
|
|
49
|
+
// IAST and DAST are optional
|
|
50
|
+
if (config.enableIast) {
|
|
51
|
+
stages.push(new iastStage_1.IastStage());
|
|
52
|
+
}
|
|
53
|
+
if (config.enableDast) {
|
|
54
|
+
stages.push(new dastStage_1.DastStage());
|
|
55
|
+
}
|
|
56
|
+
// Merge is always last
|
|
57
|
+
stages.push(new mergeStage_1.MergeStage());
|
|
58
|
+
const stagesDurationMs = {};
|
|
59
|
+
// Execute stages in sequence
|
|
60
|
+
for (const stage of stages) {
|
|
61
|
+
const stageStart = Date.now();
|
|
62
|
+
if (!options.silent) {
|
|
63
|
+
// Log stage name — caller can capture stdout if needed
|
|
64
|
+
}
|
|
65
|
+
try {
|
|
66
|
+
await stage.execute(context);
|
|
67
|
+
}
|
|
68
|
+
catch (err) {
|
|
69
|
+
// Record error in diagnostics but don't fail the pipeline for optional stages
|
|
70
|
+
const errorMsg = err instanceof Error ? err.message : String(err);
|
|
71
|
+
if (!context.diagnostics.has(stage.name)) {
|
|
72
|
+
context.diagnostics.set(stage.name, {
|
|
73
|
+
stageName: stage.name,
|
|
74
|
+
filesScanned: [],
|
|
75
|
+
filesSkipped: [],
|
|
76
|
+
durationMs: Date.now() - stageStart,
|
|
77
|
+
metadata: { error: errorMsg, failed: true },
|
|
78
|
+
});
|
|
79
|
+
}
|
|
80
|
+
if (!stage.optional) {
|
|
81
|
+
throw new Error(`Pipeline stage '${stage.name}' failed: ${errorMsg}`);
|
|
82
|
+
}
|
|
83
|
+
// Optional stages are swallowed — continue pipeline
|
|
84
|
+
}
|
|
85
|
+
stagesDurationMs[stage.name] = Date.now() - stageStart;
|
|
86
|
+
}
|
|
87
|
+
// Get the merge output
|
|
88
|
+
const mergeOutput = context.stageOutputs.get('merge');
|
|
89
|
+
if (!mergeOutput) {
|
|
90
|
+
throw new Error('Pipeline merge stage did not produce output');
|
|
91
|
+
}
|
|
92
|
+
return {
|
|
93
|
+
output: mergeOutput,
|
|
94
|
+
context,
|
|
95
|
+
durationMs: Date.now() - startTime,
|
|
96
|
+
stagesDurationMs: stagesDurationMs,
|
|
97
|
+
};
|
|
98
|
+
}
|
|
99
|
+
/**
|
|
100
|
+
* Create a pipeline context for testing or manual usage.
|
|
101
|
+
*/
|
|
102
|
+
function createPipelineContext(projectRoot, configOverrides) {
|
|
103
|
+
const config = {
|
|
104
|
+
projectRoot,
|
|
105
|
+
...stageInterface_1.DEFAULT_PIPELINE_CONFIG,
|
|
106
|
+
...configOverrides,
|
|
107
|
+
};
|
|
108
|
+
return {
|
|
109
|
+
projectRoot,
|
|
110
|
+
config,
|
|
111
|
+
graph: new graph_1.CoverageKnowledgeGraph(),
|
|
112
|
+
diagnostics: new Map(),
|
|
113
|
+
stageOutputs: new Map(),
|
|
114
|
+
};
|
|
115
|
+
}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Pipeline stage interface and execution context.
|
|
3
|
+
*
|
|
4
|
+
* Every stage in the 6-stage pipeline (SCA → AST → TIA → IAST → DAST → Merge)
|
|
5
|
+
* implements `PipelineStage`. The `PipelineContext` is threaded through all
|
|
6
|
+
* stages and accumulates the knowledge graph, diagnostics, and stage outputs.
|
|
7
|
+
*/
|
|
8
|
+
import type { CoverageKnowledgeGraph } from './graph';
|
|
9
|
+
import type { StageName, StageDiagnostics } from './types';
|
|
10
|
+
import type { AstAnalysisConfig } from '../config/types';
|
|
11
|
+
export interface PipelineConfig {
|
|
12
|
+
projectRoot: string;
|
|
13
|
+
enableIast: boolean;
|
|
14
|
+
enableDast: boolean;
|
|
15
|
+
/** DAST probing rate limit in requests/second. Default: 10. (RULE-17) */
|
|
16
|
+
dastRateLimit: number;
|
|
17
|
+
/** Abstract layer traversal depth cap. Default: 5. (RULE-05) */
|
|
18
|
+
traversalDepthCap: number;
|
|
19
|
+
/** Per-file timeout in ms. Default: 30000. (RULE-16) */
|
|
20
|
+
fileTimeoutMs: number;
|
|
21
|
+
/** Path to IAST events file. Default: 'iast-events.json' in project root. */
|
|
22
|
+
iastEventsPath?: string;
|
|
23
|
+
/** Path to DAST results file. Default: 'dast-results.json' in project root. */
|
|
24
|
+
dastResultsPath?: string;
|
|
25
|
+
/** Existing AST analysis config (passed through to analyzers). */
|
|
26
|
+
astConfig?: AstAnalysisConfig;
|
|
27
|
+
}
|
|
28
|
+
export declare const DEFAULT_PIPELINE_CONFIG: Omit<PipelineConfig, 'projectRoot'>;
|
|
29
|
+
export interface PipelineContext {
|
|
30
|
+
projectRoot: string;
|
|
31
|
+
config: PipelineConfig;
|
|
32
|
+
graph: CoverageKnowledgeGraph;
|
|
33
|
+
diagnostics: Map<StageName, StageDiagnostics>;
|
|
34
|
+
/** Accumulated output from each completed stage. */
|
|
35
|
+
stageOutputs: Map<StageName, unknown>;
|
|
36
|
+
}
|
|
37
|
+
export interface PipelineStage<TOutput = unknown> {
|
|
38
|
+
/** Stage identifier. */
|
|
39
|
+
readonly name: StageName;
|
|
40
|
+
/** If true, the pipeline continues even if this stage is skipped or fails. */
|
|
41
|
+
readonly optional: boolean;
|
|
42
|
+
/** Execute the stage, enriching the context's graph and diagnostics. */
|
|
43
|
+
execute(context: PipelineContext): Promise<TOutput>;
|
|
44
|
+
}
|
|
45
|
+
//# sourceMappingURL=stageInterface.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"stageInterface.d.ts","sourceRoot":"","sources":["../../../src/pipeline/stageInterface.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,SAAS,CAAC;AACtD,OAAO,KAAK,EAAE,SAAS,EAAE,gB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age in the 6-stage pipeline (SCA → AST → TIA → IAST → DAST → Merge)
|
|
6
|
+
* implements `PipelineStage`. The `PipelineContext` is threaded through all
|
|
7
|
+
* stages and accumulates the knowledge graph, diagnostics, and stage outputs.
|
|
8
|
+
*/
|
|
9
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
+
exports.DEFAULT_PIPELINE_CONFIG = void 0;
|
|
11
|
+
exports.DEFAULT_PIPELINE_CONFIG = {
|
|
12
|
+
enableIast: false,
|
|
13
|
+
enableDast: false,
|
|
14
|
+
dastRateLimit: 10,
|
|
15
|
+
traversalDepthCap: 5,
|
|
16
|
+
fileTimeoutMs: 30000,
|
|
17
|
+
};
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Abstract layer traversal — resolves inherited assertions, imported helpers,
|
|
3
|
+
* fixture injections, and page objects across the inheritance chain.
|
|
4
|
+
*
|
|
5
|
+
* Implements the spec's abstract layer resolution with a configurable depth cap
|
|
6
|
+
* (default 5, RULE-05). When the cap is reached, resolution is marked as 'partial'.
|
|
7
|
+
* Cycles are detected and broken (RULE-15).
|
|
8
|
+
*/
|
|
9
|
+
import type { CrossFileSymbolTable } from './types';
|
|
10
|
+
import type { TraversalResult } from './types';
|
|
11
|
+
/**
|
|
12
|
+
* Traverse the inheritance chain starting from a test class to resolve
|
|
13
|
+
* assertions, HTTP calls, and helper references from base classes.
|
|
14
|
+
*
|
|
15
|
+
* @param className - The test class/suite to start from
|
|
16
|
+
* @param table - The cross-file symbol table
|
|
17
|
+
* @param depthCap - Maximum traversal depth (RULE-05: default 5)
|
|
18
|
+
*/
|
|
19
|
+
export declare function traverseInheritanceChain(className: string, table: CrossFileSymbolTable, depthCap?: number): TraversalResult;
|
|
20
|
+
/**
|
|
21
|
+
* Resolve an imported helper function by following the import chain.
|
|
22
|
+
*
|
|
23
|
+
* @param functionName - The helper function to resolve
|
|
24
|
+
* @param fromFile - The file importing the helper
|
|
25
|
+
* @param table - The cross-file symbol table
|
|
26
|
+
* @param depthCap - Maximum traversal depth
|
|
27
|
+
*/
|
|
28
|
+
export declare function resolveImportedHelper(functionName: string, fromFile: string, table: CrossFileSymbolTable, depthCap?: number): TraversalResult;
|
|
29
|
+
/**
|
|
30
|
+
* Resolve fixture-injected assertions and HTTP calls.
|
|
31
|
+
* Traces @BeforeEach/beforeEach/pytest fixtures/@Autowired patterns.
|
|
32
|
+
*
|
|
33
|
+
* @param fixtureName - The fixture function name
|
|
34
|
+
* @param table - The cross-file symbol table
|
|
35
|
+
* @param depthCap - Maximum traversal depth
|
|
36
|
+
*/
|
|
37
|
+
export declare function resolveFixtureInjection(fixtureName: string, table: CrossFileSymbolTable, depthCap?: number): TraversalResult;
|
|
38
|
+
//# sourceMappingURL=abstractLayerTraversal.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"abstractLayerTraversal.d.ts","sourceRoot":"","sources":["../../../../../src/pipeline/stages/ast/abstractLayerTraversal.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAGH,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAC;AACpD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAG/C;;;;;;;GAOG;AACH,wBAAgB,wBAAwB,CACtC,SAAS,EAAE,MAAM,EACjB,KAAK,EAAE,oBAAoB,EAC3B,QAAQ,GAAE,MAAU,GACnB,eAAe,CA4EjB;AAED;;;;;;;GAOG;AACH,wBAAgB,qBAAqB,CACnC,YAAY,EAAE,MAAM,EACpB,QAAQ,EAAE,MAAM,EAChB,KAAK,EAAE,oBAAoB,EAC3B,QAAQ,GAAE,MAAU,GACnB,eAAe,CA2EjB;AAED;;;;;;;GAOG;AACH,wBAAgB,uBAAuB,CACrC,WAAW,EAAE,MAAM,EACnB,KAAK,EAAE,oBAAoB,EAC3B,QAAQ,GAAE,MAAU,GACnB,eAAe,CAuCjB"}
|