test_the_spawn_site_names_its_enclosing_function¶
Tests › tests/test_thread_spawns.py
What this test is for
Why it exists
A COORDINATE WITH NO NAME IS WHY THE AGENT READ THE FILE. Build 35 gave the thread row its spawn file and line, so an agent could be told a thread is created at `programs/ssl/ssl_pthread_server.c:277` and still have nothing to ask a follow-up ABOUT. Measured on mbedtls 2026-08-14: the enclosing function is `thread_create`, whose body holds the one shared `mbedtls_ssl_config`, the `pthread_join` and the compile guard — four graded marks — and `dossier('thread_create')` already returned all of it. Only the route was absent.
Given
- —
When
patterns = patterns_by_name(load_thread_patterns(None))src = ( b"#include <pthread.h>\n" b"static void *WorkerProc(void *a) { return a; }\n" b"int thread_create(void) {\n" b" pthread_t t;\n" b" return pthread_create(&t, NULL, WorkerProc, NULL);\n" b"}\n" b"void *raced = (void *) 0;\n" )tree, raw = _parse_c(src)
3 more
sites = _walk_spawn_sites(tree, raw, patterns)file_scope, raw2 = _parse_c( b"#include <pthread.h>\n" b"static void *P(void *a) { return a; }\n" b"pthread_t g;\n" b"int ignored = 0;\n" )_walk_spawn_sites(file_scope, raw2, patterns)
Then
- ✓ len(sites) equals 1
- ✓ len(sites[0]) equals 10
- ✓ sites[0][8:] equals ["unknown", None]
- ✓ sites[0][6] equals "thread_create"
- ✓ _walk_spawn_sites(file_scope, raw2, patterns) equals []
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
… 80 earlier steps
… 315 later steps
tests/test_thread_spawns.py:408 · its file's page
What it checks (5)
assert len(sites) == 1, f"expected the one pthread spawn, got {sites}"observes_walk_spawn_sitesviasitesassert len(sites[0]) == 10, f"the payload must have ten elements, got {len(sites[0])}"observes_walk_spawn_sitesviasitesassert sites[0][8:] == ["unknown", None], "a pthread_t nobody joins or detaches"observes_walk_spawn_sitesviasitesassert sites[0][6] == "thread_create"observes_walk_spawn_sitesviasitesassert _walk_spawn_sites(file_scope, raw2, patterns) == []observes_walk_spawn_sites
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
test_the_spawn_site_names_its_enclosing_function→patterns_by_name→load_thread_patterns→_parse_c→_walk_spawn_sitesWhat 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 3 requirements
Its run touches their code; that is reach, not proof.
- REQ-DDB-PIPE-003 measured
- REQ-DDB-SCHEMA-001 measured
- REQ-DDB-SCHEMA-012 inferred