@hivelore/mcp 0.51.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 +17 -5
- package/dist/index.js.map +1 -1
- package/dist/server.js +17 -5
- package/dist/server.js.map +1 -1
- package/package.json +3 -3
package/dist/index.js
CHANGED
|
@@ -1142,9 +1142,11 @@ import { existsSync as existsSync15, rmSync, symlinkSync } from "fs";
|
|
|
1142
1142
|
import os from "os";
|
|
1143
1143
|
import path6 from "path";
|
|
1144
1144
|
import {
|
|
1145
|
+
extractCorrectApproachExamples,
|
|
1145
1146
|
extractSensorExamples,
|
|
1146
1147
|
extractTestFilePathsFromCommand,
|
|
1147
1148
|
hasPendingTestMarker,
|
|
1149
|
+
isHarnessErrorOutput,
|
|
1148
1150
|
judgeProposedSensor,
|
|
1149
1151
|
loadMemoriesFromDir as loadMemoriesFromDir13,
|
|
1150
1152
|
scrubbedCommandEnv,
|
|
@@ -1371,7 +1373,16 @@ function proveRedOnIncident(command, root, redRef, timeoutMs) {
|
|
|
1371
1373
|
}
|
|
1372
1374
|
}
|
|
1373
1375
|
const run = runCommandForValidation(command, worktree, timeoutMs);
|
|
1374
|
-
if (run.status === "failed")
|
|
1376
|
+
if (run.status === "failed") {
|
|
1377
|
+
if (isHarnessErrorOutput(run.detail)) {
|
|
1378
|
+
return {
|
|
1379
|
+
proven: false,
|
|
1380
|
+
reason: "red-unrunnable",
|
|
1381
|
+
detail: `the oracle errored before reaching its assertion on the incident state, so it proves nothing there \u2014 ${run.detail}`
|
|
1382
|
+
};
|
|
1383
|
+
}
|
|
1384
|
+
return { proven: true, detail: run.detail };
|
|
1385
|
+
}
|
|
1375
1386
|
if (run.status === "passed") {
|
|
1376
1387
|
return { proven: false, reason: "red-not-proven", detail: "oracle PASSED on the incident state \u2014 it does not catch the incident" };
|
|
1377
1388
|
}
|
|
@@ -1633,6 +1644,7 @@ ${verdictCmd.detail}`,
|
|
|
1633
1644
|
...input.bad_example ? [input.bad_example] : [],
|
|
1634
1645
|
...extractSensorExamples(found.memory.body)
|
|
1635
1646
|
];
|
|
1647
|
+
const correctExamples = extractCorrectApproachExamples(found.memory.body);
|
|
1636
1648
|
const sensor = {
|
|
1637
1649
|
kind: "regex",
|
|
1638
1650
|
pattern: input.pattern,
|
|
@@ -1646,14 +1658,14 @@ ${verdictCmd.detail}`,
|
|
|
1646
1658
|
// deliberately authored by the agent and validated — higher trust than heuristic
|
|
1647
1659
|
last_fired: null
|
|
1648
1660
|
};
|
|
1649
|
-
const verdict = judgeProposedSensor(sensor, { currentTargets, badExamples });
|
|
1661
|
+
const verdict = judgeProposedSensor(sensor, { currentTargets, badExamples, correctExamples });
|
|
1650
1662
|
const self_check = {
|
|
1651
1663
|
silent_on_current: verdict.self_check.silent_on_current,
|
|
1652
1664
|
fires_on_bad: verdict.self_check.fires_on_bad,
|
|
1653
1665
|
fired_on: verdict.self_check.fired_on
|
|
1654
1666
|
};
|
|
1655
1667
|
if (!verdict.accepted) {
|
|
1656
|
-
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.";
|
|
1668
|
+
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.";
|
|
1657
1669
|
return {
|
|
1658
1670
|
accepted: false,
|
|
1659
1671
|
memory_id: input.memory_id,
|
|
@@ -3225,7 +3237,7 @@ function oneLine(value) {
|
|
|
3225
3237
|
return value.replace(/\s+/g, " ").replace(/"/g, '\\"').trim().slice(0, 120);
|
|
3226
3238
|
}
|
|
3227
3239
|
function serverVersion() {
|
|
3228
|
-
return true ? "0.
|
|
3240
|
+
return true ? "0.52.0" : "dev";
|
|
3229
3241
|
}
|
|
3230
3242
|
|
|
3231
3243
|
// src/tools/code-map.ts
|
|
@@ -4690,7 +4702,7 @@ When done, respond with: "Imported N memories: [list of IDs]" or "Nothing action
|
|
|
4690
4702
|
// src/server.ts
|
|
4691
4703
|
import { hasRecentBriefingMarker, loadConfigSync } from "@hivelore/core";
|
|
4692
4704
|
var SERVER_NAME = "hivelore";
|
|
4693
|
-
var SERVER_VERSION = "0.
|
|
4705
|
+
var SERVER_VERSION = "0.52.0";
|
|
4694
4706
|
function jsonResult(data) {
|
|
4695
4707
|
return {
|
|
4696
4708
|
content: [
|