#!/usr/bin/env python3 """Format probe — YAML surface. Does encoding the tree as YAML (no parens, native nesting, massively in LLM training) help Qwen, esp. at depth where format 4 hit a closing-token repetition tail? Node `(head a b ...)` <-> YAML mapping `head: [a, b, ...]`; each arg is a scalar atom or another mapping. Converter uses the STANDARD PyYAML parser (round-trip-verified incl. the -,*,/,true,false special-char atoms) before judging any model output. Same ablation ladder as the other probes. Reads $IONOS_API_TOKEN (never printed). Live IONOS — run with consent. """ from __future__ import annotations import json, os, re, subprocess, urllib.request, yaml from pathlib import Path ENDPOINT="https://openai.inference.de-txl.ionos.com/v1/chat/completions" MODEL="Qwen/Qwen3-Coder-Next" REPO=Path(__file__).resolve().parents[2] AIL=os.environ.get("AIL_BIN", str(REPO/"target/debug/ail")) DOC=REPO/"experiments/2026-05-12-cross-model-authoring/qwen-yaml.md" # ---- S-expr <-> tree <-> YAML (verified converter) ---- def tokenize(s): toks=[]; i=0 while i