musememory 2.2.1 → 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.2.1`
4
- > **Status**: Production Release (Hardened v2.2 with Linus-Style Code Review Bug Fixes)
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
 
@@ -39,6 +39,8 @@
39
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
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
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.
42
44
 
43
45
  ---
44
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)
@@ -26,6 +26,12 @@
26
26
 
27
27
  ## 🚀 What's New
28
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
+
29
35
  ### v2.2.0
30
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`).
31
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`).