@merittdev/horus 0.8.14 → 0.8.16

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 +20 -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.14" : "dev";
65884
- var PINNED_SOURCE_VERSION = "1.5.2";
65883
+ var HORUS_VERSION = true ? "0.8.16" : "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) {
@@ -110555,6 +110562,7 @@ async function runOneInvestigation(input, ctx, opts = {}) {
110555
110562
  {
110556
110563
  hint: input.hint,
110557
110564
  repo: renv.project,
110565
+ ...input.scope !== void 0 ? { scope: input.scope } : {},
110558
110566
  ...input.since !== void 0 ? { since: input.since } : {},
110559
110567
  ...input.logsSince !== void 0 ? { logsSince: input.logsSince } : {},
110560
110568
  ...(input.service ?? ctx.service) !== void 0 ? { service: input.service ?? ctx.service } : {}
@@ -110754,6 +110762,7 @@ async function runInvestigate(hint, opts) {
110754
110762
  const report = await runOneInvestigation(
110755
110763
  {
110756
110764
  hint,
110765
+ ...opts.scope !== void 0 ? { scope: opts.scope } : {},
110757
110766
  ...opts.since !== void 0 ? { since: opts.since } : {},
110758
110767
  ...opts.logsSince !== void 0 ? { logsSince: opts.logsSince } : {}
110759
110768
  },
@@ -115530,7 +115539,11 @@ async function ensureBackendPinned(write) {
115530
115539
  try {
115531
115540
  await execFileAsync2(
115532
115541
  "uv",
115533
- ["tool", "install", "--force", `horus-source==${PINNED_SOURCE_VERSION}`],
115542
+ // --refresh: a CLI update commonly lands seconds after a backend release, so uv's
115543
+ // cached PyPI index may not list the just-published version yet and the install
115544
+ // resolves to "unsatisfiable". Refreshing the index makes the lockstep upgrade
115545
+ // reliable right after a release (HOR-360).
115546
+ ["tool", "install", "--force", "--refresh", `horus-source==${PINNED_SOURCE_VERSION}`],
115534
115547
  { timeout: 3e5 }
115535
115548
  );
115536
115549
  write(` ${import_picocolors43.default.green("\u2713")} Source backend upgraded to ${PINNED_SOURCE_VERSION}.`);
@@ -116608,7 +116621,7 @@ Examples:
116608
116621
  });
116609
116622
  }
116610
116623
  );
116611
- 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(
116624
+ 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(
116612
116625
  "--service <name>",
116613
116626
  "service name to scope runtime logs, e.g. leadcall-api-prod"
116614
116627
  ).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(
@@ -116619,6 +116632,7 @@ Examples:
116619
116632
  project: opts.project,
116620
116633
  env: opts.env,
116621
116634
  repo: opts.repo,
116635
+ scope: opts.scope,
116622
116636
  since: opts.since,
116623
116637
  logsSince: opts.logsSince,
116624
116638
  timeout: opts.timeout,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@merittdev/horus",
3
- "version": "0.8.14",
3
+ "version": "0.8.16",
4
4
  "description": "Local-first, source-aware production-incident investigation engine",
5
5
  "type": "module",
6
6
  "bin": {