ml_switcheroo.semantics.autogen =============================== .. py:module:: ml_switcheroo.semantics.autogen .. autoapi-nested-parse:: Semantic Autogen: The Distributed Persistence Layer. This module is responsible for finalizing "Candidate Standards" proposed by the Consensus Engine into the Distributed Knowledge Base. It implements the **Hub-and-Spoke** write strategy: 1. **Hub (Specs)**: Writes Abstract Definitions (`std_args`, `description`) to the target spec file in `semantics/`. 2. **Spokes (Snapshots)**: Writes Implementation Details (`api`, `args`) to `snapshots/{framework}_vlatest_map.json`. Policy: - **Do Not Harm**: Existing keys in Specs or Snapshots (implying manual curation) are skipped to prevent overwriting high-quality manual edits. - **Additive**: New discoveries are added. - **Atomic**: Writes are performed per-file using standard JSON serialization. Classes ------- .. autoapisummary:: ml_switcheroo.semantics.autogen.SemanticPersister Module Contents --------------- .. py:class:: SemanticPersister Handles serialization of Discovered Standards to disk using Hub-and-Spoke architecture. .. py:method:: persist(candidates: List[ml_switcheroo.discovery.consensus.CandidateStandard], target_spec_file: pathlib.Path) -> None Splits and persists candidates into Specifications (Hub) and Snapshots (Spokes). :param candidates: List of aligned CandidateStandard objects. :param target_spec_file: Path to the JSON semantic spec file (Hub) to update/create. (e.g., `semantics/k_framework_extras.json`)