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
59 changes: 59 additions & 0 deletions .docs/handover-2026-04-03.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
# Handover -- 2026-04-03

## Session Summary

This session focused on getting **PR #754** (`feat: KG-boosted file search with ExternalScorer trait`) through CI and merged.

### Tasks Completed

1. **Fixed fff-search dependency** -- replaced local filesystem path with git dependency pointing to `AlexMikhalev/fff.nvim` fork branch `feat/external-scorer`
2. **Created ExternalScorer trait** in the fork at `/tmp/fff-nvim-fork/crates/fff-core/src/external_scorer.rs`, pushed to `AlexMikhalev/fff.nvim` branch `feat/external-scorer`
3. **Fixed u64 ID type migration** -- PR code used `String` IDs but main had refactored to `u64` (commit `9c8dd28f`). Updated `kg_scorer.rs`, `kg_scoring.rs` benchmark, `test_find_files.rs`, `watcher.rs`
4. **Fixed pre-existing llm_router test failures** -- tests had `llm_enabled: false` but expected `Some` from `build_llm_from_role`
5. **Fixed clippy warnings** -- `unnecessary_sort_by`, `len_zero`
6. **Added zlob feature flag** -- created `zlob` feature in `terraphim_file_search` and `terraphim_mcp_server` Cargo.toml that forwards to `fff-search/zlob`
7. **Updated CI workflow** -- added `--features zlob` to clippy, check, and test commands in `.github/workflows/ci-pr.yml`
8. **Upgraded Zig on bigbox** -- from 0.9.1 to 0.15.2 (required by zlob 1.3.0) at `/usr/local/bin/zig` symlinked to `/usr/local/zig-x86_64-linux-0.15.2/zig`
9. **Merged PR #754** and created **release v1.17.0**

### Current State

