musememory 2.2.0 β†’ 2.3.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.
@@ -1,7 +1,7 @@
1
1
  # πŸ“ Current Shipped State & Active Invariants
2
2
 
3
- > **Version**: `v2.1.0`
4
- > **Status**: Production Release (P2P Sync, Studio, and Monorepo Mesh)
3
+ > **Version**: `v2.3.0`
4
+ > **Status**: Feature Release (Autonomous Memory Optimizer, UI Dashboard Controls & Concurrent Multi-Agent Workstream Tracking)
5
5
 
6
6
  ---
7
7
 
@@ -34,6 +34,13 @@
34
34
  25. **Cross-Agent Knowledge Sync & P2P Gossip Protocol (R14)**: Portable sealed `SyncPacket` with SHA-256 integrity, vector clock causal ordering, bidirectional shared pool drop-directory gossip exchange, deduplication, Vibeguard secret scrubbing, and semantic contradiction tagging with mutual `conflict_ids`.
35
35
  26. **Full Web Observability Studio & Interactive Visual Dashboard (R15)**: Integrated web studio served over local HTTP (`memory studio`), featuring a 5-pillar health scorecard, overall letter grade, prioritized remediation action checklist, ADR registry with code-to-doc drift inspector, autonomous "Why" reasoner, bug friction clusters heatmap, debt hotspots, and live P2P mesh topology visualizer.
36
36
  27. **Multi-Repo & Monorepo Cross-Project Mesh (R16)**: Automatic workspace detection across pnpm, npm, bun, lerna, and multi-repo sibling groups; cross-project memory querying with origin package provenance; cross-package contract and entrypoint export auditing; explicit mesh linking (`mesh_links.json`); and shared invariant propagation across the entire mesh.
37
+ 28. **Unified Code & Memory Impact Analysis**: Pre-flight blast radius analysis evaluating AST callers, test suites, governing ADRs, negative warnings, and risk levels (`memory code-impact` / `muse_code_impact`).
38
+ 29. **PR & Change Context Generator**: Automatically turns git diffs into rich, memory-grounded GitHub PR descriptions linking touched anchors and active constraints (`memory pr-context` / `muse_pr_context`).
39
+ 30. **Interactive Code Anchor Reconciler**: Audits and repairs code anchors across memories, pruning dead references and updating structural hashes (`memory reconcile` / `muse_reconcile_anchors`).
40
+ 31. **Latency & Quality Telemetry Suite**: Benchmarks microsecond hot caches, FTS5 BM25 search, knapsack token packing, and ROI in a clean ASCII scoreboard (`memory benchmark`).
41
+ 32. **Linus-Style Architectural Hardening (v2.2.1)**: Elimination of shell command injection via `execFileSync`, concurrency-safe `PRAGMA busy_timeout = 5000` on SQLite WAL mode, O(N) stat storm elimination in `list(store)`, structured warnings on YAML dual-write failures, and tightened word-boundary/code-anchor ADR matching.
42
+ 33. **Autonomous Memory Optimizer & Auto-Cadence Engine (v2.3.0)**: Multi-factor noise and junk pruning engine with zero-daemon auto-cadence (every 7 days or after 48h idle), SQLite WAL defragmentation (`VACUUM;` + `PRAGMA optimize;`), CLI command `memory optimize`, and dashboard "⚑ Optimize" button.
43
+ 34. **Concurrent Multi-Agent Workstream Tracking & Clean `CURRENT.md` (v2.3.0)**: Live `AgentWorkstream` tracking table in `CURRENT.md` enabling multi-agent swarms across separate chat sessions to coordinate active tasks and target scopes; injected into prompt context (`formatPromptContext`, `resolveMuseContext`); sanitized single-pane executive summary for humans with strict grounding rules for agents.
37
44
 
38
45
  ---
39
46
 
@@ -93,7 +93,8 @@ memory audit [--limit 20]
93
93
  memory persona [developer|designer|marketer|casual]
94
94
  memory current --add "Must use Bun v1.2"
95
95
 
96
- # Diagnostics & Server
96
+ # Diagnostics, Server & Optimization
97
+ memory optimize [--dry-run] [--force] [--project core]
97
98
  memory doctor
98
99
  memory validate --dry-run
99
100
  memory mcp [--profile coding|review|architecture|core|full]
@@ -5,7 +5,36 @@ description: Active working constraints and interruption-proof session handoff m
5
5
 
6
6
  # πŸ“ Muse Current (`muse-current`)
7
7
 
