test_core_conventions.py¶
tests/test_core_conventions.py
Core conventions agent C's audit found false for real repositories (W6-W10; round 5).
test_a_linked_worktree_is_a_work_tree_root_and_a_planted_git_file_is_not
None test_core_conventions.test_a_linked_worktree_is_a_work_tree_root_and_a_planted_git_file_is_not(tmp_path)
Ask git, not the filesystem.
tests/test_core_conventions.py:121
Checks
assert (linked / ".git").is_file()assert is_work_tree_root(main) and is_work_tree_root(linked)assert not is_work_tree_root(planted)assert not is_work_tree_root(main / "nonexistent")
Result: passed
Verifies
| requirement | linked | path to the implementer |
|---|---|---|
| REQ-DDB-CONFIG-001 | measured | test_a_linked_worktree_is_a_work_tree_root_and_a_planted_git_file_is_not → git_argv |
Source · 32 lines
def test_a_linked_worktree_is_a_work_tree_root_and_a_planted_git_file_is_not(tmp_path) -> None:
"""W10: a `git worktree add` tree's `.git` is a FILE (`gitdir: …`), and the first-build gate's
`.git`-is-a-directory test refused it. The test existed for a reason — a planted one-byte
`.git` file must not make an arbitrary directory indexable — so git itself is asked, and a
planted file is still refused.
@brief Ask git, not the filesystem.
"""
import subprocess
from clew.gitenv import git_argv, git_env, is_work_tree_root
main = tmp_path / "main"
main.mkdir()
for args in (("init", "-q"), ("commit", "-q", "--allow-empty", "-m", "x")):
subprocess.run(
git_argv("-c", "user.name=t", "-c", "user.email=t@t", *args),
cwd=main,
env=git_env(),
check=True,
)
linked = tmp_path / "linked"
subprocess.run(
git_argv("worktree", "add", "-q", str(linked)), cwd=main, env=git_env(), check=True
)
planted = tmp_path / "planted"
planted.mkdir()
(planted / ".git").write_text("x")
assert (linked / ".git").is_file()
assert is_work_tree_root(main) and is_work_tree_root(linked)
assert not is_work_tree_root(planted)
assert not is_work_tree_root(main / "nonexistent")1 more lines, not shown
Activity · 15 steps
test_an_isr_predicate_is_a_call_not_a_substring
None test_core_conventions.test_an_isr_predicate_is_a_call_not_a_substring()
Predicates match as call tokens.
tests/test_core_conventions.py:25
Checks
assert not any("within_irq_window" in g for g in false_guard), false_guardassert any("k_is_in_isr" in g for g in real_guard), real_guard
Result: passed
Verifies
| requirement | linked | path to the implementer |
|---|---|---|
| REQ-DDB-PIPE-003 | measured | test_an_isr_predicate_is_a_call_not_a_substring → _guards → walk_blocking_sites → _enclosing_condition → enclosing |
Source · 14 lines
def test_an_isr_predicate_is_a_call_not_a_substring() -> None:
"""W7: `in_irq` is a substring of `within_irq_window`, so a real blocking-in-ISR conflict was
downgraded to "guarded". A call of the predicate (`k_is_in_isr()`) still guards.
@brief Predicates match as call tokens.
"""
false_guard = _guards(
"void h(void) { if (within_irq_window(dev)) { k_sem_take(&sem, K_FOREVER); } }"
)
real_guard = _guards("void h(void) { if (!k_is_in_isr()) { k_sem_take(&sem, K_FOREVER); } }")
assert not any("within_irq_window" in g for g in false_guard), false_guard
assert any("k_is_in_isr" in g for g in real_guard), real_guard
Activity · 4 steps
test_an_upper_case_C_suffix_is_cpp
None test_core_conventions.test_an_upper_case_C_suffix_is_cpp()
`.C` / `.H` route to C++.
tests/test_core_conventions.py:39
Checks
assert name("x/A.C") == name("x/A.H") == name("a.cpp")assert name("x/a.c") == name("a.h") != name("a.cpp")
Result: passed
Verifies
| requirement | linked | path to the implementer |
|---|---|---|
| REQ-DDB-PIPE-012 | inferred | test_an_upper_case_C_suffix_is_cpp → _ts_language_for → _grammar_available → has_language |
Source · 16 lines
def test_an_upper_case_C_suffix_is_cpp() -> None:
"""W9: `.C` and `.H` are the traditional Unix C++ suffixes (GCC reads `.C` as C++); lowering the
path sent them to the C grammar. `.c` and `.h` are unchanged.
@brief `.C` / `.H` route to C++.
"""
from clew.harvest import _ts_language_for
## Compared by grammar NAME: each lookup may return a fresh handle for the same grammar.
def name(path: str) -> str:
return _ts_language_for(path).__name__
assert name("x/A.C") == name("x/A.H") == name("a.cpp")
assert name("x/a.c") == name("a.h") != name("a.cpp")
Activity · 4 steps
test_super_names_the_base_class_method
None test_core_conventions.test_super_names_the_base_class_method(tmp_path)
super starts at the bases.
tests/test_core_conventions.py:75
Checks
assert ("src.shapes.B.run", "src.shapes.A.run") in pairs, pairsassert ("src.shapes.B.run", "src.shapes.B.helper") in pairs, pairs
Result: passed
Verifies
| requirement | linked | path to the implementer |
|---|---|---|
| REQ-DDB-CLI-001 | measured | test_super_names_the_base_class_method → _pairs → _run_pipeline → _run_pipeline_inner → report_stats |
| REQ-DDB-CLI-002 | inferred | test_super_names_the_base_class_method → _pairs → _run_pipeline → _run_pipeline_inner → _build_stages → _doxygen_or_partial → _doxygen_stage → _run_doxygen_from_args → run_doxygen → doxygen_supports_sqlite3 |
| REQ-DDB-CONFIG-001 | measured | test_super_names_the_base_class_method → _pairs → _run_pipeline → _run_pipeline_inner → _apply_declared_document → stated_document_meta |
| REQ-DDB-CONFIG-003 | inferred | test_super_names_the_base_class_method → _pairs → _run_pipeline → _run_pipeline_inner → _build_stages → ingest_requirements_yaml → _is_flat_req_list |
| REQ-DDB-CONFIG-004 | measured | test_super_names_the_base_class_method → _pairs → _run_pipeline → _run_pipeline_inner → _build_stages → resolve_preprocessor |
| REQ-DDB-CONFIG-005 | measured | test_super_names_the_base_class_method → _pairs → _run_pipeline → _run_pipeline_inner → _build_stages → import_kconfig |
| REQ-DDB-CONFIG-006 | measured | test_super_names_the_base_class_method → _pairs → _run_pipeline → _run_pipeline_inner → _recorded_entry_patterns → recorded_explicit |
| REQ-DDB-CONFIG-007 | measured | test_super_names_the_base_class_method → _pairs → _run_pipeline → _run_pipeline_inner → _build_stages → write_build_signature |
| REQ-DDB-CONFIG-009 | measured | test_super_names_the_base_class_method → _pairs → _run_pipeline → _run_pipeline_inner → _apply_toolchain_exclusions → load_toolchain_config |
| REQ-DDB-GUARD-012 | inferred | test_super_names_the_base_class_method → _pairs → _run_pipeline → _run_pipeline_inner → _build_stages → load_guard_config → read_guard_config → read_requirements_section |
| REQ-DDB-GUARD-019 | inferred | test_super_names_the_base_class_method → _pairs → _run_pipeline → _run_pipeline_inner → _build_stages → enrich_python_docstrings → summarize → parse_doxygen_tags |
| REQ-DDB-GUARD-024 | inferred | test_super_names_the_base_class_method → _pairs → _run_pipeline → _run_pipeline_inner → _build_stages → enrich_python_docstrings → summarize → apply_autobrief |
| REQ-DDB-INDEX-001 | measured | test_super_names_the_base_class_method → _pairs → _run_pipeline → _run_pipeline_inner → _verify_extra_input_is_read → effective_file_patterns |
| REQ-DDB-INDEX-002 | measured | test_super_names_the_base_class_method → _pairs → _run_pipeline → build_lock |
| REQ-DDB-INDEX-003 | measured | test_super_names_the_base_class_method → _pairs → _run_pipeline → _run_pipeline_inner → _build_stages → report_index_coverage |
| REQ-DDB-INDEX-004 | measured | test_super_names_the_base_class_method → _pairs → _run_pipeline → _run_pipeline_inner → _build_stages → recover_ast_symbols |
| REQ-DDB-INDEX-005 | measured | test_super_names_the_base_class_method → _pairs → _run_pipeline → _run_pipeline_inner → _build_stages → stamp_external_provenance |
| REQ-DDB-INDEX-006 | measured | test_super_names_the_base_class_method → _pairs → _run_pipeline → _run_pipeline_inner → _build_stages → record_code_text → code_text_rows |
| REQ-DDB-INDEX-007 | measured | test_super_names_the_base_class_method → _pairs → _run_pipeline → _run_pipeline_inner → _build_stages → record_owners |
| REQ-DDB-INDEX-008 | measured | test_super_names_the_base_class_method → _pairs → _run_pipeline → _run_pipeline_inner → _build_stages → ingest_file_licenses |
| REQ-DDB-INDEX-009 | measured | test_super_names_the_base_class_method → _pairs → _run_pipeline → _run_pipeline_inner → _build_stages → ingest_kerneldoc |
| REQ-DDB-INDEX-010 | measured | test_super_names_the_base_class_method → _pairs → _run_pipeline → _run_pipeline_inner → _build_stages → import_ast_includes |
| REQ-DDB-INDEX-011 | measured | test_super_names_the_base_class_method → _pairs → _run_pipeline → _run_pipeline_inner → _build_stages → import_property_keys |
| REQ-DDB-MCP-001 | measured | test_super_names_the_base_class_method → _pairs → _run_pipeline → _run_pipeline_inner → _operator_excludes → meta_section |
| REQ-DDB-MCP-004 | measured | |
| REQ-DDB-PIPE-001 | measured | test_super_names_the_base_class_method → _pairs → _run_pipeline → _run_pipeline_inner → _build_stages → enrich_database |
| REQ-DDB-PIPE-003 | measured | test_super_names_the_base_class_method → _pairs → _run_pipeline → _run_pipeline_inner → _build_stages → build_call_edges |
| REQ-DDB-PIPE-004 | measured | test_super_names_the_base_class_method → _pairs → _run_pipeline → _run_pipeline_inner → _build_stages → python_entry_seeds |
| REQ-DDB-PIPE-005 | measured | test_super_names_the_base_class_method → _pairs → _run_pipeline → _run_pipeline_inner → _build_stages → write_build_signature |
| REQ-DDB-PIPE-006 | inferred | test_super_names_the_base_class_method → _pairs → _run_pipeline → _run_pipeline_inner → _build_stages → run_rustdoc → _require_nightly_rustdoc → clean_subprocess_env |
| REQ-DDB-PIPE-007 | measured | test_super_names_the_base_class_method → _pairs → _run_pipeline → _run_pipeline_inner → _build_stages → import_kconfig_gates |
| REQ-DDB-PIPE-008 | measured | test_super_names_the_base_class_method → _pairs → _run_pipeline → _run_pipeline_inner → _build_stages → ingest_file_docs |
| REQ-DDB-PIPE-009 | measured | test_super_names_the_base_class_method → _pairs → _run_pipeline → _run_pipeline_inner → _build_stages → prune_dominated_fuzzy_call_edges |
| REQ-DDB-PIPE-010 | measured | test_super_names_the_base_class_method → _pairs → _run_pipeline → _run_pipeline_inner → _build_stages → import_shared_key_edges_inferred → _build_inferred_edges |
| REQ-DDB-PIPE-011 | measured | test_super_names_the_base_class_method → _pairs → _run_pipeline → _run_pipeline_inner → _build_stages → import_ast_includes → run_harvest → _harvest_one_file → _parseable_file |
| REQ-DDB-PIPE-012 | measured | test_super_names_the_base_class_method → _pairs → _run_pipeline → _run_pipeline_inner → _build_stages → build_harvest_plan → js_symbol_harvester |
| REQ-DDB-PIPE-013 | measured | test_super_names_the_base_class_method → _pairs → _run_pipeline → _run_pipeline_inner → _build_stages → enrich_python_docstrings |
| REQ-DDB-PIPE-014 | measured | test_super_names_the_base_class_method → _pairs → _run_pipeline → _run_pipeline_inner → _build_stages → ingest_kerneldoc → within_repo |
| REQ-DDB-PIPE-015 | measured | test_super_names_the_base_class_method → _pairs → _run_pipeline → _run_pipeline_inner → _build_stages → import_config_defaults |
| REQ-DDB-QUERY-003 | measured | test_super_names_the_base_class_method → _pairs → _run_pipeline → _run_pipeline_inner → _build_stages → mark_test_scope |
| REQ-DDB-QUERY-011 | measured | test_super_names_the_base_class_method → _pairs → _run_pipeline → _run_pipeline_inner → _build_stages → extract_threads → _ensure_threads_tables |
| REQ-DDB-SCHEMA-001 | measured | test_super_names_the_base_class_method → _pairs → _run_pipeline → _run_pipeline_inner → _build_stages → extract_threads |
| REQ-DDB-SCHEMA-002 | measured | test_super_names_the_base_class_method → _pairs → _run_pipeline → _run_pipeline_inner → _build_stages → import_shared_key_edges_inferred → _writer_dispatch_map |
| REQ-DDB-SCHEMA-003 | measured | test_super_names_the_base_class_method → _pairs → _run_pipeline → _run_pipeline_inner → _build_stages → import_callback_registration_edges → _ensure_external_boundaries_table |
| REQ-DDB-SCHEMA-004 | measured | test_super_names_the_base_class_method → _pairs → _run_pipeline → _run_pipeline_inner → _build_stages → load_dispatch_manifest |
| REQ-DDB-SCHEMA-005 | measured | test_super_names_the_base_class_method → _pairs → _run_pipeline → _run_pipeline_inner → _build_stages → resolve_key_alias_prefixes |
| REQ-DDB-SCHEMA-006 | measured | test_super_names_the_base_class_method → _pairs → _run_pipeline → _run_pipeline_inner → _build_stages → ingest_requirements_yaml |
| REQ-DDB-SCHEMA-007 | measured | test_super_names_the_base_class_method → _pairs → _run_pipeline → _run_pipeline_inner → _build_stages → import_callback_registration_edges → _ensure_external_boundaries_table |
| REQ-DDB-SCHEMA-009 | measured | test_super_names_the_base_class_method → _pairs → _run_pipeline → _run_pipeline_inner → _build_stages → import_event_edges |
| REQ-DDB-SCHEMA-011 | measured | test_super_names_the_base_class_method → _pairs → _run_pipeline → _run_pipeline_inner → _build_stages → extract_context_conflicts |
| REQ-DDB-SCHEMA-012 | measured | test_super_names_the_base_class_method → _pairs → _run_pipeline → _run_pipeline_inner → _build_stages → load_dispatch_manifest → declaration_origin |
| REQ-DDB-SCHEMA-013 | measured | test_super_names_the_base_class_method → _pairs → _run_pipeline → _run_pipeline_inner → _build_stages → import_data_model_keys |
| REQ-DDB-SCHEMA-014 | measured | test_super_names_the_base_class_method → _pairs → _run_pipeline → _run_pipeline_inner → _build_stages → ingest_file_docs → ensure_file_docs_table |
| REQ-DDB-SCHEMA-015 | measured | test_super_names_the_base_class_method → _pairs → _run_pipeline → _run_pipeline_inner → _build_stages → ingest_requirements_yaml |
| REQ-DDB-WIKI-054 | inferred | test_super_names_the_base_class_method → _pairs → _run_pipeline → _run_pipeline_inner → _build_stages → recover_ast_symbols → _recover_into → all |
Source · 22 lines
def test_super_names_the_base_class_method(tmp_path) -> None:
"""W6: `super.run()` inside `B.run` was qualified as `B.run` — the override itself — so the
self-edge was pruned and `B.run -> A.run` never existed. `this.helper()` still resolves in B.
@brief super starts at the bases.
"""
pairs = _pairs(
tmp_path,
{
"src/shapes.ts": (
"export class A {\n run(): number { return 1; }\n}\n\n"
"export class B extends A {\n"
" run(): number { return super.run() + this.helper(); }\n"
" helper(): number { return 2; }\n"
"}\n"
)
},
)
assert ("src.shapes.B.run", "src.shapes.A.run") in pairs, pairs
assert ("src.shapes.B.run", "src.shapes.B.helper") in pairs, pairs
Activity · 3 steps
test_two_files_with_one_module_key_still_resolve_their_own_calls
None test_core_conventions.test_two_files_with_one_module_key_still_resolve_their_own_calls(tmp_path)
Same-file wins a module-key collision.
tests/test_core_conventions.py:97
Checks
assert ("src.a.test.f", "src.a.test.helper") in pairs, pairsassert ("src.a.test.g", "src.a.test.helper") in pairs, pairs
Result: passed
Verifies
| requirement | linked | path to the implementer |
|---|---|---|
| REQ-DDB-CLI-001 | measured | test_two_files_with_one_module_key_still_resolve_their_own_calls → _pairs → _run_pipeline → _run_pipeline_inner → report_stats |
| REQ-DDB-CLI-002 | inferred | test_two_files_with_one_module_key_still_resolve_their_own_calls → _pairs → _run_pipeline → _run_pipeline_inner → _build_stages → _doxygen_or_partial → _doxygen_stage → _run_doxygen_from_args → run_doxygen → doxygen_supports_sqlite3 |
| REQ-DDB-CONFIG-001 | measured | test_two_files_with_one_module_key_still_resolve_their_own_calls → _pairs → _run_pipeline → _run_pipeline_inner → _apply_declared_document → stated_document_meta |
| REQ-DDB-CONFIG-003 | inferred | test_two_files_with_one_module_key_still_resolve_their_own_calls → _pairs → _run_pipeline → _run_pipeline_inner → _build_stages → ingest_requirements_yaml → _is_flat_req_list |
| REQ-DDB-CONFIG-004 | measured | test_two_files_with_one_module_key_still_resolve_their_own_calls → _pairs → _run_pipeline → _run_pipeline_inner → _build_stages → resolve_preprocessor |
| REQ-DDB-CONFIG-005 | measured | test_two_files_with_one_module_key_still_resolve_their_own_calls → _pairs → _run_pipeline → _run_pipeline_inner → _build_stages → import_kconfig |
| REQ-DDB-CONFIG-006 | measured | test_two_files_with_one_module_key_still_resolve_their_own_calls → _pairs → _run_pipeline → _run_pipeline_inner → _recorded_entry_patterns → recorded_explicit |
| REQ-DDB-CONFIG-007 | measured | test_two_files_with_one_module_key_still_resolve_their_own_calls → _pairs → _run_pipeline → _run_pipeline_inner → _build_stages → write_build_signature |
| REQ-DDB-CONFIG-009 | measured | test_two_files_with_one_module_key_still_resolve_their_own_calls → _pairs → _run_pipeline → _run_pipeline_inner → _apply_toolchain_exclusions → load_toolchain_config |
| REQ-DDB-GUARD-012 | inferred | test_two_files_with_one_module_key_still_resolve_their_own_calls → _pairs → _run_pipeline → _run_pipeline_inner → _build_stages → load_guard_config → read_guard_config → read_requirements_section |
| REQ-DDB-GUARD-019 | inferred | test_two_files_with_one_module_key_still_resolve_their_own_calls → _pairs → _run_pipeline → _run_pipeline_inner → _build_stages → enrich_python_docstrings → summarize → parse_doxygen_tags |
| REQ-DDB-GUARD-024 | inferred | test_two_files_with_one_module_key_still_resolve_their_own_calls → _pairs → _run_pipeline → _run_pipeline_inner → _build_stages → enrich_python_docstrings → summarize → apply_autobrief |
| REQ-DDB-INDEX-001 | measured | test_two_files_with_one_module_key_still_resolve_their_own_calls → _pairs → _run_pipeline → _run_pipeline_inner → _verify_extra_input_is_read → effective_file_patterns |
| REQ-DDB-INDEX-002 | measured | test_two_files_with_one_module_key_still_resolve_their_own_calls → _pairs → _run_pipeline → build_lock |
| REQ-DDB-INDEX-003 | measured | test_two_files_with_one_module_key_still_resolve_their_own_calls → _pairs → _run_pipeline → _run_pipeline_inner → _build_stages → report_index_coverage |
| REQ-DDB-INDEX-004 | measured | test_two_files_with_one_module_key_still_resolve_their_own_calls → _pairs → _run_pipeline → _run_pipeline_inner → _build_stages → recover_ast_symbols |
| REQ-DDB-INDEX-005 | measured | test_two_files_with_one_module_key_still_resolve_their_own_calls → _pairs → _run_pipeline → _run_pipeline_inner → _build_stages → stamp_external_provenance |
| REQ-DDB-INDEX-006 | measured | test_two_files_with_one_module_key_still_resolve_their_own_calls → _pairs → _run_pipeline → _run_pipeline_inner → _build_stages → record_code_text → code_text_rows |
| REQ-DDB-INDEX-007 | measured | test_two_files_with_one_module_key_still_resolve_their_own_calls → _pairs → _run_pipeline → _run_pipeline_inner → _build_stages → record_owners |
| REQ-DDB-INDEX-008 | measured | test_two_files_with_one_module_key_still_resolve_their_own_calls → _pairs → _run_pipeline → _run_pipeline_inner → _build_stages → ingest_file_licenses |
| REQ-DDB-INDEX-009 | measured | test_two_files_with_one_module_key_still_resolve_their_own_calls → _pairs → _run_pipeline → _run_pipeline_inner → _build_stages → ingest_kerneldoc |
| REQ-DDB-INDEX-010 | measured | test_two_files_with_one_module_key_still_resolve_their_own_calls → _pairs → _run_pipeline → _run_pipeline_inner → _build_stages → import_ast_includes |
| REQ-DDB-INDEX-011 | measured | test_two_files_with_one_module_key_still_resolve_their_own_calls → _pairs → _run_pipeline → _run_pipeline_inner → _build_stages → import_property_keys |
| REQ-DDB-MCP-001 | measured | test_two_files_with_one_module_key_still_resolve_their_own_calls → _pairs → _run_pipeline → _run_pipeline_inner → _operator_excludes → meta_section |
| REQ-DDB-MCP-004 | measured | |
| REQ-DDB-PIPE-001 | measured | test_two_files_with_one_module_key_still_resolve_their_own_calls → _pairs → _run_pipeline → _run_pipeline_inner → _build_stages → enrich_database |
| REQ-DDB-PIPE-003 | measured | test_two_files_with_one_module_key_still_resolve_their_own_calls → _pairs → _run_pipeline → _run_pipeline_inner → _build_stages → build_call_edges |
| REQ-DDB-PIPE-004 | measured | test_two_files_with_one_module_key_still_resolve_their_own_calls → _pairs → _run_pipeline → _run_pipeline_inner → _build_stages → python_entry_seeds |
| REQ-DDB-PIPE-005 | measured | test_two_files_with_one_module_key_still_resolve_their_own_calls → _pairs → _run_pipeline → _run_pipeline_inner → _build_stages → write_build_signature |
| REQ-DDB-PIPE-006 | inferred | test_two_files_with_one_module_key_still_resolve_their_own_calls → _pairs → _run_pipeline → _run_pipeline_inner → _build_stages → run_rustdoc → _require_nightly_rustdoc → clean_subprocess_env |
| REQ-DDB-PIPE-007 | measured | test_two_files_with_one_module_key_still_resolve_their_own_calls → _pairs → _run_pipeline → _run_pipeline_inner → _build_stages → import_kconfig_gates |
| REQ-DDB-PIPE-008 | measured | test_two_files_with_one_module_key_still_resolve_their_own_calls → _pairs → _run_pipeline → _run_pipeline_inner → _build_stages → ingest_file_docs |
| REQ-DDB-PIPE-009 | measured | test_two_files_with_one_module_key_still_resolve_their_own_calls → _pairs → _run_pipeline → _run_pipeline_inner → _build_stages → prune_dominated_fuzzy_call_edges |
| REQ-DDB-PIPE-010 | measured | test_two_files_with_one_module_key_still_resolve_their_own_calls → _pairs → _run_pipeline → _run_pipeline_inner → _build_stages → import_shared_key_edges_inferred → _build_inferred_edges |
| REQ-DDB-PIPE-011 | measured | test_two_files_with_one_module_key_still_resolve_their_own_calls → _pairs → _run_pipeline → _run_pipeline_inner → _build_stages → import_ast_includes → run_harvest → _harvest_one_file → _parseable_file |
| REQ-DDB-PIPE-012 | measured | test_two_files_with_one_module_key_still_resolve_their_own_calls → _pairs → _run_pipeline → _run_pipeline_inner → _build_stages → build_harvest_plan → js_symbol_harvester |
| REQ-DDB-PIPE-013 | measured | test_two_files_with_one_module_key_still_resolve_their_own_calls → _pairs → _run_pipeline → _run_pipeline_inner → _build_stages → enrich_python_docstrings |
| REQ-DDB-PIPE-014 | measured | test_two_files_with_one_module_key_still_resolve_their_own_calls → _pairs → _run_pipeline → _run_pipeline_inner → _build_stages → ingest_kerneldoc → within_repo |
| REQ-DDB-PIPE-015 | measured | test_two_files_with_one_module_key_still_resolve_their_own_calls → _pairs → _run_pipeline → _run_pipeline_inner → _build_stages → import_config_defaults |
| REQ-DDB-QUERY-003 | measured | test_two_files_with_one_module_key_still_resolve_their_own_calls → _pairs → _run_pipeline → _run_pipeline_inner → _build_stages → mark_test_scope |
| REQ-DDB-QUERY-011 | measured | test_two_files_with_one_module_key_still_resolve_their_own_calls → _pairs → _run_pipeline → _run_pipeline_inner → _build_stages → extract_threads → _ensure_threads_tables |
| REQ-DDB-SCHEMA-001 | measured | test_two_files_with_one_module_key_still_resolve_their_own_calls → _pairs → _run_pipeline → _run_pipeline_inner → _build_stages → extract_threads |
| REQ-DDB-SCHEMA-002 | measured | test_two_files_with_one_module_key_still_resolve_their_own_calls → _pairs → _run_pipeline → _run_pipeline_inner → _build_stages → import_shared_key_edges_inferred → _writer_dispatch_map |
| REQ-DDB-SCHEMA-003 | measured | test_two_files_with_one_module_key_still_resolve_their_own_calls → _pairs → _run_pipeline → _run_pipeline_inner → _build_stages → import_callback_registration_edges → _ensure_external_boundaries_table |
| REQ-DDB-SCHEMA-004 | measured | test_two_files_with_one_module_key_still_resolve_their_own_calls → _pairs → _run_pipeline → _run_pipeline_inner → _build_stages → load_dispatch_manifest |
| REQ-DDB-SCHEMA-005 | measured | test_two_files_with_one_module_key_still_resolve_their_own_calls → _pairs → _run_pipeline → _run_pipeline_inner → _build_stages → resolve_key_alias_prefixes |
| REQ-DDB-SCHEMA-006 | measured | test_two_files_with_one_module_key_still_resolve_their_own_calls → _pairs → _run_pipeline → _run_pipeline_inner → _build_stages → ingest_requirements_yaml |
| REQ-DDB-SCHEMA-007 | measured | test_two_files_with_one_module_key_still_resolve_their_own_calls → _pairs → _run_pipeline → _run_pipeline_inner → _build_stages → import_callback_registration_edges → _ensure_external_boundaries_table |
| REQ-DDB-SCHEMA-009 | measured | test_two_files_with_one_module_key_still_resolve_their_own_calls → _pairs → _run_pipeline → _run_pipeline_inner → _build_stages → import_event_edges |
| REQ-DDB-SCHEMA-011 | measured | test_two_files_with_one_module_key_still_resolve_their_own_calls → _pairs → _run_pipeline → _run_pipeline_inner → _build_stages → extract_context_conflicts |
| REQ-DDB-SCHEMA-012 | measured | test_two_files_with_one_module_key_still_resolve_their_own_calls → _pairs → _run_pipeline → _run_pipeline_inner → _build_stages → load_dispatch_manifest → declaration_origin |
| REQ-DDB-SCHEMA-013 | measured | test_two_files_with_one_module_key_still_resolve_their_own_calls → _pairs → _run_pipeline → _run_pipeline_inner → _build_stages → import_data_model_keys |
| REQ-DDB-SCHEMA-014 | measured | test_two_files_with_one_module_key_still_resolve_their_own_calls → _pairs → _run_pipeline → _run_pipeline_inner → _build_stages → ingest_file_docs → ensure_file_docs_table |
| REQ-DDB-SCHEMA-015 | measured | test_two_files_with_one_module_key_still_resolve_their_own_calls → _pairs → _run_pipeline → _run_pipeline_inner → _build_stages → ingest_requirements_yaml |
| REQ-DDB-WIKI-054 | inferred | test_two_files_with_one_module_key_still_resolve_their_own_calls → _pairs → _run_pipeline → _run_pipeline_inner → _build_stages → recover_ast_symbols → _recover_into → all |
Source · 24 lines
def test_two_files_with_one_module_key_still_resolve_their_own_calls(tmp_path) -> None:
"""W8: `a.test.ts` and `a/test.ts` both become module `src.a.test`, so each file's own
`helper()` saw two equal definitions in "one scope" and every same-file call was refused. A
file's own definition is its lexical scope.
@brief Same-file wins a module-key collision.
"""
pairs = _pairs(
tmp_path,
{
"src/a.test.ts": (
"export function helper(): number { return 1; }\n"
"export function f(): number { return helper(); }\n"
),
"src/a/test.ts": (
"export function helper(): number { return 2; }\n"
"export function g(): number { return helper(); }\n"
),
},
)
assert ("src.a.test.f", "src.a.test.helper") in pairs, pairs
assert ("src.a.test.g", "src.a.test.helper") in pairs, pairs