@hivelore/cli 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/{chunk-VW4U72ET.js → chunk-IICT42WP.js} +21 -8
- package/dist/chunk-IICT42WP.js.map +1 -0
- package/dist/index.js +207 -124
- package/dist/index.js.map +1 -1
- package/dist/{server-ZE5Y3Z4A.js → server-UAD33QQZ.js} +2 -2
- package/package.json +5 -7
- package/dist/chunk-VW4U72ET.js.map +0 -1
- /package/dist/{server-ZE5Y3Z4A.js.map → server-UAD33QQZ.js.map} +0 -0
|
@@ -141,9 +141,11 @@ import { existsSync as existsSync15, rmSync, symlinkSync } from "fs";
|
|
|
141
141
|
import os from "os";
|
|
142
142
|
import path6 from "path";
|
|
143
143
|
import {
|
|
144
|
+
extractCorrectApproachExamples,
|
|
144
145
|
extractSensorExamples,
|
|
145
146
|
extractTestFilePathsFromCommand,
|
|
146
147
|
hasPendingTestMarker,
|
|
148
|
+
isHarnessErrorOutput,
|
|
147
149
|
judgeProposedSensor,
|
|
148
150
|
loadMemoriesFromDir as loadMemoriesFromDir13,
|
|
149
151
|
scrubbedCommandEnv,
|
|
@@ -1502,7 +1504,16 @@ function proveRedOnIncident(command, root, redRef, timeoutMs) {
|
|
|
1502
1504
|
}
|
|
1503
1505
|
}
|
|
1504
1506
|
const run = runCommandForValidation(command, worktree, timeoutMs);
|
|
1505
|
-
if (run.status === "failed")
|
|
1507
|
+
if (run.status === "failed") {
|
|
1508
|
+
if (isHarnessErrorOutput(run.detail)) {
|
|
1509
|
+
return {
|
|
1510
|
+
proven: false,
|
|
1511
|
+
reason: "red-unrunnable",
|
|
1512
|
+
detail: `the oracle errored before reaching its assertion on the incident state, so it proves nothing there \u2014 ${run.detail}`
|
|
1513
|
+
};
|
|
1514
|
+
}
|
|
1515
|
+
return { proven: true, detail: run.detail };
|
|
1516
|
+
}
|
|
1506
1517
|
if (run.status === "passed") {
|
|
1507
1518
|
return { proven: false, reason: "red-not-proven", detail: "oracle PASSED on the incident state \u2014 it does not catch the incident" };
|
|
1508
1519
|
}
|
|
@@ -1764,6 +1775,7 @@ ${verdictCmd.detail}`,
|
|
|
1764
1775
|
...input.bad_example ? [input.bad_example] : [],
|
|
1765
1776
|
...extractSensorExamples(found.memory.body)
|
|
1766
1777
|
];
|
|
1778
|
+
const correctExamples = extractCorrectApproachExamples(found.memory.body);
|
|
1767
1779
|
const sensor = {
|
|
1768
1780
|
kind: "regex",
|
|
1769
1781
|
pattern: input.pattern,
|
|
@@ -1777,14 +1789,14 @@ ${verdictCmd.detail}`,
|
|
|
1777
1789
|
// deliberately authored by the agent and validated — higher trust than heuristic
|
|
1778
1790
|
last_fired: null
|
|
1779
1791
|
};
|
|
1780
|
-
const verdict = judgeProposedSensor(sensor, { currentTargets, badExamples });
|
|
1792
|
+
const verdict = judgeProposedSensor(sensor, { currentTargets, badExamples, correctExamples });
|
|
1781
1793
|
const self_check = {
|
|
1782
1794
|
silent_on_current: verdict.self_check.silent_on_current,
|
|
1783
1795
|
fires_on_bad: verdict.self_check.fires_on_bad,
|
|
1784
1796
|
fired_on: verdict.self_check.fired_on
|
|
1785
1797
|
};
|
|
1786
1798
|
if (!verdict.accepted) {
|
|
1787
|
-
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.";
|
|
1799
|
+
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.";
|
|
1788
1800
|
return {
|
|
1789
1801
|
accepted: false,
|
|
1790
1802
|
memory_id: input.memory_id,
|
|
@@ -3245,7 +3257,7 @@ function oneLine(value) {
|
|
|
3245
3257
|
return value.replace(/\s+/g, " ").replace(/"/g, '\\"').trim().slice(0, 120);
|
|
3246
3258
|
}
|
|
3247
3259
|
function serverVersion() {
|
|
3248
|
-
return true ? "0.
|
|
3260
|
+
return true ? "0.52.0" : "dev";
|
|
3249
3261
|
}
|
|
3250
3262
|
var CodeMapInputSchema = {
|
|
3251
3263
|
file: z21.string().optional().describe("Filter to files whose path contains this substring"),
|
|
@@ -3514,7 +3526,7 @@ function isHaiveOwnedPath(p) {
|
|
|
3514
3526
|
if (p.startsWith(".ai/")) return true;
|
|
3515
3527
|
if (HAIVE_GENERATED_FILES.has(p)) return true;
|
|
3516
3528
|
if (p.startsWith(".cursor/rules/")) return true;
|
|
3517
|
-
if (/^\.github\/workflows\/haive-.*\.ya?ml$/.test(p)) return true;
|
|
3529
|
+
if (/^\.github\/workflows\/(hivelore|haive)-.*\.ya?ml$/.test(p)) return true;
|
|
3518
3530
|
return false;
|
|
3519
3531
|
}
|
|
3520
3532
|
var MAX_FUZZY_SCAN_LINES = 2e4;
|
|
@@ -4608,7 +4620,7 @@ When done, respond with: "Imported N memories: [list of IDs]" or "Nothing action
|
|
|
4608
4620
|
};
|
|
4609
4621
|
}
|
|
4610
4622
|
var SERVER_NAME = "hivelore";
|
|
4611
|
-
var SERVER_VERSION = "0.
|
|
4623
|
+
var SERVER_VERSION = "0.52.0";
|
|
4612
4624
|
function jsonResult(data) {
|
|
4613
4625
|
return {
|
|
4614
4626
|
content: [
|
|
@@ -4685,7 +4697,8 @@ var MUTATING_TOOLS = /* @__PURE__ */ new Set([
|
|
|
4685
4697
|
function createHaiveServer(options = {}) {
|
|
4686
4698
|
const context = createContext(options);
|
|
4687
4699
|
const config = loadConfigSync(context.paths);
|
|
4688
|
-
const toolProfile = options.env?.
|
|
4700
|
+
const toolProfile = options.env?.HIVELORE_TOOL_PROFILE ?? options.env?.HAIVE_TOOL_PROFILE ?? // legacy env name
|
|
4701
|
+
config.enforcement?.toolProfile ?? "enforcement";
|
|
4689
4702
|
const requireBriefingFirst = options.env?.HAIVE_REQUIRE_BRIEFING_FIRST === "0" ? false : config.enforcement?.requireBriefingFirst ?? true;
|
|
4690
4703
|
let briefingLoaded = false;
|
|
4691
4704
|
const tracker = new SessionTracker(context);
|
|
@@ -5600,4 +5613,4 @@ export {
|
|
|
5600
5613
|
runHaiveMcpStdio,
|
|
5601
5614
|
writeMcpRuntimeMarker
|
|
5602
5615
|
};
|
|
5603
|
-
//# sourceMappingURL=chunk-
|
|
5616
|
+
//# sourceMappingURL=chunk-IICT42WP.js.map
|