# ============================================================================= # Projet : AIR — Accounting Intermediate Representation # Auteur : Simon-Pierre Boucher # Contact : contact@spboucher.ai # Fichier : base.py # Description : Pass interface — every AIC transformation implements this. # ============================================================================= """Base class for AIC passes (LLVM-pass analogue). A pass is a deterministic transformation over the CompilationUnit. It returns diagnostics; it never calls an LLM, the network, or a clock. The pass manager re-verifies the double-entry invariant after every pass. """ from __future__ import annotations import abc from aic.diagnostics import Diagnostic from aic.unit import CompilationUnit class Pass(abc.ABC): """One deterministic compilation step.""" name: str = "pass" @abc.abstractmethod def run(self, unit: CompilationUnit) -> list[Diagnostic]: """Transform the unit in place; return any diagnostics produced."""