...age parsing
# ----------------------------

def parse_messages(text: str) -> list[dict]:
    """
    Zerlegt den Block in Messages anhand deiner [MSG ... | ROLE | TS] Header.
    Returns: [{"msgno": "...", "role": "USER"/"ASSISTANT", "ts": "...", "content": "..."}]
    """
    lines = text.splitlines()
    messages = []
    current = None

    for ln in lines:
        m = re.match(
            r"^\[M...