@hiveai/cli 0.9.12 → 0.9.14

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 CHANGED
@@ -4306,6 +4306,7 @@ async function memSessionEnd(input, ctx) {
4306
4306
  const revisionCount = (fm.revision_count ?? 0) + 1;
4307
4307
  const newFrontmatter = {
4308
4308
  ...fm,
4309
+ verified_at: (/* @__PURE__ */ new Date()).toISOString(),
4309
4310
  revision_count: revisionCount,
4310
4311
  anchor: {
4311
4312
  ...fm.anchor,
@@ -5706,13 +5707,11 @@ async function preCommitCheck(input, ctx) {
5706
5707
  const filesTouching = new Set(relevantMatches.map((m) => m.id));
5707
5708
  const staleHits = verifyResult.results.filter((r) => r.stale && filesTouching.has(r.id));
5708
5709
  const blockOn = input.block_on;
5710
+ const blockingWarnings = apResult.warnings.filter(isBlockingWarning);
5709
5711
  let should_block = false;
5710
5712
  if (blockOn !== "never") {
5711
- const high = apResult.warnings.filter(
5712
- (w) => w.confidence === "authoritative" || w.confidence === "trusted"
5713
- );
5714
5713
  if (blockOn === "any" && (apResult.warnings.length > 0 || staleHits.length > 0)) should_block = true;
5715
- if (blockOn === "high-confidence" && (high.length > 0 || staleHits.length > 0)) should_block = true;
5714
+ if (blockOn === "high-confidence" && (blockingWarnings.length > 0 || staleHits.length > 0)) should_block = true;
5716
5715
  }
5717
5716
  const relevant_memories = relevantMatches.slice(0, 8).map((m) => ({
5718
5717
  id: m.id,
@@ -5724,6 +5723,7 @@ async function preCommitCheck(input, ctx) {
5724
5723
  should_block,
5725
5724
  summary: {
5726
5725
  anti_patterns: apResult.warnings.length,
5726
+ blocking_warnings: blockingWarnings.length,
5727
5727
  relevant_memories: relevant_memories.length,
5728
5728
  stale_anchors: staleHits.length
5729
5729
  },
@@ -5737,6 +5737,11 @@ async function preCommitCheck(input, ctx) {
5737
5737
  }))
5738
5738
  };
5739
5739
  }
5740
+ function isBlockingWarning(warning) {
5741
+ const highConfidence = warning.confidence === "authoritative" || warning.confidence === "trusted";
5742
+ if (!highConfidence) return false;
5743
+ return warning.reasons.includes("semantic") && (warning.semantic_score ?? 0) >= 0.65;
5744
+ }
5740
5745
  var CONFIG_PATTERNS = [
5741
5746
  ".eslintrc",
5742
5747
  "eslint.config",
@@ -6268,7 +6273,7 @@ When done, respond with: "Imported N memories: [list of IDs]" or "Nothing action
6268
6273
  };
6269
6274
  }
6270
6275
  var SERVER_NAME = "haive";
6271
- var SERVER_VERSION = "0.9.12";
6276
+ var SERVER_VERSION = "0.9.14";
6272
6277
  function jsonResult(data) {
6273
6278
  return {
6274
6279
  content: [
@@ -9417,6 +9422,7 @@ function registerSessionEnd(session2) {
9417
9422
  const revisionCount = (fm.revision_count ?? 0) + 1;
9418
9423
  const newFrontmatter = {
9419
9424
  ...fm,
9425
+ verified_at: (/* @__PURE__ */ new Date()).toISOString(),
9420
9426
  revision_count: revisionCount,
9421
9427
  anchor: {
9422
9428
  ...fm.anchor,
@@ -10832,7 +10838,7 @@ function registerDoctor(program2) {
10832
10838
  timeout: 3e3,
10833
10839
  stdio: ["ignore", "pipe", "ignore"]
10834
10840
  }).trim();
10835
- const cliVersion = "0.9.12";
10841
+ const cliVersion = "0.9.14";
10836
10842
  if (legacyRaw && legacyRaw !== cliVersion) {
10837
10843
  findings.push({
10838
10844
  severity: "warn",
@@ -11044,7 +11050,7 @@ function registerPrecommit(program2) {
11044
11050
  console.log(ui.bold(`hAIve precommit \u2014 ${touchedPaths.length} file(s)`));
11045
11051
  console.log(
11046
11052
  ui.dim(
11047
- ` anti-patterns: ${result.summary.anti_patterns} relevant memories: ${result.summary.relevant_memories} stale anchors: ${result.summary.stale_anchors}`
11053
+ ` anti-patterns: ${result.summary.anti_patterns} blocking: ${result.summary.blocking_warnings ?? result.summary.anti_patterns} relevant memories: ${result.summary.relevant_memories} stale anchors: ${result.summary.stale_anchors}`
11048
11054
  )
11049
11055
  );
11050
11056
  console.log();
@@ -11804,9 +11810,11 @@ async function buildEnforcementReport(dir, stage, sessionId) {
11804
11810
  async function hasRecentSessionRecap(paths) {
11805
11811
  if (!existsSync68(paths.memoriesDir)) return false;
11806
11812
  const all = await loadMemoriesFromDir36(paths.memoriesDir);
11807
- return all.some(
11808
- ({ memory: memory2 }) => memory2.frontmatter.type === "session_recap" && memory2.frontmatter.status !== "rejected" && isFreshIsoDate(memory2.frontmatter.created_at, SESSION_RECAP_TTL_MS)
11809
- );
11813
+ return all.some(({ memory: memory2 }) => {
11814
+ const fm = memory2.frontmatter;
11815
+ const freshnessDate = fm.verified_at ?? fm.created_at;
11816
+ return fm.type === "session_recap" && fm.status !== "rejected" && isFreshIsoDate(freshnessDate, SESSION_RECAP_TTL_MS);
11817
+ });
11810
11818
  }
11811
11819
  async function verifyMemoryPolicy(paths, config) {
11812
11820
  if (!existsSync68(paths.memoriesDir)) return [];
@@ -11908,7 +11916,7 @@ async function runPrecommitPolicy(paths) {
11908
11916
  return [{
11909
11917
  severity: "error",
11910
11918
  code: "precommit-policy-block",
11911
- message: `Pre-commit policy matched ${result.summary.anti_patterns} anti-pattern(s), ${result.summary.stale_anchors} stale anchor(s).`,
11919
+ message: `Pre-commit policy matched ${result.summary.blocking_warnings ?? result.summary.anti_patterns} blocking anti-pattern(s), ${result.summary.stale_anchors} stale anchor(s).`,
11912
11920
  fix: "Review the hAIve warnings, then update the code or the relevant memories.",
11913
11921
  impact: 45
11914
11922
  }];
@@ -12133,7 +12141,7 @@ function registerRun(program2) {
12133
12141
 
12134
12142
  // src/index.ts
12135
12143
  var program = new Command51();
12136
- program.name("haive").description("hAIve \u2014 policy enforcement layer for AI coding agents").version("0.9.12");
12144
+ program.name("haive").description("hAIve \u2014 policy enforcement layer for AI coding agents").version("0.9.14");
12137
12145
  registerInit(program);
12138
12146
  registerWelcome(program);
12139
12147
  registerResolveProject(program);