- **Branch**: `main` at `28017c38` (merge commit for PR #754)
- **Tag**: `v1.17.0` pushed to both GitHub and Gitea
- **GitHub release**: https://github.com/terraphim/terraphim-ai/releases/tag/v1.17.0
- **All CI checks green**: format, clippy, compilation, tests, WASM, security audit

### Uncommitted Work

- **`crates/terraphim_multi_agent/`** -- 4 files modified (Cargo.toml, lib.rs, pool.rs, registry.rs). These are unrelated to this session's work.
- **Stash `stash@{0}`** -- WIP from `feat/fff-kg-boosted-file-search` branch containing `test(config): add hash performance benchmarks for ahash validation`. May be worth reviewing.

### Infrastructure Changes

- **Zig 0.15.2** installed on bigbox at `/usr/local/zig-x86_64-linux-0.15.2/zig` (symlinked from `/usr/local/bin/zig`). Old versions remain:
- `/usr/local/zig-linux-x86_64-0.9.1/` (original)
- `/usr/local/zig-linux-x86_64-0.13.0/` (intermediate attempt)
- These can be cleaned up with `sudo rm -rf /usr/local/zig-linux-x86_64-0.{9.1,13.0}/`

### Key Files Modified in PR #754

| File | Change |
|------|--------|
| `crates/terraphim_file_search/` | New crate: KgPathScorer, KgWatcher, benchmarks |
| `crates/terraphim_mcp_server/src/lib.rs` | Added find_files/grep_files MCP tools |
| `crates/terraphim_mcp_server/tests/test_find_files.rs` | New integration tests |
| `crates/terraphim_mcp_server/Cargo.toml` | Added fff-search git dep + zlob feature |
| `crates/terraphim_file_search/Cargo.toml` | New, git dep on AlexMikhalev/fff.nvim fork |
| `.github/workflows/ci-pr.yml` | Added `--features zlob` to cargo commands |
| `crates/terraphim_service/src/llm.rs` | Fixed pre-existing llm_router test failures |

### External Dependencies

- **`AlexMikhalev/fff.nvim`** fork, branch `feat/external-scorer` -- contains the `ExternalScorer` trait needed by `terraphim_file_search`. If the upstream `dmtrKovalenko/fff.nvim` adds this trait, the fork dependency can be replaced.

### Known Issues / Follow-ups

- The `terraphim_multi_agent` uncommitted changes should be reviewed and either committed or discarded
- Old stashes (14 total) could be cleaned up
- Old Zig installations on bigbox can be removed
- The fff.nvim fork dependency is pinned to a branch -- consider tagging a release on the fork for stability
1 change: 1 addition & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion crates/terraphim_multi_agent/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
name = "terraphim_multi_agent"
version = "1.0.0"
edition = "2021"
description = "Multi-agent system for Terraphim built on roles with Rig framework integration"
description = "Multi-agent system for Terraphim built on roles with rust-genai integration"
license = "MIT"

[features]
Expand Down Expand Up @@ -44,6 +44,7 @@ terraphim_automata = { path = "../terraphim_automata" }
terraphim_persistence = { path = "../terraphim_persistence" }
terraphim_agent_evolution = { path = "../terraphim_agent_evolution" }
terraphim_service = { path = "../terraphim_service" }
terraphim_agent_registry = { path = "../terraphim_agent_registry" }

# Firecracker VM dependencies (optional, feature-gated)
# Note: fcctl-repl has its own workspace dependencies that may conflict
Expand Down
47 changes: 8 additions & 39 deletions crates/terraphim_multi_agent/benches/agent_operations.rs
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
use criterion::{criterion_group, criterion_main, BenchmarkId, Criterion};
use std::hint::black_box;
use std::sync::Arc;
use tokio::runtime::Runtime;

use terraphim_multi_agent::{
test_utils::create_test_agent_simple, AgentRegistry, CommandInput, CommandType,
};
use terraphim_multi_agent::{test_utils::create_test_agent_simple, CommandInput, CommandType};

/// Benchmark agent creation time
fn bench_agent_creation(c: &mut Criterion) {
Expand Down Expand Up @@ -77,40 +74,12 @@ fn bench_command_processing(c: &mut Criterion) {
}
}

/// Benchmark agent registry operations
fn bench_registry_operations(c: &mut Criterion) {
let rt = Runtime::new().unwrap();

c.bench_function("registry_register_agent", |b| {
b.iter(|| {
rt.block_on(async {
let registry = AgentRegistry::new();
let agent = create_test_agent_simple().await.unwrap();
agent.initialize().await.unwrap();

let result = registry.register_agent(Arc::new(agent)).await;
black_box(result)
})
})
});

c.bench_function("registry_find_by_capability", |b| {
b.iter(|| {
rt.block_on(async {
let registry = AgentRegistry::new();

// Pre-populate with test agents
for _i in 0..10 {
let agent = create_test_agent_simple().await.unwrap();
agent.initialize().await.unwrap();
registry.register_agent(Arc::new(agent)).await.unwrap();
}

let result = registry.find_agents_by_capability("test_capability").await;
black_box(result)
})
})
});
/// Benchmark agent registry operations (DISABLED during migration)
#[allow(dead_code)]
fn _bench_registry_operations(_c: &mut Criterion) {
// TODO: Migrate to KnowledgeGraphAgentRegistry
// This benchmark is temporarily disabled during the registry migration.
// Re-enable after implementing KnowledgeGraphAgentRegistry benchmarks.
}

/// Benchmark memory operations
Expand Down Expand Up @@ -378,7 +347,7 @@ criterion_group!(
bench_agent_creation,
bench_agent_initialization,
bench_command_processing,
bench_registry_operations,
// bench_registry_operations, // TODO: Re-enable after KG registry migration
bench_memory_operations,
bench_batch_operations,
bench_concurrent_operations,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ use std::collections::HashMap;
use std::sync::Arc;
use terraphim_config::Role;
use terraphim_multi_agent::{
AgentRegistry, CommandInput, CommandType, MultiAgentError, MultiAgentResult, TerraphimAgent,
CommandInput, CommandType, MultiAgentError, MultiAgentResult, TerraphimAgent,
};
use terraphim_persistence::DeviceStorage;
use terraphim_types::RelevanceFunction;
Expand Down Expand Up @@ -393,15 +393,16 @@ async fn demonstrate_orchestrator_workers() -> MultiAgentResult<()> {
];

let mut workers = HashMap::new();
let registry = AgentRegistry::new();
// TODO: Migrate to KnowledgeGraphAgentRegistry
// Registry temporarily disabled during migration

for (worker_name, worker_description, _worker_capability) in &worker_roles {
let worker_role = create_worker_role(worker_name, worker_description);
let worker_agent = TerraphimAgent::new(worker_role, persistence.clone(), None).await?;
worker_agent.initialize().await?;

let worker_arc = Arc::new(worker_agent);
registry.register_agent(worker_arc.clone()).await?;
// registry.register_agent(worker_arc.clone()).await?; // TODO: Re-enable with KG registry
workers.insert(worker_name.to_string(), worker_arc);
}

Expand Down
Loading
Loading