Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
The diff you're trying to view is too large. We only load the first 3000 changed files.
Binary file added .DS_Store
Binary file not shown.
Binary file added .github/.DS_Store
Binary file not shown.
45 changes: 25 additions & 20 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -1,33 +1,38 @@
---
name: Bug Report
about: Report a bug in m1nd
title: "[bug] "
labels: bug
assignees: ''
---

## Description
<!-- What happened? -->
**Describe the bug**

## Steps to Reproduce
1.
2.
3.
A clear and concise description of what the bug is.

## Expected Behavior
<!-- What should have happened? -->
**To Reproduce**

## Environment
- OS:
- Rust version:
- m1nd version:
- MCP client: <!-- Claude Code, OpenCode, etc. -->
Steps to reproduce the behavior:
1. Run `m1nd.ingest path=...`
2. Call `m1nd.activate query=...`
3. Observe error

## Graph Size
- Nodes:
- Edges:
**Expected behavior**

A clear description of what you expected to happen.

**Actual behavior**

What actually happened, including any error messages or unexpected output.

**Environment**

- OS: (e.g., macOS 14.2, Ubuntu 22.04)
- Rust version: (output of `rustc --version`)
- m1nd version: (output of `./m1nd-mcp --version` or git commit SHA)
- MCP client: (e.g., Claude Code, Cursor, Windsurf)
- Codebase size: (approximate nodes/edges from ingest output)

**Logs / output**

## Logs
<!-- Paste relevant stderr output -->
```
Paste relevant output here
```
24 changes: 13 additions & 11 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -1,19 +1,21 @@
---
name: Feature Request
about: Suggest a new tool or capability
title: "[feature] "
about: Suggest a new feature or tool
labels: enhancement
assignees: ''
---

## Problem
<!-- What problem does this solve? -->
**Is your feature request related to a problem?**

## Proposed Solution
<!-- How should it work? -->
A clear description of the problem. E.g., "When I call `activate()` on large monorepos, I can't distinguish results by semantic meaning vs. keyword proximity..."

## Use Case
<!-- Concrete example of when you'd use this -->
**Describe the solution**

## Alternatives Considered
<!-- Other approaches you thought about -->
What you'd like to happen. Be specific — which crate would this live in? What would the MCP tool signature look like?

**Alternatives considered**

Describe any workarounds or alternative solutions you've considered.

**Additional context**

Any other context, benchmarks, or references that would help implement this feature.
159 changes: 159 additions & 0 deletions .github/PLANNED_ISSUES.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,159 @@
# Planned Issues — m1nd

Issues staged for filing on GitHub. These represent the v0.3.0 and v0.4.0 roadmap.

---

## 1. feat: Embedding-based semantic similarity (fastembed)

**Label**: enhancement, v0.3.0

Replace keyword matching in `activate`/`seek` with vector embeddings for true semantic search.
`fastembed` 5.12.1 is verified on crates.io and supports ONNX inference locally with no API calls.
Currently deferred from v0.2.0 due to ONNX build complexity on cross-compiled targets.

The semantic dimension in the 4D activation score currently uses trigram TF-IDF. This works for
identifier overlap but fails on "find code that *means* authentication but never uses the word."
Embedding-based similarity would close this gap while preserving zero-API-call semantics.

---

## 2. feat: ast-grep pattern integration for scan tool

**Label**: enhancement, v0.3.0

`ast-grep-core` 0.41.1 is available on crates.io and provides structural pattern matching via YAML
rule files. The current `scan` tool in `m1nd-mcp` uses heuristic regex patterns against node
identifiers, which produces false positives on minified code and misses structural patterns.

Integrating `ast-grep-core` would allow rules like "find all functions that call X without
checking the return value" — structural queries the regex approach cannot express.

---

## 3. feat: Desktop tray application

**Label**: enhancement, v0.4.0

A system tray app (Tauri or similar) that shows:
- Graph health (node/edge counts, last ingest time)
- Active agents + lock holders (from `lock.*` tools)
- Quick-fire common queries without opening a terminal
- Plasticity drift indicator (when the graph has diverged from disk state)

