@harness-engineering/cli 2.1.0 → 2.1.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.
Files changed (45) hide show
  1. package/dist/{agents-md-XCAWON2D.js → agents-md-L4X4MOWT.js} +2 -2
  2. package/dist/{architecture-KERHEEQZ.js → architecture-WJRIYQ45.js} +3 -3
  3. package/dist/{assess-project-NPYA3UVI.js → assess-project-PHC2HO3V.js} +1 -1
  4. package/dist/bin/harness-mcp.js +13 -13
  5. package/dist/bin/harness.js +22 -22
  6. package/dist/{check-phase-gate-GE5ALEEU.js → check-phase-gate-646KY67H.js} +3 -3
  7. package/dist/{chunk-IIX5OJES.js → chunk-224XKVLP.js} +1 -1
  8. package/dist/{chunk-UWIOBHZL.js → chunk-2QPHCR22.js} +5 -5
  9. package/dist/{chunk-URLDPALI.js → chunk-2ZURBWEV.js} +3 -3
  10. package/dist/{chunk-EFA4OEEN.js → chunk-36X7TRUI.js} +2 -2
  11. package/dist/{chunk-HBQ3BK2E.js → chunk-4HKVZO7R.js} +1 -1
  12. package/dist/{chunk-T7MNLCUD.js → chunk-7XQYOXTB.js} +74 -72
  13. package/dist/{chunk-OXFFN3FD.js → chunk-CPYL6LJR.js} +1 -1
  14. package/dist/{chunk-WW6AUOA3.js → chunk-E7W3YOXL.js} +2 -2
  15. package/dist/{chunk-FQAJAM54.js → chunk-FNCJ3UCU.js} +26 -27
  16. package/dist/{chunk-D5FE4L2O.js → chunk-JPWICLXQ.js} +1 -1
  17. package/dist/{chunk-MAFI6UWT.js → chunk-K4WRQTEF.js} +137 -39
  18. package/dist/{chunk-M4C3ZIGL.js → chunk-KV7A5OZT.js} +3 -3
  19. package/dist/{chunk-4FVHBBPY.js → chunk-LO7ZLV7S.js} +1 -1
  20. package/dist/{chunk-PCX4GPNT.js → chunk-QTUPHTTK.js} +1 -1
  21. package/dist/{chunk-GCYGGQFM.js → chunk-SVC7THFK.js} +1 -1
  22. package/dist/{chunk-AEFZJ543.js → chunk-TNZYQTEE.js} +1 -1
  23. package/dist/{chunk-DRD7LLFC.js → chunk-VJQLUS5I.js} +1 -1
  24. package/dist/{chunk-LY2TY6NE.js → chunk-VKDBM3RX.js} +3 -3
  25. package/dist/{chunk-FBQYKH7R.js → chunk-W4AFGFFB.js} +2 -2
  26. package/dist/{chunk-YBGVZQQE.js → chunk-YLOAQZLA.js} +2 -2
  27. package/dist/{chunk-GHPWBWUW.js → chunk-YLTRFZAT.js} +6 -6
  28. package/dist/{chunk-RCHXBL2M.js → chunk-YWD6WXXM.js} +6 -6
  29. package/dist/{ci-workflow-A2E2RTOP.js → ci-workflow-TOS5X527.js} +2 -2
  30. package/dist/{dist-K22DQUYY.js → dist-6RT2AVYU.js} +1 -1
  31. package/dist/{docs-GXJOFVCF.js → docs-HOJMQYDZ.js} +3 -3
  32. package/dist/{engine-JBUIA2XO.js → engine-D6UYH6DB.js} +2 -2
  33. package/dist/{entropy-Y7LUT4BZ.js → entropy-LZ4IDGZR.js} +2 -2
  34. package/dist/{feedback-BHOBVKI3.js → feedback-WV7EQVK7.js} +1 -1
  35. package/dist/{generate-agent-definitions-VL3ZVR32.js → generate-agent-definitions-ZHFFS6YG.js} +3 -3
  36. package/dist/index.js +22 -22
  37. package/dist/{loader-WCKVMDYR.js → loader-Z23JTXIZ.js} +2 -2
  38. package/dist/{mcp-FA2CKHFY.js → mcp-QFZDPFNP.js} +13 -13
  39. package/dist/{performance-NISUL5AA.js → performance-7ATLHTQU.js} +3 -3
  40. package/dist/{review-pipeline-CHE5LJ5D.js → review-pipeline-COBGGXHJ.js} +2 -2
  41. package/dist/{runtime-3SKKEVPF.js → runtime-KCBNQUXK.js} +2 -2
  42. package/dist/{security-MF54MY3P.js → security-MAPRIFQT.js} +1 -1
  43. package/dist/{validate-SIWFNTXI.js → validate-74XTQR7Q.js} +3 -3
  44. package/dist/{validate-cross-check-GBX7B7CQ.js → validate-cross-check-MI5MZ7MB.js} +2 -2
  45. package/package.json +4 -4