8
- > **When to use**: Execute when the user establishes a hard project invariant, when starting a multi-step task, or before context compaction/task switching to record in-flight handoffs.
8
+ > **When to use**: Execute when the user establishes a hard project invariant, when starting a multi-step task, before context compaction/task switching, or when running multiple concurrent agents to record in-flight workstreams and prevent collisions.
9
+
10
+ ---
11
+
12
+ ## πŸ›οΈ Operational Guidelines: Humans vs AI Agents
13
+
14
+ | Persona | Purpose & Guidelines |
15
+ | :--- | :--- |
16
+ | **For Humans (Founders & Architects)** | Single-pane-of-glass executive dashboard of active project invariants, active handoffs, and active concurrent agent workstreams. **Strictly zero verbose logs, raw terminal dumps, or transcript noise.** |
17
+ | **For AI Agents (Agency Council & Subagents)** | Mandatory grounding contract. Every agent must check `CURRENT.md` at session start (`get_context`) to respect active constraints, register its active task, and check what other parallel agents are modifying to avoid merge conflicts and race conditions. |
18
+
19
+ ---
20
+
21
+ ## πŸ€– Concurrent Multi-Agent Coordination Protocol
22
+
23
+ When multiple agents run simultaneously across different IDE windows or chat sessions, each agent registers its active scope in `CURRENT.md`:
24
+
25
+ ```markdown
26
+ ## πŸ€– Active Concurrent Agent Workstreams
27
+ | Agent / Session ID | Status | Active Task | Target Scope / Files | Last Active |
28
+ | :--- | :--- | :--- | :--- | :--- |
29
+ | `Agent-Sol` | [IN-PROGRESS] | Next.js API Rate Limiter | `src/api/rate-limit.ts` | 2026-09-03T08:50:00.000Z |
30
+ | `Agent-Nexus` | [IN-PROGRESS] | SQLite WAL Hardening | `src/sqlite.ts` | 2026-09-03T08:51:00.000Z |
31
+ ```
32
+
33
+ ### Protocol Rules for Concurrent Agents:
34
+ 1. **Pre-flight Scope Audit**: Before editing files, inspect `## πŸ€– Active Concurrent Agent Workstreams`. If another agent is actively modifying your target files, coordinate or isolate your work to avoid overwriting changes.
35
+ 2. **Workstream Registration**: On starting a multi-turn task, register your agent name, task title, and target file scope.
36
+ 3. **Automatic Handoff Sync**: When updating session progress via `checkpointSession` or `updateSessionHandoff`, your workstream row is automatically updated with your latest checkpoint timestamp.
37
+ 4. **Task Completion**: Upon finishing the task, mark your workstream `COMPLETED`. Completed entries are automatically pruned after 48 hours.
9
38
 
10
39
  ---
11
40
 
@@ -24,39 +53,40 @@ Call `memory_current` or `memory_capture(type="constraint")`:
24
53
 
25
54
  This immediately updates `.memory/CURRENT.md` and dual-persists a constraint memory in SQLite.
26
55
 
27
- ### Step 2: Record Interruption-Proof Session Handoffs
28
- When completing a subtask, hitting context limits, or preparing for the next agent:
29
- Append a structured handoff block to `CURRENT.md`:
30
-
31
- ```markdown
32
- ## Active Handoff & Session Checkpoint
33
- - **Goal**: Migrate SQLite WAL connection pool to asynchronous microtask flushes.
34
- - **Completed**:
35
- - Implemented async query worker in `src/sqlite/worker.ts`.
36
- - Added unit test suite `test/sqlite_worker.test.ts`.
37
- - **In-Flight / Next Steps**:
38
- - Wire worker into `src/store.ts` save transaction.
39
- - Run full suite: `bun test`.
56
+ ### Step 2: Register & Checkpoint In-Flight Workstreams
57
+ When starting a task or checkpointing progress:
58
+ ```json
59
+ {
60
+ "action": "checkpoint",
61
+ "agent": "Sol",
62
+ "task": "Build OAuth2 Callback Handler",
63
+ "targetScope": "src/auth/*",
64
+ "progress": ["Added callback route", "Verified state nonce validation"]
65
+ }
40
66
  ```
41
67
 
42
- ### Step 3: Clear Resolved Invariants
68
+ ### Step 3: Clear Resolved Invariants & Prune Obsolete Rules
43
69
  When a temporary constraint or migration phase is complete, update `CURRENT.md` to prune obsolete rules so future context windows stay lightweight.
44
70
 
45
71
  ---
46
72
 
47
73
  ## πŸ›‘οΈ Invariant Rules for Agents
48
74
 
49
- - **High Locality**: `CURRENT.md` must contain only active, high-priority invariants and current handoffsβ€”not historical archives.
75
+ - **High Locality**: `CURRENT.md` must contain only active, high-priority invariants, concurrent workstreams, and current handoffsβ€”never historical terminal transcripts.
50
76
  - **Zero Hallucination**: Do not contradict constraints recorded in `CURRENT.md`.
77
+ - **Zero File Collisions**: Always consult the active workstreams table before modifying shared codebase modules.
51
78
 
52
79
  ---
53
80
 
54
81
  ## πŸ’» CLI Equivalents (Zero-MCP Fallback)
55
82
 
56
83
  ```bash
