altimate-code icon indicating copy to clipboard operation
altimate-code copied to clipboard

feat: [Phase 0] Dispatcher abstraction layer for Python bridge migration

Open anandgupta42 opened this issue 8 months ago • 1 comments

Phase 0: Dispatcher Abstraction Layer

Parent: #214

What

Create a Dispatcher module that wraps Bridge.call() with a native handler registry. Update all 77 tool files to use the dispatcher. Zero behavior change — everything falls back to the Python bridge.

Files to create

  • packages/opencode/src/altimate/native/dispatcher.ts — routing layer with typed registry
  • packages/opencode/src/altimate/native/index.ts — barrel exports

Files to modify

  • All 77 tool files in packages/opencode/src/altimate/tools/*.ts — Bridge.call() → Dispatcher.call()

Feature flags

  • ALTIMATE_NATIVE_ONLY=1 — throws if no native handler (CI gate)
  • ALTIMATE_SHADOW_MODE=1 — runs both paths, logs mismatches

Acceptance criteria

  • [ ] Dispatcher created with typed register() and call() functions
  • [ ] All 77 tool files updated to use Dispatcher.call()
  • [ ] bun test passes with zero regressions (bridge fallback active)
  • [ ] ALTIMATE_NATIVE_ONLY=1 throws for all methods (none migrated yet)
  • [ ] No Python behavior changes

anandgupta42 avatar Mar 17 '26 18:03 anandgupta42

Completed in PR #221.

anandgupta42 avatar Mar 18 '26 00:03 anandgupta42