Useful for teams where multiple agents share the same m1nd instance. The tray app would connect
to the existing JSON-RPC stdio server via a local socket bridge.

---

## 4. perf: flow_simulate optimization for dense graphs

**Label**: performance

BFS particle propagation in `flow_simulate` (used internally by `activate` for the causal
dimension) can be slow on graphs with >50K edges. In the current implementation, each particle
is tracked individually through the BFS queue, leading to O(particles × edges) work.

Observed: on a 50K-edge test graph, `activate` latency jumps from ~31ms to ~340ms when
`infection_rate` is set above 0.4. The epidemic model saturates too quickly on dense subgraphs
even at default settings (see related bug #9).

Candidates: parallel particle simulation via Rayon, bitset-based batch propagation similar to
the `RemovalMask` approach used in counterfactuals.

---

## 5. docs: Add video tutorial for first-time setup

**Label**: documentation

The README has solid text instructions and the wiki has detailed tool reference, but a video
walkthrough would lower the friction for first-time users who want to see ingest → activate →
learn in a real codebase before committing to building from source.

Suggested content:
1. Clone + `cargo build --release` (real terminal, real timing)
2. Add to Claude Code config
3. First `ingest` call — show what the output means
4. `activate` → `why` → `missing` sequence
5. `learn` feedback — explain Hebbian plasticity visually

---

## 6. feat: WebSocket transport for real-time graph updates

**Label**: enhancement

Currently the `m1nd-mcp` server is JSON-RPC over stdio only. A WebSocket transport would enable:
- Bidirectional communication for a future GUI (m1nd-ui)
- Real-time push of plasticity weight changes as agents learn
- Browser-based graph visualization without a Tauri wrapper

The stdio transport would remain the primary MCP path; WebSocket would be additive for
GUI/dashboard use cases.

---

## 7. test: Increase test coverage for perspective navigation

**Label**: testing

`perspective.suggest` and `perspective.affinity` have minimal test coverage in the current
test suite. `test_perspective_usecases.py` covers the happy path for `start`/`follow`/`back`
but misses:
- `suggest` with no open perspective session (should return graceful error)
- `affinity` on disconnected graph components
- `branch` + `compare` round-trip with conflicting node weights
- Concurrent perspective sessions from two agents on the same graph

These cases have produced silent wrong results in past manual testing.

---

## 8. feat: Git blame integration for temporal dimension

**Label**: enhancement

The temporal dimension currently uses co-change frequency and Hebbian feedback to weight recency.
Git blame data would add actual authorship timestamps per line, allowing the temporal score to
reflect real modification recency rather than just session-level feedback.

Implementation path: `m1nd-ingest` already runs `git log --follow` for co-change history.
Extending it to run `git blame --porcelain` per file and map blame timestamps to node weights
would give the temporal dimension a ground-truth signal independent of agent feedback.

---

## 9. bug: epidemic model saturates too quickly on dense subgraphs

**Label**: bug

The BFS epidemic model used in `activate`'s causal dimension can reach 97% infection coverage
in 3 iterations on dense subgraphs, even with `infection_rate=0.1` (the default).

Steps to reproduce:
1. Ingest a codebase with a highly-connected hub module (e.g., a shared `utils.py` with 200+
import edges)
2. Call `activate(query="utils", agent_id=...)` with default parameters
3. Observe: causal scores are uniformly high across nearly all nodes — signal saturates

The v0.2.0 release partially mitigated this with early-stopping when coverage exceeds 80%, but
edge cases remain when the hub is the query target itself (self-loop in the epidemic start node).

Expected: causal scores should discriminate. Actual: they flatten to ~0.95 across the graph.

---

## 10. feat: Export graph to Neo4j/Cypher format

**Label**: enhancement

Currently `m1nd` supports Mermaid export (used for the architecture diagram in README). Adding
Cypher export for Neo4j would let teams:
- Visualize the full graph in Neo4j Browser or Bloom
- Run Cypher queries alongside m1nd's activation queries
- Integrate with existing graph databases in data engineering stacks

The export would serialize the CSR graph to `.cypher` CREATE statements. Node properties would
include the four dimension base scores; relationship properties would include the current
plasticity weight.
18 changes: 7 additions & 11 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -1,22 +1,18 @@
## What

<!-- One sentence: what does this PR do? -->
Brief description of the change.

## Why

<!-- Motivation or issue link -->

## How

<!-- Key changes, design decisions -->
Motivation and context.

## Testing

- [ ] `cargo test` passes
- [ ] `cargo clippy` clean
- [ ] `cargo fmt` applied
- [ ] Tested with MCP client (tool name: ___)
- [ ] `cargo test --workspace` passes
- [ ] `cargo clippy --workspace` clean
- [ ] Documentation updated if needed
- [ ] New tools registered in `server.rs` dispatch

## Breaking Changes

<!-- None / describe -->
List any breaking changes to MCP tool signatures, or write "None".
3 changes: 2 additions & 1 deletion .github/wiki/Home.md
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ Antibody system (bug immune memory), Epidemic engine (SIR propagation prediction
| [Superpowers Extended](API-Reference#superpowers-extended-9-tools) | antibody_scan, antibody_list, antibody_create, flow_simulate, epidemic, tremor, trust, layers, layer_inspect | 9 |
| [Surgical](API-Reference#surgical-4-tools) | surgical_context, apply, surgical_context_v2, apply_batch | 4 |
| [v0.4.0 — Search & Efficiency](API-Reference#v040-search--efficiency-5-tools) | search, help, panoramic, savings, report | 5 |
| [v0.5.0 — Verified Writes & File Tools](API-Reference#v050-verified-writes--file-tools) | apply_batch verify, view, glob | 3 |

---

Expand Down Expand Up @@ -160,7 +161,7 @@ Claude Code · Cursor · Windsurf · GitHub Copilot · Zed · Cline · Roo Code

## On crates.io

m1nd v0.4.0 is published on [crates.io](https://crates.io/crates/m1nd-core). Add as a library dependency or build the binary from source — both paths are fully supported.
m1nd v0.5.0 is published on [crates.io](https://crates.io/crates/m1nd-core). Add as a library dependency or build the binary from source — both paths are fully supported.

---

Expand Down
12 changes: 12 additions & 0 deletions .github/wiki/Roadmap.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,18 @@ The 5-layer verification pipeline runs automatically on every `apply` call:

---

## Shipped — v0.5.0

**Added in v0.5 — Verified writes, file tools, enhanced search (DONE):**
- `apply_batch` **5-layer post-write verification** (`verify=true`) — trivial-return detection, compilation check, structural diff, semantic coherence, and regression guard
- `m1nd.view` — lightweight file reader with auto-ingest. Zero-token alternative to Read for graph-tracked files
- `m1nd.glob` — file pattern matching with auto-ingest. Graph-aware alternative to Glob
- `m1nd.search` **enhanced** — invert matching, count mode, multiline, auto-ingest on miss, glob filtering

**Total in v0.5: 63 MCP tools**

---

## Shipped — v0.4.0

**Added in v0.4 — Search, efficiency, and panoramic analysis (DONE):**
Expand Down
28 changes: 21 additions & 7 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
name: CI

on:
push:
branches: [main, master]
Expand All @@ -7,17 +8,29 @@ on:

env:
CARGO_TERM_COLOR: always
RUSTFLAGS: -Dwarnings

jobs:
test:
name: Test
check:
name: Check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
- run: cargo test --all
- run: cargo check --workspace

test:
name: Test (${{ matrix.os }})
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest]
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
- run: cargo test --workspace

clippy:
name: Clippy
Expand All @@ -28,7 +41,7 @@ jobs:
with:
components: clippy
- uses: Swatinem/rust-cache@v2
- run: cargo clippy --all -- -D warnings
- run: cargo clippy --workspace -- -D warnings

fmt:
name: Format
Expand All @@ -38,16 +51,17 @@ jobs:
- uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt
- run: cargo fmt --all -- --check
- run: cargo fmt --check

build:
name: Build (${{ matrix.os }})
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest]
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
- run: cargo build --release
- run: cargo build --release --workspace
Loading
Loading