Files
club-3090/scripts/tests
noonghunnaandClaude Opus 4.8 b1562dd1c7 fix(launch): make the switch/launch table derivation stdlib-only (#584)
ryan's Proxmox VM (no python3-yaml) fails switch.sh with
`ModuleNotFoundError: No module named 'yaml'` — surfaced by #599's
error-unswallowing. The launcher table path only used PyYAML for one
thing: pulling container_name out of each compose. Three-layer fix:

1. PyYAML is now OPTIONAL on the table path: a regex container_name
   fallback (first non-comment `container_name:` line + the existing
   ${VAR:-default} unwrap) kicks in when yaml is absent.
   CLUB3090_EMIT_NO_YAML=1 forces the fallback so CI can exercise it.
2. The --json contract path (c3 / baselines join) legitimately requires
   PyYAML — it now checks FIRST (before load_profiles, which also
   imports yaml) and fails with an actionable Fix: line
   (`sudo apt install python3-yaml`), not a bare traceback.
3. Output side of the #599 locale class: a PIPED stdout under LC_ALL=C
   defaults to ASCII → UnicodeEncodeError printing the unicode in
   status notes. Both emit blocks now pin
   sys.stdout/stderr.reconfigure(encoding="utf-8").

New guard test-registry-emit-no-yaml.sh asserts byte-identical table
output across {baseline, no-yaml, C-locale, no-yaml+C-locale (the
literal #584 rig)} and the actionable --json refusal. Live-validated:
`CLUB3090_EMIT_NO_YAML=1 LC_ALL=C PYTHONUTF8=0 PYTHONCOERCECLOCALE=0
bash scripts/switch.sh --list` renders all 48 variants. AGENTS.md
encoding section extended with the stdlib-only + write-side rules.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01EfF565T9eSLaqGzidyJ1Pm
2026-07-06 21:15:02 +00:00
..