Skip to content
Merged
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
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 12 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,10 @@ Remember important facts:

```bash
# Via MCP server
remember("We use JWT for auth because of scalability requirements")
remember({
topic: "auth-strategy",
content: "We use JWT for auth because of scalability requirements"
})
```

## MCP Tools
Expand All @@ -175,8 +178,7 @@ Get detailed explanation of a symbol:

```typescript
explain_code({
symbol: "UserService",
context_lines: 20
symbol: "UserService"
})
```

Expand All @@ -187,7 +189,7 @@ Find why a decision was made:
```typescript
trace_decision({
topic: "why microservices",
max_results: 5
time_range: "90d"
})
```

Expand All @@ -197,8 +199,8 @@ Find related code and dependencies:

```typescript
find_related({
symbol: "AuthController",
relationship_type: "both" // "depends_on" | "depended_by" | "both"
file: "src/auth/controller.ts",
direction: "both" // "dependencies" | "dependents" | "both"
})
```

Expand All @@ -208,8 +210,9 @@ Store persistent knowledge:

```typescript
remember({
key: "auth-strategy",
value: "We use JWT for stateless auth across microservices"
topic: "auth-strategy",
content: "We use JWT for stateless auth across microservices",
Comment thread
mstuart marked this conversation as resolved.
tags: ["architecture", "security"]
})
```

Expand All @@ -229,7 +232,7 @@ Retrieve learned patterns:

```typescript
get_session_patterns({
pattern_type: "architecture", // or "errors", "refactoring", "testing"
pattern_type: "testing", // "naming" | "error" | "testing" | "organization" | "import" | "config"
min_confidence: 0.7
})
```
Expand Down
21 changes: 12 additions & 9 deletions npm/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,10 @@ Remember important facts:

```bash
# Via MCP server
remember("We use JWT for auth because of scalability requirements")
remember({
topic: "auth-strategy",
content: "We use JWT for auth because of scalability requirements"
})
```

## MCP Tools
Expand All @@ -165,8 +168,7 @@ Get detailed explanation of a symbol:

```typescript
explain_code({
symbol: "UserService",
context_lines: 20
symbol: "UserService"
})
```

Expand All @@ -177,7 +179,7 @@ Find why a decision was made:
```typescript
trace_decision({
topic: "why microservices",
max_results: 5
time_range: "90d"
})
```

Expand All @@ -187,8 +189,8 @@ Find related code and dependencies:

```typescript
find_related({
symbol: "AuthController",
relationship_type: "both" // "depends_on" | "depended_by" | "both"
file: "src/auth/controller.ts",
direction: "both" // "dependencies" | "dependents" | "both"
})
```

Expand All @@ -198,8 +200,9 @@ Store persistent knowledge:

```typescript
remember({
key: "auth-strategy",
value: "We use JWT for stateless auth across microservices"
topic: "auth-strategy",
content: "We use JWT for stateless auth across microservices",
tags: ["architecture", "security"]
})
```

Expand All @@ -219,7 +222,7 @@ Retrieve learned patterns:

```typescript
get_session_patterns({
pattern_type: "architecture", // or "errors", "refactoring", "testing"
pattern_type: "testing", // "naming" | "error" | "testing" | "organization" | "import" | "config"
min_confidence: 0.7
})
```
Expand Down
9 changes: 8 additions & 1 deletion src/git/history.rs
Original file line number Diff line number Diff line change
Expand Up @@ -339,6 +339,9 @@ impl GitHistory {
continue;
};
for file in &commit.files_changed {
if seen.len() >= limit {
break;
}
seen.entry(file.clone()).or_insert(commit.timestamp);
}
if seen.len() >= limit {
Expand Down Expand Up @@ -495,10 +498,14 @@ mod tests {
}

let git = GitHistory::open(&path).unwrap();
assert_eq!(git.walk_commits(100).unwrap().len(), 8);
let files = git.recent_files(2).unwrap();

assert_eq!(files.len(), 2);
assert!(files.iter().any(|(file, _)| file == "lib.rs"));
assert!(
files.iter().any(|(file, _)| file == "lib.rs"),
"recent files: {files:?}"
);
}

#[test]
Expand Down
Loading