tests(2-I): derive syntax_tokens whitelist from STREAMS per §10.4

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
Matt Johnson 2026-05-19 21:48:44 +00:00
commit d8024f6f4f

View file

@ -203,9 +203,9 @@ def test_no_orphan_adapter_references_in_anti_patterns():
quoted = set(re.findall(r'"([a-z][a-z_]*)"', section))
# Whitelist Python-syntax tokens that incidentally appear in the section;
# everything else in this set is asserted to be a real adapter name.
syntax_tokens = {
"CENTRAL_WX", "CENTRAL_FIRE", # stream names quoted as examples
}
# Derived from STREAMS per §10.4 — stream names appear quoted as examples
# and would otherwise look like orphan adapter references.
syntax_tokens = {s.name for s in STREAMS}
candidate_adapter_names = quoted - {t.lower() for t in syntax_tokens}
known_adapters = set(discover_adapters().keys())
orphans = {n for n in candidate_adapter_names if n not in known_adapters}