@merittdev/horus 0.8.13 → 0.8.15

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 (2) hide show
  1. package/dist/index.cjs +27 -6
  2. package/package.json +1 -1
package/dist/index.cjs CHANGED
@@ -65880,8 +65880,8 @@ init_cjs_shims();
65880
65880
 
65881
65881
  // ../../packages/core/src/version.ts
65882
65882
  init_cjs_shims();
65883
- var HORUS_VERSION = true ? "0.8.13" : "dev";
65884
- var PINNED_SOURCE_VERSION = "1.5.2";
65883
+ var HORUS_VERSION = true ? "0.8.15" : "dev";
65884
+ var PINNED_SOURCE_VERSION = "1.5.3";
65885
65885
 
65886
65886
  // ../../packages/core/src/evidence.ts
65887
65887
  init_cjs_shims();
@@ -92672,7 +92672,14 @@ async function investigate(input, deps) {
92672
92672
  }
92673
92673
  }
92674
92674
  const changedFilePaths = recentChanges && recentChanges.changedFiles.length > 0 ? new Set(recentChanges.changedFiles) : void 0;
92675
- const rawSeeds = code ? await code.searchSymbols(hint, 5) : [];
92675
+ const scopePrefix = input.scope ? input.scope.replace(/^\.?\/+/, "").replace(/\/+$/, "") : void 0;
92676
+ const inScope = (s5) => {
92677
+ if (!scopePrefix) return true;
92678
+ const fp = (s5.filePath ?? "").replace(/^\.?\/+/, "");
92679
+ return fp === scopePrefix || fp.startsWith(scopePrefix + "/");
92680
+ };
92681
+ const seedSearchLimit = scopePrefix ? 25 : 5;
92682
+ const rawSeeds = code ? (await code.searchSymbols(hint, seedSearchLimit)).filter(inScope).slice(0, 5) : [];
92676
92683
  const hintTokens = [...new Set(tokenize(hint))];
92677
92684
  const hintHasCode = /\b(?=[A-Z0-9_]*[0-9_])[A-Z][A-Z0-9_]{3,}\b/.test(hint);
92678
92685
  const ranked = rankSeeds(rawSeeds, hintTokens, changedFilePaths, hintHasCode);
@@ -92681,7 +92688,7 @@ async function investigate(input, deps) {
92681
92688
  if (top && code && isTypeLikeName(top.name)) {
92682
92689
  const base2 = executableBaseName(top.name);
92683
92690
  if (base2) {
92684
- const altTop = rankSeeds(await code.searchSymbols(base2, 5), hintTokens, void 0, hintHasCode).find(
92691
+ const altTop = rankSeeds((await code.searchSymbols(base2, seedSearchLimit)).filter(inScope), hintTokens, void 0, hintHasCode).find(
92685
92692
  (r) => !isTypeLikeName(r.symbol.name)
92686
92693
  )?.symbol;
92687
92694
  if (altTop && altTop.id !== top.id) {
@@ -94421,7 +94428,18 @@ var EXTERNAL_MARKERS = [
94421
94428
  "flask",
94422
94429
  "django",
94423
94430
  "kafka",
94424
- "boto3"
94431
+ "boto3",
94432
+ // Node ORMs/DB drivers (HOR-359): markers above had only prisma/mongo/redis, so a
94433
+ // TypeORM/Sequelize/Knex backend's database layer went undetected (e.g. vendure on
94434
+ // Postgres). Names chosen to be unambiguous in file content (bare 'pg' would false-match).
94435
+ "typeorm",
94436
+ "sequelize",
94437
+ "knex",
94438
+ "drizzle-orm",
94439
+ "postgres",
94440
+ "mariadb",
94441
+ "mysql2",
94442
+ "mssql"
94425
94443
  ];
94426
94444
  async function discoverArchitecture(deps) {
94427
94445
  const nodeStats = await (async () => {
@@ -110544,6 +110562,7 @@ async function runOneInvestigation(input, ctx, opts = {}) {
110544
110562
  {
110545
110563
  hint: input.hint,
110546
110564
  repo: renv.project,
110565
+ ...input.scope !== void 0 ? { scope: input.scope } : {},
110547
110566
  ...input.since !== void 0 ? { since: input.since } : {},
110548
110567
  ...input.logsSince !== void 0 ? { logsSince: input.logsSince } : {},
110549
110568
  ...(input.service ?? ctx.service) !== void 0 ? { service: input.service ?? ctx.service } : {}
@@ -110743,6 +110762,7 @@ async function runInvestigate(hint, opts) {
110743
110762
  const report = await runOneInvestigation(
110744
110763
  {
110745
110764
  hint,
110765
+ ...opts.scope !== void 0 ? { scope: opts.scope } : {},
110746
110766
  ...opts.since !== void 0 ? { since: opts.since } : {},
110747
110767
  ...opts.logsSince !== void 0 ? { logsSince: opts.logsSince } : {}
110748
110768
  },
@@ -116597,7 +116617,7 @@ Examples:
116597
116617
  });
116598
116618
  }
116599
116619
  );
116600
- program2.command("investigate <hint>").description("Run a deterministic investigation for an incident hint").option("-c, --config <path>", "path to horus.config.ts").option("--name <name>", "registered project name (resolves via the registry)").option("--project <name>", "project name to scope to").option("--env <name>", "environment name (e.g. production)").option("--repo <name>", "repository/project to scope to (alias for --project)").option("--since <ref>", "git ref/range for change-impact (e.g. HEAD~5)").option("--logs-since <dur>", "runtime-log window as a duration (e.g. 30d, 24h); independent of --since").option("--timeout <sec>", "overall investigation deadline in seconds (default 120)").option(
116620
+ program2.command("investigate <hint>").description("Run a deterministic investigation for an incident hint").option("-c, --config <path>", "path to horus.config.ts").option("--name <name>", "registered project name (resolves via the registry)").option("--project <name>", "project name to scope to").option("--env <name>", "environment name (e.g. production)").option("--repo <name>", "repository/project to scope to (alias for --project)").option("--scope <path>", "resolve the seed only from symbols under this path (e.g. packages/core) \u2014 useful in monorepos").option("--since <ref>", "git ref/range for change-impact (e.g. HEAD~5)").option("--logs-since <dur>", "runtime-log window as a duration (e.g. 30d, 24h); independent of --since").option("--timeout <sec>", "overall investigation deadline in seconds (default 120)").option(
116601
116621
  "--service <name>",
116602
116622
  "service name to scope runtime logs, e.g. leadcall-api-prod"
116603
116623
  ).option("--json", "output JSON (alias for --format json)").option("--format <fmt>", "output format: text | markdown | json", "text").option("--ai", "enrich report with AI narrative (requires ANTHROPIC_API_KEY; falls back to deterministic on failure)").option("--ai-model <model>", "AI model for --ai (default: claude-opus-4-8)").action(
@@ -116608,6 +116628,7 @@ Examples:
116608
116628
  project: opts.project,
116609
116629
  env: opts.env,
116610
116630
  repo: opts.repo,
116631
+ scope: opts.scope,
116611
116632
  since: opts.since,
116612
116633
  logsSince: opts.logsSince,
116613
116634
  timeout: opts.timeout,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@merittdev/horus",
3
- "version": "0.8.13",
3
+ "version": "0.8.15",
4
4
  "description": "Local-first, source-aware production-incident investigation engine",
5
5
  "type": "module",
6
6
  "bin": {