terraphim / terraphim/terraphim-ai

[Architecture][P2] Phase 2: Decompose terraphim_service by capability

Open
#524 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

architecture enhancement
Dominant language
Rust
Stars
62
Forks
5
Avg merge
2h 27m
Merged PRs (30d)
1

Description

Parent: https://github.com/terraphim/terraphim-ai/issues/520
Related plan: docs/architecture-improvement-plan.md

Goal

Decompose terraphim_service into capability-focused modules with stable trait boundaries so logic is reusable and easier to test.

Deliverables

  • Capability modules for:
    • search service
    • KG/thesaurus service
    • document service
    • LLM/chat service
  • Stable crate facade with explicit interfaces and reduced monolithic lib.rs

Tasks

  • Split branching workflows into strategy objects or focused modules
  • Introduce typed service interfaces for integration and adapter reuse
  • Keep external API compatibility while refactoring internals
  • Add isolated tests per capability module

Acceptance Criteria

  • crates/terraphim_service/src/lib.rs is primarily a facade/wiring layer
  • Each service capability has isolated tests and explicit dependency boundaries
  • Existing public consumers compile with no behavioral regression

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Read docs/architecture-improvement-plan.md and inspect crates/terraphim_service/src/lib.rs to map the existing workflows and public consumers. Define capability boundaries and isolated tests for each listed service while preserving external API compatibility; done means lib.rs is mainly facade wiring, boundaries are explicit, and existing consumers compile without behavioral regression.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
api, backend
Issue type
Refactor
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.