injector_spec¶
JSON Injector for Semantic Specifications.
This module provides the StandardsInjector, a utility to update the Semantic Knowledge Base JSON files (The Hub) with new operation definitions.
It replaces the legacy LibCST-based injector that modified standards_internal.py.
Classes¶
Injects a new operation definition into the Semantic Knowledge Base (JSON). |
Module Contents¶
- class injector_spec.StandardsInjector(op_def: ml_switcheroo.core.dsl.OperationDef, tier: ml_switcheroo.enums.SemanticTier = SemanticTier.EXTRAS)¶
Injects a new operation definition into the Semantic Knowledge Base (JSON).
It determines the correct JSON file based on naming heuristics or provided tier, serializes the OperationDef to JSON-compatible dict, and updates the file.
- op_def¶
- tier¶
- found = False¶
- inject(dry_run: bool = False) bool¶
Executes the injection.
- Parameters:
dry_run – If True, prints intended changes without writing to disk.
- Returns:
True on success.
- Return type:
bool