test_a_lock_declaration_with_releases_is_accepted_on_both_routes

Tests › tests/test_buildoptions.py

passed Passed in the packaged run.

What this test is for

Why it exists

TWO DOCUMENTS DISAGREEING ABOUT ONE FACT, for the third time in this area. The loader `locks._declared_lock_pattern` reads `releases`, and this module's entry schema omitted it — so the SAME declaration was accepted from a `.clew.yaml` file and REFUSED as an inline build option.

Verifies REQ-DDB-CONFIG-008

Given

  1. document = { "locks": [ { "name": "mbedtls_mutex_lock", "form": "call", "releases": "mbedtls_mutex_unlock", "kind": "mutex", "mode": "exclusive", "role": "scoped", "operand_index": 0, } ] }
→

When

  1. bo._checked_document("locks", document)
  2. patterns = {p.name: p for p in load_lock_patterns(document)}
  3. declared = patterns["mbedtls_mutex_lock"]
→

Then

  1. ✓ bo._checked_document("locks", document) equals document
  2. ✓ declared.releases equals "mbedtls_mutex_unlock"
  3. ✓ declared.form equals "call"
  4. ✓ declared.operand_index equals 0
  5. ✓ patterns contains "lock_guard"

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.

thread `clew-first-build-` — `_first_build_worker` (clew/mcp_server/server.py) · 2 of 142 steps

… 123 earlier steps

thread startthread startthread startthread startclew/scope.pyclew/scope.pyclew/scope.pyclew/scope.pyclew/declaration.pyclew/declaration.pyclew/declaration.pyclew/declaration.pyother filesother filesother filesother filesopt (line 547)opttry (line 548)tryloop (line 598)looploop (line 648)loop_first_build_worker124. _checked_section → check_manifest_document124check_manifest_document125. check_manifest_document → _checked_document125_checked_document126. _checked_document → _checked_entries126_checked_entries▶ test enters127. _checked_entries → _checked_entry127_checked_entry128. _checked_section → _check_section_keys128_check_section_keys129. _declared_index_scope → _existing_paths129_existing_paths

… 13 later steps

2 more

tests/test_buildoptions.py:525 · its file's page

What it checks (5)

  1. assert bo._checked_document("locks", document) == document, ( "the inline route must accept every key the loader reads" ) observes _checked_document
  2. assert declared.releases == "mbedtls_mutex_unlock", ( "without a release token every critical-section extent stays NULL" ) not attributed
  3. assert declared.form == "call" not attributed
  4. assert declared.operand_index == 0 not attributed
  5. assert "lock_guard" in patterns observes load_lock_patterns via patterns

Where the product reaches it

  • main → propose_main → propose → build_context → load_declaration → load_declaration_located → _checked_sections → _checked_section → check_manifest_document → _checked_document (flow)

Call flow

test_a_lock_declaration_with_releases_is_accepted_on_both_routes→_checked_document→load_lock_patterns

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_a_lock_declaration_with_releases_is_accepted_on_both_routes · 5 checksload_lock_patternsREQ-DDB-SCHEMA-011 · measuredload_lock_patternsdeclaration_originREQ-DDB-SCHEMA-012 · measured

Requirements it verifies (1)

requirementlinked byimplementers exercised
REQ-DDB-CONFIG-008catalogunknown
Also reaches 2 requirements

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