57
- # Read active working constraints
84
+ # Read active working constraints & concurrent workstreams
58
85
  memory current get
59
86
 
60
87
  # Append a new active constraint
61
88
  memory current set "- Hard constraint description" --project my-project
89
+
90
+ # Run storage optimization (prunes test noise, junk fragments & defragments SQLite)
91
+ memory optimize
62
92
  ```
package/README.md CHANGED
@@ -13,7 +13,7 @@
13
13
  ![AST Graph](https://img.shields.io/badge/AST-CodeGraph_%26_Graphify-orange?style=for-the-badge&logo=diagram-project&logoColor=white)
14
14
  ![Architecture](https://img.shields.io/badge/Storage-Zero--Daemon_%2F_Local--First-0D9488?style=for-the-badge)
15
15
 
16
- ![CI Tests](https://img.shields.io/badge/Tests-497%20Passed-brightgreen?style=for-the-badge&logo=checkmarx)
16
+ ![CI Tests](https://img.shields.io/badge/Tests-502%20Passed-brightgreen?style=for-the-badge&logo=checkmarx)
17
17
  ![Security](https://img.shields.io/badge/Security-Vibeguard_Zero--Leak-DC2626?style=for-the-badge&logo=shield)
18
18
  ![Agent Coverage](https://img.shields.io/badge/Agents-80+_Supported-4F46E5?style=for-the-badge&logo=openai)
19
19
  ![License](https://img.shields.io/badge/License-MIT-9333EA?style=for-the-badge)
@@ -24,60 +24,40 @@
24
24
 
25
25
  ---
26
26
 
27
- ## πŸš€ What's New in v2.2.0, v2.1.0 & v2.0.0 (Impact Analysis, PR Context, Reconciler & Telemetry)
28
-
29
- ### πŸ’₯ v2.2.0 Flagship Additions: Code Impact, PR Context & Cognitive Governance
30
- - **πŸ’₯ Unified Code & Memory Impact Analysis (`memory code-impact`)**:
31
- - Synthesizes AST code callers, affected test suites, linked memories, living ADRs, negative anti-patterns, and active constraints.
32
- - Computes a composite Risk Score (0–100) and Risk Level (`LOW`, `MEDIUM`, `HIGH`, `CRITICAL`) with pre-flight actionable recommendations before modifying code.
33
- - Available via CLI `memory code-impact <file> [--symbol <name>]` and MCP tool `muse_code_impact`.
34
- - **πŸ“‹ PR & Change Context Generator (`memory pr-context`)**:
35
- - Automatically analyzes git diff against base branch, linking touched code anchors, respected ADRs, active project constraints, and blast radius.
36
- - Generates rich GitHub-ready Markdown pull request descriptions with verification checklists and merge promotion proposals.
37
- - Available via CLI `memory pr-context [--base main] [--out <file>]` and MCP tool `muse_pr_context`.
38
- - **βš“ Interactive Code Anchor Reconciler (`memory reconcile`)**:
39
- - Audits code anchors across memories, pruning dead anchors, refreshing structural hashes for drifted code, and marking abandoned memories stale.
40
- - Supports `--dry-run`, `--prune`, `--mark-stale`, `--update-hashes`, and MCP tool `muse_reconcile_anchors`.
41
- - **⚑ Repeatable Speed, Quality & ROI Benchmark Suite (`memory benchmark`)**:
42
- - Measures microsecond in-process cache reads (P50 < 4Β΅s), SQLite FTS5 BM25 search, knapsack token packing, contradiction rates, and compression ratios in a clean ASCII scoreboard.
43
- - **🧠 Complete Agent Skills Roster for v2.0–v2.2**:
44
- - Added `.agents/skills/muse-health`, `muse-drift`, `muse-why`, `muse-sync`, and `muse-mesh`.
45
-
46
- ### 🌟 v2.1.0 Flagship Additions: Multi-Agent & Mesh Orchestration
47
- - **🀝 Cross-Agent Knowledge Sync & P2P Gossip Protocol (R14)**:
48
- - Cryptographically sealed, portable `SyncPacket` engine with whole-packet SHA-256 integrity verification and vector clock causal ordering.
49
- - Zero-daemon shared filesystem gossip pool (`.memory/sync_pool/`) allowing autonomous subagent teams (frontend, backend, test) to exchange insights asynchronously.
50
- - Ingestion deduplication, inline Vibeguard secret scrubbing, and semantic contradiction tagging with mutual `conflict_ids`.
51
- - CLI `memory sync` command suite & 4 MCP tools (`muse_sync_broadcast`, `muse_sync_ingest`, `muse_sync_status`, `muse_sync_pool`).
52
- - **🌐 Full Web Observability Studio (`memory studio`) (R15)**:
53
- - Embedded zero-dependency visual web dashboard (`memory studio` or `memory ui`) with interactive control plane.
54
- - Live 5-pillar health scorecard (A–F letter grade, PASS/WARN/FAIL gate status, and prioritized remediation checklist).
55
- - Interactive ADR registry and bidirectional documentation $\longleftrightarrow$ code drift inspector.
56
- - Historical "Why" reasoner query interface, recurring bug friction heatmap, and debt scanner.
57
- - Real-time P2P gossip mesh status and interactive broadcast/shared pool sync controls.
58
- - **πŸ•ΈοΈ Multi-Repo & Monorepo Cross-Project Mesh (R16)**:
59
- - Passive automatic monorepo discovery across `pnpm`, `npm`, `bun`, `lerna`, and multi-repo sibling directories.
60
- - Cross-project memory query resolver (`resolveMeshMemories`) with origin package provenance tags (`[mesh:@scope/package]`).
61
- - Shared invariant and working constraint propagation (`propagateConstraintToMesh`) broadcasting critical security rules across all packages.
62
- - Cross-package dependency contract and entrypoint export auditor (`auditMeshContracts`) validating cross-package imports and cross-repo code anchors.
63
- - CLI `memory mesh` suite & 4 MCP tools (`muse_mesh_status`, `muse_mesh_query`, `muse_mesh_audit`, `muse_mesh_link`).
64
-
65
- ### 🧠 v2.0.0 Major Cognitive Overhaul:
66
- - **πŸ₯ Unified 5-Pillar Project Health Gate (`memory health` / `muse_health`)**: Single-call architectural audit across Store Integrity, Code Anchors, Doc-Code Alignment, Negative Sentry, and Technical Debt.
67
- - **πŸ€” Autonomous Engineering Cognition & "Why" Reasoner (`muse_why`)**: Reconstructs historical code evolution through past bug workarounds, accepted trade-offs, and timeless rules before refactoring.
68
- - **πŸ›οΈ First-Class Architecture Decision Records (`memory adr` / `memory_adr_record`)**: Living, queryable ADR entities with options considered, consequences, native code anchors, and supersession lineage.
69
- - **πŸ”„ Bidirectional Documentation $\longleftrightarrow$ Code Drift Engine (`memory_drift_audit`)**: Continuously verifies alignment across 6 states (`DOCUMENTED`, `IMPLEMENTED`, `PARTIAL`, `CONFLICTING`, `STALE`, `MISSING`).
70
- - **🎯 Flagship Unified Context Orchestrator (`muse_context`)**: Single-call fused context injection with knapsack token budget packing.
71
- - **βš™οΈ Task-Focused MCP Profiles**: Dynamic role-based tool filtering (`core`, `coding`, `debugging`, `review`, `architecture`, `maintenance`).
72
- - **βš“ Native Structural Code Anchors (`src/anchors/`)**: Line-independent structural SHA-256 hashing insensitive to spacing/comments.
73
- - **πŸͺœ Scoped Promotion & Extended Archival Lifecycle (`src/promotion/`)**: 3-tier promotion ladder (`local` $\rightarrow$ `project` $\rightarrow$ `global`), 5Γ— repeated success policy, universal generalization, and `active` $\rightarrow$ `cold` $\rightarrow$ `dormant` $\rightarrow$ `archived` lifecycle with query rehydration.
74
- - **⚑ Hot Query Cache & SQLite WAL Optimization**: Microsecond memory lookups and high-throughput concurrent I/O.
27
+ ## πŸš€ What's New
28
+
29
+ ### v2.3.0
30
+ - **Autonomous Memory Optimizer (`memory optimize`)**: High-precision noise and junk pruning engine with zero-daemon auto-cadence (every 7 days or after 48h idle) and SQLite WAL defragmentation (`VACUUM;` + `PRAGMA optimize;`).
31
+ - **Dashboard "⚑ Optimize" Trigger**: Live visual optimization controls directly inside the Web Observability Studio (`memory ui` / `memory studio`) with real-time feedback on items pruned and bytes reclaimed.
32
+ - **Concurrent Multi-Agent Workstream Tracking**: Live coordination table in `CURRENT.md` enabling multiple agents across parallel chats to monitor active tasks and target scopes without collisions.
33
+ - **Clean Operational Guidelines**: Curated single-pane executive summary for humans and strict grounding/concurrency rules for AI agents.
34
+
35
+ ### v2.2.0
36
+ - **Unified Code & Memory Impact Analysis**: Pre-flight blast radius analysis evaluating AST callers, test suites, governing ADRs, negative warnings, and risk levels (`memory code-impact` / `muse_code_impact`).
37
+ - **PR & Change Context Generator**: Automatically turns git diffs into rich, memory-grounded GitHub PR descriptions linking touched anchors and active constraints (`memory pr-context` / `muse_pr_context`).
38
+ - **Interactive Code Anchor Reconciler**: Audits and repairs code anchors across memories, pruning dead references and updating structural hashes (`memory reconcile` / `muse_reconcile_anchors`).
39
+ - **Latency & Quality Telemetry Suite**: Benchmarks microsecond hot caches, FTS5 BM25 search, knapsack token packing, and ROI in a clean ASCII scoreboard (`memory benchmark`).
40
+ - **Expanded Agent Skills**: Shipped turnkey skills for `muse-health`, `muse-drift`, `muse-why`, `muse-sync`, and `muse-mesh`.
41
+
42
+ ### v2.1.0
43
+ - **Cross-Agent Knowledge Sync & P2P Gossip Protocol**: Sealed portable `SyncPacket` engine with SHA-256 integrity and zero-daemon shared filesystem gossip pool (`memory sync` / `muse_sync_*`).
44
+ - **Web Observability Studio**: Embedded visual dashboard (`memory studio` / `memory ui`) with interactive 5-pillar health, ADR registry, code drift inspector, and sync controls.
45
+ - **Monorepo & Multi-Repo Mesh**: Automatic workspace discovery (pnpm, npm, bun, lerna) with cross-project memory queries and shared constraint propagation (`memory mesh` / `muse_mesh_*`).
46
+
47
+ ### v2.0.0
48
+ - **5-Pillar Project Health Gate**: Architectural health gate evaluating store integrity, code anchors, doc-code alignment, negative sentry, and technical debt (`memory health` / `muse_health`).
49
+ - **Cognitive "Why" Reasoner**: Reconstructs historical code evolution, bug workarounds, and trade-offs before refactoring (`muse_why`).
50
+ - **Living Architecture Decision Records (ADRs)**: Queryable ADRs with options, consequences, native code anchors, and supersession lineage (`memory adr` / `memory_adr_record`).
51
+ - **Doc ⟷ Code Drift Engine**: Continuously audits documentation against AST code implementations across 6 drift states (`memory drift` / `memory_drift_audit`).
52
+ - **Unified Context Orchestrator & MCP Profiles**: Single-call fused context injection with knapsack token packing (`muse_context`) and task-specific tool profiles.
53
+ - **Native Structural Code Anchors**: Line-independent structural SHA-256 hashing for files, symbols, and routes.
54
+ - **Scoped Promotion & Archival Lifecycle**: 3-tier promotion ladder (`local` β†’ `project` β†’ `global`) and cold/dormant/archived storage tiers.
75
55
 
76
56
  ---
77
57
 
78
58
  ## πŸ“‘ Table of Contents
79
59
 
80
- - [πŸš€ What's New in v2.1.0 & v2.0.0](#-whats-new-in-v210--v200-autonomous-cognitive-engine-p2p-sync--monorepo-mesh)
60
+ - [πŸš€ What's New](#-whats-new)
81
61
  - [πŸ’‘ What is Muse Memory? (TL;DR)](#-what-is-muse-memory-tldr)
82
62
  - [✨ Key Feature Highlights](#-key-feature-highlights)
83
63
  - [⚑ Quick Start & Installation](#-quick-start--installation)