ml_switcheroo.utils.readme_editor

Classes

ReadmeEditor

Utility to programmatically update the README.md with verification results.

Module Contents

class ml_switcheroo.utils.readme_editor.ReadmeEditor(semantics: ml_switcheroo.semantics.manager.SemanticsManager, readme_path: pathlib.Path)

Utility to programmatically update the README.md with verification results.

It regenerates the “Compatibility Matrix” table based on the current state of the Knowledge Base and the results of the latest CI run, then splices it into the README content using regex markers.

semantics

Source of Truth for API definitions.

Type:

SemanticsManager

readme_path

Path to the README file.

Type:

Path

semantics
readme_path
update_matrix(validation_results: Dict[str, bool]) bool

Regenerates the Markdown table and injects it into the README.

It looks for the section starting with ## ✅ Compatibility Matrix and replaces the content up to the next ## Header or End of File.

Parameters:

validation_results – Dictionary mapping op_name -> boolean pass status.

Returns:

True if the update was successful, False otherwise.

Return type:

bool