@hiveai/mcp 0.9.22 → 0.9.23
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 +18 -15
- package/dist/index.js.map +1 -1
- package/dist/server.js +18 -15
- package/dist/server.js.map +1 -1
- package/package.json +3 -3
package/dist/server.js
CHANGED
|
@@ -738,6 +738,7 @@ function toMatch(loaded, reason, usage) {
|
|
|
738
738
|
confidence: deriveConfidence2(fm, u),
|
|
739
739
|
read_count: u.read_count,
|
|
740
740
|
reason,
|
|
741
|
+
anchor_paths: fm.anchor.paths,
|
|
741
742
|
file_path: loaded.filePath,
|
|
742
743
|
body: loaded.memory.body
|
|
743
744
|
};
|
|
@@ -2994,12 +2995,17 @@ async function preCommitCheck(input, ctx) {
|
|
|
2994
2995
|
},
|
|
2995
2996
|
warnings: classifiedWarnings,
|
|
2996
2997
|
relevant_memories,
|
|
2997
|
-
stale_anchors: staleHits.map((r) =>
|
|
2998
|
-
id
|
|
2999
|
-
|
|
3000
|
-
|
|
3001
|
-
|
|
3002
|
-
|
|
2998
|
+
stale_anchors: staleHits.map((r) => {
|
|
2999
|
+
const match = relevantMatches.find((m) => m.id === r.id);
|
|
3000
|
+
const overlapping = match ? input.paths.filter(
|
|
3001
|
+
(p) => match.anchor_paths.some((ap) => ap === p || p.startsWith(ap + "/") || ap.startsWith(p + "/"))
|
|
3002
|
+
) : [];
|
|
3003
|
+
return {
|
|
3004
|
+
id: r.id,
|
|
3005
|
+
paths: overlapping.length > 0 ? overlapping : match ? input.paths : [],
|
|
3006
|
+
body_preview: r.reason ?? "anchored code drifted; verify before relying on this memory"
|
|
3007
|
+
};
|
|
3008
|
+
})
|
|
3003
3009
|
};
|
|
3004
3010
|
}
|
|
3005
3011
|
function classifyWarning(warning, paths) {
|
|
@@ -3019,7 +3025,7 @@ function classifyWarning(warning, paths) {
|
|
|
3019
3025
|
return {
|
|
3020
3026
|
...warning,
|
|
3021
3027
|
level: "blocking",
|
|
3022
|
-
rationale: "authoritative/trusted memory plus strong semantic match to the diff (score >= 0.
|
|
3028
|
+
rationale: "authoritative/trusted memory plus very strong semantic match to the diff (score >= 0.75)",
|
|
3023
3029
|
affected_files: affectedFiles,
|
|
3024
3030
|
repair_command: repairCommand
|
|
3025
3031
|
};
|
|
@@ -3047,7 +3053,8 @@ function classifyWarning(warning, paths) {
|
|
|
3047
3053
|
function isBlockingWarning(warning) {
|
|
3048
3054
|
const highConfidence = warning.confidence === "authoritative" || warning.confidence === "trusted";
|
|
3049
3055
|
if (!highConfidence) return false;
|
|
3050
|
-
|
|
3056
|
+
if (!warning.reasons.includes("semantic")) return false;
|
|
3057
|
+
return (warning.semantic_score ?? 0) >= 0.75;
|
|
3051
3058
|
}
|
|
3052
3059
|
function fileTypeDowngradeReason(warning, paths) {
|
|
3053
3060
|
if (paths.length === 0) return null;
|
|
@@ -3059,8 +3066,8 @@ function fileTypeDowngradeReason(warning, paths) {
|
|
|
3059
3066
|
return "docs/changelog-only change; anti-pattern is downgraded unless semantic evidence is strong.";
|
|
3060
3067
|
}
|
|
3061
3068
|
const configOnly = paths.every(isPackageOrConfigPath);
|
|
3062
|
-
if (configOnly &&
|
|
3063
|
-
return "package/config-only change;
|
|
3069
|
+
if (configOnly && !warning.reasons.includes("anchor") && !hasStrongSemantic(warning)) {
|
|
3070
|
+
return "package/config-only change; warning has no anchor on these files and no strong semantic match \u2014 downgraded to info.";
|
|
3064
3071
|
}
|
|
3065
3072
|
return null;
|
|
3066
3073
|
}
|
|
@@ -3075,10 +3082,6 @@ function isPackageOrConfigPath(file) {
|
|
|
3075
3082
|
const lower = file.toLowerCase();
|
|
3076
3083
|
return lower.endsWith("package.json") || lower.endsWith("package-lock.json") || lower.endsWith("pnpm-lock.yaml") || lower.endsWith("yarn.lock") || lower.endsWith("bun.lockb") || lower.endsWith(".config.ts") || lower.endsWith(".config.js") || lower.endsWith(".json") || lower.endsWith(".yml") || lower.endsWith(".yaml") || lower.startsWith(".github/workflows/");
|
|
3077
3084
|
}
|
|
3078
|
-
function looksRuntimeSpecific(warning) {
|
|
3079
|
-
const text = `${warning.body_preview} ${warning.id}`.toLowerCase();
|
|
3080
|
-
return /\b(runtime|controller|request|response|database|transaction|auth|cache|production|service|api|endpoint)\b/.test(text);
|
|
3081
|
-
}
|
|
3082
3085
|
function repairCommandForWarning(warning, paths) {
|
|
3083
3086
|
const firstPath = paths[0];
|
|
3084
3087
|
return firstPath ? `haive briefing --files "${firstPath}" --task "review ${warning.id}"` : `haive memory show ${warning.id}`;
|
|
@@ -3669,7 +3672,7 @@ When done, respond with: "Imported N memories: [list of IDs]" or "Nothing action
|
|
|
3669
3672
|
// src/server.ts
|
|
3670
3673
|
import { loadConfigSync } from "@hiveai/core";
|
|
3671
3674
|
var SERVER_NAME = "haive";
|
|
3672
|
-
var SERVER_VERSION = "0.9.
|
|
3675
|
+
var SERVER_VERSION = "0.9.23";
|
|
3673
3676
|
function jsonResult(data) {
|
|
3674
3677
|
return {
|
|
3675
3678
|
content: [
|