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