Skip to content

Commit 4b5f845

Browse files
AlexMikhalevTerraphim CI
andauthored
feat: consolidate agent registry and remove deprecated code (#755)
* fix: update tests and examples to work without deprecated registry - Fix AgentStatus imports in tests (use agent::AgentStatus) - Comment out registry usage in tests and examples - Update imports for CommandInput and CommandType - Add TODO comments for KG registry migration * fix(clippy): remove unused imports in benchmarks and tests - Remove unused Arc import from agent_operations.rs - Remove unused TerraphimAgent import from simple_agent_test.rs - Note: test_end_to_end_offline_workflow failure is pre-existing and unrelated to this PR --------- Co-authored-by: Terraphim CI <alex@terraphim.ai>
1 parent 28017c3 commit 4b5f845

14 files changed

Lines changed: 193 additions & 364 deletions

File tree

.docs/handover-2026-04-03.md

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
# Handover -- 2026-04-03
2+
3+
## Session Summary
4+
5+
This session focused on getting **PR #754** (`feat: KG-boosted file search with ExternalScorer trait`) through CI and merged.
6+
7+
### Tasks Completed
8+
9+
1. **Fixed fff-search dependency** -- replaced local filesystem path with git dependency pointing to `AlexMikhalev/fff.nvim` fork branch `feat/external-scorer`
10+
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`
11+
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`
12+
4. **Fixed pre-existing llm_router test failures** -- tests had `llm_enabled: false` but expected `Some` from `build_llm_from_role`
13+
5. **Fixed clippy warnings** -- `unnecessary_sort_by`, `len_zero`
14+
6. **Added zlob feature flag** -- created `zlob` feature in `terraphim_file_search` and `terraphim_mcp_server` Cargo.toml that forwards to `fff-search/zlob`
15+
7. **Updated CI workflow** -- added `--features zlob` to clippy, check, and test commands in `.github/workflows/ci-pr.yml`
16+
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`
17+
9. **Merged PR #754** and created **release v1.17.0**
18+
19+
### Current State
20+
21+
- **Branch**: `main` at `28017c38` (merge commit for PR #754)
22+
- **Tag**: `v1.17.0` pushed to both GitHub and Gitea
23+
- **GitHub release**: https://github.com/terraphim/terraphim-ai/releases/tag/v1.17.0
24+
- **All CI checks green**: format, clippy, compilation, tests, WASM, security audit
25+
26+
### Uncommitted Work
27+
28+
- **`crates/terraphim_multi_agent/`** -- 4 files modified (Cargo.toml, lib.rs, pool.rs, registry.rs). These are unrelated to this session's work.
29+
- **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.
30+
31+
### Infrastructure Changes
32+
33+
- **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:
34+
- `/usr/local/zig-linux-x86_64-0.9.1/` (original)
35+
- `/usr/local/zig-linux-x86_64-0.13.0/` (intermediate attempt)
36+
- These can be cleaned up with `sudo rm -rf /usr/local/zig-linux-x86_64-0.{9.1,13.0}/`
37+
38+
### Key Files Modified in PR #754
39+
40+
| File | Change |
41+
|------|--------|
42+
| `crates/terraphim_file_search/` | New crate: KgPathScorer, KgWatcher, benchmarks |
43+
| `crates/terraphim_mcp_server/src/lib.rs` | Added find_files/grep_files MCP tools |
44+
| `crates/terraphim_mcp_server/tests/test_find_files.rs` | New integration tests |
45+
| `crates/terraphim_mcp_server/Cargo.toml` | Added fff-search git dep + zlob feature |
46+
| `crates/terraphim_file_search/Cargo.toml` | New, git dep on AlexMikhalev/fff.nvim fork |
47+
| `.github/workflows/ci-pr.yml` | Added `--features zlob` to cargo commands |
48+
| `crates/terraphim_service/src/llm.rs` | Fixed pre-existing llm_router test failures |
49+
50+
### External Dependencies
51+
52+
- **`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.
53+
54+
### Known Issues / Follow-ups
55+
56+
- The `terraphim_multi_agent` uncommitted changes should be reviewed and either committed or discarded
57+
- Old stashes (14 total) could be cleaned up
58+
- Old Zig installations on bigbox can be removed
59+
- The fff.nvim fork dependency is pinned to a branch -- consider tagging a release on the fork for stability

Cargo.lock

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

crates/terraphim_multi_agent/Cargo.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
name = "terraphim_multi_agent"
33
version = "1.0.0"
44
edition = "2021"
5-
description = "Multi-agent system for Terraphim built on roles with Rig framework integration"
5+
description = "Multi-agent system for Terraphim built on roles with rust-genai integration"
66
license = "MIT"
77

88
[features]
@@ -44,6 +44,7 @@ terraphim_automata = { path = "../terraphim_automata" }
4444
terraphim_persistence = { path = "../terraphim_persistence" }
4545
terraphim_agent_evolution = { path = "../terraphim_agent_evolution" }
4646
terraphim_service = { path = "../terraphim_service" }
47+
terraphim_agent_registry = { path = "../terraphim_agent_registry" }
4748

4849
# Firecracker VM dependencies (optional, feature-gated)
4950
# Note: fcctl-repl has its own workspace dependencies that may conflict

crates/terraphim_multi_agent/benches/agent_operations.rs

Lines changed: 8 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,8 @@
11
use criterion::{criterion_group, criterion_main, BenchmarkId, Criterion};
22
use std::hint::black_box;
3-
use std::sync::Arc;
43
use tokio::runtime::Runtime;
54

6-
use terraphim_multi_agent::{
7-
test_utils::create_test_agent_simple, AgentRegistry, CommandInput, CommandType,
8-
};
5+
use terraphim_multi_agent::{test_utils::create_test_agent_simple, CommandInput, CommandType};
96

107
/// Benchmark agent creation time
118
fn bench_agent_creation(c: &mut Criterion) {
@@ -77,40 +74,12 @@ fn bench_command_processing(c: &mut Criterion) {
7774
}
7875
}
7976

80-
/// Benchmark agent registry operations
81-
fn bench_registry_operations(c: &mut Criterion) {
82-
let rt = Runtime::new().unwrap();
83-
84-
c.bench_function("registry_register_agent", |b| {
85-
b.iter(|| {
86-
rt.block_on(async {
87-
let registry = AgentRegistry::new();
88-
let agent = create_test_agent_simple().await.unwrap();
89-
agent.initialize().await.unwrap();
90-
91-
let result = registry.register_agent(Arc::new(agent)).await;
92-
black_box(result)
93-
})
94-
})
95-
});
96-
97-
c.bench_function("registry_find_by_capability", |b| {
98-
b.iter(|| {
99-
rt.block_on(async {
100-
let registry = AgentRegistry::new();
101-
102-
// Pre-populate with test agents
103-
for _i in 0..10 {
104-
let agent = create_test_agent_simple().await.unwrap();
105-
agent.initialize().await.unwrap();
106-
registry.register_agent(Arc::new(agent)).await.unwrap();
107-
}
108-
109-
let result = registry.find_agents_by_capability("test_capability").await;
110-
black_box(result)
111-
})
112-
})
113-
});
77+
/// Benchmark agent registry operations (DISABLED during migration)
78+
#[allow(dead_code)]
79+
fn _bench_registry_operations(_c: &mut Criterion) {
80+
// TODO: Migrate to KnowledgeGraphAgentRegistry
81+
// This benchmark is temporarily disabled during the registry migration.
82+
// Re-enable after implementing KnowledgeGraphAgentRegistry benchmarks.
11483
}
11584

11685
/// Benchmark memory operations
@@ -378,7 +347,7 @@ criterion_group!(
378347
bench_agent_creation,
379348
bench_agent_initialization,
380349
bench_command_processing,
381-
bench_registry_operations,
350+
// bench_registry_operations, // TODO: Re-enable after KG registry migration
382351
bench_memory_operations,
383352
bench_batch_operations,
384353
bench_concurrent_operations,

crates/terraphim_multi_agent/examples/agent_workflow_patterns.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ use std::collections::HashMap;
1616
use std::sync::Arc;
1717
use terraphim_config::Role;
1818
use terraphim_multi_agent::{
19-
AgentRegistry, CommandInput, CommandType, MultiAgentError, MultiAgentResult, TerraphimAgent,
19+
CommandInput, CommandType, MultiAgentError, MultiAgentResult, TerraphimAgent,
2020
};
2121
use terraphim_persistence::DeviceStorage;
2222
use terraphim_types::RelevanceFunction;
@@ -393,15 +393,16 @@ async fn demonstrate_orchestrator_workers() -> MultiAgentResult<()> {
393393
];
394394

395395
let mut workers = HashMap::new();
396-
let registry = AgentRegistry::new();
396+
// TODO: Migrate to KnowledgeGraphAgentRegistry
397+
// Registry temporarily disabled during migration
397398

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

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

0 commit comments

Comments
 (0)