ci: legible failures for malformed exceptions file; docs catch up

_parse_exceptions() now validates the document shape — top level must be a
mapping, 'exceptions' must be a list, each entry a mapping, and YAML parse
errors are caught — each failing with a ::error:: instead of an
AttributeError traceback. CI output must say what to fix. Parametrised
tests cover all four malformed shapes.

docs/feedpak-spec-gate.md: the Limitations section still described the
pre-flow-aware scanner (KEY_OPS, name-list-only receivers). Now states the
actual residual gaps: function-parameter manifests are recognised by name
only, and helper-mediated literal keys (song.py's
_gap_fill_manifest_absent(manifest, "album")) are unseen by both the scan
and the readers-complete guard, since they share one detector.

Signed-off-by: topkoa <topkoa@gmail.com>
This commit is contained in:
topkoa
2026-07-13 00:53:09 -04:00
parent 0158286d06
commit 203f82b6fe
3 changed files with 42 additions and 10 deletions
+13
View File
@@ -105,6 +105,19 @@ def test_duplicate_exception_key_is_rejected():
gate._parse_exceptions(textwrap.dedent(doc), "test")
@pytest.mark.parametrize("doc", [
"- just\n- a\n- list\n", # list at top level
"exceptions: not-a-list\n", # scalar where list expected
"exceptions:\n - just-a-string\n", # non-mapping entry
"exceptions: [\n", # invalid YAML
])
def test_malformed_exceptions_fail_legibly(doc):
# Malformed shapes must exit with a ::error::, not an AttributeError
# traceback — CI output has to say what to fix.
with pytest.raises(SystemExit):
gate._parse_exceptions(doc, "test")
def test_exception_without_issue_is_rejected():
# No tracking issue, no exception — entries are debt and debt is tracked.
doc = """