ml_switcheroo.cli.handlers.define

Handler for the ‘define’ command.

This module orchestrates the “Code Injection” workflow.

It imports YAML, validates schema, and uses: 1. JSON Injector to inject specifications into semantics/*.json (The Hub). 2. JSON Injector to update framework definition files in snapshots/ (The Spokes). 3. Code Generators to scaffold plugins and tests.

Attributes

yaml

Functions

handle_define(→ int)

Main entry point for defining new operations.

Module Contents

ml_switcheroo.cli.handlers.define.yaml = None
ml_switcheroo.cli.handlers.define.handle_define(yaml_file: pathlib.Path, dry_run: bool = False, no_test_gen: bool = False) int

Main entry point for defining new operations.

Parameters:
  • yaml_file – Path to the input YAML definition.

  • dry_run – If True, simulate changes without writing to disk.

  • no_test_gen – If True, skip generation of test files.

Returns:

Exit Code (0 for success, 1 for failure).

Return type:

int