test_the_winning_tier_reaches_build_meta_and_is_read_back

Tests › tests/test_tiers.py

passed Passed in the packaged run.

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

  1. db = tmp_path / "clew.db"
→

When

  1. resolution = _entry_patterns(argparse.Namespace(entry_patterns=["%mystyle%"]), {})
  2. _stamp(db, resolution)
  3. rows = dict( sqlite3.connect(str(db)) .execute(f"SELECT key, value FROM build_meta WHERE key LIKE '{OPTIONS_META_PREFIX}.%'") .fetchall() )
3 more
  1. inherited = _recorded_entry_patterns(argparse.Namespace(entry_patterns=None), db)
  2. list(_entry_patterns(argparse.Namespace(entry_patterns=inherited), {}).values)
  3. _entry_patterns(argparse.Namespace(entry_patterns=inherited), {})
→

Then

  1. ✓ rows[f"{OPTIONS_META_PREFIX}.{OPTION_ENTRY_PATTERNS}.{TIER_KEY}"] equals TIER_EXPLICIT
  2. ✓ rows[f"{OPTIONS_META_PREFIX}.{OPTION_ENTRY_PATTERNS}.{EXPLICIT_KEY}"] equals "%mystyle%"
  3. ✓ inherited equals ["%mystyle%"]
  4. ✓ 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)

  1. assert rows[f"{OPTIONS_META_PREFIX}.{OPTION_ENTRY_PATTERNS}.{TIER_KEY}"] == TIER_EXPLICIT not attributed
  2. assert rows[f"{OPTIONS_META_PREFIX}.{OPTION_ENTRY_PATTERNS}.{EXPLICIT_KEY}"] == "%mystyle%" not attributed
  3. assert inherited == ["%mystyle%"] observes _recorded_entry_patterns via inherited
  4. assert list(_entry_patterns(argparse.Namespace(entry_patterns=inherited), {}).values) == [ "main", "app_main", "%mystyle%", ] observes list

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→list

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.

test_the_winning_tier_reaches_build_meta_and_is_read_back · 4 checks_entry_patternsstring_listREQ-DDB-CONFIG-001 · measured_stampwrite_build_signatureREQ-DDB-CONFIG-006 · measured_stampwrite_build_signatureREQ-DDB-CONFIG-007 · measured_recorded_entry_patternsmeta_sectionREQ-DDB-MCP-001 · measured_stampwrite_build_signatureREQ-DDB-PIPE-005 · measured
Also reaches 5 requirements

Its run touches their code; that is reach, not proof.