You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
config: collect_config_issues raises on parseable-but-malformed YAML — 500 from /api/config/validate (contract says "never raises") #119
collect_config_issues documents itself as "never raises" (src/profiles/core/config/diagnostics.py:7), but line 45 calls collect_issues(raw) outside any try. Three verified crashes on content ruamel parses fine:
Draft
Crash
configs: {a: {extends: [b]}}
TypeError: cannot use 'CommentedSeq' as a dict key at validator.py:49 (extends not in configs)
Top-level scalar 42
TypeError: 'int' object is not iterable at validator.py:35 — enabled by read_yaml_text returning any YAML node despite its -> dict annotation (io/yaml_io.py:50-60)
Top-level YAML list
AttributeError: 'CommentedSeq' object has no attribute 'get' at validator.py:39
Blast radius
POST /api/config/validate → 500 (routes/config.py:187-203).
POST /api/config/save: validate_issues runs before the force check (config.py:467-469), so even force-save cannot write such drafts — the user gets a 500 instead of a 400 issue list.
Suggested fix
In read_yaml_text/read_yaml, type-narrow to Mapping — raise ValueError("configuration root must be a mapping") otherwise (or return {} and let diagnostics report it).
In validator.collect_issues, guard isinstance(extends, str) and isinstance(raw, Mapping).
Belt-and-braces: wrap the collect_issues call in collect_config_issues and convert any exception into an {"severity": "error", ...} issue.
Activity
X6M-Work commentedon Nov 6, 2026
Submitted a fix in PR #157 with test coverage for scalar roots, list roots, and non-string extends.
fix(config): prevent crashes on non-mapping root and non-string exten…