altimate-code
altimate-code copied to clipboard
epic: Eliminate Python altimate-engine — consolidate on TypeScript
Summary
Eliminate the Python altimate-engine dependency from the CLI by consolidating all functionality into TypeScript. This resolves the class of Python environment resolution issues (like #210) and removes the need for pip, venv, and native Python extensions.
Current Architecture
TS CLI → JSON-RPC stdio → Python altimate-engine
→ altimate-core (PyO3→Rust) 33 methods
→ Python DB drivers 14 methods
→ Python dbt runner 4 methods
→ Python finops SQL templates 10 methods
→ Python schema cache (SQLite) 6 methods
→ Python composite SQL ops 9 methods
→ ping 1 method
Target Architecture
TS CLI
→ @altimateai/altimate-core (napi-rs, direct) 33 methods
→ Node.js DB drivers 14 methods
→ dbt-tools (already in TS) 4 methods
→ TS finops module 10 methods
→ TS schema cache (better-sqlite3) 6 methods
→ TS composite SQL ops 9 methods
→ inline 1 method
Key Decisions (6-model consensus review)
- Dispatcher pattern (Strangler Fig) for incremental migration
ALTIMATE_NATIVE_ONLY=1CI gate +ALTIMATE_SHADOW_MODE=1parity testing- Lazy driver loading via dynamic
import() better-sqlite3+ FTS5 for schema cache- 3-tier credential store: keytar → AES file → env vars (no plaintext)
connections.jsonformat unchanged- Plain async/await (not Effect)
Phases
- [ ] Phase 0: Dispatcher abstraction (1 week)
- [ ] Phase 1: altimate-core napi-rs bindings — 41 methods (2 weeks)
- [ ] Phase 2: Connection manager + DB drivers — 14 methods (3 weeks)
- [ ] Phase 3: Schema cache + FinOps (2 weeks, parallel with Phase 4)
- [ ] Phase 4: dbt + Local testing (2 weeks, parallel with Phase 3)
- [ ] Phase 5: Bridge removal + cleanup (1 week)
Timeline
9 weeks total
Related
- Fixes #210