@hiveai/cli 0.10.0 → 0.10.1

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
@@ -249,6 +249,7 @@ import "commander";
249
249
  import {
250
250
  findProjectRoot,
251
251
  getUsage,
252
+ retirementSignal,
252
253
  loadCodeMap,
253
254
  loadMemoriesFromDir,
254
255
  loadUsageIndex,
@@ -272,6 +273,16 @@ async function lintMemoriesAsync(root, options = {}) {
272
273
  if (fm.type === "session_recap") continue;
273
274
  const body = memory2.body.trim();
274
275
  const naked = body.replace(/^#.*$/gm, "").replace(/```[\s\S]*?```/g, "").trim();
276
+ const retired = retirementSignal(fm, memory2.body);
277
+ if (retired.retired && fm.status !== "deprecated" && fm.status !== "rejected" && fm.status !== "stale") {
278
+ out.push({
279
+ file: filePath,
280
+ id: fm.id,
281
+ severity: "warn",
282
+ code: "RETIRED_ACTIVE_MEMORY",
283
+ message: `Record is still active but lifecycle metadata says it should be retired (${retired.reason}). Mark it deprecated or remove the fixed/superseded marker if it still applies.`
284
+ });
285
+ }
275
286
  if (naked.length < 40 && fm.status !== "rejected") {
276
287
  out.push({
277
288
  file: filePath,
@@ -3745,6 +3756,7 @@ import {
3745
3756
  getUsage as getUsage5,
3746
3757
  inferModulesFromPaths as inferModulesFromPaths2,
3747
3758
  isGlobPath,
3759
+ isRetiredMemory,
3748
3760
  isAutoPromoteEligible,
3749
3761
  isDecaying,
3750
3762
  isStackPackSeed as isStackPackSeed2,
@@ -3793,6 +3805,7 @@ import { existsSync as existsSync222 } from "fs";
3793
3805
  import {
3794
3806
  deriveConfidence as deriveConfidence6,
3795
3807
  getUsage as getUsage7,
3808
+ isRetiredMemory as isRetiredMemory2,
3796
3809
  loadMemoriesFromDir as loadMemoriesFromDir17,
3797
3810
  loadUsageIndex as loadUsageIndex9,
3798
3811
  literalMatchesAnyToken as literalMatchesAnyToken3,
@@ -5141,6 +5154,7 @@ async function getBriefing(input, ctx) {
5141
5154
  const s = memory2.frontmatter.status;
5142
5155
  if (s === "rejected" || s === "deprecated") return false;
5143
5156
  if (!input.include_stale && s === "stale") return false;
5157
+ if (!input.include_stale && isRetiredMemory(memory2.frontmatter, memory2.body)) return false;
5144
5158
  if (memory2.frontmatter.type === "session_recap") return false;
5145
5159
  return true;
5146
5160
  });
@@ -6054,6 +6068,9 @@ var AntiPatternsCheckInputSchema = {
6054
6068
  limit: z24.number().int().positive().max(20).default(8).describe("Cap on returned warnings."),
6055
6069
  semantic: z24.boolean().default(true).describe(
6056
6070
  "When true, also use semantic search (requires @hiveai/embeddings + memory index) to find related anti-patterns."
6071
+ ),
6072
+ min_semantic_score: z24.number().min(0).max(1).default(0.45).describe(
6073
+ "Minimum cosine score for semantic-only anti-pattern hits. Anchor/literal matches still surface. Default 0.45 keeps broad, weakly-related memories out of review noise."
6057
6074
  )
6058
6075
  };
6059
6076
  var CODE_STOPWORDS = /* @__PURE__ */ new Set([
@@ -6124,11 +6141,12 @@ async function antiPatternsCheck(input, ctx) {
6124
6141
  return { scanned: 0, warnings: [], notice: "No .ai/memories directory \u2014 nothing to check against." };
6125
6142
  }
6126
6143
  const all = await loadMemoriesFromDir17(ctx.paths.memoriesDir);
6144
+ const minSemanticScore = input.min_semantic_score ?? 0.45;
6127
6145
  const negative = all.filter(({ memory: memory2 }) => {
6128
6146
  const t = memory2.frontmatter.type;
6129
6147
  if (t !== "attempt" && t !== "gotcha") return false;
6130
6148
  const s = memory2.frontmatter.status;
6131
- return s !== "rejected" && s !== "deprecated" && s !== "stale";
6149
+ return s !== "rejected" && s !== "deprecated" && s !== "stale" && !isRetiredMemory2(memory2.frontmatter, memory2.body);
6132
6150
  });
6133
6151
  if (negative.length === 0) {
6134
6152
  return { scanned: 0, warnings: [], notice: "No attempt/gotcha memories found yet." };
@@ -6182,6 +6200,7 @@ async function antiPatternsCheck(input, ctx) {
6182
6200
  const negativeIds = new Set(negative.map(({ memory: memory2 }) => memory2.frontmatter.id));
6183
6201
  for (const hit of result.hits) {
6184
6202
  if (!negativeIds.has(hit.id)) continue;
6203
+ if (hit.score < minSemanticScore && !seen.has(hit.id)) continue;
6185
6204
  const found = negative.find(({ memory: memory2 }) => memory2.frontmatter.id === hit.id);
6186
6205
  if (found) upsert(found.memory.frontmatter, found.memory.body, "semantic", hit.score);
6187
6206
  }
@@ -7370,7 +7389,7 @@ When done, respond with: "Imported N memories: [list of IDs]" or "Nothing action
7370
7389
  };
7371
7390
  }
7372
7391
  var SERVER_NAME = "haive";
7373
- var SERVER_VERSION = "0.10.0";
7392
+ var SERVER_VERSION = "0.10.1";
7374
7393
  function jsonResult(data) {
7375
7394
  return {
7376
7395
  content: [
@@ -7409,7 +7428,6 @@ var MAINTENANCE_PROFILE_TOOLS = [
7409
7428
  "mem_delete",
7410
7429
  "mem_diff",
7411
7430
  "get_recap",
7412
- "code_search",
7413
7431
  "anti_patterns_check",
7414
7432
  "mem_distill",
7415
7433
  "mem_timeline",
@@ -12090,6 +12108,7 @@ import "commander";
12090
12108
  import {
12091
12109
  findProjectRoot as findProjectRoot41,
12092
12110
  getUsage as getUsage18,
12111
+ retirementSignal as retirementSignal2,
12093
12112
  loadConfig as loadConfig10,
12094
12113
  loadMemoriesFromDir as loadMemoriesFromDir31,
12095
12114
  loadUsageIndex as loadUsageIndex24,
@@ -12126,14 +12145,15 @@ function registerMemoryArchive(memory2) {
12126
12145
  if (typeFilter && fm.type !== typeFilter) continue;
12127
12146
  if (fm.type === "session_recap" || fm.requires_human_approval) continue;
12128
12147
  if (fm.status === "deprecated" || fm.status === "rejected") continue;
12148
+ const retired = retirementSignal2(fm, mem.body);
12129
12149
  const hasAnyAnchor = fm.anchor.paths.length + fm.anchor.symbols.length > 0;
12130
12150
  const allPathsGone = fm.anchor.paths.length > 0 && fm.anchor.paths.every((p) => !existsSync60(path44.join(paths.root, p)));
12131
12151
  const isAnchorless = !hasAnyAnchor;
12132
- if (!opts.unread && !isAnchorless && !allPathsGone) continue;
12152
+ if (!retired.retired && !opts.unread && !isAnchorless && !allPathsGone) continue;
12133
12153
  const u = getUsage18(usage, fm.id);
12134
12154
  const lastSeen = u.last_read_at ?? fm.created_at;
12135
- if (Date.parse(lastSeen) >= cutoff) continue;
12136
- const reason = isAnchorless ? `anchorless and not read since ${lastSeen.slice(0, 10)}` : allPathsGone ? `all ${fm.anchor.paths.length} anchored path(s) missing and not read since ${lastSeen.slice(0, 10)}` : `not read since ${lastSeen.slice(0, 10)} (unread decay)`;
12155
+ if (!retired.retired && Date.parse(lastSeen) >= cutoff) continue;
12156
+ const reason = retired.retired ? `retired lifecycle signal: ${retired.reason ?? "unknown"}` : isAnchorless ? `anchorless and not read since ${lastSeen.slice(0, 10)}` : allPathsGone ? `all ${fm.anchor.paths.length} anchored path(s) missing and not read since ${lastSeen.slice(0, 10)}` : `not read since ${lastSeen.slice(0, 10)} (unread decay)`;
12137
12157
  candidates.push({
12138
12158
  id: fm.id,
12139
12159
  type: fm.type,
@@ -12447,14 +12467,14 @@ function registerDoctor(program2) {
12447
12467
  fix: "Edit .ai/haive.config.json: set autoSessionEnd: true (or re-run `haive init` without --manual)."
12448
12468
  });
12449
12469
  }
12450
- findings.push(...await collectInstallFindings(root, "0.10.0"));
12470
+ findings.push(...await collectInstallFindings(root, "0.10.1"));
12451
12471
  try {
12452
12472
  const legacyRaw = execSync3("haive-mcp --version", {
12453
12473
  encoding: "utf8",
12454
12474
  timeout: 3e3,
12455
12475
  stdio: ["ignore", "pipe", "ignore"]
12456
12476
  }).trim();
12457
- const cliVersion = "0.10.0";
12477
+ const cliVersion = "0.10.1";
12458
12478
  if (legacyRaw && legacyRaw !== cliVersion) {
12459
12479
  findings.push({
12460
12480
  severity: "warn",
@@ -13752,7 +13772,7 @@ async function buildEnforcementReport(dir, stage, sessionId) {
13752
13772
  findings: [{ severity: "info", code: "enforcement-off", message: "hAIve enforcement is disabled." }]
13753
13773
  });
13754
13774
  }
13755
- findings.push(...await inspectIntegrationVersions(root, "0.10.0"));
13775
+ findings.push(...await inspectIntegrationVersions(root, "0.10.1"));
13756
13776
  if (config.enforcement?.requireBriefingFirst !== false && stage !== "ci") {
13757
13777
  const hasBriefing = await hasRecentBriefingMarker(paths, sessionId);
13758
13778
  findings.push(hasBriefing ? { severity: "ok", code: "briefing-loaded", message: "A recent hAIve briefing marker exists." } : {
@@ -14364,7 +14384,7 @@ function registerRun(program2) {
14364
14384
 
14365
14385
  // src/index.ts
14366
14386
  var program = new Command52();
14367
- program.name("haive").description("hAIve \u2014 the memory and enforcement layer of your agent harness").version("0.10.0").option("--advanced", "show maintenance and experimental commands in help");
14387
+ program.name("haive").description("hAIve \u2014 the memory and enforcement layer of your agent harness").version("0.10.1").option("--advanced", "show maintenance and experimental commands in help");
14368
14388
  registerInit(program);
14369
14389
  registerWelcome(program);
14370
14390
  registerResolveProject(program);