@harness-engineering/cli 1.25.5 → 1.25.6
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/{agents-md-COWXFHR5.js → agents-md-2PYJM2MK.js} +3 -3
- package/dist/{architecture-EYPG4ZMC.js → architecture-VCLB7A23.js} +4 -4
- package/dist/{assess-project-JQPEVJIA.js → assess-project-64C6LIKN.js} +1 -1
- package/dist/bin/harness-mcp.js +16 -15
- package/dist/bin/harness.js +26 -25
- package/dist/business-knowledge-6RHYJOB3.js +7 -0
- package/dist/{check-phase-gate-AJRMDGYW.js → check-phase-gate-RT6PGEHY.js} +4 -4
- package/dist/{chunk-KHMKAC6E.js → chunk-42ZZLMYD.js} +115 -103
- package/dist/{chunk-2X42NMPD.js → chunk-43VBX44J.js} +218 -106
- package/dist/{chunk-UB6NZNJJ.js → chunk-4YEBV2FT.js} +2 -2
- package/dist/{chunk-ZYYVDA5K.js → chunk-7BAGSY5Q.js} +1 -1
- package/dist/{chunk-KDHZAL4B.js → chunk-BUJOMC3O.js} +1 -1
- package/dist/{chunk-YFIALHGI.js → chunk-CBZECDCW.js} +5 -5
- package/dist/{chunk-KXUCIAM4.js → chunk-EY6F2QXW.js} +1 -1
- package/dist/{chunk-24ZGGCIW.js → chunk-FL6A72LV.js} +1 -1
- package/dist/{chunk-JD4FGVHH.js → chunk-JQCS75DY.js} +4 -4
- package/dist/{chunk-5R2LFUU3.js → chunk-JUXFYB2K.js} +1 -1
- package/dist/{chunk-2TFT7XRX.js → chunk-KJC4SE7C.js} +9 -9
- package/dist/{chunk-4NK7Z3BP.js → chunk-R2BI5UPK.js} +1 -1
- package/dist/{chunk-2OM5TA56.js → chunk-R7P2FMJT.js} +209 -182
- package/dist/chunk-RC5ZY3EV.js +82 -0
- package/dist/{chunk-K2SON7TI.js → chunk-RDQGCHKD.js} +252 -57
- package/dist/{chunk-WN6YIQ66.js → chunk-RKZW3FDF.js} +1 -1
- package/dist/{chunk-BOQRTARD.js → chunk-SMY35HJM.js} +1 -1
- package/dist/{chunk-KVK3KAFQ.js → chunk-SZZ5UQL7.js} +6 -6
- package/dist/{chunk-2X336Q7J.js → chunk-U2OMWI7Z.js} +1 -1
- package/dist/{chunk-KWQTMJ3B.js → chunk-VELT5VAG.js} +1 -1
- package/dist/{chunk-Q6ZEUMOF.js → chunk-WEOGCL7B.js} +3 -3
- package/dist/{chunk-PVRKHUTA.js → chunk-X2JJ3CPG.js} +8 -8
- package/dist/{chunk-2OIPQMU5.js → chunk-XLO4AXXM.js} +9 -9
- package/dist/{chunk-UI6NWJJK.js → chunk-XMEEYMGE.js} +1 -1
- package/dist/{chunk-BVRWLK5U.js → chunk-Y5JA4J2M.js} +2 -2
- package/dist/{chunk-HWLHJSJQ.js → chunk-ZAKUCM7O.js} +2 -2
- package/dist/{ci-workflow-35KBJC2U.js → ci-workflow-SZL3KVUK.js} +3 -3
- package/dist/{dist-RADHOOXG.js → dist-GRW3X2ZQ.js} +3 -1
- package/dist/{dist-UMONICND.js → dist-T3DGV5UN.js} +2 -2
- package/dist/{docs-T5J2AJH6.js → docs-WDLJORLK.js} +4 -4
- package/dist/{engine-KWHV2LUX.js → engine-2YWYRCKK.js} +3 -3
- package/dist/{entropy-GEBHWBPR.js → entropy-PJGTOORX.js} +3 -3
- package/dist/{feedback-I4QPE3RI.js → feedback-M5KCJKL2.js} +1 -1
- package/dist/{generate-agent-definitions-3XNR77ET.js → generate-agent-definitions-MFDW6LZT.js} +4 -4
- package/dist/{graph-loader-JHQVQRUS.js → graph-loader-QMKXT454.js} +1 -1
- package/dist/index.js +26 -25
- package/dist/{loader-MN2CZXPG.js → loader-6O52FYHE.js} +3 -3
- package/dist/{mcp-XSU77BZY.js → mcp-GGNFWKVC.js} +16 -15
- package/dist/{performance-7I5MCEFP.js → performance-337U5URQ.js} +4 -4
- package/dist/{review-pipeline-PWPKJXSN.js → review-pipeline-DB5RD4SN.js} +3 -3
- package/dist/{runtime-ZYEFJSGS.js → runtime-B74EN2WD.js} +3 -3
- package/dist/{scan-MPJ6JHUY.js → scan-DXQUHGTT.js} +1 -1
- package/dist/{security-OVTGS7DL.js → security-3AYN6FVU.js} +1 -1
- package/dist/{validate-ACIP5BUO.js → validate-35CD7VWN.js} +4 -4
- package/dist/{validate-cross-check-OWITNCHN.js → validate-cross-check-LJKXBQYH.js} +3 -3
- package/package.json +4 -4
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
generateAgentsMd
|
|
3
|
-
} from "./chunk-
|
|
4
|
-
import "./chunk-
|
|
3
|
+
} from "./chunk-7BAGSY5Q.js";
|
|
4
|
+
import "./chunk-42ZZLMYD.js";
|
|
5
5
|
import "./chunk-RL4VMEXL.js";
|
|
6
|
-
import "./chunk-
|
|
6
|
+
import "./chunk-RDQGCHKD.js";
|
|
7
7
|
import "./chunk-KFQGP6VL.js";
|
|
8
8
|
export {
|
|
9
9
|
generateAgentsMd
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import {
|
|
2
2
|
checkDependenciesDefinition,
|
|
3
3
|
handleCheckDependencies
|
|
4
|
-
} from "./chunk-
|
|
5
|
-
import "./chunk-
|
|
4
|
+
} from "./chunk-JQCS75DY.js";
|
|
5
|
+
import "./chunk-XMEEYMGE.js";
|
|
6
6
|
import "./chunk-EPUKTTJZ.js";
|
|
7
7
|
import "./chunk-W6Y7ZW3Y.js";
|
|
8
|
-
import "./chunk-
|
|
8
|
+
import "./chunk-42ZZLMYD.js";
|
|
9
9
|
import "./chunk-RL4VMEXL.js";
|
|
10
|
-
import "./chunk-
|
|
10
|
+
import "./chunk-RDQGCHKD.js";
|
|
11
11
|
import "./chunk-KFQGP6VL.js";
|
|
12
12
|
export {
|
|
13
13
|
checkDependenciesDefinition,
|
package/dist/bin/harness-mcp.js
CHANGED
|
@@ -1,26 +1,27 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
startServer
|
|
4
|
-
} from "../chunk-
|
|
5
|
-
import "../chunk-
|
|
6
|
-
import "../chunk-
|
|
7
|
-
import "../chunk-
|
|
8
|
-
import "../chunk-
|
|
9
|
-
import "../chunk-
|
|
10
|
-
import "../chunk-
|
|
11
|
-
import "../chunk-
|
|
12
|
-
import "../chunk-
|
|
13
|
-
import "../chunk-
|
|
14
|
-
import "../chunk-
|
|
4
|
+
} from "../chunk-43VBX44J.js";
|
|
5
|
+
import "../chunk-SZZ5UQL7.js";
|
|
6
|
+
import "../chunk-RC5ZY3EV.js";
|
|
7
|
+
import "../chunk-KJC4SE7C.js";
|
|
8
|
+
import "../chunk-4YEBV2FT.js";
|
|
9
|
+
import "../chunk-ZAKUCM7O.js";
|
|
10
|
+
import "../chunk-WEOGCL7B.js";
|
|
11
|
+
import "../chunk-JQCS75DY.js";
|
|
12
|
+
import "../chunk-XMEEYMGE.js";
|
|
13
|
+
import "../chunk-XLO4AXXM.js";
|
|
14
|
+
import "../chunk-CBZECDCW.js";
|
|
15
|
+
import "../chunk-X2JJ3CPG.js";
|
|
15
16
|
import "../chunk-EPUKTTJZ.js";
|
|
16
17
|
import "../chunk-W6Y7ZW3Y.js";
|
|
17
|
-
import "../chunk-
|
|
18
|
+
import "../chunk-JUXFYB2K.js";
|
|
18
19
|
import "../chunk-3ISINLYT.js";
|
|
19
20
|
import "../chunk-6B6UN6SG.js";
|
|
20
|
-
import "../chunk-
|
|
21
|
-
import "../chunk-
|
|
21
|
+
import "../chunk-SMY35HJM.js";
|
|
22
|
+
import "../chunk-42ZZLMYD.js";
|
|
22
23
|
import "../chunk-RL4VMEXL.js";
|
|
23
|
-
import "../chunk-
|
|
24
|
+
import "../chunk-RDQGCHKD.js";
|
|
24
25
|
import "../chunk-HIK6OEUF.js";
|
|
25
26
|
import "../chunk-3WGJMBKH.js";
|
|
26
27
|
import "../chunk-KFQGP6VL.js";
|
package/dist/bin/harness.js
CHANGED
|
@@ -3,43 +3,44 @@ import {
|
|
|
3
3
|
createProgram,
|
|
4
4
|
installCommandTelemetry,
|
|
5
5
|
printFirstRunWelcome
|
|
6
|
-
} from "../chunk-
|
|
7
|
-
import "../chunk-
|
|
8
|
-
import "../chunk-
|
|
9
|
-
import "../chunk-
|
|
10
|
-
import "../chunk-
|
|
6
|
+
} from "../chunk-R7P2FMJT.js";
|
|
7
|
+
import "../chunk-7BAGSY5Q.js";
|
|
8
|
+
import "../chunk-RKZW3FDF.js";
|
|
9
|
+
import "../chunk-EY6F2QXW.js";
|
|
10
|
+
import "../chunk-BUJOMC3O.js";
|
|
11
11
|
import "../chunk-CQ553GZO.js";
|
|
12
|
-
import "../chunk-
|
|
12
|
+
import "../chunk-FL6A72LV.js";
|
|
13
13
|
import "../chunk-GISMXMVL.js";
|
|
14
14
|
import "../chunk-WWACIIBA.js";
|
|
15
15
|
import "../chunk-TEFCFC4H.js";
|
|
16
|
-
import "../chunk-
|
|
17
|
-
import "../chunk-
|
|
16
|
+
import "../chunk-Y5JA4J2M.js";
|
|
17
|
+
import "../chunk-U2OMWI7Z.js";
|
|
18
18
|
import "../chunk-KET4QQZB.js";
|
|
19
|
-
import "../chunk-
|
|
20
|
-
import "../chunk-
|
|
19
|
+
import "../chunk-VELT5VAG.js";
|
|
20
|
+
import "../chunk-R2BI5UPK.js";
|
|
21
21
|
import {
|
|
22
22
|
dispatchSkillsFromGit
|
|
23
|
-
} from "../chunk-
|
|
24
|
-
import "../chunk-
|
|
25
|
-
import "../chunk-
|
|
26
|
-
import "../chunk-
|
|
27
|
-
import "../chunk-
|
|
28
|
-
import "../chunk-
|
|
29
|
-
import "../chunk-
|
|
30
|
-
import "../chunk-
|
|
31
|
-
import "../chunk-
|
|
32
|
-
import "../chunk-
|
|
33
|
-
import "../chunk-
|
|
23
|
+
} from "../chunk-43VBX44J.js";
|
|
24
|
+
import "../chunk-SZZ5UQL7.js";
|
|
25
|
+
import "../chunk-RC5ZY3EV.js";
|
|
26
|
+
import "../chunk-KJC4SE7C.js";
|
|
27
|
+
import "../chunk-4YEBV2FT.js";
|
|
28
|
+
import "../chunk-ZAKUCM7O.js";
|
|
29
|
+
import "../chunk-WEOGCL7B.js";
|
|
30
|
+
import "../chunk-JQCS75DY.js";
|
|
31
|
+
import "../chunk-XMEEYMGE.js";
|
|
32
|
+
import "../chunk-XLO4AXXM.js";
|
|
33
|
+
import "../chunk-CBZECDCW.js";
|
|
34
|
+
import "../chunk-X2JJ3CPG.js";
|
|
34
35
|
import "../chunk-EPUKTTJZ.js";
|
|
35
36
|
import "../chunk-W6Y7ZW3Y.js";
|
|
36
37
|
import {
|
|
37
38
|
findConfigFile,
|
|
38
39
|
loadConfig
|
|
39
|
-
} from "../chunk-
|
|
40
|
+
} from "../chunk-JUXFYB2K.js";
|
|
40
41
|
import "../chunk-3ISINLYT.js";
|
|
41
42
|
import "../chunk-6B6UN6SG.js";
|
|
42
|
-
import "../chunk-
|
|
43
|
+
import "../chunk-SMY35HJM.js";
|
|
43
44
|
import {
|
|
44
45
|
CLI_VERSION
|
|
45
46
|
} from "../chunk-BM3PWGXQ.js";
|
|
@@ -50,9 +51,9 @@ import {
|
|
|
50
51
|
readCheckState,
|
|
51
52
|
shouldRunCheck,
|
|
52
53
|
spawnBackgroundCheck
|
|
53
|
-
} from "../chunk-
|
|
54
|
+
} from "../chunk-42ZZLMYD.js";
|
|
54
55
|
import "../chunk-RL4VMEXL.js";
|
|
55
|
-
import "../chunk-
|
|
56
|
+
import "../chunk-RDQGCHKD.js";
|
|
56
57
|
import "../chunk-RRHUCDRD.js";
|
|
57
58
|
import "../chunk-EBJQ6N4M.js";
|
|
58
59
|
import "../chunk-HIK6OEUF.js";
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import {
|
|
2
2
|
createCheckPhaseGateCommand,
|
|
3
3
|
runCheckPhaseGate
|
|
4
|
-
} from "./chunk-
|
|
5
|
-
import "./chunk-
|
|
6
|
-
import "./chunk-
|
|
4
|
+
} from "./chunk-Y5JA4J2M.js";
|
|
5
|
+
import "./chunk-JUXFYB2K.js";
|
|
6
|
+
import "./chunk-42ZZLMYD.js";
|
|
7
7
|
import "./chunk-RL4VMEXL.js";
|
|
8
|
-
import "./chunk-
|
|
8
|
+
import "./chunk-RDQGCHKD.js";
|
|
9
9
|
import "./chunk-EBJQ6N4M.js";
|
|
10
10
|
import "./chunk-3WGJMBKH.js";
|
|
11
11
|
import "./chunk-KFQGP6VL.js";
|
|
@@ -13,13 +13,13 @@ import {
|
|
|
13
13
|
NODE_STABILITY,
|
|
14
14
|
init_dist as init_dist2,
|
|
15
15
|
queryTraceability
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-RDQGCHKD.js";
|
|
17
17
|
import {
|
|
18
18
|
__esm,
|
|
19
19
|
__export
|
|
20
20
|
} from "./chunk-KFQGP6VL.js";
|
|
21
21
|
|
|
22
|
-
// ../core/dist/chunk-
|
|
22
|
+
// ../core/dist/chunk-UWAI34RR.mjs
|
|
23
23
|
import { z } from "zod";
|
|
24
24
|
import { createHash } from "crypto";
|
|
25
25
|
import { minimatch } from "minimatch";
|
|
@@ -1734,8 +1734,8 @@ async function toHaveMaxDepDepth(received, maxDepth) {
|
|
|
1734
1734
|
};
|
|
1735
1735
|
}
|
|
1736
1736
|
var ArchMetricCategorySchema, ViolationSchema, MetricResultSchema, CategoryBaselineSchema, ArchBaselineSchema, CategoryRegressionSchema, ArchDiffResultSchema, ThresholdConfigSchema, ArchConfigSchema, ConstraintRuleSchema, ViolationSnapshotSchema, ViolationHistorySchema, EmergenceConfidenceSchema, EmergentConstraintSuggestionSchema, EmergenceResultSchema, accessAsync, readFileAsync, EXTENSION_BY_LANG, CircularDepsCollector, TypeScriptParser, EXTENSION_MAP, parserCache, initialized, GRAMMAR_MAP, TOP_LEVEL_TYPES, METHOD_TYPES, IDENTIFIER_TYPES, NAME_EXTRACTORS, pythonStrategy, goStrategy, RUST_USE_ARG_TYPES, RUST_PUB_ITEM_TYPES, rustStrategy, JAVA_IMPORT_TYPES, JAVA_EXPORT_TYPES, javaStrategy, STRATEGIES, TreeSitterParser, ParserRegistry, defaultRegistry, LayerViolationCollector, ArchBaselineManager, DEFAULT_THRESHOLDS, FUNCTION_PATTERNS, DECISION_PATTERNS, ComplexityCollector, DEFAULT_THRESHOLDS2, CouplingCollector, ForbiddenImportCollector, ModuleSizeCollector, DepDepthCollector, defaultCollectors, archMatchers;
|
|
1737
|
-
var
|
|
1738
|
-
"../core/dist/chunk-
|
|
1737
|
+
var init_chunk_UWAI34RR = __esm({
|
|
1738
|
+
"../core/dist/chunk-UWAI34RR.mjs"() {
|
|
1739
1739
|
"use strict";
|
|
1740
1740
|
init_dist();
|
|
1741
1741
|
ArchMetricCategorySchema = z.enum([
|
|
@@ -8820,6 +8820,27 @@ async function loadBudgetedLearnings(projectPath, options) {
|
|
|
8820
8820
|
}
|
|
8821
8821
|
return Ok(budgeted);
|
|
8822
8822
|
}
|
|
8823
|
+
function buildEntryFromFrontmatter(line, fm) {
|
|
8824
|
+
const rootCauseMatch = line.match(/\[root_cause:([^\]]+)\]/);
|
|
8825
|
+
const triedMatch = line.match(/\[tried:([^\]]+)\]/);
|
|
8826
|
+
return {
|
|
8827
|
+
hash: fm.hash,
|
|
8828
|
+
tags: fm.tags,
|
|
8829
|
+
summary: line,
|
|
8830
|
+
fullText: "",
|
|
8831
|
+
...rootCauseMatch?.[1] ? { rootCause: rootCauseMatch[1] } : {},
|
|
8832
|
+
...triedMatch?.[1] ? { triedAndFailed: triedMatch[1].split(",").map((s) => s.trim()) } : {}
|
|
8833
|
+
};
|
|
8834
|
+
}
|
|
8835
|
+
function buildEntryFromLine(line) {
|
|
8836
|
+
const idx = extractIndexEntry(line);
|
|
8837
|
+
return {
|
|
8838
|
+
hash: idx.hash,
|
|
8839
|
+
tags: idx.tags,
|
|
8840
|
+
summary: line,
|
|
8841
|
+
fullText: ""
|
|
8842
|
+
};
|
|
8843
|
+
}
|
|
8823
8844
|
async function loadIndexEntries(projectPath, skillName, stream, session) {
|
|
8824
8845
|
try {
|
|
8825
8846
|
const dirResult = await getStateDir(projectPath, stream, session);
|
|
@@ -8841,31 +8862,11 @@ async function loadIndexEntries(projectPath, skillName, stream, session) {
|
|
|
8841
8862
|
pendingFrontmatter = fm;
|
|
8842
8863
|
continue;
|
|
8843
8864
|
}
|
|
8844
|
-
const
|
|
8845
|
-
|
|
8846
|
-
|
|
8847
|
-
|
|
8848
|
-
|
|
8849
|
-
const triedMatch = line.match(/\[tried:([^\]]+)\]/);
|
|
8850
|
-
indexEntries.push({
|
|
8851
|
-
hash: pendingFrontmatter.hash,
|
|
8852
|
-
tags: pendingFrontmatter.tags,
|
|
8853
|
-
summary: line,
|
|
8854
|
-
fullText: "",
|
|
8855
|
-
// Placeholder — full text not loaded in index mode
|
|
8856
|
-
...rootCauseMatch?.[1] ? { rootCause: rootCauseMatch[1] } : {},
|
|
8857
|
-
...triedMatch?.[1] ? { triedAndFailed: triedMatch[1].split(",").map((s) => s.trim()) } : {}
|
|
8858
|
-
});
|
|
8859
|
-
pendingFrontmatter = null;
|
|
8860
|
-
} else {
|
|
8861
|
-
const idx = extractIndexEntry(line);
|
|
8862
|
-
indexEntries.push({
|
|
8863
|
-
hash: idx.hash,
|
|
8864
|
-
tags: idx.tags,
|
|
8865
|
-
summary: line,
|
|
8866
|
-
fullText: ""
|
|
8867
|
-
});
|
|
8868
|
-
}
|
|
8865
|
+
const isEntryStart = /^- \*\*\d{4}-\d{2}-\d{2}/.test(line) || /^## \d{4}-\d{2}-\d{2}/.test(line);
|
|
8866
|
+
if (isEntryStart) {
|
|
8867
|
+
const entry = pendingFrontmatter ? buildEntryFromFrontmatter(line, pendingFrontmatter) : buildEntryFromLine(line);
|
|
8868
|
+
indexEntries.push(entry);
|
|
8869
|
+
pendingFrontmatter = null;
|
|
8869
8870
|
currentBlock = [line];
|
|
8870
8871
|
} else if (line.trim() !== "" && currentBlock.length > 0) {
|
|
8871
8872
|
currentBlock.push(line);
|
|
@@ -11622,50 +11623,48 @@ function buildMergedTitle(a, b, domains) {
|
|
|
11622
11623
|
const cleanTitle = primaryFinding.title.replace(/^\[.*?\]\s*/, "");
|
|
11623
11624
|
return { title: `[${domainList}] ${cleanTitle}`, primaryFinding };
|
|
11624
11625
|
}
|
|
11626
|
+
function setIfDefined(target, key, value) {
|
|
11627
|
+
if (value !== void 0) target[key] = value;
|
|
11628
|
+
}
|
|
11625
11629
|
function mergeSecurityFields(merged, primary, a, b) {
|
|
11626
|
-
|
|
11627
|
-
|
|
11628
|
-
|
|
11629
|
-
|
|
11630
|
+
setIfDefined(merged, "cweId", primary.cweId ?? a.cweId ?? b.cweId);
|
|
11631
|
+
setIfDefined(
|
|
11632
|
+
merged,
|
|
11633
|
+
"owaspCategory",
|
|
11634
|
+
primary.owaspCategory ?? a.owaspCategory ?? b.owaspCategory
|
|
11635
|
+
);
|
|
11636
|
+
setIfDefined(merged, "confidence", primary.confidence ?? a.confidence ?? b.confidence);
|
|
11637
|
+
setIfDefined(merged, "remediation", pickLongest(a.remediation, b.remediation));
|
|
11630
11638
|
const mergedRefs = [.../* @__PURE__ */ new Set([...a.references ?? [], ...b.references ?? []])];
|
|
11631
|
-
if (cweId !== void 0) merged.cweId = cweId;
|
|
11632
|
-
if (owaspCategory !== void 0) merged.owaspCategory = owaspCategory;
|
|
11633
|
-
if (confidence !== void 0) merged.confidence = confidence;
|
|
11634
|
-
if (remediation !== void 0) merged.remediation = remediation;
|
|
11635
11639
|
if (mergedRefs.length > 0) merged.references = mergedRefs;
|
|
11636
11640
|
}
|
|
11641
|
+
function pickHigherRank(aVal, bVal, rankMap) {
|
|
11642
|
+
return (rankMap[aVal] ?? 0) >= (rankMap[bVal] ?? 0) ? aVal : bVal;
|
|
11643
|
+
}
|
|
11644
|
+
function mergedLineRange(a, b) {
|
|
11645
|
+
return [Math.min(a[0], b[0]), Math.max(a[1], b[1])];
|
|
11646
|
+
}
|
|
11647
|
+
function mergeTrustScore(a, b) {
|
|
11648
|
+
const max = Math.max(a.trustScore ?? 0, b.trustScore ?? 0);
|
|
11649
|
+
return max > 0 ? max : void 0;
|
|
11650
|
+
}
|
|
11637
11651
|
function mergeFindings(a, b) {
|
|
11638
|
-
const highestSeverity = SEVERITY_RANK[a.severity] >= SEVERITY_RANK[b.severity] ? a.severity : b.severity;
|
|
11639
|
-
const highestValidatedBy = (VALIDATED_BY_RANK[a.validatedBy] ?? 0) >= (VALIDATED_BY_RANK[b.validatedBy] ?? 0) ? a.validatedBy : b.validatedBy;
|
|
11640
|
-
const longestRationale = a.rationale.length >= b.rationale.length ? a.rationale : b.rationale;
|
|
11641
|
-
const evidenceSet = /* @__PURE__ */ new Set([...a.evidence, ...b.evidence]);
|
|
11642
|
-
const lineRange = [
|
|
11643
|
-
Math.min(a.lineRange[0], b.lineRange[0]),
|
|
11644
|
-
Math.max(a.lineRange[1], b.lineRange[1])
|
|
11645
|
-
];
|
|
11646
11652
|
const domains = /* @__PURE__ */ new Set([a.domain, b.domain]);
|
|
11647
|
-
const suggestion = pickLongest(a.suggestion, b.suggestion);
|
|
11648
11653
|
const { title, primaryFinding } = buildMergedTitle(a, b, domains);
|
|
11649
11654
|
const merged = {
|
|
11650
11655
|
id: primaryFinding.id,
|
|
11651
11656
|
file: a.file,
|
|
11652
|
-
lineRange,
|
|
11657
|
+
lineRange: mergedLineRange(a.lineRange, b.lineRange),
|
|
11653
11658
|
domain: primaryFinding.domain,
|
|
11654
|
-
severity:
|
|
11659
|
+
severity: pickHigherRank(a.severity, b.severity, SEVERITY_RANK),
|
|
11655
11660
|
title,
|
|
11656
|
-
rationale:
|
|
11657
|
-
evidence: [...
|
|
11658
|
-
validatedBy:
|
|
11661
|
+
rationale: a.rationale.length >= b.rationale.length ? a.rationale : b.rationale,
|
|
11662
|
+
evidence: [.../* @__PURE__ */ new Set([...a.evidence, ...b.evidence])],
|
|
11663
|
+
validatedBy: pickHigherRank(a.validatedBy, b.validatedBy, VALIDATED_BY_RANK)
|
|
11659
11664
|
};
|
|
11660
|
-
|
|
11661
|
-
|
|
11662
|
-
}
|
|
11665
|
+
setIfDefined(merged, "suggestion", pickLongest(a.suggestion, b.suggestion));
|
|
11666
|
+
setIfDefined(merged, "trustScore", mergeTrustScore(a, b));
|
|
11663
11667
|
mergeSecurityFields(merged, primaryFinding, a, b);
|
|
11664
|
-
const trustA = a.trustScore ?? 0;
|
|
11665
|
-
const trustB = b.trustScore ?? 0;
|
|
11666
|
-
if (trustA > 0 || trustB > 0) {
|
|
11667
|
-
merged.trustScore = Math.max(trustA, trustB);
|
|
11668
|
-
}
|
|
11669
11668
|
return merged;
|
|
11670
11669
|
}
|
|
11671
11670
|
function deduplicateFindings(options) {
|
|
@@ -13862,40 +13861,52 @@ function getOrCreateInstallId(projectRoot) {
|
|
|
13862
13861
|
fs36.writeFileSync(installIdFile, id, { encoding: "utf-8", mode: 384 });
|
|
13863
13862
|
return id;
|
|
13864
13863
|
}
|
|
13865
|
-
function
|
|
13864
|
+
function parseIdentityFromTelemetryFile(filePath) {
|
|
13866
13865
|
const identity = {};
|
|
13867
|
-
const filePath = path36.join(projectRoot, ".harness", "telemetry.json");
|
|
13868
13866
|
try {
|
|
13869
13867
|
const raw = fs37.readFileSync(filePath, "utf-8");
|
|
13870
13868
|
const parsed = JSON.parse(raw);
|
|
13871
|
-
|
|
13872
|
-
|
|
13873
|
-
|
|
13874
|
-
|
|
13875
|
-
|
|
13876
|
-
|
|
13869
|
+
const src = parsed?.identity;
|
|
13870
|
+
if (!src || typeof src !== "object") return identity;
|
|
13871
|
+
if (typeof src.project === "string") identity.project = src.project;
|
|
13872
|
+
if (typeof src.team === "string") identity.team = src.team;
|
|
13873
|
+
if (typeof src.alias === "string") identity.alias = src.alias;
|
|
13874
|
+
} catch {
|
|
13875
|
+
}
|
|
13876
|
+
return identity;
|
|
13877
|
+
}
|
|
13878
|
+
function readProjectNameFallback(configPath) {
|
|
13879
|
+
try {
|
|
13880
|
+
const raw = fs37.readFileSync(configPath, "utf-8");
|
|
13881
|
+
const config = JSON.parse(raw);
|
|
13882
|
+
return typeof config?.name === "string" ? config.name : void 0;
|
|
13883
|
+
} catch {
|
|
13884
|
+
return void 0;
|
|
13885
|
+
}
|
|
13886
|
+
}
|
|
13887
|
+
function readGitAliasFallback(cwd) {
|
|
13888
|
+
try {
|
|
13889
|
+
const gitName = execFileSync2("git", ["config", "user.name"], {
|
|
13890
|
+
cwd,
|
|
13891
|
+
encoding: "utf-8",
|
|
13892
|
+
timeout: 2e3,
|
|
13893
|
+
stdio: ["pipe", "pipe", "pipe"]
|
|
13894
|
+
}).trim();
|
|
13895
|
+
return gitName || void 0;
|
|
13877
13896
|
} catch {
|
|
13897
|
+
return void 0;
|
|
13878
13898
|
}
|
|
13899
|
+
}
|
|
13900
|
+
function readIdentity(projectRoot) {
|
|
13901
|
+
const filePath = path36.join(projectRoot, ".harness", "telemetry.json");
|
|
13902
|
+
const identity = parseIdentityFromTelemetryFile(filePath);
|
|
13879
13903
|
if (!identity.project) {
|
|
13880
|
-
|
|
13881
|
-
|
|
13882
|
-
const raw = fs37.readFileSync(configPath, "utf-8");
|
|
13883
|
-
const config = JSON.parse(raw);
|
|
13884
|
-
if (typeof config?.name === "string") identity.project = config.name;
|
|
13885
|
-
} catch {
|
|
13886
|
-
}
|
|
13904
|
+
const fallbackProject = readProjectNameFallback(path36.join(projectRoot, "harness.config.json"));
|
|
13905
|
+
if (fallbackProject) identity.project = fallbackProject;
|
|
13887
13906
|
}
|
|
13888
13907
|
if (!identity.alias) {
|
|
13889
|
-
|
|
13890
|
-
|
|
13891
|
-
cwd: projectRoot,
|
|
13892
|
-
encoding: "utf-8",
|
|
13893
|
-
timeout: 2e3,
|
|
13894
|
-
stdio: ["pipe", "pipe", "pipe"]
|
|
13895
|
-
}).trim();
|
|
13896
|
-
if (gitName) identity.alias = gitName;
|
|
13897
|
-
} catch {
|
|
13898
|
-
}
|
|
13908
|
+
const fallbackAlias = readGitAliasFallback(projectRoot);
|
|
13909
|
+
if (fallbackAlias) identity.alias = fallbackAlias;
|
|
13899
13910
|
}
|
|
13900
13911
|
return identity;
|
|
13901
13912
|
}
|
|
@@ -13963,7 +13974,7 @@ async function send(events, apiKey) {
|
|
|
13963
13974
|
var VALID_TYPES, CONVENTIONAL_PATTERN, DEFAULT_AGNIX_TIMEOUT_MS, HARNESS_AGNIX_DISABLE, HARNESS_AGNIX_BIN, CLAUDE_MD_WARN_BYTES, CLAUDE_MD_ERROR_BYTES, CONTEXT_FILES, MIN_DESCRIPTION_LENGTH, SETTINGS_PATHS, KNOWN_HOOK_EVENTS, MCP_SETTINGS_FILES, REQUIRED_SECTIONS, SETTINGS_FILES, KNOWN_AGNIX_TOOLS, DEFAULT_SECTIONS, DEFAULT_RATIOS, NODE_TYPE_TO_CATEGORY, SECTION_LEVEL_MAP, DEFAULT_LEVEL, DEFAULT_BUDGET, DEFAULT_LOADER_CONFIG, LEVEL_FRACTIONS, PHASE_PRIORITIES, ManifestSchema, BundleConstraintsSchema, BundleSchema, ContributionsSchema, LockfilePackageSchema, LockfileSchema, SharableLayerSchema, SharableForbiddenImportSchema, SharableBoundaryConfigSchema, SharableSecurityRulesSchema, VALID_SCOPES, LINE_PATTERN, START_PATTERN, END_PATTERN, CODE_BLOCK_LANGUAGES, DEFAULT_DRIFT_CONFIG, FILE_TYPES, EXPORT_TYPES, CONVENTION_DESCRIPTIONS, RULE_CHECKERS, EntropyAnalyzer, readFile42, writeFile32, unlink22, mkdir22, copyFile2, DEFAULT_FIX_CONFIG, EXPORT_TYPE_KEYWORD, ALWAYS_UNSAFE_TYPES, idCounter, DEAD_CODE_FIX_ACTIONS, MustExportRuleSchema, MustExportDefaultRuleSchema, NoExportRuleSchema, MustImportRuleSchema, NoImportRuleSchema, NamingRuleSchema, MaxExportsRuleSchema, MaxLinesRuleSchema, RequireJSDocRuleSchema, RuleSchema, ConfigPatternSchema, PatternConfigSchema, DriftConfigSchema, DeadCodeConfigSchema, EntropyConfigSchema, BaselineManager, BenchmarkRunner, RegressionDetector, SKIP_DIRS, SOURCE_EXTENSIONS, FUNCTION_DECL_RE, CONST_DECL_RE, CriticalPathResolver, NoOpTelemetryAdapter, NoOpExecutor, ConsoleSink, feedbackConfig, ChecklistBuilder, AgentActionEmitter, globalEmitter, FileSink, NoOpSink, CategorySnapshotSchema, TimelineSnapshotSchema, TimelineFileSchema, TrendLineSchema, TrendResultSchema, DEFAULT_STABILITY_THRESHOLDS, ALL_CATEGORIES, TimelineManager, ConfidenceTierSchema, RegressionResultSchema, DirectionSchema, CategoryForecastSchema, SpecImpactSignalsSchema, SpecImpactEstimateSchema, ContributingFeatureSchema, AdjustedForecastSchema, PredictionWarningSchema, StabilityForecastSchema, PredictionResultSchema, PredictionOptionsSchema, VALID_STATUSES, EM_DASH, VALID_PRIORITIES, ALL_CATEGORIES2, DIRECTION_THRESHOLD, PredictionEngine, DEFAULT_COEFFICIENTS, SpecImpactEstimator, EMPTY_HISTORY, ViolationHistoryManager, NORMALIZERS, MAX_SAMPLES, DEFAULT_WINDOW_WEEKS, DEFAULT_MIN_OCCURRENCES, FailureEntrySchema, HandoffSchema, GateCheckSchema, GateResultSchema, GateConfigSchema, HarnessStateSchema, DEFAULT_STATE, StreamInfoSchema, StreamIndexSchema, DEFAULT_STREAM_INDEX, HARNESS_DIR, STATE_FILE, LEARNINGS_FILE, FAILURES_FILE, HANDOFF_FILE, GATE_CONFIG_FILE, INDEX_FILE, SESSIONS_DIR, SESSION_INDEX_FILE, SUMMARY_FILE, SESSION_STATE_FILE, ARCHIVE_DIR, CONTENT_HASHES_FILE, EVENTS_FILE, STREAMS_DIR, STREAM_NAME_REGEX, branchCache, BRANCH_CACHE_TTL_MS, STATE_FILES, MAX_CACHE_ENTRIES, learningsCacheMap, WEIGHTS, PROMOTABLE_OUTCOMES, failuresCacheMap, FAILURE_LINE_REGEX, SAFE_GATE_COMMAND, SkillEventSchema, knownHashesCache, EVENT_FORMATTERS, RuleRegistry, DEFAULT_SECURITY_CONFIG, RuleOverrideSchema, SecurityConfigSchema, secretRules, injectionRules, xssRules, cryptoRules, pathTraversalRules, networkRules, deserializationRules, agentConfigRules, mcpRules, insecureDefaultsRules, sharpEdgesRules, nodeRules, expressRules, reactRules, goRules, SecurityScanner, hiddenUnicodePatterns, reRolingPatterns, permissionEscalationPatterns, encodedPayloadPatterns, indirectInjectionPatterns, contextManipulationPatterns, socialEngineeringPatterns, suspiciousPatterns, ALL_PATTERNS, DESTRUCTIVE_BASH, TAINT_DURATION_MS, DEFAULT_SESSION_ID, SecurityCategorySnapshotSchema, SupplyChainSnapshotSchema, SecurityTimelineSnapshotSchema, FindingLifecycleSchema, SecurityTimelineFileSchema, DirectionSchema2, SecurityTrendLineSchema, TrendAttributionSchema, SecurityTrendResultSchema, TimeToFixStatsSchema, TimeToFixResultSchema, EMPTY_SUPPLY_CHAIN, SecurityTimelineManager, ALL_CHECKS, STATUS_ICONS, CINotifier, ExclusionSet, PREFIX_PATTERNS, TEST_FILE_PATTERN, MD_FILE_PATTERN, ALL_DOMAINS, SECURITY_PATTERNS, SEVERITY_RANK, SEVERITY_ORDER, SEVERITY_LABELS, VALIDATED_BY_RANK, VALIDATION_SCORES, DOMAIN_BASELINES, FACTOR_WEIGHTS, EVIDENCE_SATURATION, CORROBORATED_AGREEMENT, STANDALONE_AGREEMENT, AGREEMENT_LINE_GAP, COMPLIANCE_DESCRIPTOR, EXPORT_RE, BUG_DETECTION_DESCRIPTOR, SECURITY_DESCRIPTOR, EVAL_PATTERN, SECRET_PATTERNS, SQL_CONCAT_PATTERN, SHELL_EXEC_PATTERN, ARCHITECTURE_DESCRIPTOR, LARGE_FILE_THRESHOLD, VIOLATION_FILE_RE, LEARNINGS_DESCRIPTOR, RELEVANCE_THRESHOLD, AGENT_DESCRIPTORS, AGENT_RUNNERS, DOWNGRADE_MAP, DEFAULT_PROVIDER_TIERS, SMALL_SUGGESTION_LINE_LIMIT, FILE_LINE_RANGE_PATTERN, FILE_LINE_PATTERN, FILE_ONLY_PATTERN, SECURITY_SENSITIVE_PATH, MIGRATION_PATH, TEST_PATH, CONFIG_PATH, STAGE_DOMAINS, EM_DASH2, STATUS_RANK, RETRY_DEFAULTS, GitHubIssuesSyncAdapter, syncMutex, PRIORITY_RANK, POSITION_WEIGHT, DEPENDENTS_WEIGHT, AFFINITY_WEIGHT, InteractionTypeSchema, QuestionSchema, ConfirmationSchema, TransitionSchema, EmitInteractionInputSchema, ProjectScanner, SHELL_TEMPLATE, STYLES, SCRIPTS, MockLLMService, llmService, ContentPipeline, BlueprintGenerator, TOKENS_PER_MILLION, fallback_default, LITELLM_PRICING_URL, CACHE_TTL_MS, STALENESS_WARNING_DAYS, MICRODOLLARS_PER_DOLLAR, TOKENS_PER_MILLION2, StructuralStrategy, DEFAULT_TOKEN_BUDGET, CHARS_PER_TOKEN, TRUNCATION_MARKER, TruncationStrategy, CompactionPipeline, STABILITY_LOOKUP, TIER_ORDER, AnthropicCacheAdapter, TIER_ORDER2, OpenAICacheAdapter, TIER_ORDER3, CACHED_CONTENT_MARKER, GeminiCacheAdapter, VERSION, POSTHOG_BATCH_URL, MAX_ATTEMPTS, TIMEOUT_MS;
|
|
13964
13975
|
var init_dist3 = __esm({
|
|
13965
13976
|
"../core/dist/index.mjs"() {
|
|
13966
|
-
|
|
13977
|
+
init_chunk_UWAI34RR();
|
|
13967
13978
|
init_dist();
|
|
13968
13979
|
init_dist();
|
|
13969
13980
|
init_dist();
|
|
@@ -17559,7 +17570,7 @@ var init_dist3 = __esm({
|
|
|
17559
17570
|
info: 0,
|
|
17560
17571
|
total: 0
|
|
17561
17572
|
};
|
|
17562
|
-
SecurityTimelineManager = class {
|
|
17573
|
+
SecurityTimelineManager = class _SecurityTimelineManager {
|
|
17563
17574
|
rootDir;
|
|
17564
17575
|
timelinePath;
|
|
17565
17576
|
constructor(rootDir) {
|
|
@@ -17831,6 +17842,11 @@ var init_dist3 = __esm({
|
|
|
17831
17842
|
}
|
|
17832
17843
|
}
|
|
17833
17844
|
}
|
|
17845
|
+
static SEVERITY_COUNT_KEY = {
|
|
17846
|
+
error: "errorCount",
|
|
17847
|
+
warning: "warningCount",
|
|
17848
|
+
info: "infoCount"
|
|
17849
|
+
};
|
|
17834
17850
|
aggregateByCategory(findings) {
|
|
17835
17851
|
const result = {};
|
|
17836
17852
|
for (const finding of findings) {
|
|
@@ -17844,9 +17860,8 @@ var init_dist3 = __esm({
|
|
|
17844
17860
|
}
|
|
17845
17861
|
const cat = result[finding.category];
|
|
17846
17862
|
cat.findingCount++;
|
|
17847
|
-
|
|
17848
|
-
|
|
17849
|
-
else cat.infoCount++;
|
|
17863
|
+
const key = _SecurityTimelineManager.SEVERITY_COUNT_KEY[finding.severity] ?? "infoCount";
|
|
17864
|
+
cat[key]++;
|
|
17850
17865
|
}
|
|
17851
17866
|
return result;
|
|
17852
17867
|
}
|
|
@@ -17874,26 +17889,23 @@ var init_dist3 = __esm({
|
|
|
17874
17889
|
return { current, previous, delta, direction };
|
|
17875
17890
|
}
|
|
17876
17891
|
computeAttribution(first, last) {
|
|
17877
|
-
const attribution = [];
|
|
17878
17892
|
const allCategories = /* @__PURE__ */ new Set([
|
|
17879
17893
|
...Object.keys(first.byCategory),
|
|
17880
17894
|
...Object.keys(last.byCategory)
|
|
17881
17895
|
]);
|
|
17896
|
+
const results = [];
|
|
17882
17897
|
for (const category of allCategories) {
|
|
17883
|
-
const
|
|
17884
|
-
|
|
17885
|
-
const delta = currCount - prevCount;
|
|
17886
|
-
if (delta === 0) continue;
|
|
17887
|
-
const direction = delta < 0 ? "improving" : "declining";
|
|
17888
|
-
const sign = delta > 0 ? "+" : "";
|
|
17889
|
-
attribution.push({
|
|
17890
|
-
category,
|
|
17891
|
-
delta,
|
|
17892
|
-
direction,
|
|
17893
|
-
description: `${sign}${delta} ${category} findings`
|
|
17894
|
-
});
|
|
17898
|
+
const attr = this.categoryAttribution(category, first.byCategory, last.byCategory);
|
|
17899
|
+
if (attr) results.push(attr);
|
|
17895
17900
|
}
|
|
17896
|
-
return
|
|
17901
|
+
return results;
|
|
17902
|
+
}
|
|
17903
|
+
categoryAttribution(category, prev, curr) {
|
|
17904
|
+
const delta = (curr[category]?.findingCount ?? 0) - (prev[category]?.findingCount ?? 0);
|
|
17905
|
+
if (delta === 0) return null;
|
|
17906
|
+
const direction = delta < 0 ? "improving" : "declining";
|
|
17907
|
+
const sign = delta > 0 ? "+" : "";
|
|
17908
|
+
return { category, delta, direction, description: `${sign}${delta} ${category} findings` };
|
|
17897
17909
|
}
|
|
17898
17910
|
computeStats(values) {
|
|
17899
17911
|
if (values.length === 0) {
|