@hivelore/mcp 0.49.0 → 0.52.0
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.
- package/dist/index.js +20 -7
- package/dist/index.js.map +1 -1
- package/dist/server.js +20 -7
- package/dist/server.js.map +1 -1
- package/package.json +4 -5
package/dist/server.js
CHANGED
|
@@ -1140,9 +1140,11 @@ import { existsSync as existsSync15, rmSync, symlinkSync } from "fs";
|
|
|
1140
1140
|
import os from "os";
|
|
1141
1141
|
import path6 from "path";
|
|
1142
1142
|
import {
|
|
1143
|
+
extractCorrectApproachExamples,
|
|
1143
1144
|
extractSensorExamples,
|
|
1144
1145
|
extractTestFilePathsFromCommand,
|
|
1145
1146
|
hasPendingTestMarker,
|
|
1147
|
+
isHarnessErrorOutput,
|
|
1146
1148
|
judgeProposedSensor,
|
|
1147
1149
|
loadMemoriesFromDir as loadMemoriesFromDir13,
|
|
1148
1150
|
scrubbedCommandEnv,
|
|
@@ -1369,7 +1371,16 @@ function proveRedOnIncident(command, root, redRef, timeoutMs) {
|
|
|
1369
1371
|
}
|
|
1370
1372
|
}
|
|
1371
1373
|
const run = runCommandForValidation(command, worktree, timeoutMs);
|
|
1372
|
-
if (run.status === "failed")
|
|
1374
|
+
if (run.status === "failed") {
|
|
1375
|
+
if (isHarnessErrorOutput(run.detail)) {
|
|
1376
|
+
return {
|
|
1377
|
+
proven: false,
|
|
1378
|
+
reason: "red-unrunnable",
|
|
1379
|
+
detail: `the oracle errored before reaching its assertion on the incident state, so it proves nothing there \u2014 ${run.detail}`
|
|
1380
|
+
};
|
|
1381
|
+
}
|
|
1382
|
+
return { proven: true, detail: run.detail };
|
|
1383
|
+
}
|
|
1373
1384
|
if (run.status === "passed") {
|
|
1374
1385
|
return { proven: false, reason: "red-not-proven", detail: "oracle PASSED on the incident state \u2014 it does not catch the incident" };
|
|
1375
1386
|
}
|
|
@@ -1631,6 +1642,7 @@ ${verdictCmd.detail}`,
|
|
|
1631
1642
|
...input.bad_example ? [input.bad_example] : [],
|
|
1632
1643
|
...extractSensorExamples(found.memory.body)
|
|
1633
1644
|
];
|
|
1645
|
+
const correctExamples = extractCorrectApproachExamples(found.memory.body);
|
|
1634
1646
|
const sensor = {
|
|
1635
1647
|
kind: "regex",
|
|
1636
1648
|
pattern: input.pattern,
|
|
@@ -1644,14 +1656,14 @@ ${verdictCmd.detail}`,
|
|
|
1644
1656
|
// deliberately authored by the agent and validated — higher trust than heuristic
|
|
1645
1657
|
last_fired: null
|
|
1646
1658
|
};
|
|
1647
|
-
const verdict = judgeProposedSensor(sensor, { currentTargets, badExamples });
|
|
1659
|
+
const verdict = judgeProposedSensor(sensor, { currentTargets, badExamples, correctExamples });
|
|
1648
1660
|
const self_check = {
|
|
1649
1661
|
silent_on_current: verdict.self_check.silent_on_current,
|
|
1650
1662
|
fires_on_bad: verdict.self_check.fires_on_bad,
|
|
1651
1663
|
fired_on: verdict.self_check.fired_on
|
|
1652
1664
|
};
|
|
1653
1665
|
if (!verdict.accepted) {
|
|
1654
|
-
const guidance = verdict.reason === "fires-on-current" ? `The sensor matches the CURRENT (correct) code in ${verdict.self_check.fired_on.join(", ")}. Add or tighten the 'absent' companion so correct usage is excluded, then re-propose.` : verdict.reason === "missed-bad-example" ? "The sensor did not match the bad example, so it won't catch the mistake. Adjust the pattern to match the faulty code, then re-propose." : verdict.reason === "brittle" ? `The pattern is brittle (${verdict.brittle}). Use a durable pattern (avoid hardcoded line numbers), then re-propose.` : "Re-propose with a discriminating pattern.";
|
|
1666
|
+
const guidance = verdict.reason === "fires-on-current" ? `The sensor matches the CURRENT (correct) code in ${verdict.self_check.fired_on.join(", ")}. Add or tighten the 'absent' companion so correct usage is excluded, then re-propose.` : verdict.reason === "fires-on-correct" ? "The pattern matches the lesson's OWN recommended fix (its `Instead, use:` approach) \u2014 it is inverted and would block the correct code, never the mistake. Point the pattern at the FAULTY usage (not the fix), then re-propose." : verdict.reason === "missed-bad-example" ? "The sensor did not match the bad example, so it won't catch the mistake. Adjust the pattern to match the faulty code, then re-propose." : verdict.reason === "brittle" ? `The pattern is brittle (${verdict.brittle}). Use a durable pattern (avoid hardcoded line numbers), then re-propose.` : "Re-propose with a discriminating pattern.";
|
|
1655
1667
|
return {
|
|
1656
1668
|
accepted: false,
|
|
1657
1669
|
memory_id: input.memory_id,
|
|
@@ -3231,7 +3243,7 @@ function oneLine(value) {
|
|
|
3231
3243
|
return value.replace(/\s+/g, " ").replace(/"/g, '\\"').trim().slice(0, 120);
|
|
3232
3244
|
}
|
|
3233
3245
|
function serverVersion() {
|
|
3234
|
-
return true ? "0.
|
|
3246
|
+
return true ? "0.52.0" : "dev";
|
|
3235
3247
|
}
|
|
3236
3248
|
|
|
3237
3249
|
// src/tools/code-map.ts
|
|
@@ -3543,7 +3555,7 @@ function isHaiveOwnedPath(p) {
|
|
|
3543
3555
|
if (p.startsWith(".ai/")) return true;
|
|
3544
3556
|
if (HAIVE_GENERATED_FILES.has(p)) return true;
|
|
3545
3557
|
if (p.startsWith(".cursor/rules/")) return true;
|
|
3546
|
-
if (/^\.github\/workflows\/haive-.*\.ya?ml$/.test(p)) return true;
|
|
3558
|
+
if (/^\.github\/workflows\/(hivelore|haive)-.*\.ya?ml$/.test(p)) return true;
|
|
3547
3559
|
return false;
|
|
3548
3560
|
}
|
|
3549
3561
|
var MAX_FUZZY_SCAN_LINES = 2e4;
|
|
@@ -4696,7 +4708,7 @@ When done, respond with: "Imported N memories: [list of IDs]" or "Nothing action
|
|
|
4696
4708
|
// src/server.ts
|
|
4697
4709
|
import { hasRecentBriefingMarker, loadConfigSync } from "@hivelore/core";
|
|
4698
4710
|
var SERVER_NAME = "hivelore";
|
|
4699
|
-
var SERVER_VERSION = "0.
|
|
4711
|
+
var SERVER_VERSION = "0.52.0";
|
|
4700
4712
|
function jsonResult(data) {
|
|
4701
4713
|
return {
|
|
4702
4714
|
content: [
|
|
@@ -4773,7 +4785,8 @@ var MUTATING_TOOLS = /* @__PURE__ */ new Set([
|
|
|
4773
4785
|
function createHaiveServer(options = {}) {
|
|
4774
4786
|
const context = createContext(options);
|
|
4775
4787
|
const config = loadConfigSync(context.paths);
|
|
4776
|
-
const toolProfile = options.env?.
|
|
4788
|
+
const toolProfile = options.env?.HIVELORE_TOOL_PROFILE ?? options.env?.HAIVE_TOOL_PROFILE ?? // legacy env name
|
|
4789
|
+
config.enforcement?.toolProfile ?? "enforcement";
|
|
4777
4790
|
const requireBriefingFirst = options.env?.HAIVE_REQUIRE_BRIEFING_FIRST === "0" ? false : config.enforcement?.requireBriefingFirst ?? true;
|
|
4778
4791
|
let briefingLoaded = false;
|
|
4779
4792
|
const tracker = new SessionTracker(context);
|