Skip to content

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

@anandgupta42

Description

@anandgupta42

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/*.tsBridge.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

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions