test_sections_mirror_the_standalone_manifest_formats¶
Tests › tests/test_declaration.py
What this test is for
Why it exists
A section holds EXACTLY what the corresponding standalone file holds, so a repo can move an existing manifest's contents in verbatim and the same parser handles both delivery routes.
Given
(tmp_path / ".clew.yaml").write_text( "shared_key_patterns:\n" " writers:\n" ' - name_prefix: "Store_Set_"\n' " readers:\n" ' - name_prefix: "Store_Get_"\n' "thread_patterns:\n" " spawns:\n" ' - name: "osThreadNew_wrapper"\n' " entry_arg_index: 1\n", encoding="utf-8", )
When
decl = load_declaration(tmp_path)writers, readers = load_shared_key_patterns(section(decl, SECTION_SHARED_KEY))spawns = load_thread_patterns(section(decl, SECTION_THREADS))names = {p.name for p in spawns}
Then
- ✓ len(writers) equals 1
- ✓ len(readers) equals 1
- ✓ names contains "osThreadNew_wrapper"
- ✓ {p.name for p in DEFAULT_SPAWN_PATTERNS} is at most names
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) · 9 of 142 steps
… 99 earlier steps
… 14 steps between
… 5 steps between
… 3 later steps
2 more
- clew — `main` (clew/cli.py) · 9 of 400 steps
- Build this wiki from the index · 8 of 400 steps
tests/test_declaration.py:52 · its file's page
What it checks (4)
assert len(writers) == 1not attributedassert len(readers) == 1not attributedassert "osThreadNew_wrapper" in namesnot attributedassert {p.name for p in DEFAULT_SPAWN_PATTERNS} <= namesnot attributed
Where the product reaches it
main→propose_main→propose→build_context→load_declaration(flow)
Call flow
test_sections_mirror_the_standalone_manifest_formats→load_declaration→load_shared_key_patterns→load_thread_patternsWhat 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 6 requirements
Its run touches their code; that is reach, not proof.
- REQ-DDB-CONFIG-001 measured
- REQ-DDB-GUARD-012 inferred
- REQ-DDB-SCHEMA-001 measured
- REQ-DDB-SCHEMA-005 measured
- REQ-DDB-SCHEMA-012 measured
- REQ-DDB-WIKI-054 inferred