@hivelore/cli 0.30.0 → 0.30.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
@@ -3680,7 +3680,7 @@ ${SEED_FOOTER(stack)}` });
3680
3680
 
3681
3681
  // src/commands/init.ts
3682
3682
  var execFileAsync = promisify2(execFile2);
3683
- var HAIVE_GITHUB_ACTION_REF = `v${"0.30.0"}`;
3683
+ var HAIVE_GITHUB_ACTION_REF = `v${"0.30.1"}`;
3684
3684
  var PROJECT_CONTEXT_TEMPLATE = `# Project context
3685
3685
 
3686
3686
  > Generated by \`hivelore init\`. Run \`hivelore init --bootstrap\` to auto-fill from your codebase,
@@ -7515,7 +7515,7 @@ function oneLine(value) {
7515
7515
  return value.replace(/\s+/g, " ").replace(/"/g, '\\"').trim().slice(0, 120);
7516
7516
  }
7517
7517
  function serverVersion() {
7518
- return true ? "0.30.0" : "dev";
7518
+ return true ? "0.30.1" : "dev";
7519
7519
  }
7520
7520
  var CodeMapInputSchema = {
7521
7521
  file: z21.string().optional().describe("Filter to files whose path contains this substring"),
@@ -9426,7 +9426,7 @@ When done, respond with: "Imported N memories: [list of IDs]" or "Nothing action
9426
9426
  };
9427
9427
  }
9428
9428
  var SERVER_NAME = "hivelore";
9429
- var SERVER_VERSION = "0.30.0";
9429
+ var SERVER_VERSION = "0.30.1";
9430
9430
  function jsonResult(data) {
9431
9431
  return {
9432
9432
  content: [
@@ -15402,7 +15402,7 @@ function registerDoctor(program2) {
15402
15402
  fix: "Edit .ai/haive.config.json: set autoSessionEnd: true (or re-run `hivelore init` without --manual)."
15403
15403
  });
15404
15404
  }
15405
- findings.push(...await collectInstallFindings(root, "0.30.0"));
15405
+ findings.push(...await collectInstallFindings(root, "0.30.1"));
15406
15406
  findings.push(...await collectToolchainFindings(root));
15407
15407
  try {
15408
15408
  const legacyRaw = execSync4("haive-mcp --version", {
@@ -15410,7 +15410,7 @@ function registerDoctor(program2) {
15410
15410
  timeout: 3e3,
15411
15411
  stdio: ["ignore", "pipe", "ignore"]
15412
15412
  }).trim();
15413
- const cliVersion = "0.30.0";
15413
+ const cliVersion = "0.30.1";
15414
15414
  if (legacyRaw && legacyRaw !== cliVersion) {
15415
15415
  findings.push({
15416
15416
  severity: "warn",
@@ -16514,6 +16514,7 @@ import {
16514
16514
  isFreshIsoDate,
16515
16515
  isRetiredMemory as isRetiredMemory3,
16516
16516
  loadConfig as loadConfig15,
16517
+ detectAgentContext,
16517
16518
  loadMemoriesFromDir as loadMemoriesFromDir40,
16518
16519
  memoryMatchesAnchorPaths as memoryMatchesAnchorPaths6,
16519
16520
  readRecentBriefingMarker,
@@ -17031,6 +17032,8 @@ async function runWithEnforcement(command, args, opts) {
17031
17032
  HAIVE_SESSION_ID: sessionId,
17032
17033
  HAIVE_BRIEFING_FILE: briefingFile,
17033
17034
  HAIVE_ENFORCEMENT: "strict",
17035
+ HAIVE_AGENT: "1",
17036
+ // wrapped process is an agent — process gates bind it (detectAgentContext)
17034
17037
  HAIVE_TOOL_PROFILE: process.env.HAIVE_TOOL_PROFILE ?? "enforcement"
17035
17038
  }
17036
17039
  });
@@ -17177,7 +17180,7 @@ async function buildEnforcementReport(dir, stage, sessionId) {
17177
17180
  findings: [{ severity: "info", code: "enforcement-off", message: "Hivelore enforcement is disabled." }]
17178
17181
  });
17179
17182
  }
17180
- findings.push(...await inspectIntegrationVersions(root, "0.30.0"));
17183
+ findings.push(...await inspectIntegrationVersions(root, "0.30.1"));
17181
17184
  if (config.enforcement?.requireBriefingFirst !== false && stage !== "ci") {
17182
17185
  const hasBriefing = await hasRecentBriefingMarker2(paths, sessionId);
17183
17186
  findings.push(hasBriefing ? { severity: "ok", code: "briefing-loaded", message: "A recent Hivelore briefing marker exists." } : {
@@ -17227,24 +17230,44 @@ async function buildEnforcementReport(dir, stage, sessionId) {
17227
17230
  const changed = await getChangedFiles(root, stage).catch(() => []);
17228
17231
  findings.push(...await checkBootstrapComplete(paths, config, changed.some(looksLikeProductionCode)));
17229
17232
  }
17230
- const score = buildScore(findings, config.enforcement?.scoreThreshold);
17233
+ const agentContext = detectAgentContext();
17234
+ const relaxForHuman = stage !== "ci" && !agentContext.agent && (config.enforcement?.humanCommits ?? "relaxed") === "relaxed";
17235
+ let effectiveFindings = findings;
17236
+ if (relaxForHuman) {
17237
+ const PROCESS_GATE_CODES = /* @__PURE__ */ new Set([
17238
+ "briefing-missing",
17239
+ "session-recap-missing",
17240
+ "decision-coverage-missing",
17241
+ "bootstrap-incomplete"
17242
+ ]);
17243
+ effectiveFindings = findings.map(
17244
+ (f) => f.severity === "error" && PROCESS_GATE_CODES.has(f.code) ? {
17245
+ ...f,
17246
+ severity: "warn",
17247
+ impact: 5,
17248
+ message: `${f.message} (relaxed to a warning: no agent harness detected, so this human commit is not bound by agent process gates \u2014 set enforcement.humanCommits="strict" to change that)`
17249
+ } : f
17250
+ );
17251
+ }
17252
+ const score = buildScore(effectiveFindings, config.enforcement?.scoreThreshold);
17231
17253
  if (score.score < score.threshold) {
17232
- findings.push({
17254
+ effectiveFindings = [...effectiveFindings, {
17233
17255
  severity: "error",
17234
17256
  code: "enforcement-score-below-threshold",
17235
17257
  message: `Enforcement score ${score.score}% is below required threshold ${score.threshold}%.`,
17236
17258
  fix: "Load the relevant briefing, address policy findings, then rerun `hivelore enforce check`.",
17237
17259
  impact: 0
17238
- });
17260
+ }];
17239
17261
  }
17240
- const hasErrors = findings.some((f) => f.severity === "error");
17262
+ const hasErrors = effectiveFindings.some((f) => f.severity === "error");
17241
17263
  return withCategories({
17242
17264
  root,
17243
17265
  initialized,
17244
17266
  mode,
17245
- score: buildScore(findings, config.enforcement?.scoreThreshold),
17267
+ actor: agentContext.agent ? `agent (${agentContext.signals.join(", ")})` : relaxForHuman ? "human \u2014 process gates relaxed" : "human \u2014 strict (enforcement.humanCommits)",
17268
+ score: buildScore(effectiveFindings, config.enforcement?.scoreThreshold),
17246
17269
  should_block: mode === "strict" && hasErrors,
17247
- findings
17270
+ findings: effectiveFindings
17248
17271
  });
17249
17272
  }
17250
17273
  function withCategories(report) {
@@ -18138,7 +18161,7 @@ function printReport(report, json, explain = false) {
18138
18161
  console.log(JSON.stringify(report, null, 2));
18139
18162
  return;
18140
18163
  }
18141
- console.log(ui.bold(`Hivelore enforcement \u2014 ${report.mode}`));
18164
+ console.log(ui.bold(`Hivelore enforcement \u2014 ${report.mode}${report.actor ? ` \xB7 ${report.actor}` : ""}`));
18142
18165
  console.log(ui.dim(` root: ${report.root}`));
18143
18166
  console.log(ui.dim(` score: ${report.score.score}% / threshold ${report.score.threshold}%`));
18144
18167
  if (explain) {
@@ -19495,7 +19518,7 @@ function registerBridges(program2) {
19495
19518
 
19496
19519
  // src/index.ts
19497
19520
  var program = new Command64();
19498
- program.name("hivelore").description("Hivelore - repo-native memory and context policy for coding-agent harnesses").version("0.30.0").option("--advanced", "show maintenance and experimental commands in help").showSuggestionAfterError(true);
19521
+ program.name("hivelore").description("Hivelore - repo-native memory and context policy for coding-agent harnesses").version("0.30.1").option("--advanced", "show maintenance and experimental commands in help").showSuggestionAfterError(true);
19499
19522
  registerInit(program);
19500
19523
  registerWelcome(program);
19501
19524
  registerResolveProject(program);