@hivelore/cli 0.47.0 → 0.51.0

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.
@@ -1979,6 +1979,10 @@ var ScaffoldTestInputSchema = {
1979
1979
  memory_id: z17.string().min(1).describe("Id of the attempt/gotcha lesson to scaffold a post-incident test from."),
1980
1980
  framework: z17.enum(["vitest", "jest", "pytest", "gotest"]).optional().describe("Test framework. Auto-detected from the package that owns the lesson's anchor paths when omitted."),
1981
1981
  out_path: z17.string().optional().describe("Override the generated test file path (repo-relative)."),
1982
+ style: z17.enum(["example", "property", "differential"]).optional().describe(
1983
+ "Test shape (default 'example'): 'property' states the invariant once and checks it over many generated inputs (fast-check/Hypothesis); 'differential' asserts the subject agrees with a `reference` implementation for all inputs. Both lower the cost of expressing the invariant."
1984
+ ),
1985
+ reference: z17.string().optional().describe("Required for style='differential': import specifier of the reference implementation to compare against."),
1982
1986
  red_ref: z17.string().optional().describe(
1983
1987
  "Pre-fix incident commit/ref. When set, the scaffold names the symbols the fix (<red_ref>..HEAD) touched within the lesson's anchor scope and pre-fills the example around them, so the assertion is a targeted edit rather than a blank page. A bad ref falls back to the generic template."
1984
1988
  ),
@@ -1990,6 +1994,10 @@ async function scaffoldTest(input, ctx) {
1990
1994
  if (!found) {
1991
1995
  return { ok: false, error: `No memory found with id ${input.memory_id}`, memory_id: input.memory_id };
1992
1996
  }
1997
+ const style = input.style ?? "example";
1998
+ if (style === "differential" && !input.reference) {
1999
+ return { ok: false, error: "style='differential' requires `reference` (the reference implementation to compare against).", memory_id: input.memory_id };
2000
+ }
1993
2001
  const anchorPaths = found.memory.frontmatter.anchor.paths ?? [];
1994
2002
  const allGroups = await detectTestFrameworksForAnchors(ctx.paths.root, anchorPaths);
1995
2003
  const groups = input.out_path ? allGroups.slice(0, 1) : allGroups;
@@ -2013,8 +2021,9 @@ async function scaffoldTest(input, ctx) {
2013
2021
  paths: anchorPaths,
2014
2022
  incidentHints
2015
2023
  };
2024
+ const styleOpts = { style, reference: input.reference };
2016
2025
  let scaffolds = groups.map(
2017
- (g) => scaffoldPostIncidentTest(lesson, { framework: frameworkFor(g.framework), outPath: input.out_path, baseDir: g.baseDir })
2026
+ (g) => scaffoldPostIncidentTest(lesson, { framework: frameworkFor(g.framework), outPath: input.out_path, baseDir: g.baseDir, ...styleOpts })
2018
2027
  );
2019
2028
  let proposeCommand = scaffolds[0].proposeCommand;
2020
2029
  if (scaffolds.length > 1) {
@@ -2023,7 +2032,8 @@ async function scaffoldTest(input, ctx) {
2023
2032
  (g) => scaffoldPostIncidentTest(lesson, {
2024
2033
  framework: frameworkFor(g.framework),
2025
2034
  baseDir: g.baseDir,
2026
- proposeCommandOverride: proposeCommand
2035
+ proposeCommandOverride: proposeCommand,
2036
+ ...styleOpts
2027
2037
  })
2028
2038
  );
2029
2039
  }
@@ -3235,7 +3245,7 @@ function oneLine(value) {
3235
3245
  return value.replace(/\s+/g, " ").replace(/"/g, '\\"').trim().slice(0, 120);
3236
3246
  }
3237
3247
  function serverVersion() {
3238
- return true ? "0.47.0" : "dev";
3248
+ return true ? "0.51.0" : "dev";
3239
3249
  }
3240
3250
  var CodeMapInputSchema = {
3241
3251
  file: z21.string().optional().describe("Filter to files whose path contains this substring"),
@@ -3504,7 +3514,7 @@ function isHaiveOwnedPath(p) {
3504
3514
  if (p.startsWith(".ai/")) return true;
3505
3515
  if (HAIVE_GENERATED_FILES.has(p)) return true;
3506
3516
  if (p.startsWith(".cursor/rules/")) return true;
3507
- if (/^\.github\/workflows\/haive-.*\.ya?ml$/.test(p)) return true;
3517
+ if (/^\.github\/workflows\/(hivelore|haive)-.*\.ya?ml$/.test(p)) return true;
3508
3518
  return false;
3509
3519
  }
3510
3520
  var MAX_FUZZY_SCAN_LINES = 2e4;
@@ -4459,13 +4469,25 @@ Examples of things to look for:
4459
4469
  ### 5. Did you find that an existing memory is outdated or wrong?
4460
4470
  \u2192 If yes, call **\`mem_update\`** with the correct information, or **\`mem_reject\`** if it's completely wrong
4461
4471
 
4472
+ ## The bar \u2014 capture only what is UNGUESSABLE
4473
+
4474
+ A memory earns its place only if it carries *hard-won, repo-specific knowledge a capable teammate could
4475
+ NOT infer* from the code, the docs, or common practice. A "decision" that merely restates what the
4476
+ implementation already shows, a "convention" that is just standard style, a "gotcha" that is generic
4477
+ best practice \u2014 these are noise, and noise makes every future briefing worse. **For a routine change,
4478
+ capturing nothing is the correct, expected outcome.** Only reach for \`mem_save\` when you can name the
4479
+ arbitrary constraint (an invariant, a tradeoff with a real WHY, a footgun that cost you time) that the
4480
+ next agent would otherwise get wrong.
4481
+
4462
4482
  ## Rules
4463
4483
 
4464
4484
  - One memory per insight. Don't cram multiple lessons into one body.
4465
4485
  - Anchor memories to file paths when possible (the \`paths\` field) \u2014 this enables staleness detection.
4466
4486
  - Prefer \`scope="team"\` for anything a teammate or future agent would benefit from.
4467
- - Skip sections where you genuinely have nothing to add. Don't fabricate memories.
4468
- - **Question 0 is not optional** \u2014 always scan your exploration history for code-level discoveries.
4487
+ - Skip sections where you genuinely have nothing to add. Don't fabricate memories \u2014 an empty post-task
4488
+ is better than a corpus of restated obvious facts.
4489
+ - Scan your exploration history for genuine code-level discoveries (failed approaches, real footguns),
4490
+ but hold each to the bar above before saving it.
4469
4491
 
4470
4492
  ### 6. Close the session \u2014 always
4471
4493
  Call **\`mem_session_end\`** with:
@@ -4586,7 +4608,7 @@ When done, respond with: "Imported N memories: [list of IDs]" or "Nothing action
4586
4608
  };
4587
4609
  }
4588
4610
  var SERVER_NAME = "hivelore";
4589
- var SERVER_VERSION = "0.47.0";
4611
+ var SERVER_VERSION = "0.51.0";
4590
4612
  function jsonResult(data) {
4591
4613
  return {
4592
4614
  content: [
@@ -4663,7 +4685,8 @@ var MUTATING_TOOLS = /* @__PURE__ */ new Set([
4663
4685
  function createHaiveServer(options = {}) {
4664
4686
  const context = createContext(options);
4665
4687
  const config = loadConfigSync(context.paths);
4666
- const toolProfile = options.env?.HAIVE_TOOL_PROFILE ?? config.enforcement?.toolProfile ?? "enforcement";
4688
+ const toolProfile = options.env?.HIVELORE_TOOL_PROFILE ?? options.env?.HAIVE_TOOL_PROFILE ?? // legacy env name
4689
+ config.enforcement?.toolProfile ?? "enforcement";
4667
4690
  const requireBriefingFirst = options.env?.HAIVE_REQUIRE_BRIEFING_FIRST === "0" ? false : config.enforcement?.requireBriefingFirst ?? true;
4668
4691
  let briefingLoaded = false;
4669
4692
  const tracker = new SessionTracker(context);
@@ -5578,4 +5601,4 @@ export {
5578
5601
  runHaiveMcpStdio,
5579
5602
  writeMcpRuntimeMarker
5580
5603
  };
5581
- //# sourceMappingURL=chunk-HBS7PNNY.js.map
5604
+ //# sourceMappingURL=chunk-UK4CWVS7.js.map