test_sections_mirror_the_standalone_manifest_formats

Tests › tests/test_declaration.py

passed Passed in the packaged run.

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

  1. (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

  1. decl = load_declaration(tmp_path)
  2. writers, readers = load_shared_key_patterns(section(decl, SECTION_SHARED_KEY))
  3. spawns = load_thread_patterns(section(decl, SECTION_THREADS))
  4. names = {p.name for p in spawns}
→

Then

  1. ✓ len(writers) equals 1
  2. ✓ len(readers) equals 1
  3. ✓ names contains "osThreadNew_wrapper"
  4. ✓ {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

thread startthread startthread startthread startclew/scope.pyclew/scope.pyclew/scope.pyclew/scope.pyclew/declaration.pyclew/declaration.pyclew/declaration.pyclew/declaration.pyother filesother filesother filesother filesalt (line 1171)altopt (line 529)opt_first_build_worker100. declared_scope_rejection → _declared_index_scope100_declared_index_scope101. _declared_index_scope → load_declaration_located101load_declaration_located102–105. load_declaration_located → _read_mapping102_read_mapping +3 more106. _checked_section → _checked_list_section106_checked_list_section107. _checked_list_section → all107all

… 14 steps between

thread startthread startthread startthread startclew/scope.pyclew/scope.pyclew/scope.pyclew/scope.pyclew/declaration.pyclew/declaration.pyclew/declaration.pyclew/declaration.pyother filesother filesother filesother filesloop (line 569)loopopt (line 571)optopt (line 547)opttry (line 548)try_first_build_worker122. _checked_tests → _checked_list_section122_checked_list_section123. _checked_tests → 123… 1 call not run124. _checked_section → check_manifest_document124check_manifest_document125–127. check_manifest_document → _checked_document125_checked_document +2 more128. _checked_section → _check_section_keys128_check_section_keys129. _declared_index_scope → _existing_paths129_existing_paths

… 5 steps between

thread startthread startthread startthread startclew/mcp_server/server.pyclew/mcp_server/server.pyclew/mcp_server/server.pyclew/mcp_server/server.pyclew/scope.pyclew/scope.pyclew/scope.pyclew/scope.pyclew/declaration.pyclew/declaration.pyclew/declaration.pyclew/declaration.pyother filesother filesother filesother filescatch (line 3328)catch_first_build_worker135. _sub_index_scope → declared_sub_index_excludes135declared_sub_index_excludes136. declared_sub_index_excludes → load_declaration136load_declaration137. load_declaration → load_declaration_located137load_declaration_located▶ test enters138. _run_build_walked → _bounded_output138_bounded_output139. _bounded_output → all139all

… 3 later steps

2 more

tests/test_declaration.py:52 · its file's page

What it checks (4)

  1. assert len(writers) == 1 not attributed
  2. assert len(readers) == 1 not attributed
  3. assert "osThreadNew_wrapper" in names not attributed
  4. assert {p.name for p in DEFAULT_SPAWN_PATTERNS} <= names not 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_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_sections_mirror_the_standalone_manifest_formats · 4 checksload_declarationREQ-DDB-CONFIG-001 · measuredload_declaration… 4 calls …_validate_nodeREQ-DDB-GUARD-012 · inferredload_thread_patternsREQ-DDB-SCHEMA-001 · measuredload_shared_key_patternsREQ-DDB-SCHEMA-005 · measuredload_shared_key_patternsdeclaration_originREQ-DDB-SCHEMA-012 · measuredload_declaration… 4 calls …allREQ-DDB-WIKI-054 · inferred
Also reaches 6 requirements

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