@cachly-dev/mcp-server 0.10.102 β†’ 0.10.103

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/README.md CHANGED
@@ -494,6 +494,18 @@ keep talking to your backend on every editor launch. All data stays in your infr
494
494
 
495
495
  ---
496
496
 
497
+ ## 🧠 Brain v3 β€” what's new
498
+
499
+ | Feature | Tool | What it does |
500
+ |---|---|---|
501
+ | Autonomous hygiene | `brain_hygiene` | Sweeps stale lessons, flags provisional, archives orphans |
502
+ | PR risk scan | `brain_plan` + `cachly-action scan` | Predicts CI failures before they run, posts PR comment |
503
+ | Multi-agent arbitration | `brain_conflicts` Β· `brain_resolve_conflict` | Detects + resolves conflicting lessons across agents |
504
+ | Plans dashboard | `brain_plan` | Persistent plans in the UI with step tracking and brain-viz overlay |
505
+ | Privacy federation | `brain_contribute_signal` Β· `brain_import_meta` | Share patterns without sharing data β€” k-anonymous global commons |
506
+
507
+ ---
508
+
497
509
  ## πŸ› οΈ Ecosystem & Docs
498
510
 
499
511
  **One brain, wherever you work.** Start with the MCP server, or drop the same memory
@@ -505,11 +517,11 @@ straight into your editor β€” your lessons follow you across all of them.
505
517
  | **[Cachly Brain for VS Code](https://marketplace.visualstudio.com/items?itemName=cachly-dev.cachly-brain)** | One-click memory in the editor β€” status bar, lessons view, ambient learning. No terminal needed. |
506
518
  | **[Cachly Brain for JetBrains](https://plugins.jetbrains.com/plugin/32059-cachly-brain)** | Same brain for IntelliJ / PyCharm / GoLand / WebStorm / Rider β€” status bar, brain health, lessons view. |
507
519
  | **[`@cachly-dev/openclaw`](https://www.npmjs.com/package/@cachly-dev/openclaw)** | Cut LLM costs 60–90% in JS/TS apps |
520
+ | **[cachly-dev/cachly-action](https://github.com/cachly-dev/cachly-action)** | GitHub Action: auto-setup, PR risk scan, auto-learn from merged PRs, weekly hygiene |
508
521
 
509
522
  - 🌐 [cachly.dev](https://cachly.dev) β€” Dashboard & free signup
510
523
  - πŸ“– [Docs](https://cachly.dev/docs/ai-memory) β€” Full documentation
511
- - πŸ“Š [BENCH.md](./BENCH.md) β€” The recall-quality proof
512
- - 🧭 [STRATEGY.md](./STRATEGY.md) · [VISION_10X.md](./VISION_10X.md) · [PROGRESS.md](./PROGRESS.md)
524
+ - πŸ—ΊοΈ [Public Roadmap](https://cachly.dev/roadmap) β€” what's coming next
513
525
  - πŸ’¬ [GitHub Issues](https://github.com/cachly-dev/cachly-mcp/issues) β€” Bugs & feature requests
514
526
 
515
527
  ---
@@ -536,10 +536,21 @@ export async function handleBrainTool(name, args, getConnection, apiFetch) {
536
536
  if (!existEdge)
537
537
  continue;
538
538
  if (existEdge.edgeType === 'fixes' && existEdge.confidence > 0.7 && existEdge.trials >= 3) {
539
- beliefConflict = `⚠️ **belief_conflict** on \`${topic}\`: previously confirmed fix (confidence ${existEdge.confidence.toFixed(2)}, n=${existEdge.trials}) now reports failure. Both beliefs retained as \`contested\`. Use \`ckg_inspect(concept="${conceptId}")\` to review.`;
540
- // Store conflict marker
539
+ beliefConflict = `⚠️ **belief_conflict** on \`${topic}\`: previously confirmed fix (confidence ${existEdge.confidence.toFixed(2)}, n=${existEdge.trials}) now reports failure. Both beliefs retained as \`contested\`. Use \`brain_resolve_conflict(instance_id="...", topic="${topic}", winner="success"|"failure")\` to arbitrate, or \`ckg_inspect(concept="${conceptId}")\` to review.`;
540
+ // Store conflict marker β€” records WHICH agent reported the contradiction
541
+ // so multi-agent arbitration can show both sides (Move 4).
541
542
  const conflictKey = `cachly:ckg:conflict:${conceptId}`;
542
- await redis.set(conflictKey, JSON.stringify({ topic, detected_at: new Date().toISOString(), fix_confidence: existEdge.confidence, fix_trials: existEdge.trials, failure_outcome: outcome }), 'EX', 60 * 60 * 24 * 90);
543
+ await redis.set(conflictKey, JSON.stringify({
544
+ topic,
545
+ concept_id: conceptId,
546
+ detected_at: new Date().toISOString(),
547
+ fix_confidence: existEdge.confidence,
548
+ fix_trials: existEdge.trials,
549
+ failure_outcome: outcome,
550
+ reported_by: author || 'unknown',
551
+ what_failed: what_failed || '',
552
+ resolved: false,
553
+ }), 'EX', 60 * 60 * 24 * 90);
543
554
  // Auto-trigger MADC deliberation in background β€” never blocks learn_from_attempts
544
555
  // Note: fire-and-forget; madc_deliberate is handled elsewhere in the switch
545
556
  // (conflict marker stored above β€” no warm-up call needed)
@@ -605,6 +616,10 @@ export async function handleBrainTool(name, args, getConnection, apiFetch) {
605
616
  // Builds the "who knows what" map automatically from author + file_paths.
606
617
  // Person β†’ authored β†’ Concept edges power brain_who_knows queries.
607
618
  if (author) {
619
+ // Agent activity registry (Move 4): track which agents are actively
620
+ // writing to this Brain, keyed by author, with a 1h TTL. Powers
621
+ // brain_conflicts' "who is live" view and multi-agent arbitration.
622
+ redis.set(`cachly:agents:active:${author}`, JSON.stringify({ author, last_topic: topic, last_outcome: outcome, ts: new Date().toISOString() }), 'EX', 60 * 60).catch(() => { });
608
623
  try {
609
624
  const domain = topic.split(':')[0] ?? 'unknown';
610
625
  const personId = await ckgUpsertPersonNode(redis, author, domain);
@@ -818,12 +833,16 @@ export async function handleBrainTool(name, args, getConnection, apiFetch) {
818
833
  // text-similar failed attempts (the moat; see src/rerank.ts + Cachly-Bench). ──
819
834
  const kwMatches = rerankByQuality(rawMatches);
820
835
  const savedHere = [];
836
+ // Exclude archived lessons β€” they are kept for audit but must not surface in recall.
821
837
  const lessonMatches = kwMatches.filter(m => m.key.startsWith('cachly:lesson:best:'));
822
838
  let crossAuthorThisCall = 0;
823
839
  for (const m of lessonMatches.slice(0, 5)) {
824
840
  const existing = await redis.get(m.key).catch(() => null);
825
841
  if (existing) {
826
842
  const lesson = safeJsonParse(existing, null);
843
+ // Skip archived lessons β€” brain_hygiene moves them here; they should not resurface.
844
+ if (lesson?.state === 'archived')
845
+ continue;
827
846
  if (lesson) {
828
847
  const updated = { ...lesson, recall_count: (lesson.recall_count ?? 0) + 1, verified_at: new Date().toISOString() };
829
848
  redis.set(m.key, JSON.stringify(updated)).catch(() => { });