@harness-engineering/cli 2.3.0 → 2.3.1
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-N7YBQPE3.js → agents-md-5JG3AE5A.js} +3 -3
- package/dist/{architecture-PP7WERSV.js → architecture-544ISXDI.js} +4 -4
- package/dist/{assess-project-WXFCJQTX.js → assess-project-PBO6XFJC.js} +1 -1
- package/dist/bin/harness-mcp.js +15 -15
- package/dist/bin/harness.js +25 -25
- package/dist/{check-phase-gate-R3KQFBAH.js → check-phase-gate-BZU4DGF3.js} +4 -4
- package/dist/{chunk-MT2MMBUA.js → chunk-22OKI5QI.js} +9 -9
- package/dist/{chunk-6CHNY3NJ.js → chunk-2564TBT6.js} +1 -1
- package/dist/{chunk-YG4ZBGEH.js → chunk-7BNK4M23.js} +1 -1
- package/dist/{chunk-3LPOTTPX.js → chunk-A36MGB3V.js} +92 -92
- package/dist/{chunk-PW3U4YJV.js → chunk-DBJC4ULT.js} +9 -4
- package/dist/{chunk-MKPRB4PL.js → chunk-DHWFOHPX.js} +1 -1
- package/dist/{chunk-4NFV5UZO.js → chunk-EMJFHTPZ.js} +3 -3
- package/dist/{chunk-DLBMYLYR.js → chunk-IYA3NS5P.js} +1 -1
- package/dist/{chunk-LM4F5KBK.js → chunk-J4MX5DIA.js} +5 -5
- package/dist/{chunk-5KTTKXQN.js → chunk-JMACX5FN.js} +1 -1
- package/dist/{chunk-KWD6FF7M.js → chunk-KJR4Z2YC.js} +8 -8
- package/dist/{chunk-L3CEN42B.js → chunk-KT5PWWWO.js} +1 -1
- package/dist/{chunk-GUIX2TMZ.js → chunk-LBYGGNEZ.js} +1 -1
- package/dist/{chunk-YEBUFRTT.js → chunk-LYMPKO6N.js} +2 -2
- package/dist/{chunk-35FI23SO.js → chunk-N6DVSOLZ.js} +118 -112
- package/dist/{chunk-7PGYJO3L.js → chunk-QZ67TDLJ.js} +3 -3
- package/dist/{chunk-GTXUUGFG.js → chunk-R6GLLMRZ.js} +9 -9
- package/dist/{chunk-NP2ZI6E3.js → chunk-T2ZMHXCX.js} +1 -1
- package/dist/{chunk-EJPR5VCT.js → chunk-TIJXG4UB.js} +6 -6
- package/dist/{chunk-KTWKW6KJ.js → chunk-TIQU5VY7.js} +1 -1
- package/dist/{chunk-D2LZUJLP.js → chunk-U2SF3KAQ.js} +2 -2
- package/dist/{chunk-KUVPSUG4.js → chunk-WMZKZCCE.js} +1 -1
- package/dist/{chunk-BMM3GXV6.js → chunk-XPRGWHBL.js} +80 -37
- package/dist/{chunk-5PPV4WYY.js → chunk-YI6NTL72.js} +5 -5
- package/dist/{chunk-4DWOMGUM.js → chunk-YNG7BWGB.js} +396 -79
- package/dist/{ci-workflow-GFCXFJ4G.js → ci-workflow-ZO6FPO3V.js} +3 -3
- package/dist/{dist-D27LJR2T.js → dist-SQAOKWXM.js} +5 -3
- package/dist/{dist-I4LWG3IN.js → dist-ZS3Y3YWP.js} +8 -2
- package/dist/{docs-UXKDKPJF.js → docs-VW2KDPI3.js} +4 -4
- package/dist/{engine-A63FRDLF.js → engine-LFQ2JSHY.js} +3 -3
- package/dist/{entropy-IFIP4ZP4.js → entropy-P62LCVJI.js} +3 -3
- package/dist/{feedback-W36DSJQA.js → feedback-O3TZAPGX.js} +1 -1
- package/dist/{generate-agent-definitions-F4YMKQLP.js → generate-agent-definitions-WVCOZDKI.js} +4 -4
- package/dist/{glob-helper-FZPPTGJN.js → glob-helper-JE3MO4UD.js} +1 -1
- package/dist/{graph-loader-5MKHAJJF.js → graph-loader-TJU4E7KL.js} +1 -1
- package/dist/index.js +25 -25
- package/dist/{loader-4UAOGUSS.js → loader-UB2A65DN.js} +3 -3
- package/dist/{mcp-YW7PLXVQ.js → mcp-ST26QMDK.js} +15 -15
- package/dist/{performance-AZ5UYPOQ.js → performance-5HQG3IU6.js} +4 -4
- package/dist/{review-pipeline-OLQVGBWJ.js → review-pipeline-VRDL5A7J.js} +3 -3
- package/dist/{runtime-GG3U5HH5.js → runtime-TQQT2MWQ.js} +3 -3
- package/dist/{scan-BIJYHOE7.js → scan-SFX5U3TE.js} +1 -1
- package/dist/{security-MYTRFSR7.js → security-IMFAE6MW.js} +1 -1
- package/dist/{validate-QI4V4JY6.js → validate-GW2DG64P.js} +4 -4
- package/dist/{validate-cross-check-XRSSAXJP.js → validate-cross-check-F5YQVXLT.js} +3 -3
- package/package.json +6 -6
|
@@ -9,17 +9,19 @@ import {
|
|
|
9
9
|
isOk
|
|
10
10
|
} from "./chunk-RL4VMEXL.js";
|
|
11
11
|
import {
|
|
12
|
+
DEFAULT_SKIP_DIRS,
|
|
12
13
|
GraphStore,
|
|
13
14
|
NODE_STABILITY,
|
|
14
15
|
init_dist as init_dist2,
|
|
15
|
-
queryTraceability
|
|
16
|
-
|
|
16
|
+
queryTraceability,
|
|
17
|
+
skipDirGlobs
|
|
18
|
+
} from "./chunk-XPRGWHBL.js";
|
|
17
19
|
import {
|
|
18
20
|
__esm,
|
|
19
21
|
__export
|
|
20
22
|
} from "./chunk-KFQGP6VL.js";
|
|
21
23
|
|
|
22
|
-
// ../core/dist/chunk-
|
|
24
|
+
// ../core/dist/chunk-4UI65RLE.mjs
|
|
23
25
|
import { z } from "zod";
|
|
24
26
|
import { createHash } from "crypto";
|
|
25
27
|
import { minimatch } from "minimatch";
|
|
@@ -1421,7 +1423,7 @@ function mapForbiddenImportViolations(forbidden, rootDir, category) {
|
|
|
1421
1423
|
});
|
|
1422
1424
|
}
|
|
1423
1425
|
function isSkippedEntry(name) {
|
|
1424
|
-
return name.startsWith(".") || name
|
|
1426
|
+
return name.startsWith(".") || DEFAULT_SKIP_DIRS.has(name);
|
|
1425
1427
|
}
|
|
1426
1428
|
function isTsSourceFile(name) {
|
|
1427
1429
|
if (!name.endsWith(".ts") && !name.endsWith(".tsx")) return false;
|
|
@@ -1510,7 +1512,7 @@ function extractImportSources(content, filePath) {
|
|
|
1510
1512
|
return sources;
|
|
1511
1513
|
}
|
|
1512
1514
|
function isSkippedEntry2(name) {
|
|
1513
|
-
return name.startsWith(".") || name
|
|
1515
|
+
return name.startsWith(".") || DEFAULT_SKIP_DIRS.has(name);
|
|
1514
1516
|
}
|
|
1515
1517
|
function isTsSourceFile2(name) {
|
|
1516
1518
|
if (!name.endsWith(".ts") && !name.endsWith(".tsx")) return false;
|
|
@@ -1746,10 +1748,12 @@ async function toHaveMaxDepDepth(received, maxDepth) {
|
|
|
1746
1748
|
};
|
|
1747
1749
|
}
|
|
1748
1750
|
var __defProp, __export2, ArchMetricCategorySchema, ViolationSchema, MetricResultSchema, CategoryBaselineSchema, ArchBaselineSchema, CategoryRegressionSchema, ArchDiffResultSchema, ThresholdConfigSchema, ArchConfigSchema, ConstraintRuleSchema, ViolationSnapshotSchema, ViolationHistorySchema, EmergenceConfidenceSchema, EmergentConstraintSuggestionSchema, EmergenceResultSchema, accessAsync, readFileAsync, EXTENSION_BY_LANG, JS_EXT_FALLBACKS, 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;
|
|
1749
|
-
var
|
|
1750
|
-
"../core/dist/chunk-
|
|
1751
|
+
var init_chunk_4UI65RLE = __esm({
|
|
1752
|
+
"../core/dist/chunk-4UI65RLE.mjs"() {
|
|
1751
1753
|
"use strict";
|
|
1752
1754
|
init_dist();
|
|
1755
|
+
init_dist2();
|
|
1756
|
+
init_dist2();
|
|
1753
1757
|
__defProp = Object.defineProperty;
|
|
1754
1758
|
__export2 = (target, all) => {
|
|
1755
1759
|
for (var name in all)
|
|
@@ -2982,6 +2986,7 @@ __export(dist_exports, {
|
|
|
2982
2986
|
ViolationHistorySchema: () => ViolationHistorySchema,
|
|
2983
2987
|
ViolationSchema: () => ViolationSchema,
|
|
2984
2988
|
ViolationSnapshotSchema: () => ViolationSnapshotSchema,
|
|
2989
|
+
WHATWG_BAD_PORTS: () => WHATWG_BAD_PORTS,
|
|
2985
2990
|
acquireCompoundLock: () => acquireCompoundLock,
|
|
2986
2991
|
addProvenance: () => addProvenance,
|
|
2987
2992
|
agentConfigRules: () => agentConfigRules,
|
|
@@ -3007,6 +3012,7 @@ __export(dist_exports, {
|
|
|
3007
3012
|
archiveStream: () => archiveStream,
|
|
3008
3013
|
assembleCandidateReport: () => assembleCandidateReport,
|
|
3009
3014
|
assembleReport: () => assembleReport,
|
|
3015
|
+
assertPortUsable: () => assertPortUsable,
|
|
3010
3016
|
assertSanitized: () => assertSanitized,
|
|
3011
3017
|
assignFeature: () => assignFeature,
|
|
3012
3018
|
buildDependencyGraph: () => buildDependencyGraph,
|
|
@@ -3121,6 +3127,7 @@ __export(dist_exports, {
|
|
|
3121
3127
|
goRules: () => goRules,
|
|
3122
3128
|
injectionRules: () => injectionRules,
|
|
3123
3129
|
insecureDefaultsRules: () => insecureDefaultsRules,
|
|
3130
|
+
isBadPort: () => isBadPort,
|
|
3124
3131
|
isDuplicateFinding: () => isDuplicateFinding,
|
|
3125
3132
|
isErr: () => isErr,
|
|
3126
3133
|
isOk: () => isOk,
|
|
@@ -3319,10 +3326,11 @@ import { basename as basename4, dirname as dirname42 } from "path";
|
|
|
3319
3326
|
import { z as z3 } from "zod";
|
|
3320
3327
|
import * as fs4 from "fs/promises";
|
|
3321
3328
|
import * as fs5 from "fs/promises";
|
|
3322
|
-
import {
|
|
3329
|
+
import { resolve as resolve5 } from "path";
|
|
3323
3330
|
import { minimatch as minimatch22 } from "minimatch";
|
|
3324
|
-
import {
|
|
3325
|
-
import { dirname as
|
|
3331
|
+
import { join as join15, resolve as resolve42 } from "path";
|
|
3332
|
+
import { dirname as dirname5, resolve as resolve6 } from "path";
|
|
3333
|
+
import { dirname as dirname6, extname as extname2, resolve as resolve7 } from "path";
|
|
3326
3334
|
import { minimatch as minimatch3 } from "minimatch";
|
|
3327
3335
|
import { readdirSync, statSync as statSync2 } from "fs";
|
|
3328
3336
|
import { join as join16 } from "path";
|
|
@@ -3455,6 +3463,16 @@ import { execFile as execFile2 } from "child_process";
|
|
|
3455
3463
|
import { promisify as promisify3 } from "util";
|
|
3456
3464
|
import * as fs46 from "fs/promises";
|
|
3457
3465
|
import * as path45 from "path";
|
|
3466
|
+
function isBadPort(port) {
|
|
3467
|
+
return BAD_PORT_SET.has(port);
|
|
3468
|
+
}
|
|
3469
|
+
function assertPortUsable(port, label = "server") {
|
|
3470
|
+
if (isBadPort(port)) {
|
|
3471
|
+
throw new Error(
|
|
3472
|
+
`Refusing to bind ${label} to port ${port}: this port is on the WHATWG fetch bad-ports list, so browsers and Node's fetch() will reject every connection with "bad port". Choose a different port. See https://fetch.spec.whatwg.org/#port-blocking for the full list.`
|
|
3473
|
+
);
|
|
3474
|
+
}
|
|
3475
|
+
}
|
|
3458
3476
|
async function validateFileStructure(projectPath, conventions) {
|
|
3459
3477
|
const missing = [];
|
|
3460
3478
|
const unexpected = [];
|
|
@@ -3714,7 +3732,7 @@ function isAgnixDisabled() {
|
|
|
3714
3732
|
return v === "1" || v === "true";
|
|
3715
3733
|
}
|
|
3716
3734
|
function runAgnix(cwd, strict, binPath, timeoutMs = DEFAULT_AGNIX_TIMEOUT_MS, spawnFn = spawn) {
|
|
3717
|
-
return new Promise((
|
|
3735
|
+
return new Promise((resolve10) => {
|
|
3718
3736
|
const args = ["--format", "json"];
|
|
3719
3737
|
if (strict) args.push("--strict");
|
|
3720
3738
|
args.push(cwd);
|
|
@@ -3728,7 +3746,7 @@ function runAgnix(cwd, strict, binPath, timeoutMs = DEFAULT_AGNIX_TIMEOUT_MS, sp
|
|
|
3728
3746
|
if (settled) return;
|
|
3729
3747
|
settled = true;
|
|
3730
3748
|
clearTimeout(timer);
|
|
3731
|
-
|
|
3749
|
+
resolve10(outcome);
|
|
3732
3750
|
};
|
|
3733
3751
|
const timer = setTimeout(() => {
|
|
3734
3752
|
child.kill("SIGKILL");
|
|
@@ -5867,44 +5885,232 @@ function extractPackageEntries(rootDir, pkg) {
|
|
|
5867
5885
|
if (entries.length === 0 && typeof pkg["main"] === "string") {
|
|
5868
5886
|
entries.push(resolve42(rootDir, pkg["main"]));
|
|
5869
5887
|
}
|
|
5870
|
-
if (pkg["bin"])
|
|
5871
|
-
entries.push(...collectFieldEntries(rootDir, pkg["bin"]));
|
|
5872
|
-
}
|
|
5888
|
+
if (pkg["bin"]) entries.push(...collectFieldEntries(rootDir, pkg["bin"]));
|
|
5873
5889
|
return entries;
|
|
5874
5890
|
}
|
|
5875
|
-
async function
|
|
5876
|
-
|
|
5877
|
-
|
|
5891
|
+
async function readPackageJsonEntries(rootDir, pkgPath) {
|
|
5892
|
+
const content = await readFileContent(pkgPath);
|
|
5893
|
+
if (!content.ok) return [];
|
|
5894
|
+
try {
|
|
5895
|
+
const pkg = JSON.parse(content.value);
|
|
5896
|
+
return extractPackageEntries(rootDir, pkg);
|
|
5897
|
+
} catch {
|
|
5898
|
+
return [];
|
|
5878
5899
|
}
|
|
5900
|
+
}
|
|
5901
|
+
async function resolveTypeScript(rootDir) {
|
|
5879
5902
|
const pkgPath = join15(rootDir, "package.json");
|
|
5880
|
-
|
|
5881
|
-
|
|
5882
|
-
|
|
5883
|
-
|
|
5884
|
-
|
|
5885
|
-
|
|
5886
|
-
|
|
5887
|
-
|
|
5888
|
-
|
|
5903
|
+
const detected = await fileExists(pkgPath);
|
|
5904
|
+
if (detected) {
|
|
5905
|
+
const entries = await readPackageJsonEntries(rootDir, pkgPath);
|
|
5906
|
+
if (entries.length > 0) {
|
|
5907
|
+
return { language: "typescript", detected: true, entries, hints: TS_HINTS };
|
|
5908
|
+
}
|
|
5909
|
+
}
|
|
5910
|
+
for (const conv of TS_CONVENTIONS) {
|
|
5911
|
+
const p = join15(rootDir, conv);
|
|
5912
|
+
if (await fileExists(p)) {
|
|
5913
|
+
return { language: "typescript", detected: true, entries: [p], hints: TS_HINTS };
|
|
5914
|
+
}
|
|
5915
|
+
}
|
|
5916
|
+
return { language: "typescript", detected, entries: [], hints: TS_HINTS };
|
|
5917
|
+
}
|
|
5918
|
+
async function detectPython(rootDir) {
|
|
5919
|
+
return await fileExists(join15(rootDir, "pyproject.toml")) || await fileExists(join15(rootDir, "setup.py")) || await fileExists(join15(rootDir, "requirements.txt"));
|
|
5920
|
+
}
|
|
5921
|
+
async function readPyProject(rootDir) {
|
|
5922
|
+
const pyproject = join15(rootDir, "pyproject.toml");
|
|
5923
|
+
if (!await fileExists(pyproject)) return { scriptTargets: [] };
|
|
5924
|
+
const content = await readFileContent(pyproject);
|
|
5925
|
+
if (!content.ok) return { scriptTargets: [] };
|
|
5926
|
+
return parsePyProject(content.value);
|
|
5927
|
+
}
|
|
5928
|
+
async function resolveScriptTargetEntry(rootDir, target) {
|
|
5929
|
+
const mod = target.split(":")[0];
|
|
5930
|
+
if (!mod) return void 0;
|
|
5931
|
+
const relPath2 = mod.replaceAll(".", "/") + ".py";
|
|
5932
|
+
for (const candidate of [join15(rootDir, relPath2), join15(rootDir, "src", relPath2)]) {
|
|
5933
|
+
if (await fileExists(candidate)) return candidate;
|
|
5934
|
+
}
|
|
5935
|
+
return void 0;
|
|
5936
|
+
}
|
|
5937
|
+
async function resolvePythonFromScripts(rootDir, targets) {
|
|
5938
|
+
const entries = [];
|
|
5939
|
+
for (const target of targets) {
|
|
5940
|
+
const entry = await resolveScriptTargetEntry(rootDir, target);
|
|
5941
|
+
if (entry) entries.push(entry);
|
|
5942
|
+
}
|
|
5943
|
+
return entries;
|
|
5944
|
+
}
|
|
5945
|
+
async function resolvePythonFromProjectName(rootDir, projectName) {
|
|
5946
|
+
if (!projectName) return [];
|
|
5947
|
+
const normalized = projectName.replaceAll("-", "_");
|
|
5948
|
+
const candidates = [
|
|
5949
|
+
join15(rootDir, normalized, "__init__.py"),
|
|
5950
|
+
join15(rootDir, normalized, "__main__.py"),
|
|
5951
|
+
join15(rootDir, "src", normalized, "__init__.py"),
|
|
5952
|
+
join15(rootDir, "src", normalized, "__main__.py")
|
|
5953
|
+
];
|
|
5954
|
+
const entries = [];
|
|
5955
|
+
for (const c of candidates) {
|
|
5956
|
+
if (await fileExists(c)) entries.push(c);
|
|
5957
|
+
}
|
|
5958
|
+
return entries;
|
|
5959
|
+
}
|
|
5960
|
+
async function resolvePythonConventions(rootDir) {
|
|
5961
|
+
const entries = [];
|
|
5962
|
+
for (const conv of PYTHON_CONVENTIONS) {
|
|
5963
|
+
const p = join15(rootDir, conv);
|
|
5964
|
+
if (await fileExists(p)) entries.push(p);
|
|
5965
|
+
}
|
|
5966
|
+
return entries;
|
|
5967
|
+
}
|
|
5968
|
+
async function findPythonTopLevelPackages(rootDir) {
|
|
5969
|
+
const found = await findFiles("*/__init__.py", rootDir);
|
|
5970
|
+
if (found.length > 0) return found;
|
|
5971
|
+
return findFiles("src/*/__init__.py", rootDir);
|
|
5972
|
+
}
|
|
5973
|
+
async function resolvePython(rootDir) {
|
|
5974
|
+
if (!await detectPython(rootDir)) {
|
|
5975
|
+
return { language: "python", detected: false, entries: [], hints: PYTHON_HINTS };
|
|
5976
|
+
}
|
|
5977
|
+
const info = await readPyProject(rootDir);
|
|
5978
|
+
const strategies = [
|
|
5979
|
+
() => resolvePythonFromScripts(rootDir, info.scriptTargets),
|
|
5980
|
+
() => resolvePythonFromProjectName(rootDir, info.projectName),
|
|
5981
|
+
() => resolvePythonConventions(rootDir),
|
|
5982
|
+
() => findPythonTopLevelPackages(rootDir)
|
|
5983
|
+
];
|
|
5984
|
+
for (const strategy of strategies) {
|
|
5985
|
+
const entries = await strategy();
|
|
5986
|
+
if (entries.length > 0) {
|
|
5987
|
+
return { language: "python", detected: true, entries, hints: PYTHON_HINTS };
|
|
5988
|
+
}
|
|
5989
|
+
}
|
|
5990
|
+
return { language: "python", detected: true, entries: [], hints: PYTHON_HINTS };
|
|
5991
|
+
}
|
|
5992
|
+
async function resolveGo(rootDir) {
|
|
5993
|
+
const hints = ["Create main.go at the project root, or use the cmd/<name>/main.go layout"];
|
|
5994
|
+
const detected = await fileExists(join15(rootDir, "go.mod"));
|
|
5995
|
+
if (!detected) return { language: "go", detected: false, entries: [], hints };
|
|
5996
|
+
const entries = [];
|
|
5997
|
+
const mainGo = join15(rootDir, "main.go");
|
|
5998
|
+
if (await fileExists(mainGo)) entries.push(mainGo);
|
|
5999
|
+
entries.push(...await findFiles("cmd/*/main.go", rootDir));
|
|
6000
|
+
return { language: "go", detected: true, entries, hints };
|
|
6001
|
+
}
|
|
6002
|
+
async function resolveRust(rootDir) {
|
|
6003
|
+
const hints = [
|
|
6004
|
+
"Create src/main.rs or src/lib.rs",
|
|
6005
|
+
"Declare [[bin]] entries with a `path` in Cargo.toml"
|
|
6006
|
+
];
|
|
6007
|
+
const cargoPath = join15(rootDir, "Cargo.toml");
|
|
6008
|
+
const detected = await fileExists(cargoPath);
|
|
6009
|
+
if (!detected) return { language: "rust", detected: false, entries: [], hints };
|
|
6010
|
+
const entries = [];
|
|
6011
|
+
const content = await readFileContent(cargoPath);
|
|
6012
|
+
if (content.ok) {
|
|
6013
|
+
for (const bp of parseCargoBinPaths(content.value)) {
|
|
6014
|
+
const abs = resolve42(rootDir, bp);
|
|
6015
|
+
if (await fileExists(abs)) entries.push(abs);
|
|
5889
6016
|
}
|
|
5890
6017
|
}
|
|
5891
|
-
|
|
5892
|
-
|
|
5893
|
-
|
|
5894
|
-
|
|
5895
|
-
return Ok([convPath]);
|
|
6018
|
+
if (entries.length === 0) {
|
|
6019
|
+
for (const conv of ["src/main.rs", "src/lib.rs"]) {
|
|
6020
|
+
const p = join15(rootDir, conv);
|
|
6021
|
+
if (await fileExists(p)) entries.push(p);
|
|
5896
6022
|
}
|
|
6023
|
+
entries.push(...await findFiles("src/bin/*.rs", rootDir));
|
|
6024
|
+
}
|
|
6025
|
+
return { language: "rust", detected: true, entries, hints };
|
|
6026
|
+
}
|
|
6027
|
+
async function resolveJava(rootDir) {
|
|
6028
|
+
const hints = [
|
|
6029
|
+
"Place an entry class at src/main/java/**/Main.java (or *Application.java for Spring Boot)"
|
|
6030
|
+
];
|
|
6031
|
+
const detected = await fileExists(join15(rootDir, "pom.xml")) || await fileExists(join15(rootDir, "build.gradle")) || await fileExists(join15(rootDir, "build.gradle.kts"));
|
|
6032
|
+
if (!detected) return { language: "java", detected: false, entries: [], hints };
|
|
6033
|
+
const entries = [];
|
|
6034
|
+
entries.push(...await findFiles("src/main/java/**/Main.java", rootDir));
|
|
6035
|
+
entries.push(...await findFiles("src/main/java/**/*Application.java", rootDir));
|
|
6036
|
+
return { language: "java", detected: true, entries, hints };
|
|
6037
|
+
}
|
|
6038
|
+
function parseTomlLine(raw) {
|
|
6039
|
+
const line = raw.replace(/(^|\s)#.*$/, "").trim();
|
|
6040
|
+
if (!line) return {};
|
|
6041
|
+
const sectionMatch = /^\[([^\]]+)\]$/.exec(line);
|
|
6042
|
+
if (sectionMatch) return { section: sectionMatch[1] ?? "" };
|
|
6043
|
+
const eq = line.indexOf("=");
|
|
6044
|
+
if (eq <= 0) return {};
|
|
6045
|
+
return {
|
|
6046
|
+
key: line.slice(0, eq).trim(),
|
|
6047
|
+
value: stripTomlString2(line.slice(eq + 1).trim())
|
|
6048
|
+
};
|
|
6049
|
+
}
|
|
6050
|
+
function parsePyProject(content) {
|
|
6051
|
+
const result = { scriptTargets: [] };
|
|
6052
|
+
let section = null;
|
|
6053
|
+
for (const raw of content.split(/\r?\n/)) {
|
|
6054
|
+
const parsed = parseTomlLine(raw);
|
|
6055
|
+
if (parsed.section !== void 0) {
|
|
6056
|
+
section = parsed.section;
|
|
6057
|
+
continue;
|
|
6058
|
+
}
|
|
6059
|
+
if (parsed.key === void 0 || parsed.value === void 0) continue;
|
|
6060
|
+
if (section === "project" && parsed.key === "name") result.projectName = parsed.value;
|
|
6061
|
+
else if (section === "project.scripts") result.scriptTargets.push(parsed.value);
|
|
6062
|
+
}
|
|
6063
|
+
return result;
|
|
6064
|
+
}
|
|
6065
|
+
function parseCargoBinPaths(content) {
|
|
6066
|
+
const paths = [];
|
|
6067
|
+
let inBin = false;
|
|
6068
|
+
for (const raw of content.split(/\r?\n/)) {
|
|
6069
|
+
const line = raw.replace(/(^|\s)#.*$/, "").trim();
|
|
6070
|
+
if (!line) continue;
|
|
6071
|
+
if (line === "[[bin]]") {
|
|
6072
|
+
inBin = true;
|
|
6073
|
+
continue;
|
|
6074
|
+
}
|
|
6075
|
+
if (line.startsWith("[")) {
|
|
6076
|
+
inBin = false;
|
|
6077
|
+
continue;
|
|
6078
|
+
}
|
|
6079
|
+
if (!inBin) continue;
|
|
6080
|
+
const eq = line.indexOf("=");
|
|
6081
|
+
if (eq <= 0) continue;
|
|
6082
|
+
const key = line.slice(0, eq).trim();
|
|
6083
|
+
if (key === "path") paths.push(stripTomlString2(line.slice(eq + 1).trim()));
|
|
6084
|
+
}
|
|
6085
|
+
return paths;
|
|
6086
|
+
}
|
|
6087
|
+
function stripTomlString2(value) {
|
|
6088
|
+
if (value.startsWith('"') && value.endsWith('"') || value.startsWith("'") && value.endsWith("'")) {
|
|
6089
|
+
return value.slice(1, -1);
|
|
5897
6090
|
}
|
|
6091
|
+
return value;
|
|
6092
|
+
}
|
|
6093
|
+
async function resolveEntryPoints(rootDir, explicitEntries) {
|
|
6094
|
+
if (explicitEntries && explicitEntries.length > 0) {
|
|
6095
|
+
return Ok(explicitEntries.map((e) => resolve42(rootDir, e)));
|
|
6096
|
+
}
|
|
6097
|
+
const resolvers = [resolveTypeScript, resolvePython, resolveGo, resolveRust, resolveJava];
|
|
6098
|
+
const resolutions = [];
|
|
6099
|
+
for (const resolver of resolvers) {
|
|
6100
|
+
const res = await resolver(rootDir);
|
|
6101
|
+
resolutions.push(res);
|
|
6102
|
+
if (res.entries.length > 0) return Ok(res.entries);
|
|
6103
|
+
}
|
|
6104
|
+
const detectedLangs = resolutions.filter((r) => r.detected);
|
|
6105
|
+
const suggestions = detectedLangs.length > 0 ? detectedLangs.flatMap((r) => r.hints) : resolutions.flatMap((r) => r.hints);
|
|
6106
|
+
suggestions.push("Specify entryPoints in config");
|
|
6107
|
+
const reason = detectedLangs.length > 0 ? `Detected ${detectedLangs.map((r) => r.language).join(", ")} project but found no entry points` : "No language manifest (package.json, pyproject.toml, go.mod, Cargo.toml, pom.xml) and no conventional entry files found";
|
|
5898
6108
|
return Err(
|
|
5899
6109
|
createEntropyError(
|
|
5900
6110
|
"ENTRY_POINT_NOT_FOUND",
|
|
5901
6111
|
"Could not resolve entry points",
|
|
5902
|
-
{ reason
|
|
5903
|
-
|
|
5904
|
-
'Add "exports" or "main" to package.json',
|
|
5905
|
-
"Create src/index.ts",
|
|
5906
|
-
"Specify entryPoints in config"
|
|
5907
|
-
]
|
|
6112
|
+
{ reason },
|
|
6113
|
+
suggestions
|
|
5908
6114
|
)
|
|
5909
6115
|
);
|
|
5910
6116
|
}
|
|
@@ -6001,6 +6207,7 @@ function extractSymbolsFromNode(node) {
|
|
|
6001
6207
|
return [];
|
|
6002
6208
|
}
|
|
6003
6209
|
function extractInternalSymbols(ast) {
|
|
6210
|
+
if (ast.language !== "typescript" && ast.language !== "javascript") return [];
|
|
6004
6211
|
const body = ast.body;
|
|
6005
6212
|
if (!body?.body) return [];
|
|
6006
6213
|
const nodes = body.body;
|
|
@@ -6011,6 +6218,7 @@ function toJSDocComment(comment) {
|
|
|
6011
6218
|
return { content: comment.value, line: comment.loc?.start?.line || 0 };
|
|
6012
6219
|
}
|
|
6013
6220
|
function extractJSDocComments(ast) {
|
|
6221
|
+
if (ast.language !== "typescript" && ast.language !== "javascript") return [];
|
|
6014
6222
|
const body = ast.body;
|
|
6015
6223
|
if (!body?.comments) return [];
|
|
6016
6224
|
return body.comments.flatMap((c) => {
|
|
@@ -6068,19 +6276,16 @@ function extractAllCodeReferences(docs) {
|
|
|
6068
6276
|
}
|
|
6069
6277
|
async function buildSnapshot2(config) {
|
|
6070
6278
|
const startTime = Date.now();
|
|
6071
|
-
const
|
|
6072
|
-
const rootDir = resolve42(config.rootDir);
|
|
6279
|
+
const rootDir = resolve5(config.rootDir);
|
|
6073
6280
|
const entryPointsResult = await resolveEntryPoints(rootDir, config.entryPoints);
|
|
6074
6281
|
if (!entryPointsResult.ok) {
|
|
6075
6282
|
return Err(entryPointsResult.error);
|
|
6076
6283
|
}
|
|
6077
|
-
const
|
|
6078
|
-
const
|
|
6079
|
-
|
|
6080
|
-
|
|
6081
|
-
|
|
6082
|
-
"**/*.spec.ts"
|
|
6083
|
-
];
|
|
6284
|
+
const registry = getDefaultRegistry();
|
|
6285
|
+
const singleParser = config.parser;
|
|
6286
|
+
const parserForFile = (filePath) => singleParser ?? registry.getForFile(filePath);
|
|
6287
|
+
const includePatterns = config.include || DEFAULT_INCLUDE_PATTERNS;
|
|
6288
|
+
const excludePatterns = config.exclude || [...skipDirGlobs(), "**/*.test.ts", "**/*.spec.ts"];
|
|
6084
6289
|
let sourceFilePaths = [];
|
|
6085
6290
|
for (const pattern of includePatterns) {
|
|
6086
6291
|
const files2 = await findFiles(pattern, rootDir);
|
|
@@ -6092,10 +6297,12 @@ async function buildSnapshot2(config) {
|
|
|
6092
6297
|
});
|
|
6093
6298
|
const files = [];
|
|
6094
6299
|
for (const filePath of sourceFilePaths) {
|
|
6095
|
-
const
|
|
6300
|
+
const fileParser = parserForFile(filePath);
|
|
6301
|
+
if (!fileParser) continue;
|
|
6302
|
+
const parseResult = await fileParser.parseFile(filePath);
|
|
6096
6303
|
if (!parseResult.ok) continue;
|
|
6097
|
-
const importsResult =
|
|
6098
|
-
const exportsResult =
|
|
6304
|
+
const importsResult = fileParser.extractImports(parseResult.value);
|
|
6305
|
+
const exportsResult = fileParser.extractExports(parseResult.value);
|
|
6099
6306
|
const internalSymbols = extractInternalSymbols(parseResult.value);
|
|
6100
6307
|
const jsDocComments = extractJSDocComments(parseResult.value);
|
|
6101
6308
|
files.push({
|
|
@@ -6107,7 +6314,7 @@ async function buildSnapshot2(config) {
|
|
|
6107
6314
|
jsDocComments
|
|
6108
6315
|
});
|
|
6109
6316
|
}
|
|
6110
|
-
const graphResult = await buildDependencyGraph(sourceFilePaths,
|
|
6317
|
+
const graphResult = await buildDependencyGraph(sourceFilePaths, singleParser ?? registry);
|
|
6111
6318
|
const dependencyGraph = graphResult.ok ? graphResult.value : { nodes: [], edges: [] };
|
|
6112
6319
|
const docPatterns = config.docPaths || ["docs/**/*.md", "README.md", "**/README.md"];
|
|
6113
6320
|
let docFilePaths = [];
|
|
@@ -6242,7 +6449,7 @@ async function checkStructureDrift(snapshot, _config) {
|
|
|
6242
6449
|
for (const doc of snapshot.docs) {
|
|
6243
6450
|
const fileLinks = extractFileLinks(doc.content);
|
|
6244
6451
|
for (const { link, line } of fileLinks) {
|
|
6245
|
-
const resolvedPath =
|
|
6452
|
+
const resolvedPath = resolve6(dirname5(doc.path), link);
|
|
6246
6453
|
const exists = await fileExists(resolvedPath);
|
|
6247
6454
|
if (!exists) {
|
|
6248
6455
|
drifts.push({
|
|
@@ -6344,7 +6551,7 @@ function resolveImportToFile(importSource, fromFile, snapshot, fileIndex) {
|
|
|
6344
6551
|
}
|
|
6345
6552
|
const hasFile = fileIndex ? (p) => fileIndex.has(p) : (p) => snapshot.files.some((f) => f.path === p);
|
|
6346
6553
|
const fromDir = dirname6(fromFile);
|
|
6347
|
-
const resolved =
|
|
6554
|
+
const resolved = resolve7(fromDir, importSource);
|
|
6348
6555
|
const sourceExt = extname2(resolved);
|
|
6349
6556
|
const fallbacks = JS_EXT_FALLBACKS2[sourceExt];
|
|
6350
6557
|
if (fallbacks) {
|
|
@@ -6354,7 +6561,7 @@ function resolveImportToFile(importSource, fromFile, snapshot, fileIndex) {
|
|
|
6354
6561
|
if (hasFile(candidate)) return candidate;
|
|
6355
6562
|
}
|
|
6356
6563
|
for (const indexExt of [".ts", ".tsx", ".jsx"]) {
|
|
6357
|
-
const indexPath2 =
|
|
6564
|
+
const indexPath2 = resolve7(base, "index" + indexExt);
|
|
6358
6565
|
if (hasFile(indexPath2)) return indexPath2;
|
|
6359
6566
|
}
|
|
6360
6567
|
}
|
|
@@ -6365,7 +6572,7 @@ function resolveImportToFile(importSource, fromFile, snapshot, fileIndex) {
|
|
|
6365
6572
|
if (hasFile(candidate)) return candidate;
|
|
6366
6573
|
}
|
|
6367
6574
|
for (const indexExt of [".ts", ".tsx"]) {
|
|
6368
|
-
const indexPath2 =
|
|
6575
|
+
const indexPath2 = resolve7(resolved, "index" + indexExt);
|
|
6369
6576
|
if (hasFile(indexPath2)) return indexPath2;
|
|
6370
6577
|
}
|
|
6371
6578
|
}
|
|
@@ -6881,7 +7088,7 @@ function dirSize(dirPath) {
|
|
|
6881
7088
|
return 0;
|
|
6882
7089
|
}
|
|
6883
7090
|
for (const entry of entries) {
|
|
6884
|
-
if (entry
|
|
7091
|
+
if (DEFAULT_SKIP_DIRS.has(entry)) continue;
|
|
6885
7092
|
const fullPath = join16(dirPath, entry);
|
|
6886
7093
|
try {
|
|
6887
7094
|
const stat2 = statSync2(fullPath);
|
|
@@ -8938,7 +9145,7 @@ function checkOverlap(newEntry, existingEntries, options) {
|
|
|
8938
9145
|
};
|
|
8939
9146
|
}
|
|
8940
9147
|
function sleep(ms) {
|
|
8941
|
-
return new Promise((
|
|
9148
|
+
return new Promise((resolve10) => setTimeout(resolve10, ms));
|
|
8942
9149
|
}
|
|
8943
9150
|
async function acquireFileLock(lockPath) {
|
|
8944
9151
|
for (let attempt = 0; attempt < LOCK_RETRIES; attempt++) {
|
|
@@ -10415,8 +10622,7 @@ async function runDocsCheck(projectRoot, config) {
|
|
|
10415
10622
|
docsDir,
|
|
10416
10623
|
sourceDir: projectRoot,
|
|
10417
10624
|
excludePatterns: entropyConfig.excludePatterns || [
|
|
10418
|
-
|
|
10419
|
-
"**/dist/**",
|
|
10625
|
+
...skipDirGlobs(),
|
|
10420
10626
|
"**/*.test.ts",
|
|
10421
10627
|
"**/fixtures/**"
|
|
10422
10628
|
]
|
|
@@ -10481,12 +10687,7 @@ async function runSecurityCheck(projectRoot, config) {
|
|
|
10481
10687
|
const { glob: globFn } = await import("glob");
|
|
10482
10688
|
const sourceFiles = await globFn("**/*.{ts,tsx,js,jsx,go,py}", {
|
|
10483
10689
|
cwd: projectRoot,
|
|
10484
|
-
ignore: securityConfig.exclude ?? [
|
|
10485
|
-
"**/node_modules/**",
|
|
10486
|
-
"**/dist/**",
|
|
10487
|
-
"**/*.test.ts",
|
|
10488
|
-
"**/fixtures/**"
|
|
10489
|
-
],
|
|
10690
|
+
ignore: securityConfig.exclude ?? [...skipDirGlobs(), "**/*.test.ts", "**/fixtures/**"],
|
|
10490
10691
|
absolute: true
|
|
10491
10692
|
});
|
|
10492
10693
|
const scanResult = await scanner.scanFiles(sourceFiles);
|
|
@@ -13008,7 +13209,7 @@ function parseRepoParts(repo) {
|
|
|
13008
13209
|
return { owner: parts[0], repo: parts[1] };
|
|
13009
13210
|
}
|
|
13010
13211
|
function sleep2(ms) {
|
|
13011
|
-
return new Promise((
|
|
13212
|
+
return new Promise((resolve10) => setTimeout(resolve10, ms));
|
|
13012
13213
|
}
|
|
13013
13214
|
async function fetchWithRetry(fetchFn, input, init, opts = RETRY_DEFAULTS) {
|
|
13014
13215
|
let lastResponse;
|
|
@@ -13158,8 +13359,8 @@ async function syncFromExternal(roadmap, adapter2, config, options, prefetchedTi
|
|
|
13158
13359
|
async function fullSync(roadmapPath, adapter2, config, options) {
|
|
13159
13360
|
const previousSync = syncMutex;
|
|
13160
13361
|
let releaseMutex;
|
|
13161
|
-
syncMutex = new Promise((
|
|
13162
|
-
releaseMutex =
|
|
13362
|
+
syncMutex = new Promise((resolve10) => {
|
|
13363
|
+
releaseMutex = resolve10;
|
|
13163
13364
|
});
|
|
13164
13365
|
await previousSync;
|
|
13165
13366
|
try {
|
|
@@ -14822,7 +15023,7 @@ function collectEvents(projectRoot, consent) {
|
|
|
14822
15023
|
);
|
|
14823
15024
|
}
|
|
14824
15025
|
function sleep3(ms) {
|
|
14825
|
-
return new Promise((
|
|
15026
|
+
return new Promise((resolve10) => setTimeout(resolve10, ms));
|
|
14826
15027
|
}
|
|
14827
15028
|
async function send(events, apiKey) {
|
|
14828
15029
|
if (events.length === 0) return;
|
|
@@ -15395,14 +15596,20 @@ function assembleCandidateReport(input) {
|
|
|
15395
15596
|
}
|
|
15396
15597
|
return lines.join("\n");
|
|
15397
15598
|
}
|
|
15398
|
-
var VALID_TYPES, CONVENTIONAL_PATTERN, LOOKBACK_PATTERN, PulseDbSourceSchema, PulseSourcesSchema, PulseConfigSchema, BUG_TRACK_CATEGORIES, KNOWLEDGE_TRACK_CATEGORIES, ALL_SOLUTION_CATEGORIES, ISO_DATE, BugTrackSchema, KnowledgeTrackSchema, BaseFrontmatter, SolutionDocFrontmatterSchema, TRACK_CATEGORIES, 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, JS_EXT_FALLBACKS2, FILE_TYPES, EXPORT_TYPES, CONVENTION_DESCRIPTIONS, RULE_CHECKERS, EntropyAnalyzer, readFile62, 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,
|
|
15599
|
+
var WHATWG_BAD_PORTS, BAD_PORT_SET, VALID_TYPES, CONVENTIONAL_PATTERN, LOOKBACK_PATTERN, PulseDbSourceSchema, PulseSourcesSchema, PulseConfigSchema, BUG_TRACK_CATEGORIES, KNOWLEDGE_TRACK_CATEGORIES, ALL_SOLUTION_CATEGORIES, ISO_DATE, BugTrackSchema, KnowledgeTrackSchema, BaseFrontmatter, SolutionDocFrontmatterSchema, TRACK_CATEGORIES, 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, TS_HINTS, TS_CONVENTIONS, PYTHON_HINTS, PYTHON_CONVENTIONS, DEFAULT_INCLUDE_PATTERNS, CODE_BLOCK_LANGUAGES, DEFAULT_DRIFT_CONFIG, JS_EXT_FALLBACKS2, FILE_TYPES, EXPORT_TYPES, CONVENTION_DESCRIPTIONS, RULE_CHECKERS, EntropyAnalyzer, readFile62, 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, 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, LOCK_RETRIES, LOCK_BACKOFFS, 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, JS_EXT_FALLBACKS22, 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, PRIORITY_RANK2, POSITION_WEIGHT, DEPENDENTS_WEIGHT, AFFINITY_WEIGHT, ConflictError, DEFAULTS, GitHubHttp, ETagStore, START_MARKER, END_MARKER, SERIALIZER_FIELDS, GitHubIssuesTrackerAdapter, migrate_exports, HASH_RE, 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, CompoundLockHeldError, KNOWN_CATEGORIES, ALLOWED_FIELD_KEYS, PII_TOKENS, PII_FIELD_DENYLIST, PII_LINE_RE, ALLOWED_SET, PulseAdapterAlreadyRegisteredError, REGISTRY, MOCK_ADAPTER_NAME, ALLOWED_FIELD_SET, adapter, LOOKBACK_RE, MAX_LINES, INLINE_TEMPLATE, TRUNCATION_MARKER2, execFileAsync, FIX_RE, EMPTY_REPO_RE, execFileAsync2, TRACK_CATEGORIES2, STOPWORDS, KEYWORD_TO_CATEGORY;
|
|
15399
15600
|
var init_dist3 = __esm({
|
|
15400
15601
|
"../core/dist/index.mjs"() {
|
|
15401
|
-
|
|
15602
|
+
init_chunk_4UI65RLE();
|
|
15402
15603
|
init_dist();
|
|
15604
|
+
init_dist2();
|
|
15605
|
+
init_dist2();
|
|
15606
|
+
init_dist2();
|
|
15403
15607
|
init_dist();
|
|
15404
15608
|
init_dist();
|
|
15405
15609
|
init_dist2();
|
|
15610
|
+
init_dist2();
|
|
15611
|
+
init_dist2();
|
|
15612
|
+
init_dist2();
|
|
15406
15613
|
init_dist();
|
|
15407
15614
|
init_dist();
|
|
15408
15615
|
init_dist();
|
|
@@ -15410,6 +15617,91 @@ var init_dist3 = __esm({
|
|
|
15410
15617
|
init_dist();
|
|
15411
15618
|
init_dist();
|
|
15412
15619
|
init_dist2();
|
|
15620
|
+
WHATWG_BAD_PORTS = Object.freeze([
|
|
15621
|
+
1,
|
|
15622
|
+
7,
|
|
15623
|
+
9,
|
|
15624
|
+
11,
|
|
15625
|
+
13,
|
|
15626
|
+
15,
|
|
15627
|
+
17,
|
|
15628
|
+
19,
|
|
15629
|
+
20,
|
|
15630
|
+
21,
|
|
15631
|
+
22,
|
|
15632
|
+
23,
|
|
15633
|
+
25,
|
|
15634
|
+
37,
|
|
15635
|
+
42,
|
|
15636
|
+
43,
|
|
15637
|
+
53,
|
|
15638
|
+
69,
|
|
15639
|
+
77,
|
|
15640
|
+
79,
|
|
15641
|
+
87,
|
|
15642
|
+
95,
|
|
15643
|
+
101,
|
|
15644
|
+
102,
|
|
15645
|
+
103,
|
|
15646
|
+
104,
|
|
15647
|
+
109,
|
|
15648
|
+
110,
|
|
15649
|
+
111,
|
|
15650
|
+
113,
|
|
15651
|
+
115,
|
|
15652
|
+
117,
|
|
15653
|
+
119,
|
|
15654
|
+
123,
|
|
15655
|
+
135,
|
|
15656
|
+
137,
|
|
15657
|
+
139,
|
|
15658
|
+
143,
|
|
15659
|
+
161,
|
|
15660
|
+
179,
|
|
15661
|
+
389,
|
|
15662
|
+
427,
|
|
15663
|
+
465,
|
|
15664
|
+
512,
|
|
15665
|
+
513,
|
|
15666
|
+
514,
|
|
15667
|
+
515,
|
|
15668
|
+
526,
|
|
15669
|
+
530,
|
|
15670
|
+
531,
|
|
15671
|
+
532,
|
|
15672
|
+
540,
|
|
15673
|
+
548,
|
|
15674
|
+
554,
|
|
15675
|
+
556,
|
|
15676
|
+
563,
|
|
15677
|
+
587,
|
|
15678
|
+
601,
|
|
15679
|
+
636,
|
|
15680
|
+
989,
|
|
15681
|
+
990,
|
|
15682
|
+
993,
|
|
15683
|
+
995,
|
|
15684
|
+
1719,
|
|
15685
|
+
1720,
|
|
15686
|
+
1723,
|
|
15687
|
+
2049,
|
|
15688
|
+
3659,
|
|
15689
|
+
4045,
|
|
15690
|
+
4190,
|
|
15691
|
+
5060,
|
|
15692
|
+
5061,
|
|
15693
|
+
6e3,
|
|
15694
|
+
6566,
|
|
15695
|
+
6665,
|
|
15696
|
+
6666,
|
|
15697
|
+
6667,
|
|
15698
|
+
6668,
|
|
15699
|
+
6669,
|
|
15700
|
+
6679,
|
|
15701
|
+
6697,
|
|
15702
|
+
10080
|
|
15703
|
+
]);
|
|
15704
|
+
BAD_PORT_SET = new Set(WHATWG_BAD_PORTS);
|
|
15413
15705
|
VALID_TYPES = [
|
|
15414
15706
|
"feat",
|
|
15415
15707
|
"fix",
|
|
@@ -15724,6 +16016,32 @@ var init_dist3 = __esm({
|
|
|
15724
16016
|
LINE_PATTERN = /^[ \t]*(?:\/\/|#)\s*harness-ignore(?!\s*(?:SEC-|-start|-end))(?:\s+([\w,]+))?(?::\s*(.+))?$/;
|
|
15725
16017
|
START_PATTERN = /^[ \t]*(?:\/\/|#)\s*harness-ignore-start(?:\s+([\w,]+))?(?::\s*(.+))?$/;
|
|
15726
16018
|
END_PATTERN = /^[ \t]*(?:\/\/|#)\s*harness-ignore-end\s*$/;
|
|
16019
|
+
TS_HINTS = ['Add "exports" or "main" to package.json', "Create src/index.ts"];
|
|
16020
|
+
TS_CONVENTIONS = ["src/index.ts", "src/main.ts", "src/index.tsx", "index.ts", "main.ts"];
|
|
16021
|
+
PYTHON_HINTS = [
|
|
16022
|
+
"Add an entry to [project.scripts] in pyproject.toml",
|
|
16023
|
+
"Create main.py or <package>/__main__.py"
|
|
16024
|
+
];
|
|
16025
|
+
PYTHON_CONVENTIONS = [
|
|
16026
|
+
"__main__.py",
|
|
16027
|
+
"main.py",
|
|
16028
|
+
"app.py",
|
|
16029
|
+
"src/__main__.py",
|
|
16030
|
+
"src/main.py",
|
|
16031
|
+
"src/app.py"
|
|
16032
|
+
];
|
|
16033
|
+
DEFAULT_INCLUDE_PATTERNS = [
|
|
16034
|
+
"**/*.ts",
|
|
16035
|
+
"**/*.tsx",
|
|
16036
|
+
"**/*.js",
|
|
16037
|
+
"**/*.jsx",
|
|
16038
|
+
"**/*.mjs",
|
|
16039
|
+
"**/*.cjs",
|
|
16040
|
+
"**/*.py",
|
|
16041
|
+
"**/*.go",
|
|
16042
|
+
"**/*.rs",
|
|
16043
|
+
"**/*.java"
|
|
16044
|
+
];
|
|
15727
16045
|
CODE_BLOCK_LANGUAGES = /* @__PURE__ */ new Set(["typescript", "ts", "javascript", "js"]);
|
|
15728
16046
|
DEFAULT_DRIFT_CONFIG = {
|
|
15729
16047
|
docPaths: [],
|
|
@@ -15762,10 +16080,7 @@ var init_dist3 = __esm({
|
|
|
15762
16080
|
snapshot;
|
|
15763
16081
|
report;
|
|
15764
16082
|
constructor(config) {
|
|
15765
|
-
this.config = {
|
|
15766
|
-
...config,
|
|
15767
|
-
parser: config.parser || new TypeScriptParser()
|
|
15768
|
-
};
|
|
16083
|
+
this.config = { ...config };
|
|
15769
16084
|
}
|
|
15770
16085
|
/**
|
|
15771
16086
|
* Run full entropy analysis.
|
|
@@ -16357,7 +16672,6 @@ var init_dist3 = __esm({
|
|
|
16357
16672
|
};
|
|
16358
16673
|
}
|
|
16359
16674
|
};
|
|
16360
|
-
SKIP_DIRS = /* @__PURE__ */ new Set(["node_modules", "dist", ".git"]);
|
|
16361
16675
|
SOURCE_EXTENSIONS = /* @__PURE__ */ new Set([".ts", ".tsx", ".js", ".jsx"]);
|
|
16362
16676
|
FUNCTION_DECL_RE = /(?:export\s+)?(?:async\s+)?function\s+(\w+)/;
|
|
16363
16677
|
CONST_DECL_RE = /(?:export\s+)?(?:const|let)\s+(\w+)\s*=/;
|
|
@@ -16398,7 +16712,7 @@ var init_dist3 = __esm({
|
|
|
16398
16712
|
}
|
|
16399
16713
|
for (const item of items) {
|
|
16400
16714
|
if (item.isDirectory()) {
|
|
16401
|
-
if (
|
|
16715
|
+
if (DEFAULT_SKIP_DIRS.has(item.name)) continue;
|
|
16402
16716
|
this.walkDir(path4.join(dir, item.name), entries);
|
|
16403
16717
|
} else if (item.isFile() && SOURCE_EXTENSIONS.has(path4.extname(item.name))) {
|
|
16404
16718
|
this.scanFile(path4.join(dir, item.name), entries);
|
|
@@ -17878,14 +18192,14 @@ var init_dist3 = __esm({
|
|
|
17878
18192
|
enabled: true,
|
|
17879
18193
|
strict: false,
|
|
17880
18194
|
rules: {},
|
|
17881
|
-
exclude: [
|
|
18195
|
+
exclude: [...skipDirGlobs(), "**/*.test.ts", "**/fixtures/**"]
|
|
17882
18196
|
};
|
|
17883
18197
|
RuleOverrideSchema = z10.enum(["off", "error", "warning", "info"]);
|
|
17884
18198
|
SecurityConfigSchema = z10.object({
|
|
17885
18199
|
enabled: z10.boolean().default(true),
|
|
17886
18200
|
strict: z10.boolean().default(false),
|
|
17887
18201
|
rules: z10.record(z10.string(), RuleOverrideSchema).optional().default({}),
|
|
17888
|
-
exclude: z10.array(z10.string()).optional().default([
|
|
18202
|
+
exclude: z10.array(z10.string()).optional().default([...skipDirGlobs(), "**/*.test.ts", "**/fixtures/**"]),
|
|
17889
18203
|
external: z10.object({
|
|
17890
18204
|
semgrep: z10.object({
|
|
17891
18205
|
enabled: z10.union([z10.literal("auto"), z10.boolean()]).default("auto"),
|
|
@@ -21300,6 +21614,9 @@ export {
|
|
|
21300
21614
|
architecture,
|
|
21301
21615
|
archModule,
|
|
21302
21616
|
archMatchers,
|
|
21617
|
+
WHATWG_BAD_PORTS,
|
|
21618
|
+
isBadPort,
|
|
21619
|
+
assertPortUsable,
|
|
21303
21620
|
validateFileStructure,
|
|
21304
21621
|
validateConfig,
|
|
21305
21622
|
validateCommitMessage,
|