ml_switcheroo.utils.readme_editor

Utilities for updating the project README.

This module provides logic to inject automated verification reports (the Compatibility Matrix) directly into the README.md file, ensuring documentation stays valid with the code.

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
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