@merittdev/horus 0.12.0 → 0.12.2

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 (3) hide show
  1. package/README.md +14 -7
  2. package/dist/index.cjs +144 -125
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -6,7 +6,7 @@
6
6
 
7
7
  **Understand what happened.**
8
8
 
9
- Open-source incident investigation. Horus connects Elasticsearch, Sentry, Grafana, MongoDB, Postgres, Redis, BullMQ, and source intelligence into deterministic reports — installable today.
9
+ Open-source incident investigation. Horus connects Elasticsearch, Sentry, Grafana, MongoDB, Postgres, Redis (incl. BullMQ queues), Axiom logs, and source intelligence into deterministic reports — installable today.
10
10
 
11
11
  CLI-only. Read-only against production systems. Horus never writes to your infrastructure.
12
12
 
@@ -63,7 +63,7 @@ Horus source intelligence requires a local code-graph host (the curl installer a
63
63
 
64
64
  | Runtime + Source | Investigation Engine | Investigation Report |
65
65
  |---|---|---|
66
- | Elasticsearch logs · Sentry errors | Correlation | Suspected causes (ranked) |
66
+ | Elasticsearch · Axiom logs · Sentry errors | Correlation | Suspected causes (ranked) |
67
67
  | Grafana metrics | Timeline | Hypotheses + confidence |
68
68
  | MongoDB · Postgres · Redis state | Cause ranking | Evidence + gaps |
69
69
  | BullMQ queue runtime | | Next actions |
@@ -73,7 +73,7 @@ Pipeline: **Evidence → Correlation → Hypotheses → Timeline → Report**
73
73
 
74
74
  ## Sources Horus investigates
75
75
 
76
- Elasticsearch · Sentry · Grafana · MongoDB · Postgres · Redis · BullMQ · Git changes · Source graph · Queue map · Ownership
76
+ Elasticsearch · Sentry · Grafana · MongoDB · Postgres · Redis · BullMQ · Axiom · Git changes · Source graph · Queue map · Ownership
77
77
 
78
78
  Trace reconstruction is not shipped yet. Connectors are read-only and project-scoped.
79
79
 
@@ -124,6 +124,7 @@ Installable today. More connectors and AI providers are in progress.
124
124
  **Today**
125
125
 
126
126
  - Elasticsearch logs
127
+ - Axiom logs
127
128
  - Sentry errors
128
129
  - Grafana metrics
129
130
  - MongoDB / Postgres / Redis state
@@ -149,11 +150,12 @@ Horus is organized in four layers:
149
150
 
150
151
  **Source Intelligence**
151
152
 
152
- - Horus source intelligence backend — code graph, semantic search, impact analysis, ownership.
153
+ - Horus source intelligence backend — code graph, semantic search, impact analysis, ownership across TypeScript/JavaScript and Python (tree-sitter).
153
154
 
154
155
  **Runtime Evidence**
155
156
 
156
157
  - **Elasticsearch** — logs → synthesized error-signature evidence
158
+ - **Axiom** — structured logs (APL) → synthesized error-signature evidence, same path as Elasticsearch
157
159
  - **Sentry** — grouped exceptions (issues) → same error-signature / direct-seed path as logs
158
160
  - **MongoDB / Postgres** — application/operational state
159
161
  - **Grafana** — metrics via its datasource proxy
@@ -186,7 +188,7 @@ Horus talks to the source intelligence backend over **HTTP/MCP only** (no CLI sh
186
188
  The config model separates **code** from **runtime**:
187
189
 
188
190
  - **Code belongs to the project** — `repositories[]`, each served by its own source intelligence host.
189
- - **Runtime belongs to the environment** — `environments[].connectors` (Elasticsearch, Sentry, MongoDB, Postgres, Grafana, Redis/BullMQ).
191
+ - **Runtime belongs to the environment** — `environments[].connectors` (Elasticsearch, Sentry, MongoDB, Postgres, Grafana, Redis/BullMQ, Axiom).
190
192
 
191
193
  ```ts
192
194
  // config/horus.config.ts
@@ -265,7 +267,7 @@ The installer **does not** configure Elasticsearch, MongoDB, Grafana, Redis, or
265
267
 
266
268
  ```bash
267
269
  # Replace vX.Y.Z with the current release tag
268
- curl -fsSL https://github.com/meritt-dev/horus/releases/download/v0.1.0/horus-v0.1.0 -o horus
270
+ curl -fsSL https://github.com/meritt-dev/horus/releases/download/v0.12.0/horus-v0.12.0 -o horus
269
271
  chmod +x horus
270
272
  sudo mv horus /usr/local/bin/horus
271
273
  horus --version
@@ -311,12 +313,17 @@ horus investigate --help
311
313
  | Command | What it does |
312
314
  | --- | --- |
313
315
  | `horus status [--project --env]` | Per-project/env connector-health matrix |
316
+ | `horus connect <type>` | Add/update a runtime connector — `elasticsearch` / `mongodb` / `postgres` / `sentry` / `axiom` / `grafana` / `redis` (plus `ai` to configure an AI provider) |
314
317
  | `horus index --project <p> --env <e>` | Build the queue map (stitcher) for a project |
318
+ | `horus hosts [--reap]` | List source-intelligence hosts and live status; `--reap` stops orphaned hosts |
319
+ | `horus stop [--all]` | Stop this repo's source-intelligence host (`--all` stops every host) |
315
320
  | `horus investigate --project <p> --env <e> "<hint>"` | Full deterministic investigation report |
316
321
  | `horus logs [service] --project <p> --env <e>` | Error-signature evidence (`--raw` for lines) |
317
322
  | `horus state --project <p> --env <e>` | MongoDB application-state evidence (read-only) |
318
323
  | `horus metrics [hint] --project <p> --env <e>` | Grafana metrics evidence |
319
324
  | `horus explain <symbol>` · `blast-radius` · `architecture` · `what-changed` | Source-aware code intelligence (requires source intelligence backend) |
325
+ | `horus memory <show\|add\|list\|link\|...>` | Inspect/author deterministic incident memory; `memory link` adds `supersedes` / `contradicts` / `recurs-with` edges |
326
+ | `horus feedback <id> [--resolved] [--note] [--cause]` | Record outcome feedback on an investigation (improves Horus) |
320
327
 
321
328
  ## Local project workflow (git-style)
322
329
 
@@ -340,7 +347,7 @@ horus projects
340
347
  ```
341
348
  packages/
342
349
  core/ evidence model, config schema + project/env resolution, version pins
343
- connectors/ provider contracts + source intelligence (HTTP/MCP) · Elasticsearch · Grafana · MongoDB · Git
350
+ connectors/ provider contracts + source intelligence (HTTP/MCP) · Elasticsearch · Sentry · Axiom · Grafana · MongoDB · Postgres · Redis · BullMQ · application-state · Git
344
351
  stitcher/ queue-boundary stitcher
345
352
  db/ Drizzle schema + migrations (plain Postgres, no pgvector)
346
353
  engine/ deterministic investigation pipeline (timeline, correlation, hypotheses, gaps)
package/dist/index.cjs CHANGED
@@ -14500,7 +14500,7 @@ var require_utils = __commonJS({
14500
14500
  }
14501
14501
  }
14502
14502
  function get(url, options = {}) {
14503
- return new Promise((resolve12, reject) => {
14503
+ return new Promise((resolve13, reject) => {
14504
14504
  let timeoutId;
14505
14505
  const request = http.get(url, options, (response) => {
14506
14506
  response.setEncoding("utf8");
@@ -14508,7 +14508,7 @@ var require_utils = __commonJS({
14508
14508
  response.on("data", (chunk) => body2 += chunk);
14509
14509
  response.on("end", () => {
14510
14510
  (0, timers_1.clearTimeout)(timeoutId);
14511
- resolve12({ status: response.statusCode, body: body2 });
14511
+ resolve13({ status: response.statusCode, body: body2 });
14512
14512
  });
14513
14513
  }).on("error", (error3) => {
14514
14514
  (0, timers_1.clearTimeout)(timeoutId);
@@ -14527,13 +14527,13 @@ var require_utils = __commonJS({
14527
14527
  return host && match.test(host.toLowerCase()) ? true : false;
14528
14528
  }
14529
14529
  function promiseWithResolvers() {
14530
- let resolve12;
14530
+ let resolve13;
14531
14531
  let reject;
14532
14532
  const promise = new Promise(function withResolversExecutor(promiseResolve, promiseReject) {
14533
- resolve12 = promiseResolve;
14533
+ resolve13 = promiseResolve;
14534
14534
  reject = promiseReject;
14535
14535
  });
14536
- return { promise, resolve: resolve12, reject };
14536
+ return { promise, resolve: resolve13, reject };
14537
14537
  }
14538
14538
  function squashError(_error) {
14539
14539
  return;
@@ -14544,8 +14544,8 @@ var require_utils = __commonJS({
14544
14544
  exports2.randomBytes = randomBytes;
14545
14545
  async function once(ee3, name2, options) {
14546
14546
  options?.signal?.throwIfAborted();
14547
- const { promise, resolve: resolve12, reject } = promiseWithResolvers();
14548
- const onEvent = (data) => resolve12(data);
14547
+ const { promise, resolve: resolve13, reject } = promiseWithResolvers();
14548
+ const onEvent = (data) => resolve13(data);
14549
14549
  const onError2 = (error3) => reject(error3);
14550
14550
  const abortListener = addAbortListener(options?.signal, function() {
14551
14551
  reject(this.reason);
@@ -17165,13 +17165,13 @@ var require_mongo_logger = __commonJS({
17165
17165
  function createStdioLogger(stream) {
17166
17166
  return {
17167
17167
  write: (log) => {
17168
- return new Promise((resolve12, reject) => {
17168
+ return new Promise((resolve13, reject) => {
17169
17169
  const logLine = (0, util_1.inspect)(log, { compact: true, breakLength: Infinity });
17170
17170
  stream.write(`${logLine}
17171
17171
  `, "utf-8", (error3) => {
17172
17172
  if (error3)
17173
17173
  return reject(error3);
17174
- resolve12(true);
17174
+ resolve13(true);
17175
17175
  });
17176
17176
  });
17177
17177
  }
@@ -28020,20 +28020,20 @@ var require_compression = __commonJS({
28020
28020
  ]);
28021
28021
  var ZSTD_COMPRESSION_LEVEL = 3;
28022
28022
  var zlibInflate = (buf) => {
28023
- return new Promise((resolve12, reject) => {
28023
+ return new Promise((resolve13, reject) => {
28024
28024
  zlib.inflate(buf, (error3, result) => {
28025
28025
  if (error3)
28026
28026
  return reject(error3);
28027
- resolve12(result);
28027
+ resolve13(result);
28028
28028
  });
28029
28029
  });
28030
28030
  };
28031
28031
  var zlibDeflate = (buf, options) => {
28032
- return new Promise((resolve12, reject) => {
28032
+ return new Promise((resolve13, reject) => {
28033
28033
  zlib.deflate(buf, options, (error3, result) => {
28034
28034
  if (error3)
28035
28035
  return reject(error3);
28036
- resolve12(result);
28036
+ resolve13(result);
28037
28037
  });
28038
28038
  });
28039
28039
  };
@@ -28761,7 +28761,7 @@ var require_state_machine = __commonJS({
28761
28761
  socket = tls2.connect(socketOptions, () => {
28762
28762
  socket.write(message);
28763
28763
  });
28764
- const { promise: willResolveKmsRequest, reject: rejectOnTlsSocketError, resolve: resolve12 } = (0, utils_1.promiseWithResolvers)();
28764
+ const { promise: willResolveKmsRequest, reject: rejectOnTlsSocketError, resolve: resolve13 } = (0, utils_1.promiseWithResolvers)();
28765
28765
  abortListener = (0, utils_1.addAbortListener)(options?.signal, function() {
28766
28766
  destroySockets();
28767
28767
  rejectOnTlsSocketError(this.reason);
@@ -28773,7 +28773,7 @@ var require_state_machine = __commonJS({
28773
28773
  request.addResponse(buffer2.read(bytesNeeded));
28774
28774
  }
28775
28775
  if (request.bytesNeeded <= 0) {
28776
- resolve12();
28776
+ resolve13();
28777
28777
  }
28778
28778
  });
28779
28779
  await (options?.timeoutContext?.csotEnabled() ? Promise.all([
@@ -30365,8 +30365,8 @@ var require_on_data = __commonJS({
30365
30365
  }
30366
30366
  if (finished)
30367
30367
  return closeHandler();
30368
- const { promise, resolve: resolve12, reject } = (0, utils_1.promiseWithResolvers)();
30369
- unconsumedPromises.push({ resolve: resolve12, reject });
30368
+ const { promise, resolve: resolve13, reject } = (0, utils_1.promiseWithResolvers)();
30369
+ unconsumedPromises.push({ resolve: resolve13, reject });
30370
30370
  return promise;
30371
30371
  },
30372
30372
  return() {
@@ -31550,13 +31550,13 @@ var require_connect = __commonJS({
31550
31550
  socket.setNoDelay(noDelay);
31551
31551
  socket.setTimeout(connectTimeoutMS);
31552
31552
  let cancellationHandler = null;
31553
- const { promise: connectedSocket, resolve: resolve12, reject } = (0, utils_1.promiseWithResolvers)();
31553
+ const { promise: connectedSocket, resolve: resolve13, reject } = (0, utils_1.promiseWithResolvers)();
31554
31554
  if (existingSocket) {
31555
- resolve12(socket);
31555
+ resolve13(socket);
31556
31556
  } else {
31557
31557
  const start2 = performance.now();
31558
31558
  const connectEvent = useTLS ? "secureConnect" : "connect";
31559
- socket.once(connectEvent, () => resolve12(socket)).once("error", (cause) => reject(new error_1.MongoNetworkError(error_1.MongoError.buildErrorMessage(cause), { cause }))).once("timeout", () => {
31559
+ socket.once(connectEvent, () => resolve13(socket)).once("error", (cause) => reject(new error_1.MongoNetworkError(error_1.MongoError.buildErrorMessage(cause), { cause }))).once("timeout", () => {
31560
31560
  reject(new error_1.MongoNetworkTimeoutError(`Socket '${connectEvent}' timed out after ${performance.now() - start2 | 0}ms (connectTimeoutMS: ${connectTimeoutMS})`));
31561
31561
  }).once("close", () => reject(new error_1.MongoNetworkError(`Socket closed after ${performance.now() - start2 | 0} during connection establishment`)));
31562
31562
  if (options.cancellationToken != null) {
@@ -32117,10 +32117,10 @@ var require_connection_pool = __commonJS({
32117
32117
  async checkOut(options) {
32118
32118
  const checkoutTime = (0, utils_1.processTimeMS)();
32119
32119
  this.emitAndLog(_ConnectionPool.CONNECTION_CHECK_OUT_STARTED, new connection_pool_events_1.ConnectionCheckOutStartedEvent(this));
32120
- const { promise, resolve: resolve12, reject } = (0, utils_1.promiseWithResolvers)();
32120
+ const { promise, resolve: resolve13, reject } = (0, utils_1.promiseWithResolvers)();
32121
32121
  const timeout = options.timeoutContext.connectionCheckoutTimeout;
32122
32122
  const waitQueueMember = {
32123
- resolve: resolve12,
32123
+ resolve: resolve13,
32124
32124
  reject,
32125
32125
  cancelled: false,
32126
32126
  checkoutTime
@@ -33359,13 +33359,13 @@ var require_connection_string = __commonJS({
33359
33359
  var LB_REPLICA_SET_ERROR = "loadBalanced option not supported with a replicaSet option";
33360
33360
  var LB_DIRECT_CONNECTION_ERROR = "loadBalanced option not supported when directConnection is provided";
33361
33361
  function retryDNSTimeoutFor(rrtype) {
33362
- const resolve12 = rrtype === "SRV" ? (address) => dns.promises.resolve(address, "SRV") : (address) => dns.promises.resolve(address, "TXT");
33362
+ const resolve13 = rrtype === "SRV" ? (address) => dns.promises.resolve(address, "SRV") : (address) => dns.promises.resolve(address, "TXT");
33363
33363
  return async function dnsReqRetryTimeout(lookupAddress) {
33364
33364
  try {
33365
- return await resolve12(lookupAddress);
33365
+ return await resolve13(lookupAddress);
33366
33366
  } catch (firstDNSError) {
33367
33367
  if (firstDNSError.code === dns.TIMEOUT) {
33368
- return await resolve12(lookupAddress);
33368
+ return await resolve13(lookupAddress);
33369
33369
  } else {
33370
33370
  throw firstDNSError;
33371
33371
  }
@@ -37068,13 +37068,13 @@ var require_topology = __commonJS({
37068
37068
  }
37069
37069
  return transaction.server;
37070
37070
  }
37071
- const { promise: serverPromise, resolve: resolve12, reject } = (0, utils_1.promiseWithResolvers)();
37071
+ const { promise: serverPromise, resolve: resolve13, reject } = (0, utils_1.promiseWithResolvers)();
37072
37072
  const waitQueueMember = {
37073
37073
  serverSelector,
37074
37074
  topologyDescription: this.description,
37075
37075
  mongoLogger: this.client.mongoLogger,
37076
37076
  transaction,
37077
- resolve: resolve12,
37077
+ resolve: resolve13,
37078
37078
  reject,
37079
37079
  cancelled: false,
37080
37080
  startTime: (0, utils_1.processTimeMS)(),
@@ -42598,7 +42598,7 @@ var require_dist2 = __commonJS({
42598
42598
  function parse4(stream, callback) {
42599
42599
  const parser = new parser_1.Parser();
42600
42600
  stream.on("data", (buffer2) => parser.parse(buffer2, callback));
42601
- return new Promise((resolve12) => stream.on("end", () => resolve12()));
42601
+ return new Promise((resolve13) => stream.on("end", () => resolve13()));
42602
42602
  }
42603
42603
  }
42604
42604
  });
@@ -43367,12 +43367,12 @@ var require_client = __commonJS({
43367
43367
  this._connect(callback);
43368
43368
  return;
43369
43369
  }
43370
- return new this._Promise((resolve12, reject) => {
43370
+ return new this._Promise((resolve13, reject) => {
43371
43371
  this._connect((error3) => {
43372
43372
  if (error3) {
43373
43373
  reject(error3);
43374
43374
  } else {
43375
- resolve12(this);
43375
+ resolve13(this);
43376
43376
  }
43377
43377
  });
43378
43378
  });
@@ -43719,8 +43719,8 @@ var require_client = __commonJS({
43719
43719
  } else {
43720
43720
  query = new Query3(config2, values2, callback);
43721
43721
  if (!query.callback) {
43722
- result = new this._Promise((resolve12, reject) => {
43723
- query.callback = (err2, res) => err2 ? reject(err2) : resolve12(res);
43722
+ result = new this._Promise((resolve13, reject) => {
43723
+ query.callback = (err2, res) => err2 ? reject(err2) : resolve13(res);
43724
43724
  }).catch((err2) => {
43725
43725
  Error.captureStackTrace(err2);
43726
43726
  throw err2;
@@ -43804,8 +43804,8 @@ var require_client = __commonJS({
43804
43804
  if (cb) {
43805
43805
  this.connection.once("end", cb);
43806
43806
  } else {
43807
- return new this._Promise((resolve12) => {
43808
- this.connection.once("end", resolve12);
43807
+ return new this._Promise((resolve13) => {
43808
+ this.connection.once("end", resolve13);
43809
43809
  });
43810
43810
  }
43811
43811
  }
@@ -43855,8 +43855,8 @@ var require_pg_pool = __commonJS({
43855
43855
  const cb = function(err2, client) {
43856
43856
  err2 ? rej(err2) : res(client);
43857
43857
  };
43858
- const result = new Promise2(function(resolve12, reject) {
43859
- res = resolve12;
43858
+ const result = new Promise2(function(resolve13, reject) {
43859
+ res = resolve13;
43860
43860
  rej = reject;
43861
43861
  }).catch((err2) => {
43862
43862
  Error.captureStackTrace(err2);
@@ -43917,7 +43917,7 @@ var require_pg_pool = __commonJS({
43917
43917
  if (typeof Promise2.try === "function") {
43918
43918
  return Promise2.try(f5);
43919
43919
  }
43920
- return new Promise2((resolve12) => resolve12(f5()));
43920
+ return new Promise2((resolve13) => resolve13(f5()));
43921
43921
  }
43922
43922
  _isFull() {
43923
43923
  return this._clients.length >= this.options.max;
@@ -44311,8 +44311,8 @@ var require_query2 = __commonJS({
44311
44311
  NativeQuery.prototype._getPromise = function() {
44312
44312
  if (this._promise) return this._promise;
44313
44313
  this._promise = new Promise(
44314
- function(resolve12, reject) {
44315
- this._once("end", resolve12);
44314
+ function(resolve13, reject) {
44315
+ this._once("end", resolve13);
44316
44316
  this._once("error", reject);
44317
44317
  }.bind(this)
44318
44318
  );
@@ -44491,12 +44491,12 @@ var require_client2 = __commonJS({
44491
44491
  this._connect(callback);
44492
44492
  return;
44493
44493
  }
44494
- return new this._Promise((resolve12, reject) => {
44494
+ return new this._Promise((resolve13, reject) => {
44495
44495
  this._connect((error3) => {
44496
44496
  if (error3) {
44497
44497
  reject(error3);
44498
44498
  } else {
44499
- resolve12(this);
44499
+ resolve13(this);
44500
44500
  }
44501
44501
  });
44502
44502
  });
@@ -44520,8 +44520,8 @@ var require_client2 = __commonJS({
44520
44520
  query = new NativeQuery(config2, values2, callback);
44521
44521
  if (!query.callback) {
44522
44522
  let resolveOut, rejectOut;
44523
- result = new this._Promise((resolve12, reject) => {
44524
- resolveOut = resolve12;
44523
+ result = new this._Promise((resolve13, reject) => {
44524
+ resolveOut = resolve13;
44525
44525
  rejectOut = reject;
44526
44526
  }).catch((err2) => {
44527
44527
  Error.captureStackTrace(err2);
@@ -44584,8 +44584,8 @@ var require_client2 = __commonJS({
44584
44584
  }
44585
44585
  let result;
44586
44586
  if (!cb) {
44587
- result = new this._Promise(function(resolve12, reject) {
44588
- cb = (err2) => err2 ? reject(err2) : resolve12();
44587
+ result = new this._Promise(function(resolve13, reject) {
44588
+ cb = (err2) => err2 ? reject(err2) : resolve13();
44589
44589
  });
44590
44590
  }
44591
44591
  this.native.end(function() {
@@ -49964,7 +49964,7 @@ var require_Command = __commonJS({
49964
49964
  }
49965
49965
  }
49966
49966
  initPromise() {
49967
- const promise = new Promise((resolve12, reject) => {
49967
+ const promise = new Promise((resolve13, reject) => {
49968
49968
  if (!this.transformed) {
49969
49969
  this.transformed = true;
49970
49970
  const transformer = _Command._transformer.argument[this.name];
@@ -49973,7 +49973,7 @@ var require_Command = __commonJS({
49973
49973
  }
49974
49974
  this.stringifyArguments();
49975
49975
  }
49976
- this.resolve = this._convertValue(resolve12);
49976
+ this.resolve = this._convertValue(resolve13);
49977
49977
  this.reject = (err2) => {
49978
49978
  this._clearTimers();
49979
49979
  if (this.errorStack) {
@@ -50006,11 +50006,11 @@ var require_Command = __commonJS({
50006
50006
  /**
50007
50007
  * Convert the value from buffer to the target encoding.
50008
50008
  */
50009
- _convertValue(resolve12) {
50009
+ _convertValue(resolve13) {
50010
50010
  return (value) => {
50011
50011
  try {
50012
50012
  this._clearTimers();
50013
- resolve12(this.transformReply(value));
50013
+ resolve13(this.transformReply(value));
50014
50014
  this.isResolved = true;
50015
50015
  } catch (err2) {
50016
50016
  this.reject(err2);
@@ -50306,13 +50306,13 @@ var require_autoPipelining = __commonJS({
50306
50306
  if (client.isCluster && !client.slots.length) {
50307
50307
  if (client.status === "wait")
50308
50308
  client.connect().catch(lodash_1.noop);
50309
- return (0, standard_as_callback_1.default)(new Promise(function(resolve12, reject) {
50309
+ return (0, standard_as_callback_1.default)(new Promise(function(resolve13, reject) {
50310
50310
  client.delayUntilReady((err2) => {
50311
50311
  if (err2) {
50312
50312
  reject(err2);
50313
50313
  return;
50314
50314
  }
50315
- executeWithAutoPipelining(client, functionName, commandName, args2, null).then(resolve12, reject);
50315
+ executeWithAutoPipelining(client, functionName, commandName, args2, null).then(resolve13, reject);
50316
50316
  });
50317
50317
  }), callback);
50318
50318
  }
@@ -50333,13 +50333,13 @@ var require_autoPipelining = __commonJS({
50333
50333
  pipeline[exports2.kExec] = true;
50334
50334
  setImmediate(executeAutoPipeline, client, slotKey);
50335
50335
  }
50336
- const autoPipelinePromise = new Promise(function(resolve12, reject) {
50336
+ const autoPipelinePromise = new Promise(function(resolve13, reject) {
50337
50337
  pipeline[exports2.kCallbacks].push(function(err2, value) {
50338
50338
  if (err2) {
50339
50339
  reject(err2);
50340
50340
  return;
50341
50341
  }
50342
- resolve12(value);
50342
+ resolve13(value);
50343
50343
  });
50344
50344
  if (functionName === "call") {
50345
50345
  args2.unshift(commandName);
@@ -50581,8 +50581,8 @@ var require_Pipeline = __commonJS({
50581
50581
  this[name2] = redis[name2];
50582
50582
  this[name2 + "Buffer"] = redis[name2 + "Buffer"];
50583
50583
  });
50584
- this.promise = new Promise((resolve12, reject) => {
50585
- this.resolve = resolve12;
50584
+ this.promise = new Promise((resolve13, reject) => {
50585
+ this.resolve = resolve13;
50586
50586
  this.reject = reject;
50587
50587
  });
50588
50588
  const _this = this;
@@ -50976,13 +50976,13 @@ var require_transaction = __commonJS({
50976
50976
  if (this.isCluster && !this.redis.slots.length) {
50977
50977
  if (this.redis.status === "wait")
50978
50978
  this.redis.connect().catch(utils_1.noop);
50979
- return (0, standard_as_callback_1.default)(new Promise((resolve12, reject) => {
50979
+ return (0, standard_as_callback_1.default)(new Promise((resolve13, reject) => {
50980
50980
  this.redis.delayUntilReady((err2) => {
50981
50981
  if (err2) {
50982
50982
  reject(err2);
50983
50983
  return;
50984
50984
  }
50985
- this.exec(pipeline).then(resolve12, reject);
50985
+ this.exec(pipeline).then(resolve13, reject);
50986
50986
  });
50987
50987
  }), callback);
50988
50988
  }
@@ -52452,7 +52452,7 @@ var require_cluster = __commonJS({
52452
52452
  * Connect to a cluster
52453
52453
  */
52454
52454
  connect() {
52455
- return new Promise((resolve12, reject) => {
52455
+ return new Promise((resolve13, reject) => {
52456
52456
  if (this.status === "connecting" || this.status === "connect" || this.status === "ready") {
52457
52457
  reject(new Error("Redis is already connecting/connected"));
52458
52458
  return;
@@ -52481,7 +52481,7 @@ var require_cluster = __commonJS({
52481
52481
  this.retryAttempts = 0;
52482
52482
  this.executeOfflineCommands();
52483
52483
  this.resetNodesRefreshInterval();
52484
- resolve12();
52484
+ resolve13();
52485
52485
  };
52486
52486
  let closeListener = void 0;
52487
52487
  const refreshListener = () => {
@@ -53097,7 +53097,7 @@ var require_cluster = __commonJS({
53097
53097
  });
53098
53098
  }
53099
53099
  resolveSrv(hostname2) {
53100
- return new Promise((resolve12, reject) => {
53100
+ return new Promise((resolve13, reject) => {
53101
53101
  this.options.resolveSrv(hostname2, (err2, records) => {
53102
53102
  if (err2) {
53103
53103
  return reject(err2);
@@ -53111,7 +53111,7 @@ var require_cluster = __commonJS({
53111
53111
  if (!group.records.length) {
53112
53112
  sortedKeys.shift();
53113
53113
  }
53114
- self2.dnsLookup(record2.name).then((host) => resolve12({
53114
+ self2.dnsLookup(record2.name).then((host) => resolve13({
53115
53115
  host,
53116
53116
  port: record2.port
53117
53117
  }), tryFirstOne);
@@ -53121,14 +53121,14 @@ var require_cluster = __commonJS({
53121
53121
  });
53122
53122
  }
53123
53123
  dnsLookup(hostname2) {
53124
- return new Promise((resolve12, reject) => {
53124
+ return new Promise((resolve13, reject) => {
53125
53125
  this.options.dnsLookup(hostname2, (err2, address) => {
53126
53126
  if (err2) {
53127
53127
  debug("failed to resolve hostname %s to IP: %s", hostname2, err2.message);
53128
53128
  reject(err2);
53129
53129
  } else {
53130
53130
  debug("resolved hostname %s to IP %s", hostname2, address);
53131
- resolve12(address);
53131
+ resolve13(address);
53132
53132
  }
53133
53133
  });
53134
53134
  });
@@ -53287,7 +53287,7 @@ var require_StandaloneConnector = __commonJS({
53287
53287
  if (options.tls) {
53288
53288
  Object.assign(connectionOptions, options.tls);
53289
53289
  }
53290
- return new Promise((resolve12, reject) => {
53290
+ return new Promise((resolve13, reject) => {
53291
53291
  process.nextTick(() => {
53292
53292
  if (!this.connecting) {
53293
53293
  reject(new Error(utils_1.CONNECTION_CLOSED_ERROR_MSG));
@@ -53306,7 +53306,7 @@ var require_StandaloneConnector = __commonJS({
53306
53306
  this.stream.once("error", (err2) => {
53307
53307
  this.firstError = err2;
53308
53308
  });
53309
- resolve12(this.stream);
53309
+ resolve13(this.stream);
53310
53310
  });
53311
53311
  });
53312
53312
  }
@@ -53468,7 +53468,7 @@ var require_SentinelConnector = __commonJS({
53468
53468
  const error3 = new Error(errorMsg);
53469
53469
  if (typeof retryDelay === "number") {
53470
53470
  eventEmitter("error", error3);
53471
- await new Promise((resolve12) => setTimeout(resolve12, retryDelay));
53471
+ await new Promise((resolve13) => setTimeout(resolve13, retryDelay));
53472
53472
  return connectToNext();
53473
53473
  } else {
53474
53474
  throw error3;
@@ -54817,7 +54817,7 @@ var require_Redis = __commonJS({
54817
54817
  return (0, standard_as_callback_1.default)(promise, callback);
54818
54818
  }
54819
54819
  _connect() {
54820
- return new Promise((resolve12, reject) => {
54820
+ return new Promise((resolve13, reject) => {
54821
54821
  if (this.status === "connecting" || this.status === "connect" || this.status === "ready") {
54822
54822
  reject(new Error("Redis is already connecting/connected"));
54823
54823
  return;
@@ -54896,7 +54896,7 @@ var require_Redis = __commonJS({
54896
54896
  }
54897
54897
  const connectionReadyHandler = function() {
54898
54898
  _this.removeListener("close", connectionCloseHandler);
54899
- resolve12();
54899
+ resolve13();
54900
54900
  };
54901
54901
  var connectionCloseHandler = function() {
54902
54902
  _this.removeListener("ready", connectionReadyHandler);
@@ -54989,10 +54989,10 @@ var require_Redis = __commonJS({
54989
54989
  monitor: true,
54990
54990
  lazyConnect: false
54991
54991
  });
54992
- return (0, standard_as_callback_1.default)(new Promise(function(resolve12, reject) {
54992
+ return (0, standard_as_callback_1.default)(new Promise(function(resolve13, reject) {
54993
54993
  monitorInstance.once("error", reject);
54994
54994
  monitorInstance.once("monitoring", function() {
54995
- resolve12(monitorInstance);
54995
+ resolve13(monitorInstance);
54996
54996
  });
54997
54997
  }), callback);
54998
54998
  }
@@ -61898,7 +61898,7 @@ var require_compile = __commonJS({
61898
61898
  const schOrFunc = root.refs[ref];
61899
61899
  if (schOrFunc)
61900
61900
  return schOrFunc;
61901
- let _sch = resolve12.call(this, root, ref);
61901
+ let _sch = resolve13.call(this, root, ref);
61902
61902
  if (_sch === void 0) {
61903
61903
  const schema = (_a = root.localRefs) === null || _a === void 0 ? void 0 : _a[ref];
61904
61904
  const { schemaId } = this.opts;
@@ -61925,7 +61925,7 @@ var require_compile = __commonJS({
61925
61925
  function sameSchemaEnv(s1, s22) {
61926
61926
  return s1.schema === s22.schema && s1.root === s22.root && s1.baseId === s22.baseId;
61927
61927
  }
61928
- function resolve12(root, ref) {
61928
+ function resolve13(root, ref) {
61929
61929
  let sch;
61930
61930
  while (typeof (sch = this.refs[ref]) == "string")
61931
61931
  ref = sch;
@@ -62559,7 +62559,7 @@ var require_fast_uri = __commonJS({
62559
62559
  }
62560
62560
  return uri;
62561
62561
  }
62562
- function resolve12(baseURI, relativeURI, options) {
62562
+ function resolve13(baseURI, relativeURI, options) {
62563
62563
  const schemelessOptions = options ? Object.assign({ scheme: "null" }, options) : { scheme: "null" };
62564
62564
  const resolved = resolveComponent(parse4(baseURI, schemelessOptions), parse4(relativeURI, schemelessOptions), schemelessOptions, true);
62565
62565
  schemelessOptions.skipEscape = true;
@@ -62817,7 +62817,7 @@ var require_fast_uri = __commonJS({
62817
62817
  var fastUri = {
62818
62818
  SCHEMES,
62819
62819
  normalize,
62820
- resolve: resolve12,
62820
+ resolve: resolve13,
62821
62821
  resolveComponent,
62822
62822
  equal,
62823
62823
  serialize,
@@ -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.12.0" : "dev";
65884
- var PINNED_SOURCE_VERSION = "2.0.0";
65883
+ var HORUS_VERSION = true ? "0.12.2" : "dev";
65884
+ var PINNED_SOURCE_VERSION = "2.0.1";
65885
65885
 
65886
65886
  // ../../packages/core/src/evidence.ts
65887
65887
  init_cjs_shims();
@@ -70876,7 +70876,7 @@ var SourceHttpClient = class {
70876
70876
  this.maxRetries = opts.maxRetries ?? 2;
70877
70877
  }
70878
70878
  sleep(ms) {
70879
- return new Promise((resolve12) => setTimeout(resolve12, ms));
70879
+ return new Promise((resolve13) => setTimeout(resolve13, ms));
70880
70880
  }
70881
70881
  async request(method, path, body2) {
70882
70882
  const url = `${this.baseUrl}${path}`;
@@ -71198,10 +71198,10 @@ async function fetchHostRepoPath(hostUrl) {
71198
71198
  }
71199
71199
  async function findFreePort(start2 = 8420, end = 8520) {
71200
71200
  for (let port = start2; port <= end; port += 1) {
71201
- const free = await new Promise((resolve12) => {
71201
+ const free = await new Promise((resolve13) => {
71202
71202
  const srv = (0, import_node_net.createServer)();
71203
- srv.once("error", () => resolve12(false));
71204
- srv.once("listening", () => srv.close(() => resolve12(true)));
71203
+ srv.once("error", () => resolve13(false));
71204
+ srv.once("listening", () => srv.close(() => resolve13(true)));
71205
71205
  srv.listen(port, "127.0.0.1");
71206
71206
  });
71207
71207
  if (free) return port;
@@ -82080,9 +82080,9 @@ var originError = /* @__PURE__ */ Symbol("OriginError");
82080
82080
  var CLOSE = {};
82081
82081
  var Query2 = class extends Promise {
82082
82082
  constructor(strings, args2, handler, canceller, options = {}) {
82083
- let resolve12, reject;
82083
+ let resolve13, reject;
82084
82084
  super((a2, b5) => {
82085
- resolve12 = a2;
82085
+ resolve13 = a2;
82086
82086
  reject = b5;
82087
82087
  });
82088
82088
  this.tagged = Array.isArray(strings.raw);
@@ -82093,7 +82093,7 @@ var Query2 = class extends Promise {
82093
82093
  this.options = options;
82094
82094
  this.state = null;
82095
82095
  this.statement = null;
82096
- this.resolve = (x4) => (this.active = false, resolve12(x4));
82096
+ this.resolve = (x4) => (this.active = false, resolve13(x4));
82097
82097
  this.reject = (x4) => (this.active = false, reject(x4));
82098
82098
  this.active = false;
82099
82099
  this.cancelled = null;
@@ -82141,12 +82141,12 @@ var Query2 = class extends Promise {
82141
82141
  if (this.executed && !this.active)
82142
82142
  return { done: true };
82143
82143
  prev && prev();
82144
- const promise = new Promise((resolve12, reject) => {
82144
+ const promise = new Promise((resolve13, reject) => {
82145
82145
  this.cursorFn = (value) => {
82146
- resolve12({ value, done: false });
82146
+ resolve13({ value, done: false });
82147
82147
  return new Promise((r) => prev = r);
82148
82148
  };
82149
- this.resolve = () => (this.active = false, resolve12({ done: true }));
82149
+ this.resolve = () => (this.active = false, resolve13({ done: true }));
82150
82150
  this.reject = (x4) => (this.active = false, reject(x4));
82151
82151
  });
82152
82152
  this.execute();
@@ -82778,12 +82778,12 @@ function Connection2(options, queues = {}, { onopen = noop, onend = noop, onclos
82778
82778
  x4.on("drain", drain);
82779
82779
  return x4;
82780
82780
  }
82781
- async function cancel({ pid, secret }, resolve12, reject) {
82781
+ async function cancel({ pid, secret }, resolve13, reject) {
82782
82782
  try {
82783
82783
  cancelMessage = bytes_default().i32(16).i32(80877102).i32(pid).i32(secret).end(16);
82784
82784
  await connect();
82785
82785
  socket.once("error", reject);
82786
- socket.once("close", resolve12);
82786
+ socket.once("close", resolve13);
82787
82787
  } catch (error4) {
82788
82788
  reject(error4);
82789
82789
  }
@@ -83732,7 +83732,7 @@ function parseEvent(x4) {
83732
83732
  init_cjs_shims();
83733
83733
  var import_stream2 = __toESM(require("stream"), 1);
83734
83734
  function largeObject(sql2, oid, mode = 131072 | 262144) {
83735
- return new Promise(async (resolve12, reject) => {
83735
+ return new Promise(async (resolve13, reject) => {
83736
83736
  await sql2.begin(async (sql3) => {
83737
83737
  let finish;
83738
83738
  !oid && ([{ oid }] = await sql3`select lo_creat(-1) as oid`);
@@ -83758,7 +83758,7 @@ function largeObject(sql2, oid, mode = 131072 | 262144) {
83758
83758
  ) seek
83759
83759
  `
83760
83760
  };
83761
- resolve12(lo);
83761
+ resolve13(lo);
83762
83762
  return new Promise(async (r) => finish = r);
83763
83763
  async function readable({
83764
83764
  highWaterMark = 2048 * 8,
@@ -83932,8 +83932,8 @@ function Postgres(a2, b5) {
83932
83932
  }
83933
83933
  async function reserve() {
83934
83934
  const queue = queue_default();
83935
- const c4 = open.length ? open.shift() : await new Promise((resolve12, reject) => {
83936
- const query = { reserve: resolve12, reject };
83935
+ const c4 = open.length ? open.shift() : await new Promise((resolve13, reject) => {
83936
+ const query = { reserve: resolve13, reject };
83937
83937
  queries.push(query);
83938
83938
  closed.length && connect(closed.shift(), query);
83939
83939
  });
@@ -83970,9 +83970,9 @@ function Postgres(a2, b5) {
83970
83970
  let uncaughtError, result;
83971
83971
  name2 && await sql3`savepoint ${sql3(name2)}`;
83972
83972
  try {
83973
- result = await new Promise((resolve12, reject) => {
83973
+ result = await new Promise((resolve13, reject) => {
83974
83974
  const x4 = fn3(sql3);
83975
- Promise.resolve(Array.isArray(x4) ? Promise.all(x4) : x4).then(resolve12, reject);
83975
+ Promise.resolve(Array.isArray(x4) ? Promise.all(x4) : x4).then(resolve13, reject);
83976
83976
  });
83977
83977
  if (uncaughtError)
83978
83978
  throw uncaughtError;
@@ -84029,8 +84029,8 @@ function Postgres(a2, b5) {
84029
84029
  return c4.execute(query) ? move(c4, busy) : move(c4, full);
84030
84030
  }
84031
84031
  function cancel(query) {
84032
- return new Promise((resolve12, reject) => {
84033
- query.state ? query.active ? connection_default(options).cancel(query.state, resolve12, reject) : query.cancelled = { resolve: resolve12, reject } : (queries.remove(query), query.cancelled = true, query.reject(Errors.generic("57014", "canceling statement due to user request")), resolve12());
84032
+ return new Promise((resolve13, reject) => {
84033
+ query.state ? query.active ? connection_default(options).cancel(query.state, resolve13, reject) : query.cancelled = { resolve: resolve13, reject } : (queries.remove(query), query.cancelled = true, query.reject(Errors.generic("57014", "canceling statement due to user request")), resolve13());
84034
84034
  });
84035
84035
  }
84036
84036
  async function end({ timeout = null } = {}) {
@@ -84049,11 +84049,11 @@ function Postgres(a2, b5) {
84049
84049
  async function close() {
84050
84050
  await Promise.all(connections.map((c4) => c4.end()));
84051
84051
  }
84052
- async function destroy(resolve12) {
84052
+ async function destroy(resolve13) {
84053
84053
  await Promise.all(connections.map((c4) => c4.terminate()));
84054
84054
  while (queries.length)
84055
84055
  queries.shift().reject(Errors.connection("CONNECTION_DESTROYED", options));
84056
- resolve12();
84056
+ resolve13();
84057
84057
  }
84058
84058
  function connect(c4, query) {
84059
84059
  move(c4, connecting);
@@ -93865,7 +93865,7 @@ function scoreSeed(s5, index2, hintTokens, changedFiles, hintHasCode, qualifier,
93865
93865
  score -= 4;
93866
93866
  }
93867
93867
  score += Math.max(0, 5 - index2) * (hintHasCode ? 0.8 : 0.1);
93868
- if (s5.score !== void 0) score += s5.score * (hintHasCode ? 8 : 1.5);
93868
+ if (s5.score !== void 0) score += s5.score * (hintHasCode ? 8 : 2);
93869
93869
  if (/\.[jt]sx?$/i.test(s5.name)) score -= 5;
93870
93870
  if (hintTokens !== void 0 && hintTokens.length > 0) {
93871
93871
  let hintBoost = 0;
@@ -93886,17 +93886,27 @@ function isDeprioritizedSeedPath(filePath) {
93886
93886
  filePath
93887
93887
  );
93888
93888
  }
93889
+ function isAnchoredExactSeed(s5, qualifier, hintHasCode, preferNamed) {
93890
+ if (qualifier && qualifierBoost(s5, qualifier) >= 40) return true;
93891
+ if (preferNamed !== void 0 && s5.name.toLowerCase() === preferNamed.toLowerCase()) return true;
93892
+ if (hintHasCode === true && s5.score !== void 0 && s5.score >= 0.9) return true;
93893
+ return false;
93894
+ }
93889
93895
  function rankSeeds(seeds, hintTokens, changedFiles, hintHasCode, qualifier, preferNamed) {
93890
93896
  const scored = seeds.map((symbol, i3) => ({
93891
93897
  symbol,
93892
93898
  score: scoreSeed(symbol, i3, hintTokens, changedFiles, hintHasCode, qualifier, preferNamed),
93893
93899
  role: seedRole(symbol),
93894
93900
  i: i3,
93895
- deprio: isDeprioritizedSeedPath(symbol.filePath)
93901
+ deprio: isDeprioritizedSeedPath(symbol.filePath),
93902
+ // HOR-430: a deprioritized candidate the request anchors on exactly is exempt from the
93903
+ // hard demotion below — it keeps only the soft path penalty so a strong/exact match in an
93904
+ // example/test file can still surface.
93905
+ anchored: isAnchoredExactSeed(symbol, qualifier, hintHasCode, preferNamed)
93896
93906
  }));
93897
93907
  const hasReal = scored.some((s5) => !s5.deprio);
93898
93908
  if (hasReal) {
93899
- for (const s5 of scored) if (s5.deprio) s5.score -= 1e3;
93909
+ for (const s5 of scored) if (s5.deprio && !s5.anchored) s5.score -= 1e3;
93900
93910
  }
93901
93911
  return scored.sort((a2, b5) => b5.score === a2.score ? a2.i - b5.i : b5.score - a2.score).map(({ symbol, score, role }) => ({ symbol, score, role }));
93902
93912
  }
@@ -110484,7 +110494,7 @@ var Protocol = class {
110484
110494
  return;
110485
110495
  }
110486
110496
  const pollInterval = task2.pollInterval ?? this._options?.defaultTaskPollInterval ?? 1e3;
110487
- await new Promise((resolve12) => setTimeout(resolve12, pollInterval));
110497
+ await new Promise((resolve13) => setTimeout(resolve13, pollInterval));
110488
110498
  options?.signal?.throwIfAborted();
110489
110499
  }
110490
110500
  } catch (error3) {
@@ -110501,7 +110511,7 @@ var Protocol = class {
110501
110511
  */
110502
110512
  request(request, resultSchema, options) {
110503
110513
  const { relatedRequestId, resumptionToken, onresumptiontoken, task, relatedTask } = options ?? {};
110504
- return new Promise((resolve12, reject) => {
110514
+ return new Promise((resolve13, reject) => {
110505
110515
  const earlyReject = (error3) => {
110506
110516
  reject(error3);
110507
110517
  };
@@ -110579,7 +110589,7 @@ var Protocol = class {
110579
110589
  if (!parseResult.success) {
110580
110590
  reject(parseResult.error);
110581
110591
  } else {
110582
- resolve12(parseResult.data);
110592
+ resolve13(parseResult.data);
110583
110593
  }
110584
110594
  } catch (error3) {
110585
110595
  reject(error3);
@@ -110840,12 +110850,12 @@ var Protocol = class {
110840
110850
  }
110841
110851
  } catch {
110842
110852
  }
110843
- return new Promise((resolve12, reject) => {
110853
+ return new Promise((resolve13, reject) => {
110844
110854
  if (signal.aborted) {
110845
110855
  reject(new McpError(ErrorCode.InvalidRequest, "Request cancelled"));
110846
110856
  return;
110847
110857
  }
110848
- const timeoutId = setTimeout(resolve12, interval2);
110858
+ const timeoutId = setTimeout(resolve13, interval2);
110849
110859
  signal.addEventListener("abort", () => {
110850
110860
  clearTimeout(timeoutId);
110851
110861
  reject(new McpError(ErrorCode.InvalidRequest, "Request cancelled"));
@@ -111954,7 +111964,7 @@ var McpServer = class {
111954
111964
  let task = createTaskResult.task;
111955
111965
  const pollInterval = task.pollInterval ?? 5e3;
111956
111966
  while (task.status !== "completed" && task.status !== "failed" && task.status !== "cancelled") {
111957
- await new Promise((resolve12) => setTimeout(resolve12, pollInterval));
111967
+ await new Promise((resolve13) => setTimeout(resolve13, pollInterval));
111958
111968
  const updatedTask = await extra.taskStore.getTask(taskId);
111959
111969
  if (!updatedTask) {
111960
111970
  throw new McpError(ErrorCode.InternalError, `Task ${taskId} not found during polling`);
@@ -112605,12 +112615,12 @@ var StdioServerTransport = class {
112605
112615
  this.onclose?.();
112606
112616
  }
112607
112617
  send(message) {
112608
- return new Promise((resolve12) => {
112618
+ return new Promise((resolve13) => {
112609
112619
  const json2 = serializeMessage(message);
112610
112620
  if (this._stdout.write(json2)) {
112611
- resolve12();
112621
+ resolve13();
112612
112622
  } else {
112613
- this._stdout.once("drain", resolve12);
112623
+ this._stdout.once("drain", resolve13);
112614
112624
  }
112615
112625
  });
112616
112626
  }
@@ -116045,9 +116055,9 @@ async function runWatch(opts) {
116045
116055
  while (!stopping) {
116046
116056
  await pollOnce();
116047
116057
  if (stopping) break;
116048
- await new Promise((resolve12) => {
116049
- wake = resolve12;
116050
- const timer2 = setTimeout(resolve12, intervalSec * 1e3);
116058
+ await new Promise((resolve13) => {
116059
+ wake = resolve13;
116060
+ const timer2 = setTimeout(resolve13, intervalSec * 1e3);
116051
116061
  if (typeof timer2.unref === "function") timer2.unref();
116052
116062
  });
116053
116063
  wake = null;
@@ -119417,7 +119427,7 @@ async function checkboxSearch(opts) {
119417
119427
  if (choices.length === 0) {
119418
119428
  return [];
119419
119429
  }
119420
- return new Promise((resolve12, reject) => {
119430
+ return new Promise((resolve13, reject) => {
119421
119431
  let filter = "";
119422
119432
  const selected = /* @__PURE__ */ new Set();
119423
119433
  let cursor = 0;
@@ -119483,7 +119493,7 @@ async function checkboxSearch(opts) {
119483
119493
  output.write(`
119484
119494
  ? ${import_picocolors39.default.bold(message)} ${summary}
119485
119495
  `);
119486
- resolve12(values2);
119496
+ resolve13(values2);
119487
119497
  }
119488
119498
  function cancel() {
119489
119499
  cleanup();
@@ -119580,7 +119590,7 @@ async function selectSearch(opts) {
119580
119590
  if (choices.length === 0) {
119581
119591
  throw new ExitPromptError("No choices to select from");
119582
119592
  }
119583
- return new Promise((resolve12, reject) => {
119593
+ return new Promise((resolve13, reject) => {
119584
119594
  let filter = "";
119585
119595
  let cursor = 0;
119586
119596
  let filtered = choices;
@@ -119638,7 +119648,7 @@ async function selectSearch(opts) {
119638
119648
  output.write(`
119639
119649
  ? ${import_picocolors39.default.bold(message)} ${value}
119640
119650
  `);
119641
- resolve12(value);
119651
+ resolve13(value);
119642
119652
  }
119643
119653
  function cancel() {
119644
119654
  cleanup();
@@ -120081,7 +120091,7 @@ function missingRequired(type, opts) {
120081
120091
  }
120082
120092
  }
120083
120093
  function ask(label, placeholder = "", required2 = true) {
120084
- return new Promise((resolve12) => {
120094
+ return new Promise((resolve13) => {
120085
120095
  const hint = placeholder ? import_picocolors41.default.dim(` (${placeholder})`) : "";
120086
120096
  const suffix = required2 ? "" : import_picocolors41.default.dim(" [optional]");
120087
120097
  process.stdout.write(` ${label}${suffix}${hint}: `);
@@ -120092,12 +120102,12 @@ function ask(label, placeholder = "", required2 = true) {
120092
120102
  });
120093
120103
  rl.once("line", (line2) => {
120094
120104
  rl.close();
120095
- resolve12(line2.trim() || (required2 ? placeholder : ""));
120105
+ resolve13(line2.trim() || (required2 ? placeholder : ""));
120096
120106
  });
120097
120107
  });
120098
120108
  }
120099
120109
  function askPassword(label) {
120100
- return new Promise((resolve12) => {
120110
+ return new Promise((resolve13) => {
120101
120111
  const stdin = process.stdin;
120102
120112
  if (typeof stdin.setRawMode === "function") {
120103
120113
  process.stdout.write(` ${label}${import_picocolors41.default.dim(" [optional]")}: `);
@@ -120111,7 +120121,7 @@ function askPassword(label) {
120111
120121
  stdin.pause();
120112
120122
  stdin.removeListener("data", onData);
120113
120123
  process.stdout.write("\n");
120114
- resolve12(value);
120124
+ resolve13(value);
120115
120125
  } else if (char2 === "") {
120116
120126
  process.exit(1);
120117
120127
  } else if (char2 === "\x7F" || char2 === "\b") {
@@ -120126,7 +120136,7 @@ function askPassword(label) {
120126
120136
  };
120127
120137
  stdin.on("data", onData);
120128
120138
  } else {
120129
- resolve12(ask(label, "", false));
120139
+ resolve13(ask(label, "", false));
120130
120140
  }
120131
120141
  });
120132
120142
  }
@@ -120678,7 +120688,7 @@ async function stopHost(root, hostUrl) {
120678
120688
  await cleanupSpawnedRecord(root);
120679
120689
  return 0;
120680
120690
  }
120681
- if (!hostArgvRegex(port).test(info2.args)) {
120691
+ if (!isOwnHostProcess(spawned.pid, port, root, info2.args)) {
120682
120692
  console.error(
120683
120693
  import_picocolors42.default.red(
120684
120694
  `Pid ${spawned.pid} args do not match "horus-source host --port ${port}". Got: "${info2.args.slice(0, 120)}". Aborting for safety.`
@@ -120725,6 +120735,15 @@ function hostArgvRegex(port) {
120725
120735
  `(?:^|\\s)(?:\\S*/)?horus-source\\s+host\\s+--port(?:=|\\s+)${String(port)}(?=\\s|$)`
120726
120736
  );
120727
120737
  }
120738
+ function hostArgvAnyPortRegex() {
120739
+ return /(?:^|\s)(?:\S*\/)?horus-source\s+host\s+--port(?:=|\s+)\d+(?=\s|$)/;
120740
+ }
120741
+ function isOwnHostProcess(pid, port, root, args2) {
120742
+ if (hostArgvRegex(port).test(args2)) return true;
120743
+ if (!hostArgvAnyPortRegex().test(args2)) return false;
120744
+ const rec = readSourceHostPid(root);
120745
+ return rec !== null && rec.pid === pid && Number.isFinite(rec.port) && rec.port === port && !!rec.repoPath && (0, import_node_path22.resolve)(rec.repoPath) === (0, import_node_path22.resolve)(root);
120746
+ }
120728
120747
  async function cleanupSpawnedRecord(root) {
120729
120748
  try {
120730
120749
  await unlinkAsync((0, import_node_path22.join)(root, HORUS_DIR, SPAWNED_HOST_FILE2));
@@ -120738,7 +120757,7 @@ async function stopBackendServerPid(root, port) {
120738
120757
  if (rec.repoPath && rec.repoPath !== root) return "none";
120739
120758
  const info2 = await getProcessInfo(rec.pid);
120740
120759
  if (info2 === null) return "none";
120741
- if (!hostArgvRegex(port).test(info2.args)) {
120760
+ if (!isOwnHostProcess(rec.pid, port, root, info2.args)) {
120742
120761
  console.log(
120743
120762
  import_picocolors42.default.dim(
120744
120763
  `Host pid ${rec.pid} is now an unrelated process (stale source/host.json / PID reuse) \u2014 host already gone.`
@@ -122216,7 +122235,7 @@ async function runSkillPath(target, opts) {
122216
122235
  init_cjs_shims();
122217
122236
  var import_node_child_process12 = require("child_process");
122218
122237
  var import_picocolors49 = __toESM(require_picocolors(), 1);
122219
- var sleep2 = (ms) => new Promise((resolve12) => setTimeout(resolve12, ms));
122238
+ var sleep2 = (ms) => new Promise((resolve13) => setTimeout(resolve13, ms));
122220
122239
  function openBrowser(url) {
122221
122240
  const cmd = process.platform === "darwin" ? "open" : process.platform === "win32" ? "cmd" : "xdg-open";
122222
122241
  const args2 = process.platform === "win32" ? ["/c", "start", "", url] : [url];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@merittdev/horus",
3
- "version": "0.12.0",
3
+ "version": "0.12.2",
4
4
  "description": "Local-first, source-aware production-incident investigation engine",
5
5
  "type": "module",
6
6
  "bin": {