test_an_unresolved_extent_carries_no_calls_through_to_R2¶
Tests › tests/test_critical_sections.py
What this test is for
Why it exists
The fail-closed rule has to survive the query layer too: a section whose extent is NULL must arrive with an empty `calls`, so a consumer cannot read a partial membership as a complete one.
Given
conn = _query_db()conn.execute( "INSERT INTO lock_acquisitions " "(id, lock_id, holder_rowid, path_rowid, form, role, mode, start_line, end_line, " " pattern_name, declared, confidence) " "VALUES (3, 1, 3, 1, 'call', 'acquire', 'exclusive', 60, NULL, " "'pthread_mutex_lock', 0, 'low')" )
When
section = next(s for s in sections_in(conn, "audit") if s.start_line == 60)
Then
- ✓ section.end_line is None
- ✓ section.calls equals ()
- ✓ section.confidence equals EXTENT_UNRESOLVED
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.
clew — `main` (clew/cli.py) · 1 of 400 steps
… 352 earlier steps
… 43 later steps
1 more
- `main` (scripts/export_parity.py) · 1 of 203 steps
tests/test_critical_sections.py:679 · its file's page
What it checks (3)
assert section.end_line is Noneobservessections_inviasectionassert section.calls == ()observessections_inviasectionassert section.confidence == EXTENT_UNRESOLVEDobservessections_inviasection
Where the product reaches it
No product flow reaches this code: no product entry point's flow calls any of the functions this test calls.
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 4 requirements
Its run touches their code; that is reach, not proof.
- REQ-DDB-QUERY-001 measured
- REQ-DDB-QUERY-003 measured
- REQ-DDB-SCHEMA-011 measured
- REQ-DDB-SCHEMA-012 measured