@@ -1,15 +1,15 @@
1
1
  import {
2
2
  generateRuntime
3
- } from "./chunk-AEFZJ543.js";
3
+ } from "./chunk-TNZYQTEE.js";
4
4
  import {
5
5
  generateAgentsMd
6
- } from "./chunk-HBQ3BK2E.js";
6
+ } from "./chunk-4HKVZO7R.js";
7
7
  import {
8
8
  generateCIWorkflow
9
- } from "./chunk-D5FE4L2O.js";
9
+ } from "./chunk-JPWICLXQ.js";
10
10
  import {
11
11
  TemplateEngine
12
- } from "./chunk-IIX5OJES.js";
12
+ } from "./chunk-224XKVLP.js";
13
13
  import {
14
14
  generate,
15
15
  validate
@@ -28,18 +28,18 @@ import {
28
28
  OutputMode,
29
29
  createCheckPhaseGateCommand,
30
30
  findFiles
31
- } from "./chunk-WW6AUOA3.js";
31
+ } from "./chunk-E7W3YOXL.js";
32
32
  import {
33
33
  createGenerateAgentDefinitionsCommand,
34
34
  generateAgentDefinitions
35
- } from "./chunk-GCYGGQFM.js";
35
+ } from "./chunk-SVC7THFK.js";
36
36
  import {
37
37
  toKebabCase
38
38
  } from "./chunk-KET4QQZB.js";
39
39
  import {
40
40
  listPersonas,
41
41
  loadPersona
42
- } from "./chunk-DRD7LLFC.js";
42
+ } from "./chunk-VJQLUS5I.js";
43
43
  import {
44
44
  createScanCommand,
45
45
  loadIngestOptions
@@ -57,7 +57,7 @@ import {
57
57
  loadCachedSnapshot,
58
58
  persistToolingConfig,
59
59
  recommend
60
- } from "./chunk-T7MNLCUD.js";
60
+ } from "./chunk-7XQYOXTB.js";
61
61
  import {
62
62
  loadGraphStore
63
63
  } from "./chunk-KTWKW6KJ.js";
@@ -67,7 +67,7 @@ import {
67
67
  import {
68
68
  findConfigFile,
69
69
  resolveConfig
70
- } from "./chunk-4FVHBBPY.js";
70
+ } from "./chunk-LO7ZLV7S.js";
71
71
  import {
72
72
  VALID_PLATFORMS
73
73
  } from "./chunk-3ISINLYT.js";
