Skip to main content

Module adapter

Module adapter 

Source
Expand description

Adapter module — maps component IDs to executors (Rust or legacy shell script).

This module provides:

  • AdapterRegistry — maps component IDs to executors (Rust or legacy shell script)
  • [RustAdapter] — routes to native Rust implementations (no shell subprocess)
  • [LegacyAdapter] — invokes shell scripts with correct argument forwarding
  • AdapterError — structured errors for unknown components and execution failures

§Design

The adapter layer is the migration bridge between Rust-native implementations and legacy shell scripts. For each component ID, the registry determines whether to use a Rust executor (fast, no subprocess) or fall back to the legacy shell script (backward compatible).

component_id → AdapterRegistry → RustAdapter (native)
                               → LegacyAdapter (shell script)
                               → Err(AdapterNotFound)

§Validation Assertions

  • VAL-MIGR-009: Rust-registered adapter routes to Rust impl, no shell subprocess
  • VAL-MIGR-010: No Rust adapter → falls back to install_*.sh with correct args
  • VAL-MIGR-011: Unknown component ID returns Err(AdapterNotFound)
  • VAL-MIGR-012: Output format matches shell for migrated components
  • VAL-MIGR-013: Exit codes match shell for success/failure/partial cases

Modules§

legacy_adapter
Legacy adapter — invokes shell scripts with correct argument forwarding.
rust_adapter
Rust-native adapter — executes component operations without spawning shell subprocesses.

Structs§

AdapterOutput
Result of executing a component adapter.
AdapterRef
Reference to an adapter returned by the registry.
AdapterRegistry
Registry that maps component IDs to their executor adapters.
RegistryExecutor
An ApplyExecutor that delegates to the AdapterRegistry.

Enums§

AdapterError
Errors produced by the adapter layer.

Traits§

Adapter
Trait for component adapters.