test_entry_patterns_declaration_replaces_the_guesses_not_the_facts¶
Tests › tests/test_declaration.py
What this test is for
Why it exists
#34: a repo whose handlers are reached only through indirect dispatch has no static caller for them, so liveness marks them orphan. Naming that convention reclaims them — measured on a C++ codebase, declaring its dispatch naming takes orphans from 61 to 17, and the survivors (now_ms, parse_bool, read_file, slurp) are genuine utility leaves.
Given
args = argparse.Namespace(entry_patterns=None)decl = {SECTION_ENTRY_PATTERNS: ["%trampoline%", "dispatch_%"]}
When
declared = _entry_patterns(args, decl)list(_entry_patterns(args, {}).values)_entry_patterns(args, {})
3 more
explicit = argparse.Namespace(entry_patterns=["only_this"])list(_entry_patterns(explicit, decl).values)_entry_patterns(explicit, decl)
Then
- ✓ set(ENTRY_PATTERN_FACTS) is at most set(declared.values)
- ✓ declared.values contains "%trampoline%"
- ✓ declared.values contains "dispatch_%"
- ✓ declared.values does not contain "%init%"
- ✓ list(_entry_patterns(args, {}).values) equals DEFAULT_ENTRY_PATTERNS
- ✓ list(_entry_patterns(explicit, decl).values) equals [*ENTRY_PATTERN_FACTS, "only_this"]
tests/test_declaration.py:119 · its file's page
What it checks (5)
assert set(ENTRY_PATTERN_FACTS) <= set(declared.values), "facts must survive"observes_entry_patternsviadeclaredassert "%trampoline%" in declared.values and "dispatch_%" in declared.valuesobserves_entry_patternsviadeclaredassert "%init%" not in declared.values, "a declaration replaces the guesses"observes_entry_patternsviadeclaredassert list(_entry_patterns(args, {}).values) == DEFAULT_ENTRY_PATTERNSobserveslistassert list(_entry_patterns(explicit, decl).values) == [*ENTRY_PATTERN_FACTS, "only_this"]observeslist
Where the product reaches it
dossier→subject_payload→_flatten_subject→list(flow)
Call flow
What it reaches
Each row runs from this test, through the calls it makes, to the code a requirement names. If that code breaks, the test's checks are what should catch it. Reaching is not proving: a check only proves what it observes. No mutation records were given, so these rows say what the test REACHES.
Also reaches 2 requirements
Its run touches their code; that is reach, not proof.
- REQ-DDB-CONFIG-001 measured
- REQ-DDB-CONFIG-006 measured