4d24f357a0
A config.yaml whose top-level value is a list or scalar parses fine, so the strict check_config_version(raise_on_parse_error=True) from #101778 still returned (0, latest) and migrate_config() proceeded: sanitize_env_file() rewrote .env, then save_config()'s fail-closed guard raised RuntimeError. Raise InvalidUserConfigError up front for that shape too, so the "no side effect before the invalid config is surfaced" guarantee holds for both invalid-config shapes. Tolerant callers are unchanged. Tests: parametrize the two #101778 regression tests over malformed-yaml and list-root; assert the tolerant call still does not raise. Also make the test_update_autostash check_config_version mock kwarg-tolerant, matching the author's fix in test_config.py.