@@ -164,7 +164,7 @@ import {
164
164
  validateSolutionsDir,
165
165
  writeConfig,
166
166
  writeLockfile
167
- } from "./chunk-MAFI6UWT.js";
167
+ } from "./chunk-K4WRQTEF.js";
168
168
  import {
169
169
  Err,
170
170
  Ok
@@ -378,7 +378,7 @@ function registerSkillsCommand(adoption) {
378
378
  const globalOpts = cmd.optsWithGlobals();
379
379
  const limit = Math.max(parseInt(opts.limit, 10) || 20, 1);
380
380
  const cwd = process.cwd();
381
- const { readAdoptionRecords, aggregateBySkill } = await import("./dist-K22DQUYY.js");
381
+ const { readAdoptionRecords, aggregateBySkill } = await import("./dist-6RT2AVYU.js");
382
382
  const records = readAdoptionRecords(cwd);
383
383
  if (records.length === 0) {
384
384
  if (globalOpts.json) {
@@ -414,7 +414,7 @@ function registerRecentCommand(adoption) {
414
414
  const globalOpts = cmd.optsWithGlobals();
415
415
  const limit = Math.max(parseInt(opts.limit, 10) || 20, 1);
416
416
  const cwd = process.cwd();
417
- const { readAdoptionRecords } = await import("./dist-K22DQUYY.js");
417
+ const { readAdoptionRecords } = await import("./dist-6RT2AVYU.js");
418
418
  const records = readAdoptionRecords(cwd);
419
419
  if (records.length === 0) {
420
420
  if (globalOpts.json) {
@@ -492,7 +492,7 @@ function registerSkillCommand(adoption) {
492
492
  adoption.command("skill <name>").description("Show detail for a specific skill").action(async (name, _opts, cmd) => {
493
493
  const globalOpts = cmd.optsWithGlobals();
494
494
  const cwd = process.cwd();
495
- const { readAdoptionRecords, aggregateBySkill } = await import("./dist-K22DQUYY.js");
495
+ const { readAdoptionRecords, aggregateBySkill } = await import("./dist-6RT2AVYU.js");
496
496
  const records = readAdoptionRecords(cwd);
497
497
  const skillRecords = records.filter((r) => r.skill === name);
498
498
  if (skillRecords.length === 0) {
@@ -968,8 +968,7 @@ async function runCheckArch(options) {
968
968
  const manager = new ArchBaselineManager(cwd, archConfig.baselinePath);
969
969
  if (options.updateBaseline) {
970
970
  const commitHash = getCommitHash(cwd);
971
- const baseline2 = manager.capture(results, commitHash);
972
- manager.save(baseline2);
971
+ manager.update(results, commitHash);
973
972
  return Ok({
974
973
  passed: true,
975
974
  mode: "baseline",
@@ -5776,7 +5775,7 @@ function createMcpCommand() {
5776
5775
  parseBudget
5777
5776
  ).action(async (opts) => {
5778
5777
  const [{ startServer: startServer2, getToolDefinitions: getToolDefinitions2 }, { selectTier }] = await Promise.all([
5779
- import("./mcp-FA2CKHFY.js"),
5778
+ import("./mcp-QFZDPFNP.js"),
5780
5779
  import("./tool-tiers-7QGZ3FKY.js")
5781
5780
  ]);
5782
5781
  if (opts.tools && opts.tools.length > 0) {
@@ -6267,7 +6266,7 @@ function registerBenchCommand(perf) {
6267
6266
  perf.command("bench [glob]").description("Run benchmarks via vitest bench").action(async (glob2, _opts, cmd) => {
6268
6267
  const globalOpts = cmd.optsWithGlobals();
6269
6268
  const cwd = process.cwd();
6270
- const { BenchmarkRunner } = await import("./dist-K22DQUYY.js");
6269
+ const { BenchmarkRunner } = await import("./dist-6RT2AVYU.js");
6271
6270
  const runner = new BenchmarkRunner();
6272
6271
  const benchFiles = runner.discover(cwd, glob2);
6273
6272
  if (benchFiles.length === 0) {
@@ -6331,7 +6330,7 @@ async function runBaselinesShow(globalOpts) {
6331
6330
  }
6332
6331
  async function runBaselinesUpdate(globalOpts) {
6333
6332
  const cwd = process.cwd();
6334
- const { BenchmarkRunner } = await import("./dist-K22DQUYY.js");
6333
+ const { BenchmarkRunner } = await import("./dist-6RT2AVYU.js");
6335
6334
  const runner = new BenchmarkRunner();
6336
6335
  const manager = new BaselineManager(cwd);
6337
6336
  logger.info("Running benchmarks to update baselines...");
@@ -6372,7 +6371,7 @@ function registerReportCommand(perf) {
6372
6371
  perf.command("report").description("Full performance report with metrics, trends, and hotspots").action(async (_opts, cmd) => {
6373
6372
  const globalOpts = cmd.optsWithGlobals();
6374
6373
  const cwd = process.cwd();
6375
- const { EntropyAnalyzer: EntropyAnalyzer2 } = await import("./dist-K22DQUYY.js");
6374
+ const { EntropyAnalyzer: EntropyAnalyzer2 } = await import("./dist-6RT2AVYU.js");
6376
6375
  const analyzer = new EntropyAnalyzer2({
6377
6376
  rootDir: path42.resolve(cwd),
6378
6377
  analyze: { complexity: true, coupling: true }
@@ -6763,7 +6762,7 @@ async function runPublishAnalyses(opts) {
6763
6762
  const nameToExternalId = buildNameToExternalIdMap(projectPath);
6764
6763
  if (!nameToExternalId) return process.exit(1);
6765
6764
  const { AnalysisArchive } = await import("@harness-engineering/orchestrator");
6766
- const { GitHubIssuesSyncAdapter: GitHubIssuesSyncAdapter2 } = await import("./dist-K22DQUYY.js");
6765
+ const { GitHubIssuesSyncAdapter: GitHubIssuesSyncAdapter2 } = await import("./dist-6RT2AVYU.js");
6767
6766
  const archive = new AnalysisArchive(path44.join(projectPath, ".harness", "analyses"));
6768
6767
  const analyses = await archive.list();
6769
6768
  if (analyses.length === 0) {
@@ -8908,7 +8907,7 @@ async function runSyncAnalyses(opts) {
8908
8907
  return;
8909
8908
  }
8910
8909
  const { AnalysisArchive, loadPublishedIndex: loadPublishedIndex2, savePublishedIndex: savePublishedIndex2 } = await import("@harness-engineering/orchestrator");
8911
- const { GitHubIssuesSyncAdapter: GitHubIssuesSyncAdapter2 } = await import("./dist-K22DQUYY.js");
8910
+ const { GitHubIssuesSyncAdapter: GitHubIssuesSyncAdapter2 } = await import("./dist-6RT2AVYU.js");
8912
8911
  const adapter = new GitHubIssuesSyncAdapter2({ token, config: trackerConfig });
8913
8912
  const archive = new AnalysisArchive(path60.join(projectPath, ".harness", "analyses"));
8914
8913
  const publishedIndex = loadPublishedIndex2(projectPath);
@@ -9854,7 +9853,7 @@ function createUpdateCommand() {
9854
9853
  // src/commands/usage.ts
9855
9854
  import { Command as Command88 } from "commander";
9856
9855
  async function loadAndPriceRecords(cwd, includeClaudeSessions = false) {
9857
- const { readCostRecords, loadPricingData, calculateCost, parseCCRecords } = await import("./dist-K22DQUYY.js");
9856
+ const { readCostRecords, loadPricingData, calculateCost, parseCCRecords } = await import("./dist-6RT2AVYU.js");
9858
9857
  const records = readCostRecords(cwd);
9859
9858
  if (includeClaudeSessions) {
9860
9859
  const ccRecords = parseCCRecords();
@@ -9947,7 +9946,7 @@ function registerDailyCommand(usage) {
9947
9946
  else logger.info("No usage data found. Run some harness sessions first.");
9948
9947
  return;
9949
9948
  }
9950
- const { aggregateByDay } = await import("./dist-K22DQUYY.js");
9949
+ const { aggregateByDay } = await import("./dist-6RT2AVYU.js");
9951
9950
  const limited = aggregateByDay(records).slice(0, days);
9952
9951
  if (globalOpts.json) {
9953
9952
  console.log(
@@ -9976,7 +9975,7 @@ function registerSessionsCommand(usage) {
9976
9975
  }
9977
9976
  return;
9978
9977
  }
9979
- const { aggregateBySession } = await import("./dist-K22DQUYY.js");
9978
+ const { aggregateBySession } = await import("./dist-6RT2AVYU.js");
9980
9979
  const sessionData = aggregateBySession(records);
9981
9980
  const limited = sessionData.slice(0, limit);
9982
9981
  if (globalOpts.json) {
@@ -10056,7 +10055,7 @@ function registerSessionCommand(usage) {
10056
10055
  cwd,
10057
10056
  globalOpts.includeClaudeSessions
10058
10057
  );
10059
- const { aggregateBySession } = await import("./dist-K22DQUYY.js");
10058
+ const { aggregateBySession } = await import("./dist-6RT2AVYU.js");
10060
10059
  const sessionData = aggregateBySession(records);
10061
10060
  const match = sessionData.find((s) => s.sessionId === id);
10062
10061
  if (!match) {
@@ -10091,7 +10090,7 @@ function registerLatestCommand(usage) {
10091
10090
  }
10092
10091
  return;
10093
10092
  }
10094
- const { aggregateBySession } = await import("./dist-K22DQUYY.js");
10093
+ const { aggregateBySession } = await import("./dist-6RT2AVYU.js");
10095
10094
  const sessionData = aggregateBySession(records);
10096
10095
  const latest = sessionData[0];
10097
10096
  if (!latest) {
@@ -10243,7 +10242,7 @@ function resolveValidateMode(globalOpts) {
10243
10242
  return OutputMode.TEXT;
10244
10243
  }
10245
10244
  async function printCrossCheckWarnings(mode) {
10246
- const { runCrossCheck: runCrossCheck2 } = await import("./validate-cross-check-GBX7B7CQ.js");
10245
+ const { runCrossCheck: runCrossCheck2 } = await import("./validate-cross-check-MI5MZ7MB.js");
10247
10246
  const cwd = process.cwd();
10248
10247
  const crossResult = await runCrossCheck2({
10249
10248
  specsDir: path64.join(cwd, "docs", "specs"),
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  init_dist
3
- } from "./chunk-MAFI6UWT.js";
3
+ } from "./chunk-K4WRQTEF.js";
4
4
  import {
5
5
  Err,
6
6
  Ok
@@ -19,7 +19,7 @@ import {
19
19
  __export
20
20
  } from "./chunk-KFQGP6VL.js";
21
21
 
22
- // ../core/dist/chunk-H73442AZ.mjs
22
+ // ../core/dist/chunk-CE225WRK.mjs
23
23
  import { z } from "zod";
24
24
  import { createHash } from "crypto";
25
25
  import { minimatch } from "minimatch";
@@ -115,20 +115,32 @@ function getExtensionsForLang(lang) {
115
115
  return [".ts", ".tsx", ".js", ".jsx"];
116
116
  }
117
117
  }
118
- function resolveImportPath(importSource, fromFile, _rootDir) {
118
+ async function resolveImportPath(importSource, fromFile, _rootDir) {
119
119
  if (!importSource.startsWith(".") && !importSource.startsWith("/")) {
120
120
  return null;
121
121
  }
122
122
  const fromDir = dirname(fromFile);
123
- let resolved = resolve(fromDir, importSource);
124
- const ext = extname(fromFile);
125
- const lang = detectLangFromExt(ext);
126
- const extensions = getExtensionsForLang(lang);
123
+ const resolved = resolve(fromDir, importSource);
124
+ const sourceExt = extname(resolved);
125
+ const fromLang = detectLangFromExt(extname(fromFile));
126
+ const fallbacks = JS_EXT_FALLBACKS[sourceExt];
127
+ if (fallbacks) {
128
+ const base = resolved.slice(0, -sourceExt.length);
129
+ for (const ext of fallbacks) {
130
+ const candidate = base + ext;
131
+ if (await fileExists(candidate)) return candidate.replace(/\\/g, "/");
132
+ }
133
+ for (const indexExt of [".ts", ".tsx", ".jsx"]) {
134
+ const indexPath2 = resolve(base, "index" + indexExt);
135
+ if (await fileExists(indexPath2)) return indexPath2.replace(/\\/g, "/");
136
+ }
137
+ }
127
138
  const hasKnownExt = Object.values(EXTENSION_BY_LANG).flat().some((e) => resolved.endsWith(e));
128
- if (!hasKnownExt) {
129
- resolved = resolved + extensions[0];
139
+ if (hasKnownExt) {
140
+ return resolved.replace(/\\/g, "/");
130
141
  }
131
- return resolved.replace(/\\/g, "/");
142
+ const extensions = getExtensionsForLang(fromLang);
143
+ return (resolved + extensions[0]).replace(/\\/g, "/");
132
144
  }
133
145
  function getImportType(imp) {
134
146
  if (imp.kind === "type") return "type-only";
@@ -157,7 +169,7 @@ async function buildDependencyGraph(files, parser, graphDependencyData) {
157
169
  continue;
158
170
  }
159
171
  for (const imp of importsResult.value) {
160
- const resolvedPath = resolveImportPath(imp.source, file, "");
172
+ const resolvedPath = await resolveImportPath(imp.source, file, "");
161
173
  if (resolvedPath) {
162
174
  edges.push({
163
175
  from: normalizedFile,
@@ -1733,9 +1745,9 @@ async function toHaveMaxDepDepth(received, maxDepth) {
1733
1745
  message: () => pass ? `Expected dependency depth in '${received.scope}' to exceed ${maxDepth} but it was ${maxActual}` : `Module '${received.scope}' has dependency depth ${maxActual} (limit: ${maxDepth})`
1734
1746
  };
1735
1747
  }
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 init_chunk_H73442AZ = __esm({
1738
- "../core/dist/chunk-H73442AZ.mjs"() {
1748
+ var 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 init_chunk_CE225WRK = __esm({
1750
+ "../core/dist/chunk-CE225WRK.mjs"() {
1739
1751
  "use strict";
1740
1752
  init_dist();
1741
1753
  ArchMetricCategorySchema = z.enum([
@@ -1853,6 +1865,12 @@ var init_chunk_H73442AZ = __esm({
1853
1865
  rust: [".rs"],
1854
1866
  java: [".java"]
1855
1867
  };
1868
+ JS_EXT_FALLBACKS = {
1869
+ ".js": [".ts", ".tsx", ".jsx"],
1870
+ ".jsx": [".tsx"],
1871
+ ".mjs": [".mts"],
1872
+ ".cjs": [".cts"]
1873
+ };
1856
1874
  CircularDepsCollector = class {
1857
1875
  category = "circular-deps";
1858
1876
  getRules(_config, _rootDir) {
@@ -2439,6 +2457,25 @@ var init_chunk_H73442AZ = __esm({
2439
2457
  return null;
2440
2458
  }
2441
2459
  }
2460
+ /**
2461
+ * Refresh the on-disk baseline with new results.
2462
+ *
2463
+ * Categories present in `results` overwrite their on-disk entry; categories
2464
+ * absent from `results` are preserved as-is. This prevents silent data loss
2465
+ * when a collector returns no results (e.g. transient failure or a filtered
2466
+ * run) and the regenerated file is committed (issue #268).
2467
+ *
2468
+ * Use this from the `--update-baseline` flow instead of `capture()` + `save()`.
2469
+ */
2470
+ update(results, commitHash) {
2471
+ const fresh = this.capture(results, commitHash);
2472
+ const existing = this.load();
2473
+ if (existing) {
2474
+ fresh.metrics = { ...existing.metrics, ...fresh.metrics };
2475
+ }
2476
+ this.save(fresh);
2477
+ return fresh;
2478
+ }
2442
2479
  /**
2443
2480
  * Save an ArchBaseline to disk.
2444
2481
  * Creates parent directories if they do not exist.
@@ -3267,7 +3304,7 @@ import * as fs4 from "fs/promises";
3267
3304
  import { join as join14, resolve as resolve32 } from "path";
3268
3305
  import { minimatch as minimatch22 } from "minimatch";
3269
3306
  import { dirname as dirname5, resolve as resolve4 } from "path";
3270
- import { dirname as dirname6, resolve as resolve5 } from "path";
3307
+ import { dirname as dirname6, extname as extname2, resolve as resolve5 } from "path";
3271
3308
  import { minimatch as minimatch3 } from "minimatch";
3272
3309
  import { readdirSync, statSync as statSync2 } from "fs";
3273
3310
  import { join as join15 } from "path";
@@ -3344,7 +3381,7 @@ import { z as z11 } from "zod";
3344
3381
  import { readFileSync as readFileSync23, writeFileSync as writeFileSync16, renameSync as renameSync82, mkdirSync as mkdirSync15, existsSync as existsSync332 } from "fs";
3345
3382
  import { execSync as execSync3 } from "child_process";
3346
3383
  import { randomBytes as randomBytes22 } from "crypto";
3347
- import { join as join39, dirname as dirname13 } from "path";
3384
+ import { isAbsolute as isAbsolute4, join as join39, relative as relative32, dirname as dirname13 } from "path";
3348
3385
  import * as path24 from "path";
3349
3386
  import * as path25 from "path";
3350
3387
  import * as path26 from "path";
@@ -6243,19 +6280,30 @@ function resolveImportToFile(importSource, fromFile, snapshot, fileIndex) {
6243
6280
  }
6244
6281
  const hasFile = fileIndex ? (p) => fileIndex.has(p) : (p) => snapshot.files.some((f) => f.path === p);
6245
6282
  const fromDir = dirname6(fromFile);
6246
- let resolved = resolve5(fromDir, importSource);
6247
- if (!resolved.endsWith(".ts") && !resolved.endsWith(".tsx")) {
6248
- const withTs = resolved + ".ts";
6249
- if (hasFile(withTs)) {
6250
- return withTs;
6283
+ const resolved = resolve5(fromDir, importSource);
6284
+ const sourceExt = extname2(resolved);
6285
+ const fallbacks = JS_EXT_FALLBACKS2[sourceExt];
6286
+ if (fallbacks) {
6287
+ const base = resolved.slice(0, -sourceExt.length);
6288
+ for (const ext of fallbacks) {
6289
+ const candidate = base + ext;
6290
+ if (hasFile(candidate)) return candidate;
6251
6291
  }
6252
- const withIndex = resolve5(resolved, "index.ts");
6253
- if (hasFile(withIndex)) {
6254
- return withIndex;
6292
+ for (const indexExt of [".ts", ".tsx", ".jsx"]) {
6293
+ const indexPath2 = resolve5(base, "index" + indexExt);
6294
+ if (hasFile(indexPath2)) return indexPath2;
6255
6295
  }
6256
6296
  }
6257
- if (hasFile(resolved)) {
6258
- return resolved;
6297
+ if (hasFile(resolved)) return resolved;
6298
+ if (!sourceExt) {
6299
+ for (const ext of [".ts", ".tsx"]) {
6300
+ const candidate = resolved + ext;
6301
+ if (hasFile(candidate)) return candidate;
6302
+ }
6303
+ for (const indexExt of [".ts", ".tsx"]) {
6304
+ const indexPath2 = resolve5(resolved, "index" + indexExt);
6305
+ if (hasFile(indexPath2)) return indexPath2;
6306
+ }
6259
6307
  }
6260
6308
  return null;
6261
6309
  }
@@ -10915,12 +10963,18 @@ async function resolveImportPath2(projectRoot, fromFile, importSource) {
10915
10963
  const basePath = path26.resolve(fromDir, importSource);
10916
10964
  if (!isWithinProject(basePath, projectRoot)) return null;
10917
10965
  const relBase = relativePosix(projectRoot, basePath);
10918
- const candidates = [
10919
- relBase + ".ts",
10920
- relBase + ".tsx",
10921
- relBase + ".mts",
10922
- path26.join(relBase, "index.ts")
10923
- ];
10966
+ const sourceExt = path26.extname(relBase);
10967
+ const candidates = [];
10968
+ const fallbacks = JS_EXT_FALLBACKS22[sourceExt];
10969
+ if (fallbacks) {
10970
+ const stripped = relBase.slice(0, -sourceExt.length);
10971
+ for (const ext of fallbacks) candidates.push(stripped + ext);
10972
+ candidates.push(path26.join(stripped, "index.ts"));
10973
+ candidates.push(path26.join(stripped, "index.tsx"));
10974
+ candidates.push(path26.join(stripped, "index.jsx"));
10975
+ }
10976
+ candidates.push(relBase + ".ts", relBase + ".tsx", relBase + ".mts");
10977
+ candidates.push(path26.join(relBase, "index.ts"));
10924
10978
  for (const candidate of candidates) {
10925
10979
  const absCandidate = path26.join(projectRoot, candidate);
10926
10980
  if (await fileExists(absCandidate)) {
@@ -14710,10 +14764,10 @@ function assembleCandidateReport(input) {
14710
14764
  }
14711
14765
  return lines.join("\n");
14712
14766
  }
14713
- 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, 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, 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, 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, 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, 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;
14767
+ 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, 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, 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, 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, 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;
14714
14768
  var init_dist3 = __esm({
14715
14769
  "../core/dist/index.mjs"() {
14716
- init_chunk_H73442AZ();
14770
+ init_chunk_CE225WRK();
14717
14771
  init_dist();
14718
14772
  init_dist();
14719
14773
  init_dist();
@@ -15043,6 +15097,12 @@ var init_dist3 = __esm({
15043
15097
  checkStructure: true,
15044
15098
  ignorePatterns: []
15045
15099
  };
15100
+ JS_EXT_FALLBACKS2 = {
15101
+ ".js": [".ts", ".tsx", ".jsx"],
15102
+ ".jsx": [".tsx"],
15103
+ ".mjs": [".mts"],
15104
+ ".cjs": [".cts"]
15105
+ };
15046
15106
  FILE_TYPES = /* @__PURE__ */ new Set(["file", "module"]);
15047
15107
  EXPORT_TYPES = /* @__PURE__ */ new Set(["function", "class", "method", "interface", "variable"]);
15048
15108
  CONVENTION_DESCRIPTIONS = {
@@ -18397,6 +18457,10 @@ var init_dist3 = __esm({
18397
18457
  /**
18398
18458
  * Load timeline from disk.
18399
18459
  * Returns empty SecurityTimelineFile if file does not exist or is invalid.
18460
+ * Lifecycle entries with absolute paths under rootDir are migrated to repo-relative
18461
+ * form on read (older versions persisted whatever the scanner emitted, which leaked
18462
+ * machine paths into committed timeline.json). Migrated files are re-saved so the
18463
+ * fixup is one-shot.
18400
18464
  */
18401
18465
  load() {
18402
18466
  if (!existsSync332(this.timelinePath)) {
@@ -18413,6 +18477,15 @@ var init_dist3 = __esm({
18413
18477
  );
18414
18478
  return { version: 1, snapshots: [], findingLifecycles: [] };
18415
18479
  }
18480
+ let mutated = false;
18481
+ for (const lc of parsed.data.findingLifecycles) {
18482
+ const next = this.toRepoRelativePath(lc.file);
18483
+ if (next !== lc.file) {
18484
+ lc.file = next;
18485
+ mutated = true;
18486
+ }
18487
+ }
18488
+ if (mutated) this.save(parsed.data);
18416
18489
  return parsed.data;
18417
18490
  } catch (error) {
18418
18491
  console.error(`Error loading security timeline from ${this.timelinePath}:`, error);
@@ -18437,16 +18510,17 @@ var init_dist3 = __esm({
18437
18510
  * appends to timeline (or replaces if same commitHash), and saves.
18438
18511
  */
18439
18512
  capture(scanResult, commitHash, supplyChain) {
18440
- const byCategory = this.aggregateByCategory(scanResult.findings);
18441
- const bySeverity = this.aggregateBySeverity(scanResult.findings);
18442
- const findingIds = scanResult.findings.map((f) => securityFindingId(f));
18513
+ const normalized = scanResult.findings.map((f) => this.normalizeFindingPath(f));
18514
+ const byCategory = this.aggregateByCategory(normalized);
18515
+ const bySeverity = this.aggregateBySeverity(normalized);
18516
+ const findingIds = normalized.map((f) => securityFindingId(f));
18443
18517
  const supply = supplyChain ?? EMPTY_SUPPLY_CHAIN;
18444
18518
  const snapshot = {
18445
18519
  capturedAt: (/* @__PURE__ */ new Date()).toISOString(),
18446
18520
  commitHash,
18447
18521
  securityScore: 0,
18448
18522
  // computed below
18449
- totalFindings: scanResult.findings.length,
18523
+ totalFindings: normalized.length,
18450
18524
  bySeverity,
18451
18525
  byCategory,
18452
18526
  supplyChain: supply,
@@ -18509,13 +18583,14 @@ var init_dist3 = __esm({
18509
18583
  */
18510
18584
  updateLifecycles(currentFindings, commitHash) {
18511
18585
  const timeline = this.load();
18512
- const currentIds = new Set(currentFindings.map((f) => securityFindingId(f)));
18586
+ const normalized = currentFindings.map((f) => this.normalizeFindingPath(f));
18587
+ const currentIds = new Set(normalized.map((f) => securityFindingId(f)));
18513
18588
  const now = (/* @__PURE__ */ new Date()).toISOString();
18514
18589
  const lifecycleMap = /* @__PURE__ */ new Map();
18515
18590
  for (const lc of timeline.findingLifecycles) {
18516
18591
  lifecycleMap.set(lc.findingId, lc);
18517
18592
  }
18518
- for (const finding of currentFindings) {
18593
+ for (const finding of normalized) {
18519
18594
  const id = securityFindingId(finding);
18520
18595
  this.upsertLifecycle(lifecycleMap, id, finding, now, commitHash);
18521
18596
  }
@@ -18630,6 +18705,23 @@ var init_dist3 = __esm({
18630
18705
  return Math.round(Math.max(0, Math.min(100, 100 - penalty)));
18631
18706
  }
18632
18707
  // --- Private helpers ---
18708
+ /**
18709
+ * Convert a path to repo-relative form using forward slashes. Absolute paths under
18710
+ * rootDir are stripped; already-relative paths are normalized to forward slashes;
18711
+ * paths that escape rootDir (relative starts with `..`) are returned unchanged so we
18712
+ * never silently misattribute a finding outside the project.
18713
+ */
18714
+ toRepoRelativePath(filePath) {
18715
+ if (!filePath) return filePath;
18716
+ if (!isAbsolute4(filePath)) return filePath.replaceAll("\\", "/");
18717
+ const rel = relative32(this.rootDir, filePath).replaceAll("\\", "/");
18718
+ if (rel === "" || rel.startsWith("../") || rel === "..") return filePath;
18719
+ return rel;
18720
+ }
18721
+ normalizeFindingPath(finding) {
18722
+ const next = this.toRepoRelativePath(finding.file);
18723
+ return next === finding.file ? finding : { ...finding, file: next };
18724
+ }
18633
18725
  upsertLifecycle(map, id, finding, now, commitHash) {
18634
18726
  if (!map.has(id)) {
18635
18727
  map.set(id, {
@@ -18865,6 +18957,12 @@ var init_dist3 = __esm({
18865
18957
  MD_FILE_PATTERN = /\.md$/;
18866
18958
  ALL_DOMAINS = ["compliance", "bug", "security", "architecture", "learnings"];
18867
18959
  SECURITY_PATTERNS = /auth|crypto|password|secret|token|session|cookie|hash|encrypt|decrypt|sql|shell|exec|eval/i;
18960
+ JS_EXT_FALLBACKS22 = {
18961
+ ".js": [".ts", ".tsx", ".jsx"],
18962
+ ".jsx": [".tsx"],
18963
+ ".mjs": [".mts"],
18964
+ ".cjs": [".cts"]
18965
+ };
18868
18966
  SEVERITY_RANK = {
18869
18967
  suggestion: 0,
18870
18968
  important: 1,
@@ -6,7 +6,7 @@ import {
6
6
  } from "./chunk-W6Y7ZW3Y.js";
7
7
  import {
8
8
  init_dist
9
- } from "./chunk-MAFI6UWT.js";
9
+ } from "./chunk-K4WRQTEF.js";
10
10
  import {
11
11
  Ok
12
12
  } from "./chunk-RL4VMEXL.js";
@@ -127,7 +127,7 @@ function buildSummaryResponse(report) {
127
127
  }
128
128
  async function handleDetectEntropy(input) {
129
129
  try {
130
- const { EntropyAnalyzer } = await import("./dist-K22DQUYY.js");
130
+ const { EntropyAnalyzer } = await import("./dist-6RT2AVYU.js");
131
131
  const typeFilter = input.type ?? "all";
132
132
  const analyzer = new EntropyAnalyzer({
133
133
  rootDir: sanitizePath(input.path),
@@ -146,7 +146,7 @@ async function handleDetectEntropy(input) {
146
146
  return resultToMcpResponse(result);
147
147
  }
148
148
  if (!result.ok) return resultToMcpResponse(result);
149
- const { createFixes, applyFixes, generateSuggestions } = await import("./dist-K22DQUYY.js");
149
+ const { createFixes, applyFixes, generateSuggestions } = await import("./dist-6RT2AVYU.js");
150
150
  const report = result.value;
151
151
  const deadCode = report.deadCode;
152
152
  const fixTypesConfig = input.fixTypes ? { fixTypes: input.fixTypes } : void 0;
@@ -4,7 +4,7 @@ import {
4
4
  import {
5
5
  ArchConfigSchema,
6
6
  init_dist
7
- } from "./chunk-MAFI6UWT.js";
7
+ } from "./chunk-K4WRQTEF.js";
8
8
  import {
9
9
  Err,
10
10
  Ok
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  init_dist
3
- } from "./chunk-MAFI6UWT.js";
3
+ } from "./chunk-K4WRQTEF.js";
4
4
  import {
5
5
  Ok
6
6
  } from "./chunk-RL4VMEXL.js";
@@ -4,7 +4,7 @@ import {
4
4
  import {
5
5
  listPersonas,
6
6
  loadPersona
7
- } from "./chunk-DRD7LLFC.js";
7
+ } from "./chunk-VJQLUS5I.js";
8
8
  import {
9
9
  GENERATED_HEADER_AGENT,
10
10
  VALID_PLATFORMS,
@@ -3,7 +3,7 @@ import {
3
3
  } from "./chunk-KET4QQZB.js";
4
4
  import {
5
5
  init_dist
6
- } from "./chunk-MAFI6UWT.js";
6
+ } from "./chunk-K4WRQTEF.js";
7
7
  import {
8
8
  Err,
9
9
  Ok
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  init_dist
3
- } from "./chunk-MAFI6UWT.js";
3
+ } from "./chunk-K4WRQTEF.js";
4
4
  import {
5
5
  Err,
6
6
  Ok