Research Document: Issue #624 - Remove terraphim_repl, Consolidate CLIs
Status: Approved Author: Claude Code Date: 2026-03-11 Reviewers: Engineering Team
Executive Summary
Issue #624 requests removing the terraphim_repl crate and consolidating CLIs. Research found that terraphim_repl is already excluded from the workspace but the directory still exists. No nested terraphim_settings duplicates were found. The remaining work is to delete the terraphim_repl directory and verify no references remain.
Essential Questions Check
| Question | Answer | Evidence |
|----------|--------|----------|
| Energizing? | Yes | Cleanup removes dead code |
| Leverages strengths? | Yes | terraphim_agent provides REPL via --features repl-full |
| Meets real need? | Yes | Issue #624 explicitly requests this |
Proceed: Yes - 3/3 YES
Problem Statement
Description
Remove the 87-LOC terraphim_repl crate (subset of terraphim_agent) and consolidate CLI functionality into terraphim_agent.
Impact
Removes redundant code and simplifies the codebase.
Success Criteria
- terraphim_repl directory removed
cargo build -p terraphim_agent --features repl-fullsucceedscargo build -p terraphim_clisucceedscargo test --workspacepasses
Current State Analysis
Existing Implementation
Root Cargo.toml exclude list:
exclude = [
# ... other excludes ...
# Superseded by terraphim_agent
"crates/terraphim_repl",
# ...
]terraphim_repl directory: EXISTS at crates/terraphim_repl/
- Cargo.toml (1.9 KB)
- CHANGELOG.md
- README.md
- src/ directory
- tests/ directory
- assets/ directory
terraphim_agent: Provides REPL via repl-full feature
Code Locations
| Component | Location | Status | |-----------|----------|--------| | terraphim_repl | crates/terraphim_repl/ | EXISTS but excluded | | terraphim_agent | crates/terraphim_agent/ | Active, has REPL feature | | terraphim_cli | crates/terraphim_cli/ | Active CLI |
Dependencies
terraphim_repl dependencies (from its Cargo.toml):
- tokio
- terraphim_types
- terraphim_settings
- terraphim_config
- terraphim_automata
- terraphim_rolegraph
- terraphim_service
- terraphim_persistence
Note: These are all provided by terraphim_agent with --features repl-full.
Nested terraphim_settings Search
Result: No nested terraphim_settings directories found.
Constraints
Technical Constraints
- Must ensure terraphim_agent REPL feature provides equivalent functionality
- Cannot break existing CLI builds
Business Constraints
- No breaking changes to user-facing functionality
- terraphim_repl is already excluded (no users affected)
Vital Few
Essential Constraints
| Constraint | Why It's Vital | Evidence | |------------|----------------|----------| | terraphim_agent REPL works | Must replace terraphim_repl | Issue requirements | | No CLI breakage | terraphim_cli must still work | Issue requirements |
Eliminated from Scope
| Eliminated Item | Why Eliminated | |-----------------|----------------| | Nested settings cleanup | No nested directories found | | .release-plz.toml update | terraphim_repl not in config |
Risks and Unknowns
Known Risks
| Risk | Likelihood | Impact | Mitigation | |------|------------|--------|------------| | terraphim_agent REPL missing features | Low | Low | terraphim_repl was subset, terraphim_agent superset | | Documentation references | Medium | Low | Search and update docs |
Open Questions
- Are there any documentation references to terraphim_repl? - Need to check
Research Findings
Key Insights
- Already Excluded: terraphim_repl is already in workspace exclude list
- No Nested Settings: No nested terraphim_settings directories found
- No .release-plz.toml Entry: terraphim_repl not in release config (nothing to update)
- Directory Exists: The actual crates/terraphim_repl/ directory still needs removal
terraphim_repl Content Analysis
Size: ~87 LOC (as stated in issue)
Functionality: Basic REPL loop using rustyline
Superseded By: terraphim_agent with --features repl-full
Verification Commands
# Verify terraphim_agent REPL builds
# Verify terraphim_cli builds
# Run tests
Recommendations
Proceed/No-Proceed
Proceed - Straightforward cleanup of already-excluded crate.
Scope
- Remove
crates/terraphim_repl/directory entirely - Verify workspace builds without it
- Update any documentation references (if found)
Risk Mitigation
- Run full workspace check before committing
- Verify terraphim_agent REPL feature works
Next Steps
- Create design document with implementation steps
- Remove terraphim_repl directory
- Run cargo check --workspace
- Run cargo test --workspace
- Commit and PR
Appendix
terraphim_repl Directory Structure
crates/terraphim_repl/
├── Cargo.toml
├── CHANGELOG.md
├── README.md
├── assets/
├── src/
│ └── main.rs (87 LOC)
└── tests/References to Check
- Any documentation mentioning terraphim_repl
- README files
- CHANGELOG entries