test_unresolved_gates_distinguish_no_definition_site_from_never_tried

Tests › tests/test_payload_completeness.py

passed Passed in the packaged run.

What this test is for

Why it exists

TWO GAPS THAT LOOKED IDENTICAL AND MEAN OPPOSITE THINGS. `if sites:` dropped the key for a gate the index cannot place, so its absence was indistinguishable from having been capped out.

Given

  1. payload = { "name": "subject_fn", "gated_by": [{"symbol": "SOUND_FINDME"}, {"symbol": "NOWHERE_DEFINED_XYZ"}], }
→

When

  1. resolved, gaps = _gate_definitions(rich_db, payload)
  2. many = { "name": "subject_fn", "gated_by": [{"symbol": f"GATE_{i:03d}"} for i in range(_GATE_DEFINITION_CAP + 3)], }
  3. _resolved2, gaps2 = _gate_definitions(rich_db, many)
  4. _r3, gaps3 = _gate_definitions(rich_db, {"name": "f", "gated_by": [{"symbol": "SOUND_FINDME"}]})
→

Then

  1. ✓ resolved contains "SOUND_FINDME"
  2. ✓ gaps is not None
  3. ✓ gaps["no_definition_site"] equals ["NOWHERE_DEFINED_XYZ"]
  4. ✓ gaps does not contain "not_attempted"
  5. ✓ gaps2 is not None
  6. ✓ len(gaps2["not_attempted"]) equals 3
  7. ✓ gaps3 is None

What it exercises

The parts of the system's flows this test ran, measured by per-test coverage: lit steps ran in this test, dimmed ones did not, and ▶ marks where the test called in. Each title opens the whole flow with these steps lit.

Look up one name: everything the index holds about it · 23 of 226 steps

… 17 earlier steps

callercallercallercallerclew/query/_common.pyclew/query/_common.pyclew/query/_common.pyclew/query/_common.pyclew/query/recovery.pyclew/query/recovery.pyclew/query/recovery.pyclew/query/recovery.pydossier18. _documentation_mentions → table_exists18table_exists19. _documentation_mentions → has_columns19has_columns20. has_columns → table_exists20table_exists21–22. _hint_from → _name_exists21_name_exists +1 more

… 32 steps between

callercallercallercallercallerclew/query/payload.pyclew/query/payload.pyclew/query/payload.pyclew/query/payload.pyclew/query/payload.pyclew/query/_common.pyclew/query/_common.pyclew/query/_common.pyclew/query/_common.pyclew/query/_common.pyother filesother filesother filesother filesother filesloop (line 515)looploop (line 660)looploop ×2 (line 288)loop ×2dossier55. matching_identity → qualified_name_of55qualified_name_of56. _flatten_subject → _gate_definitions56_gate_definitions57. _gate_definitions → macro_definitions57macro_definitions▶ test enters58. macro_definitions → connect58connect59. macro_definitions → macro_definitions_conn59macro_definitions_conn60. macro_definitions_conn → has_columns60has_columns61–62. macro_definitions_conn → _macro_def61_macro_def +1 more63. gates_covering → table_exists63table_exists64. gates_covering → has_columns64has_columns65. gates_covering → _gate_columns65_gate_columns66–67. _gate_columns → has_columns66has_columns ×268. gates_covering → _with_defaults68_with_defaults69. _with_defaults → table_exists69table_exists70. _with_defaults → _defaults_for_macros70_defaults_for_macros71. _with_defaults → decided_default71decided_default72. decided_default → is_shipped_config72is_shipped_config73. _with_defaults → _in_default_build73_in_default_build74. _macro_def → _macro_params74_macro_params75. _macro_params → table_exists75table_exists76. _macro_def → strip_xml76strip_xml77. _macro_def → _referenced_by77_referenced_by78. _referenced_by → table_exists78table_exists79. _macro_def → symbol_provenance79symbol_provenance80–81. symbol_provenance → records_provenance80records_provenance +1 more82. _gate_definitions → _gate_definition_gaps82_gate_definition_gaps83–84. _flatten_subject → _empty_callers_note83_empty_callers_note +1 more

… 142 later steps

2 more

tests/test_payload_completeness.py:282 · its file's page

What it checks (6)

  1. assert "SOUND_FINDME" in resolved, "precondition: the placeable gate must still resolve" not attributed
  2. assert gaps is not None, "an unplaceable gate must be disclosed, not silently dropped" not attributed
  3. assert gaps["no_definition_site"] == ["NOWHERE_DEFINED_XYZ"], ( f"the unplaceable gate must be NAMED, not counted — a count leaves a reader unable to ask " f"for the one they care about; got {gaps}" ) not attributed
  4. assert "not_attempted" not in gaps, "nothing was capped here, so nothing may claim it was" not attributed
  5. assert gaps2 is not None and len(gaps2["not_attempted"]) == 3, ( f"the three gates beyond the cap must be named as not attempted; got {gaps2}" ) not attributed
  6. assert gaps3 is None, ( "when every gate resolves there is nothing to disclose — a block on every reply is one a " "reader learns to skip" ) not attributed

Where the product reaches it

  • dossier → subject_payload → _flatten_subject → _gate_definitions (flow)

Call flow

test_unresolved_gates_distinguish_no_definition_site_from_never_tried→_gate_definitions

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_unresolved_gates_distinguish_no_definition_site_from_never_tried · 6 checks_gate_definitions… 3 calls …symbol_provenanceREQ-DDB-INDEX-004 · measured_gate_definitionsmacro_definitionsconnectREQ-DDB-QUERY-001 · measured_gate_definitionsmacro_definitionsmacro_definitions_connhas_columnsREQ-DDB-QUERY-003 · measured_gate_definitions… 5 calls …_in_default_buildREQ-DDB-QUERY-004 · inferred_gate_definitions… 3 calls …gates_coveringREQ-DDB-QUERY-006 · measured_gate_definitionsmacro_definitionsREQ-DDB-QUERY-012 · measured_gate_definitions… 5 calls …decided_defaultREQ-DDB-QUERY-013 · inferred
Also reaches 7 requirements

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