@merittdev/horus 0.8.4 → 0.8.5

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 +62 -1
  2. package/package.json +1 -1
package/dist/index.cjs CHANGED
@@ -65880,7 +65880,7 @@ init_cjs_shims();
65880
65880
 
65881
65881
  // ../../packages/core/src/version.ts
65882
65882
  init_cjs_shims();
65883
- var HORUS_VERSION = true ? "0.8.4" : "dev";
65883
+ var HORUS_VERSION = true ? "0.8.5" : "dev";
65884
65884
  var PINNED_SOURCE_VERSION = "1.5.0";
65885
65885
 
65886
65886
  // ../../packages/core/src/evidence.ts
@@ -92976,6 +92976,67 @@ async function investigate(input, deps) {
92976
92976
  } catch {
92977
92977
  }
92978
92978
  }
92979
+ if (top !== void 0 && typeof deps.code?.searchSymbols === "function") {
92980
+ const GAP_D_MAX_RESOLVE = 12;
92981
+ const seedScope = /* @__PURE__ */ new Set([top.id, ...(ctx?.callees ?? []).map((c4) => c4.id)]);
92982
+ const alreadyEmitted = new Set(seedEmittedJoins.map((j3) => j3.code));
92983
+ const candidates = analysis.signatures.filter(
92984
+ (s5) => s5.key !== "" && s5.key !== "(none)" && s5.count > 0 && !alreadyEmitted.has(s5.key)
92985
+ ).sort((a2, b5) => b5.count - a2.count).slice(0, GAP_D_MAX_RESOLVE);
92986
+ for (const sig of candidates) {
92987
+ let raiser;
92988
+ try {
92989
+ raiser = (await deps.code.searchSymbols(sig.key, 1))[0];
92990
+ } catch {
92991
+ continue;
92992
+ }
92993
+ if (raiser === void 0 || !seedScope.has(raiser.id)) continue;
92994
+ let evId = directEvIdByKey.get(sig.key);
92995
+ if (evId === void 0) {
92996
+ const where = raiser.id === top.id ? "the seed" : "a callee of the seed";
92997
+ const links = raiser.startLine !== void 0 && raiser.startLine > 0 ? { symbolId: raiser.id, file: raiser.filePath, line: raiser.startLine } : { symbolId: raiser.id, file: raiser.filePath };
92998
+ const ev = mkEv(
92999
+ "log",
93000
+ `event_code ${sig.key}: ${sig.count}x in Elasticsearch \u2014 raised by ${raiser.name} (${where})`.slice(
93001
+ 0,
93002
+ 220
93003
+ ),
93004
+ {
93005
+ signature: sig.key,
93006
+ count: sig.count,
93007
+ firstSeen: sig.firstSeen,
93008
+ lastSeen: sig.lastSeen,
93009
+ services: sig.services,
93010
+ isNew: sig.isNew ?? false,
93011
+ ratio: sig.ratio ?? null,
93012
+ sampleMessage: sig.sampleMessage ?? null,
93013
+ relevanceClass: "direct",
93014
+ relevanceReason: `event_code ${sig.key} is raised by ${raiser.name} (${where})`,
93015
+ crossSignalJoin: true,
93016
+ seedEmitted: true
93017
+ },
93018
+ links,
93019
+ sig.lastSeen || void 0,
93020
+ 0.9
93021
+ );
93022
+ if (sig.isNew) ev.isNew = sig.isNew;
93023
+ if (typeof sig.ratio === "number" && Number.isFinite(sig.ratio)) ev.ratio = sig.ratio;
93024
+ logEvIds.push(ev.id);
93025
+ directLogEvIds.push(ev.id);
93026
+ directSignatures.push({ key: sig.key, count: sig.count, message: sig.sampleMessage ?? "" });
93027
+ directEvIdByKey.set(sig.key, ev.id);
93028
+ evId = ev.id;
93029
+ }
93030
+ seedEmittedJoins.push({
93031
+ code: sig.key,
93032
+ count: sig.count,
93033
+ message: sig.sampleMessage ?? "",
93034
+ evId,
93035
+ isNew: sig.isNew ?? false,
93036
+ level: sig.level ?? null
93037
+ });
93038
+ }
93039
+ }
92979
93040
  if (typeof deps.logs.aggregateErrors === "function") {
92980
93041
  const sigForEntities = analysis.signatures.find(
92981
93042
  (s5) => detectEntityFields(s5.sampleContext).length > 0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@merittdev/horus",
3
- "version": "0.8.4",
3
+ "version": "0.8.5",
4
4
  "description": "Local-first, source-aware production-incident investigation engine",
5
5
  "type": "module",
6
6
  "bin": {