test_the_winning_tier_reaches_build_meta_and_is_read_back¶
Tests › tests/test_tiers.py
What this test is for
Why it exists
PROVENANCE SURVIVES A REFRESH. Scope is re-derived from scratch on every build and nothing consulted what a previous build stamped, so an applied and recorded statement was discarded by the next refresh — which then reported success over a policy the operator had replaced. This is the same read-back `_operator_excludes` does, asserted end to end through the real writer.
Given
db = tmp_path / "clew.db"
When
resolution = _entry_patterns(argparse.Namespace(entry_patterns=["%mystyle%"]), {})_stamp(db, resolution)rows = dict( sqlite3.connect(str(db)) .execute(f"SELECT key, value FROM build_meta WHERE key LIKE '{OPTIONS_META_PREFIX}.%'") .fetchall() )
3 more
inherited = _recorded_entry_patterns(argparse.Namespace(entry_patterns=None), db)list(_entry_patterns(argparse.Namespace(entry_patterns=inherited), {}).values)_entry_patterns(argparse.Namespace(entry_patterns=inherited), {})
Then
- ✓ rows[f"{OPTIONS_META_PREFIX}.{OPTION_ENTRY_PATTERNS}.{TIER_KEY}"] equals TIER_EXPLICIT
- ✓ rows[f"{OPTIONS_META_PREFIX}.{OPTION_ENTRY_PATTERNS}.{EXPLICIT_KEY}"] equals "%mystyle%"
- ✓ inherited equals ["%mystyle%"]
- ✓ list(_entry_patterns(argparse.Namespace(entry_patterns=inherited), {}).values) equals [ "main", "app_main", "%mystyle%", ]
tests/test_tiers.py:430 · its file's page
What it checks (4)
assert rows[f"{OPTIONS_META_PREFIX}.{OPTION_ENTRY_PATTERNS}.{TIER_KEY}"] == TIER_EXPLICITnot attributedassert rows[f"{OPTIONS_META_PREFIX}.{OPTION_ENTRY_PATTERNS}.{EXPLICIT_KEY}"] == "%mystyle%"not attributedassert inherited == ["%mystyle%"]observes_recorded_entry_patternsviainheritedassert list(_entry_patterns(argparse.Namespace(entry_patterns=inherited), {}).values) == [ "main", "app_main", "%mystyle%", ]observeslist
Where the product reaches it
dossier→subject_payload→_flatten_subject→list(flow)
Call flow
test_the_winning_tier_reaches_build_meta_and_is_read_back→_entry_patterns→_stamp→_recorded_entry_patterns→listWhat 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 5 requirements
Its run touches their code; that is reach, not proof.
- REQ-DDB-CONFIG-001 measured
- REQ-DDB-CONFIG-006 measured
- REQ-DDB-CONFIG-007 measured
- REQ-DDB-MCP-001 measured
- REQ-DDB-PIPE-005 measured