test_wiki_composite.py¶
tests/test_wiki_composite.py
The composite requirement tree across pinned dependencies (GH #68, P6b-3a).
test_a_dependency_catalogue_is_read_at_its_pin
None test_wiki_composite.test_a_dependency_catalogue_is_read_at_its_pin(Path tmp_path)
hal gains REQ-HAL-002 after the pin: not in the tree.
tests/test_wiki_composite.py:105
Checks
assert "hal:REQ-HAL-002" not in tree.nodes
Result: passed
Verifies
| requirement | linked | path to the implementer |
|---|---|---|
| REQ-DDB-CONFIG-001 | measured | test_a_dependency_catalogue_is_read_at_its_pin → compose → _root_source → declared_catalog → load_guard_config |
| REQ-DDB-CONFIG-003 | measured | test_a_dependency_catalogue_is_read_at_its_pin → compose → _root_source → declared_catalog → _is_flat_req_list |
| REQ-DDB-GUARD-012 | inferred | test_a_dependency_catalogue_is_read_at_its_pin → compose → _root_source → declared_catalog → load_guard_config → read_guard_config → read_requirements_section |
| REQ-DDB-GUARD-024 | inferred | test_a_dependency_catalogue_is_read_at_its_pin → compose → _root_source → declared_catalog → load_guard_config → read_guard_config → load_config → apply_opt_in_languages |
| REQ-DDB-GUARD-027 | measured | test_a_dependency_catalogue_is_read_at_its_pin → compose → _walk → _nested_specs → git_text |
| REQ-DDB-SCHEMA-006 | measured | test_a_dependency_catalogue_is_read_at_its_pin → compose → _root_source → declared_catalog → resolve_catalog_path |
| REQ-DDB-SCHEMA-015 | measured | test_a_dependency_catalogue_is_read_at_its_pin → compose → _nodes → link_ids |
| REQ-DDB-WIKI-015 | measured | test_a_dependency_catalogue_is_read_at_its_pin → compose → _root_source → declared_catalog |
| REQ-DDB-WIKI-040 | measured | test_a_dependency_catalogue_is_read_at_its_pin → compose |
| REQ-DDB-WIKI-054 | inferred | test_a_dependency_catalogue_is_read_at_its_pin → compose → _root_source → declared_catalog → _is_flat_req_list → all |
Source · 12 lines
def test_a_dependency_catalogue_is_read_at_its_pin(tmp_path: Path) -> None:
"""@brief hal gains REQ-HAL-002 after the pin: not in the tree."""
product, pins = _fixture(tmp_path)
_repo(
tmp_path / "hal",
"requirements:\n REQ-HAL-001:\n name: Timer fires\n satisfies: lib:REQ-LIB-001\n"
" REQ-HAL-002:\n name: Later\n satisfies: lib:REQ-LIB-001\n",
)
tree = compose(product, "product", _specs(product, pins), probe=_no_index)
assert "hal:REQ-HAL-002" not in tree.nodes
Activity · 4 steps
test_a_dependency_requirement_implemented_here_is_served_not_unreached
None test_wiki_composite.test_a_dependency_requirement_implemented_here_is_served_not_unreached(Path tmp_path)
lib:REQ-LIB-002 tagged in the root's index: implemented_here.
tests/test_wiki_composite.py:317
Checks
assert "lib:REQ-LIB-002" in tree.implemented_hereassert "lib:REQ-LIB-002" not in tree.unreached
Result: passed
Verifies
| requirement | linked | path to the implementer |
|---|---|---|
| REQ-DDB-CONFIG-001 | measured | test_a_dependency_requirement_implemented_here_is_served_not_unreached → compose → _root_source → declared_catalog → load_guard_config |
| REQ-DDB-CONFIG-003 | measured | test_a_dependency_requirement_implemented_here_is_served_not_unreached → compose → _root_source → declared_catalog → _is_flat_req_list |
| REQ-DDB-GUARD-012 | inferred | test_a_dependency_requirement_implemented_here_is_served_not_unreached → compose → _root_source → declared_catalog → load_guard_config → read_guard_config → read_requirements_section |
| REQ-DDB-GUARD-024 | inferred | test_a_dependency_requirement_implemented_here_is_served_not_unreached → compose → _root_source → declared_catalog → load_guard_config → read_guard_config → load_config → apply_opt_in_languages |
| REQ-DDB-GUARD-027 | measured | test_a_dependency_requirement_implemented_here_is_served_not_unreached → compose → _walk → _nested_specs → git_text |
| REQ-DDB-SCHEMA-006 | measured | test_a_dependency_requirement_implemented_here_is_served_not_unreached → compose → _root_source → declared_catalog → resolve_catalog_path |
| REQ-DDB-SCHEMA-015 | measured | test_a_dependency_requirement_implemented_here_is_served_not_unreached → compose → _nodes → link_ids |
| REQ-DDB-WIKI-015 | measured | test_a_dependency_requirement_implemented_here_is_served_not_unreached → compose → _root_source → declared_catalog |
| REQ-DDB-WIKI-040 | measured | test_a_dependency_requirement_implemented_here_is_served_not_unreached → compose |
| REQ-DDB-WIKI-054 | inferred | test_a_dependency_requirement_implemented_here_is_served_not_unreached → compose → _root_source → declared_catalog → _is_flat_req_list → all |
Source · 19 lines
def test_a_dependency_requirement_implemented_here_is_served_not_unreached(tmp_path: Path) -> None:
"""A pinned catalogue's requirement this repository's own code tags is SERVED HERE — the W8
direction (a library implementing its product's catalogue) — never reported as unreached.
@brief lib:REQ-LIB-002 tagged in the root's index: implemented_here.
"""
product, pins = _fixture(tmp_path)
db = _root_db(tmp_path / "root.db", ("REQ-LIB-002",))
def trace(_db: Path, _rid: str):
return ((), ())
tree = compose(
product, "product", _specs(product, pins), probe=_no_index, trace=trace, root_db=db
)
assert "lib:REQ-LIB-002" in tree.implemented_here
assert "lib:REQ-LIB-002" not in tree.unreached
Activity · 6 steps
test_a_markdown_wiki_with_pinned_catalogues_has_the_product_trace_page
None test_wiki_composite.test_a_markdown_wiki_with_pinned_catalogues_has_the_product_trace_page(Path tmp_path)
#73 item 1, built: the page is written and listed in the GitHub sidebar.
tests/test_wiki_composite.py:384
Checks
assert page.startswith("# Product trace") and "`lib:REQ-LIB-001`" in pageassert "Product-trace" in (out / "_Sidebar.md").read_text()
Result: passed
Verifies
| requirement | linked | path to the implementer |
|---|---|---|
| REQ-DDB-CLI-001 | measured | test_a_markdown_wiki_with_pinned_catalogues_has_the_product_trace_page → _run_pipeline → _run_pipeline_inner → report_stats |
| REQ-DDB-CLI-002 | inferred | test_a_markdown_wiki_with_pinned_catalogues_has_the_product_trace_page → _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_a_markdown_wiki_with_pinned_catalogues_has_the_product_trace_page → _run_pipeline → _run_pipeline_inner → _apply_declared_document → stated_document_meta |
| REQ-DDB-CONFIG-003 | measured | test_a_markdown_wiki_with_pinned_catalogues_has_the_product_trace_page → build_markdown → compose → _root_source → declared_catalog → _is_flat_req_list |
| REQ-DDB-CONFIG-004 | measured | test_a_markdown_wiki_with_pinned_catalogues_has_the_product_trace_page → _run_pipeline → _run_pipeline_inner → _build_stages → resolve_preprocessor |
| REQ-DDB-CONFIG-005 | measured | test_a_markdown_wiki_with_pinned_catalogues_has_the_product_trace_page → _run_pipeline → _run_pipeline_inner → _build_stages → import_kconfig |
| REQ-DDB-CONFIG-006 | measured | test_a_markdown_wiki_with_pinned_catalogues_has_the_product_trace_page → _run_pipeline → _run_pipeline_inner → _recorded_entry_patterns → recorded_explicit |
| REQ-DDB-CONFIG-007 | measured | test_a_markdown_wiki_with_pinned_catalogues_has_the_product_trace_page → _run_pipeline → _run_pipeline_inner → _build_stages → write_build_signature |
| REQ-DDB-CONFIG-009 | measured | test_a_markdown_wiki_with_pinned_catalogues_has_the_product_trace_page → _run_pipeline → _run_pipeline_inner → _apply_toolchain_exclusions → load_toolchain_config |
| REQ-DDB-GUARD-012 | measured | test_a_markdown_wiki_with_pinned_catalogues_has_the_product_trace_page → build_markdown → load_wiki_config → _requirements_section → read_requirements_section |
| REQ-DDB-GUARD-019 | measured | test_a_markdown_wiki_with_pinned_catalogues_has_the_product_trace_page → _run_pipeline → _run_pipeline_inner → _build_stages → enrich_python_docstrings → summarize → parse_doxygen_tags |
| REQ-DDB-GUARD-022 | measured | |
| REQ-DDB-GUARD-024 | measured | test_a_markdown_wiki_with_pinned_catalogues_has_the_product_trace_page → _run_pipeline → _run_pipeline_inner → _build_stages → enrich_python_docstrings → summarize → apply_autobrief |
| REQ-DDB-GUARD-027 | measured | test_a_markdown_wiki_with_pinned_catalogues_has_the_product_trace_page → build_markdown → compose → _walk → _nested_specs → git_text |
| REQ-DDB-INDEX-001 | measured | test_a_markdown_wiki_with_pinned_catalogues_has_the_product_trace_page → _run_pipeline → _run_pipeline_inner → _verify_extra_input_is_read → effective_file_patterns |
| REQ-DDB-INDEX-002 | measured | test_a_markdown_wiki_with_pinned_catalogues_has_the_product_trace_page → _run_pipeline → build_lock |
| REQ-DDB-INDEX-003 | measured | test_a_markdown_wiki_with_pinned_catalogues_has_the_product_trace_page → _run_pipeline → _run_pipeline_inner → _build_stages → report_index_coverage |
| REQ-DDB-INDEX-004 | measured | test_a_markdown_wiki_with_pinned_catalogues_has_the_product_trace_page → _run_pipeline → _run_pipeline_inner → _build_stages → recover_ast_symbols |
| REQ-DDB-INDEX-005 | measured | test_a_markdown_wiki_with_pinned_catalogues_has_the_product_trace_page → _run_pipeline → _run_pipeline_inner → _build_stages → stamp_external_provenance |
| REQ-DDB-INDEX-006 | measured | test_a_markdown_wiki_with_pinned_catalogues_has_the_product_trace_page → _run_pipeline → _run_pipeline_inner → _build_stages → record_code_text → code_text_rows |
| REQ-DDB-INDEX-007 | measured | test_a_markdown_wiki_with_pinned_catalogues_has_the_product_trace_page → _run_pipeline → _run_pipeline_inner → _build_stages → record_owners |
| REQ-DDB-INDEX-008 | measured | test_a_markdown_wiki_with_pinned_catalogues_has_the_product_trace_page → _run_pipeline → _run_pipeline_inner → _build_stages → ingest_file_licenses |
| REQ-DDB-INDEX-009 | measured | test_a_markdown_wiki_with_pinned_catalogues_has_the_product_trace_page → _run_pipeline → _run_pipeline_inner → _build_stages → ingest_kerneldoc |
| REQ-DDB-INDEX-010 | measured | test_a_markdown_wiki_with_pinned_catalogues_has_the_product_trace_page → _run_pipeline → _run_pipeline_inner → _build_stages → import_ast_includes |
| REQ-DDB-INDEX-011 | measured | test_a_markdown_wiki_with_pinned_catalogues_has_the_product_trace_page → _run_pipeline → _run_pipeline_inner → _build_stages → import_property_keys |
| REQ-DDB-MCP-001 | measured | test_a_markdown_wiki_with_pinned_catalogues_has_the_product_trace_page → _run_pipeline → _run_pipeline_inner → _operator_excludes → meta_section |
| REQ-DDB-MCP-004 | measured | |
| REQ-DDB-PIPE-001 | measured | test_a_markdown_wiki_with_pinned_catalogues_has_the_product_trace_page → _run_pipeline → _run_pipeline_inner → _build_stages → enrich_database |
| REQ-DDB-PIPE-003 | measured | test_a_markdown_wiki_with_pinned_catalogues_has_the_product_trace_page → _run_pipeline → _run_pipeline_inner → _build_stages → build_call_edges |
| REQ-DDB-PIPE-004 | measured | test_a_markdown_wiki_with_pinned_catalogues_has_the_product_trace_page → _run_pipeline → _run_pipeline_inner → _build_stages → python_entry_seeds |
| REQ-DDB-PIPE-005 | measured | test_a_markdown_wiki_with_pinned_catalogues_has_the_product_trace_page → _run_pipeline → _run_pipeline_inner → _build_stages → write_build_signature |
| REQ-DDB-PIPE-006 | measured | test_a_markdown_wiki_with_pinned_catalogues_has_the_product_trace_page → _run_pipeline → _run_pipeline_inner → _build_stages → run_rustdoc → _require_nightly_rustdoc → clean_subprocess_env |
| REQ-DDB-PIPE-007 | measured | test_a_markdown_wiki_with_pinned_catalogues_has_the_product_trace_page → _run_pipeline → _run_pipeline_inner → _build_stages → import_kconfig_gates |
| REQ-DDB-PIPE-008 | measured | test_a_markdown_wiki_with_pinned_catalogues_has_the_product_trace_page → _run_pipeline → _run_pipeline_inner → _build_stages → ingest_file_docs |
| REQ-DDB-PIPE-009 | measured | test_a_markdown_wiki_with_pinned_catalogues_has_the_product_trace_page → _run_pipeline → _run_pipeline_inner → _build_stages → prune_dominated_fuzzy_call_edges |
| REQ-DDB-PIPE-010 | measured | test_a_markdown_wiki_with_pinned_catalogues_has_the_product_trace_page → _run_pipeline → _run_pipeline_inner → _build_stages → import_shared_key_edges_inferred → _build_inferred_edges |
| REQ-DDB-PIPE-011 | measured | test_a_markdown_wiki_with_pinned_catalogues_has_the_product_trace_page → _run_pipeline → _run_pipeline_inner → _build_stages → import_ast_includes → run_harvest → _harvest_one_file → _parseable_file |
| REQ-DDB-PIPE-012 | measured | test_a_markdown_wiki_with_pinned_catalogues_has_the_product_trace_page → _run_pipeline → _run_pipeline_inner → _build_stages → build_harvest_plan → js_symbol_harvester |
| REQ-DDB-PIPE-013 | measured | test_a_markdown_wiki_with_pinned_catalogues_has_the_product_trace_page → _run_pipeline → _run_pipeline_inner → _build_stages → enrich_python_docstrings |
| REQ-DDB-PIPE-014 | measured | test_a_markdown_wiki_with_pinned_catalogues_has_the_product_trace_page → _run_pipeline → _run_pipeline_inner → _build_stages → ingest_kerneldoc → within_repo |
| REQ-DDB-PIPE-015 | measured | test_a_markdown_wiki_with_pinned_catalogues_has_the_product_trace_page → _run_pipeline → _run_pipeline_inner → _build_stages → import_config_defaults |
| REQ-DDB-QUERY-001 | measured | test_a_markdown_wiki_with_pinned_catalogues_has_the_product_trace_page → build_markdown → _all_flows → entry_point_flows → connect |
| REQ-DDB-QUERY-003 | measured | test_a_markdown_wiki_with_pinned_catalogues_has_the_product_trace_page → build_markdown → _flow_page → derive_flow → qualified_name_of |
| REQ-DDB-QUERY-010 | inferred | test_a_markdown_wiki_with_pinned_catalogues_has_the_product_trace_page → build_markdown → _flow_page → derive_flow → _entry_rowids → function_candidates |
| REQ-DDB-QUERY-011 | measured | test_a_markdown_wiki_with_pinned_catalogues_has_the_product_trace_page → _run_pipeline → _run_pipeline_inner → _build_stages → extract_threads → _ensure_threads_tables |
| REQ-DDB-SCHEMA-001 | measured | test_a_markdown_wiki_with_pinned_catalogues_has_the_product_trace_page → _run_pipeline → _run_pipeline_inner → _build_stages → extract_threads |
| REQ-DDB-SCHEMA-002 | measured | test_a_markdown_wiki_with_pinned_catalogues_has_the_product_trace_page → _run_pipeline → _run_pipeline_inner → _build_stages → import_shared_key_edges_inferred → _writer_dispatch_map |
| REQ-DDB-SCHEMA-003 | measured | test_a_markdown_wiki_with_pinned_catalogues_has_the_product_trace_page → _run_pipeline → _run_pipeline_inner → _build_stages → import_callback_registration_edges → _ensure_external_boundaries_table |
| REQ-DDB-SCHEMA-004 | measured | test_a_markdown_wiki_with_pinned_catalogues_has_the_product_trace_page → _run_pipeline → _run_pipeline_inner → _build_stages → load_dispatch_manifest |
| REQ-DDB-SCHEMA-005 | measured | test_a_markdown_wiki_with_pinned_catalogues_has_the_product_trace_page → _run_pipeline → _run_pipeline_inner → _build_stages → resolve_key_alias_prefixes |
| REQ-DDB-SCHEMA-006 | measured | test_a_markdown_wiki_with_pinned_catalogues_has_the_product_trace_page → _run_pipeline → _run_pipeline_inner → _build_stages → ingest_requirements_yaml |
| REQ-DDB-SCHEMA-007 | measured | test_a_markdown_wiki_with_pinned_catalogues_has_the_product_trace_page → _run_pipeline → _run_pipeline_inner → _build_stages → import_callback_registration_edges → _ensure_external_boundaries_table |
| REQ-DDB-SCHEMA-009 | measured | test_a_markdown_wiki_with_pinned_catalogues_has_the_product_trace_page → _run_pipeline → _run_pipeline_inner → _build_stages → import_event_edges |
| REQ-DDB-SCHEMA-011 | measured | test_a_markdown_wiki_with_pinned_catalogues_has_the_product_trace_page → _run_pipeline → _run_pipeline_inner → _build_stages → extract_context_conflicts |
| REQ-DDB-SCHEMA-012 | measured | test_a_markdown_wiki_with_pinned_catalogues_has_the_product_trace_page → _run_pipeline → _run_pipeline_inner → _build_stages → load_dispatch_manifest → declaration_origin |
| REQ-DDB-SCHEMA-013 | measured | test_a_markdown_wiki_with_pinned_catalogues_has_the_product_trace_page → _run_pipeline → _run_pipeline_inner → _build_stages → import_data_model_keys |
| REQ-DDB-SCHEMA-014 | measured | test_a_markdown_wiki_with_pinned_catalogues_has_the_product_trace_page → _run_pipeline → _run_pipeline_inner → _build_stages → ingest_file_docs → ensure_file_docs_table |
| REQ-DDB-SCHEMA-015 | measured | test_a_markdown_wiki_with_pinned_catalogues_has_the_product_trace_page → build_markdown → compose → _nodes → link_ids |
| REQ-DDB-WIKI-001 | inferred | test_a_markdown_wiki_with_pinned_catalogues_has_the_product_trace_page → build_markdown → _flow_page → derive_flow |
| REQ-DDB-WIKI-002 | measured | test_a_markdown_wiki_with_pinned_catalogues_has_the_product_trace_page → build_markdown → _write_ci_summary → ci_summary |
| REQ-DDB-WIKI-004 | measured | |
| REQ-DDB-WIKI-005 | measured | |
| REQ-DDB-WIKI-010 | measured | test_a_markdown_wiki_with_pinned_catalogues_has_the_product_trace_page → build_markdown → _write_ci_summary → _test_results → parse_junit → fold_cases |
| REQ-DDB-WIKI-012 | measured | test_a_markdown_wiki_with_pinned_catalogues_has_the_product_trace_page → build_markdown → _requirements → group_of |
| REQ-DDB-WIKI-015 | measured | test_a_markdown_wiki_with_pinned_catalogues_has_the_product_trace_page → build_markdown → compose → _root_source → declared_catalog |
| REQ-DDB-WIKI-016 | measured | |
| REQ-DDB-WIKI-018 | measured | test_a_markdown_wiki_with_pinned_catalogues_has_the_product_trace_page → build_markdown → _all_flows → entry_point_flows |
| REQ-DDB-WIKI-022 | inferred | test_a_markdown_wiki_with_pinned_catalogues_has_the_product_trace_page → build_markdown → _requirements → first |
| REQ-DDB-WIKI-029 | inferred | test_a_markdown_wiki_with_pinned_catalogues_has_the_product_trace_page → build_markdown → _flow_page → flow_mermaid |
| REQ-DDB-WIKI-038 | measured | test_a_markdown_wiki_with_pinned_catalogues_has_the_product_trace_page → build_markdown |
| REQ-DDB-WIKI-040 | measured | test_a_markdown_wiki_with_pinned_catalogues_has_the_product_trace_page → build_markdown → compose |
| REQ-DDB-WIKI-041 | inferred | test_a_markdown_wiki_with_pinned_catalogues_has_the_product_trace_page → build_markdown → _flow_page → derive_flow |
| REQ-DDB-WIKI-054 | inferred | test_a_markdown_wiki_with_pinned_catalogues_has_the_product_trace_page → build_markdown → load_wiki_config → _comments → all |
Source · 17 lines
def test_a_markdown_wiki_with_pinned_catalogues_has_the_product_trace_page(tmp_path: Path) -> None:
"""@brief #73 item 1, built: the page is written and listed in the GitHub sidebar."""
from clew.cli import _build_argparser, _run_pipeline
from clew.wiki.markdown import build_markdown
product, pins = _fixture(tmp_path)
(product / "m.py").write_text('def go():\n """Go."""\n return 1\n')
(product / ".clew.yaml").write_text(
"requirements:\n external:\n"
f" - {{name: lib, repo: ../lib, rev: {pins['lib']}, path: requirements.yaml}}\n"
)
db = tmp_path / "product.db"
_run_pipeline(_build_argparser().parse_args(["--output", str(db), "--repo-root", str(product)]))
out = build_markdown(product, db, tmp_path / "md", "github")
page = (out / "Product-trace.md").read_text()
assert page.startswith("# Product trace") and "`lib:REQ-LIB-001`" in page
assert "Product-trace" in (out / "_Sidebar.md").read_text()1 more lines, not shown
Activity · 11 steps
test_a_repository_cycle_terminates
None test_wiki_composite.test_a_repository_cycle_terminates(Path tmp_path)
hal names lib back: the walk stops at a repository it has already read at that pin.
tests/test_wiki_composite.py:143
Checks
assert "hal:REQ-HAL-001" in tree.nodes
Result: passed
Verifies
| requirement | linked | path to the implementer |
|---|---|---|
| REQ-DDB-CONFIG-001 | measured | test_a_repository_cycle_terminates → compose → _root_source → declared_catalog → load_guard_config |
| REQ-DDB-CONFIG-003 | measured | test_a_repository_cycle_terminates → compose → _root_source → declared_catalog → _is_flat_req_list |
| REQ-DDB-GUARD-012 | inferred | test_a_repository_cycle_terminates → compose → _root_source → declared_catalog → load_guard_config → read_guard_config → read_requirements_section |
| REQ-DDB-GUARD-024 | inferred | test_a_repository_cycle_terminates → compose → _root_source → declared_catalog → load_guard_config → read_guard_config → load_config → apply_opt_in_languages |
| REQ-DDB-GUARD-027 | measured | test_a_repository_cycle_terminates → compose → _walk → _nested_specs → git_text |
| REQ-DDB-SCHEMA-006 | measured | test_a_repository_cycle_terminates → compose → _root_source → declared_catalog → resolve_catalog_path |
| REQ-DDB-SCHEMA-015 | measured | test_a_repository_cycle_terminates → compose → _nodes → link_ids |
| REQ-DDB-WIKI-015 | measured | test_a_repository_cycle_terminates → compose → _root_source → declared_catalog |
| REQ-DDB-WIKI-040 | measured | test_a_repository_cycle_terminates → compose |
| REQ-DDB-WIKI-054 | inferred | test_a_repository_cycle_terminates → compose → _root_source → declared_catalog → _is_flat_req_list → all |
Source · 17 lines
def test_a_repository_cycle_terminates(tmp_path: Path) -> None:
"""@brief hal names lib back: the walk stops at a repository it has already read at that pin."""
product, pins = _fixture(tmp_path)
hal = _repo(
tmp_path / "hal",
"requirements:\n REQ-HAL-001:\n name: Timer fires\n satisfies: lib:REQ-LIB-001\n",
_catalogs(("lib", "../lib", pins["lib"])),
)
pins["lib"] = _repo(
tmp_path / "lib",
"requirements:\n REQ-LIB-001:\n name: Bounded retry\n satisfies: product:REQ-PRD-001\n",
_catalogs(("hal", "../hal", hal)),
)
tree = compose(product, "product", _specs(product, pins), probe=_no_index)
assert "hal:REQ-HAL-001" in tree.nodes
Activity · 5 steps
test_a_requirement_with_a_page_here_links_to_it
None test_wiki_composite.test_a_requirement_with_a_page_here_links_to_it(Path tmp_path)
Product trace: requirement ids link to their pages.
tests/test_wiki_composite.py:336
Checks
assert '<a href="req-REQ-PRD-001.html"><code' in htmlassert 'href="req-lib' not in html and 'href="req-REQ-PRD-002' not in html
Result: passed
Verifies
| requirement | linked | path to the implementer |
|---|---|---|
| REQ-DDB-CONFIG-001 | measured | test_a_requirement_with_a_page_here_links_to_it → _tree → compose → _root_source → declared_catalog → load_guard_config |
| REQ-DDB-CONFIG-003 | measured | test_a_requirement_with_a_page_here_links_to_it → _tree → compose → _root_source → declared_catalog → _is_flat_req_list |
| REQ-DDB-GUARD-012 | inferred | test_a_requirement_with_a_page_here_links_to_it → _tree → compose → _root_source → declared_catalog → load_guard_config → read_guard_config → read_requirements_section |
| REQ-DDB-GUARD-024 | inferred | test_a_requirement_with_a_page_here_links_to_it → _tree → compose → _root_source → declared_catalog → load_guard_config → read_guard_config → load_config → apply_opt_in_languages |
| REQ-DDB-GUARD-027 | measured | test_a_requirement_with_a_page_here_links_to_it → _tree → compose → _walk → _nested_specs → git_text |
| REQ-DDB-SCHEMA-006 | measured | test_a_requirement_with_a_page_here_links_to_it → _tree → compose → _root_source → declared_catalog → resolve_catalog_path |
| REQ-DDB-SCHEMA-015 | measured | test_a_requirement_with_a_page_here_links_to_it → _tree → compose → _nodes → link_ids |
| REQ-DDB-WIKI-015 | measured | test_a_requirement_with_a_page_here_links_to_it → _tree → compose → _root_source → declared_catalog |
| REQ-DDB-WIKI-022 | measured | test_a_requirement_with_a_page_here_links_to_it → product_html → _line → page_of |
| REQ-DDB-WIKI-040 | measured | test_a_requirement_with_a_page_here_links_to_it → product_html |
| REQ-DDB-WIKI-054 | inferred | test_a_requirement_with_a_page_here_links_to_it → _tree → compose → _root_source → declared_catalog → _is_flat_req_list → all |
Source · 16 lines
def test_a_requirement_with_a_page_here_links_to_it(tmp_path: Path) -> None:
"""OWNER (round 5, P5.4): the product trace page gets links. A requirement that has a page in
THIS site links to it; one that does not (a dependency's, not implemented here) stays text, so
no link leads to a page that does not exist.
@brief Product trace: requirement ids link to their pages.
"""
from clew.wiki.config import Audience
from clew.wiki.productpage import product_html
tree, _ = _tree(tmp_path)
html = product_html(tree, Audience(), pages=frozenset({"REQ-PRD-001"}))
assert '<a href="req-REQ-PRD-001.html"><code' in html
assert 'href="req-lib' not in html and 'href="req-REQ-PRD-002' not in html
Activity · 6 steps
test_a_tagged_requirement_without_a_catalogue_entry_is_a_root
None test_wiki_composite.test_a_tagged_requirement_without_a_catalogue_entry_is_a_root(Path tmp_path)
REQ-PRD-003 is tagged only: a root.
tests/test_wiki_composite.py:299
Checks
assert "product:REQ-PRD-003" in tree.roots
Result: passed
Verifies
| requirement | linked | path to the implementer |
|---|---|---|
| REQ-DDB-CONFIG-001 | measured | test_a_tagged_requirement_without_a_catalogue_entry_is_a_root → compose → _root_source → declared_catalog → load_guard_config |
| REQ-DDB-CONFIG-003 | measured | test_a_tagged_requirement_without_a_catalogue_entry_is_a_root → compose → _root_source → declared_catalog → _is_flat_req_list |
| REQ-DDB-GUARD-012 | inferred | test_a_tagged_requirement_without_a_catalogue_entry_is_a_root → compose → _root_source → declared_catalog → load_guard_config → read_guard_config → read_requirements_section |
| REQ-DDB-GUARD-024 | inferred | test_a_tagged_requirement_without_a_catalogue_entry_is_a_root → compose → _root_source → declared_catalog → load_guard_config → read_guard_config → load_config → apply_opt_in_languages |
| REQ-DDB-GUARD-027 | measured | test_a_tagged_requirement_without_a_catalogue_entry_is_a_root → compose → _walk → _nested_specs → git_text |
| REQ-DDB-SCHEMA-006 | measured | test_a_tagged_requirement_without_a_catalogue_entry_is_a_root → compose → _root_source → declared_catalog → resolve_catalog_path |
| REQ-DDB-SCHEMA-015 | measured | test_a_tagged_requirement_without_a_catalogue_entry_is_a_root → compose → _nodes → link_ids |
| REQ-DDB-WIKI-015 | measured | test_a_tagged_requirement_without_a_catalogue_entry_is_a_root → compose → _root_source → declared_catalog |
| REQ-DDB-WIKI-040 | measured | test_a_tagged_requirement_without_a_catalogue_entry_is_a_root → compose |
| REQ-DDB-WIKI-054 | inferred | test_a_tagged_requirement_without_a_catalogue_entry_is_a_root → compose → _root_source → declared_catalog → _is_flat_req_list → all |
Source · 18 lines
def test_a_tagged_requirement_without_a_catalogue_entry_is_a_root(tmp_path: Path) -> None:
"""THE ROOT IS THIS REPOSITORY'S REQUIREMENTS, the set its Requirements page shows: catalogue
entries AND ids its code tags. A repository with no catalogue still has a tree.
@brief REQ-PRD-003 is tagged only: a root.
"""
product, pins = _fixture(tmp_path)
db = _root_db(tmp_path / "root.db", ("REQ-PRD-003",))
def trace(_db: Path, _rid: str):
return ((), ())
tree = compose(
product, "product", _specs(product, pins), probe=_no_index, trace=trace, root_db=db
)
assert "product:REQ-PRD-003" in tree.roots
Activity · 5 steps
test_an_indexed_dependency_carries_its_trace
None test_wiki_composite.test_an_indexed_dependency_carries_its_trace(Path tmp_path)
Indexed: implementers and tests come from that dependency's index.
tests/test_wiki_composite.py:200
Checks
assert node.evidence == "indexed"assert node.implementers == ("retry_send",) and node.tests == ("test_retry",)
Result: passed
Verifies
| requirement | linked | path to the implementer |
|---|---|---|
| REQ-DDB-CONFIG-001 | measured | test_an_indexed_dependency_carries_its_trace → compose → _root_source → declared_catalog → load_guard_config |
| REQ-DDB-CONFIG-003 | measured | test_an_indexed_dependency_carries_its_trace → compose → _root_source → declared_catalog → _is_flat_req_list |
| REQ-DDB-GUARD-012 | inferred | test_an_indexed_dependency_carries_its_trace → compose → _root_source → declared_catalog → load_guard_config → read_guard_config → read_requirements_section |
| REQ-DDB-GUARD-024 | inferred | test_an_indexed_dependency_carries_its_trace → compose → _root_source → declared_catalog → load_guard_config → read_guard_config → load_config → apply_opt_in_languages |
| REQ-DDB-GUARD-027 | measured | test_an_indexed_dependency_carries_its_trace → compose → _walk → _nested_specs → git_text |
| REQ-DDB-SCHEMA-006 | measured | test_an_indexed_dependency_carries_its_trace → compose → _root_source → declared_catalog → resolve_catalog_path |
| REQ-DDB-SCHEMA-015 | measured | test_an_indexed_dependency_carries_its_trace → compose → _nodes → link_ids |
| REQ-DDB-WIKI-015 | measured | test_an_indexed_dependency_carries_its_trace → compose → _root_source → declared_catalog |
| REQ-DDB-WIKI-040 | measured | test_an_indexed_dependency_carries_its_trace → compose |
| REQ-DDB-WIKI-054 | inferred | test_an_indexed_dependency_carries_its_trace → compose → _root_source → declared_catalog → _is_flat_req_list → all |
Source · 19 lines
def test_an_indexed_dependency_carries_its_trace(tmp_path: Path) -> None:
"""@brief Indexed: implementers and tests come from that dependency's index."""
product, pins = _fixture(tmp_path)
def indexed(dep: Path, pin: str, sha: str | None):
return ("indexed", "", Path(f"/{dep.name}.db"))
def trace(db: Path, req_id: str):
return (("retry_send",), ("test_retry",)) if req_id == "REQ-LIB-001" else ((), ())
tree = compose(product, "product", _specs(product, pins), probe=indexed, trace=trace)
node = tree.nodes["lib:REQ-LIB-001"]
assert node.evidence == "indexed"
assert node.implementers == ("retry_send",) and node.tests == ("test_retry",)
# --- P6b-3b: the page and `check` ------------------------------------------------------------------
Activity · 7 steps
test_an_unknown_dependency_carries_no_evidence_and_links_its_checkout
None test_wiki_composite.test_an_unknown_dependency_carries_no_evidence_and_links_its_checkout(Path tmp_path)
Unknown rows: implementers and tests None (absent, not empty), link = checkout.
tests/test_wiki_composite.py:187
Checks
assert node.evidence == "unknown" and node.implementers is None and node.tests is Noneassert node.link == str((tmp_path / "lib").resolve())
Result: passed
Verifies
| requirement | linked | path to the implementer |
|---|---|---|
| REQ-DDB-CONFIG-001 | measured | test_an_unknown_dependency_carries_no_evidence_and_links_its_checkout → compose → _root_source → declared_catalog → load_guard_config |
| REQ-DDB-CONFIG-003 | measured | test_an_unknown_dependency_carries_no_evidence_and_links_its_checkout → compose → _root_source → declared_catalog → _is_flat_req_list |
| REQ-DDB-GUARD-012 | inferred | test_an_unknown_dependency_carries_no_evidence_and_links_its_checkout → compose → _root_source → declared_catalog → load_guard_config → read_guard_config → read_requirements_section |
| REQ-DDB-GUARD-024 | inferred | test_an_unknown_dependency_carries_no_evidence_and_links_its_checkout → compose → _root_source → declared_catalog → load_guard_config → read_guard_config → load_config → apply_opt_in_languages |
| REQ-DDB-GUARD-027 | measured | test_an_unknown_dependency_carries_no_evidence_and_links_its_checkout → compose → _walk → _nested_specs → git_text |
| REQ-DDB-SCHEMA-006 | measured | test_an_unknown_dependency_carries_no_evidence_and_links_its_checkout → compose → _root_source → declared_catalog → resolve_catalog_path |
| REQ-DDB-SCHEMA-015 | measured | test_an_unknown_dependency_carries_no_evidence_and_links_its_checkout → compose → _nodes → link_ids |
| REQ-DDB-WIKI-015 | measured | test_an_unknown_dependency_carries_no_evidence_and_links_its_checkout → compose → _root_source → declared_catalog |
| REQ-DDB-WIKI-040 | measured | test_an_unknown_dependency_carries_no_evidence_and_links_its_checkout → compose |
| REQ-DDB-WIKI-054 | inferred | test_an_unknown_dependency_carries_no_evidence_and_links_its_checkout → compose → _root_source → declared_catalog → _is_flat_req_list → all |
Source · 13 lines
def test_an_unknown_dependency_carries_no_evidence_and_links_its_checkout(tmp_path: Path) -> None:
"""@brief Unknown rows: implementers and tests None (absent, not empty), link = checkout."""
product, pins = _fixture(tmp_path)
def unknown(dep: Path, pin: str, sha: str | None):
return ("unknown", f"not indexed at pin {pin[:12]}", Path("/nonexistent.db"))
tree = compose(product, "product", _specs(product, pins), probe=unknown)
node = tree.nodes["lib:REQ-LIB-001"]
assert node.evidence == "unknown" and node.implementers is None and node.tests is None
assert node.link == str((tmp_path / "lib").resolve())
Activity · 6 steps
test_check_reports_dangling_links_and_pin_conflicts
None test_wiki_composite.test_check_reports_dangling_links_and_pin_conflicts(Path tmp_path)
`clew wiki check`'s composite problems: the dangling id and the double pin, by name.
tests/test_wiki_composite.py:263
Checks
assert any("REQ-PRD-999" in p and "lib:REQ-LIB-003" in p for p in problems), problemsassert any("pinned at" in p for p in problems), problems
Result: passed
Verifies
| requirement | linked | path to the implementer |
|---|---|---|
| REQ-DDB-CONFIG-001 | measured | test_check_reports_dangling_links_and_pin_conflicts → composite_problems → compose → _root_source → declared_catalog → load_guard_config |
| REQ-DDB-CONFIG-003 | measured | test_check_reports_dangling_links_and_pin_conflicts → composite_problems → compose → _root_source → declared_catalog → _is_flat_req_list |
| REQ-DDB-GUARD-012 | inferred | test_check_reports_dangling_links_and_pin_conflicts → composite_problems → compose → _root_source → declared_catalog → load_guard_config → read_guard_config → read_requirements_section |
| REQ-DDB-GUARD-024 | inferred | test_check_reports_dangling_links_and_pin_conflicts → composite_problems → compose → _root_source → declared_catalog → load_guard_config → read_guard_config → load_config → apply_opt_in_languages |
| REQ-DDB-GUARD-027 | measured | test_check_reports_dangling_links_and_pin_conflicts → composite_problems → compose → _walk → _nested_specs → git_text |
| REQ-DDB-SCHEMA-006 | measured | test_check_reports_dangling_links_and_pin_conflicts → composite_problems → compose → _root_source → declared_catalog → resolve_catalog_path |
| REQ-DDB-SCHEMA-015 | measured | test_check_reports_dangling_links_and_pin_conflicts → composite_problems → compose → _nodes → link_ids |
| REQ-DDB-WIKI-015 | measured | test_check_reports_dangling_links_and_pin_conflicts → composite_problems → compose → _root_source → declared_catalog |
| REQ-DDB-WIKI-040 | measured | test_check_reports_dangling_links_and_pin_conflicts → composite_problems |
| REQ-DDB-WIKI-054 | inferred | test_check_reports_dangling_links_and_pin_conflicts → composite_problems → compose → _root_source → declared_catalog → _is_flat_req_list → all |
Source · 21 lines
def test_check_reports_dangling_links_and_pin_conflicts(tmp_path: Path) -> None:
"""@brief `clew wiki check`'s composite problems: the dangling id and the double pin, by name."""
from clew.wiki.composite import composite_problems
from clew.wiki.config import CatalogSpec
product, pins = _fixture(tmp_path)
pins["lib"] = _repo(
tmp_path / "lib",
"requirements:\n REQ-LIB-003:\n name: Broken\n satisfies: product:REQ-PRD-999\n",
_catalogs(("hal", "../hal", pins["hal"])),
)
newer = _repo(tmp_path / "hal", "requirements:\n REQ-HAL-001:\n name: Timer v2\n")
specs = [
CatalogSpec("hal2", "../hal", newer, "requirements.yaml"),
*_specs(product, pins),
]
problems = composite_problems(product, specs, probe=_no_index)
assert any("REQ-PRD-999" in p and "lib:REQ-LIB-003" in p for p in problems), problems
assert any("pinned at" in p for p in problems), problems
Activity · 9 steps
test_evidence_is_withheld_unless_the_index_is_at_the_pin
None test_wiki_composite.test_evidence_is_withheld_unless_the_index_is_at_the_pin(Path tmp_path)
probe_index states.
tests/test_wiki_composite.py:160
Checks
assert probe(lambda _p: None, lambda *_: False)[0] == "absent"assert probe(lambda _p: db, lambda *_: False)[0] == "indexed"assert state == "unknown" and "older than" in noteassert state == "unknown" and "uncommitted" in noteassert state == "unknown" and pin[:12] in note
Result: passed
Verifies
| requirement | linked | path to the implementer |
|---|---|---|
| REQ-DDB-CONFIG-001 | measured | test_evidence_is_withheld_unless_the_index_is_at_the_pin → probe_index → git_text → git_argv |
| REQ-DDB-GUARD-027 | measured | test_evidence_is_withheld_unless_the_index_is_at_the_pin → probe_index → git_text |
| REQ-DDB-WIKI-040 | measured | test_evidence_is_withheld_unless_the_index_is_at_the_pin → probe_index |
Source · 27 lines
def test_evidence_is_withheld_unless_the_index_is_at_the_pin(tmp_path: Path) -> None:
"""THE PIN RULE, each refusal named: no index -> absent; checkout moved past the pin, or
uncommitted changes, or a stale index -> unknown with the reason; all clear -> indexed.
@brief probe_index states.
"""
_, pins = _fixture(tmp_path)
lib = tmp_path / "lib"
db = tmp_path / "lib.db"
db.write_text("")
pin = pins["lib"]
def probe(locate, stale):
return probe_index(lib, pin, pin, locate=locate, is_stale=stale)
assert probe(lambda _p: None, lambda *_: False)[0] == "absent"
assert probe(lambda _p: db, lambda *_: False)[0] == "indexed"
state, note, _ = probe(lambda _p: db, lambda *_: True)
assert state == "unknown" and "older than" in note
(lib / "requirements.yaml").write_text("requirements: {}\n")
state, note, _ = probe(lambda _p: db, lambda *_: False)
assert state == "unknown" and "uncommitted" in note
_git(lib, "commit", "-qam", "moved")
state, note, _ = probe(lambda _p: db, lambda *_: False)
assert state == "unknown" and pin[:12] in note
Activity · 16 steps
test_one_repository_pinned_twice_is_a_conflict
None test_wiki_composite.test_one_repository_pinned_twice_is_a_conflict(Path tmp_path)
The product pins hal at a newer commit than lib does: reported, the first kept.
tests/test_wiki_composite.py:132
Checks
assert any("hal" in c and newer[:12] in c for c in tree.conflicts), tree.conflicts
Result: passed
Verifies
| requirement | linked | path to the implementer |
|---|---|---|
| REQ-DDB-CONFIG-001 | measured | test_one_repository_pinned_twice_is_a_conflict → compose → _root_source → declared_catalog → load_guard_config |
| REQ-DDB-CONFIG-003 | measured | test_one_repository_pinned_twice_is_a_conflict → compose → _root_source → declared_catalog → _is_flat_req_list |
| REQ-DDB-GUARD-012 | inferred | test_one_repository_pinned_twice_is_a_conflict → compose → _root_source → declared_catalog → load_guard_config → read_guard_config → read_requirements_section |
| REQ-DDB-GUARD-024 | inferred | test_one_repository_pinned_twice_is_a_conflict → compose → _root_source → declared_catalog → load_guard_config → read_guard_config → load_config → apply_opt_in_languages |
| REQ-DDB-GUARD-027 | measured | test_one_repository_pinned_twice_is_a_conflict → compose → _walk → _nested_specs → git_text |
| REQ-DDB-SCHEMA-006 | measured | test_one_repository_pinned_twice_is_a_conflict → compose → _root_source → declared_catalog → resolve_catalog_path |
| REQ-DDB-SCHEMA-015 | measured | test_one_repository_pinned_twice_is_a_conflict → compose → _nodes → link_ids |
| REQ-DDB-WIKI-015 | measured | test_one_repository_pinned_twice_is_a_conflict → compose → _root_source → declared_catalog |
| REQ-DDB-WIKI-040 | measured | test_one_repository_pinned_twice_is_a_conflict → compose |
| REQ-DDB-WIKI-054 | inferred | test_one_repository_pinned_twice_is_a_conflict → compose → _root_source → declared_catalog → _is_flat_req_list → all |
Source · 11 lines
def test_one_repository_pinned_twice_is_a_conflict(tmp_path: Path) -> None:
"""@brief The product pins hal at a newer commit than lib does: reported, the first kept."""
product, pins = _fixture(tmp_path)
newer = _repo(tmp_path / "hal", "requirements:\n REQ-HAL-001:\n name: Timer v2\n")
from clew.wiki.config import CatalogSpec
specs = [*_specs(product, pins), CatalogSpec("hal2", "../hal", newer, "requirements.yaml")]
tree = compose(product, "product", specs, probe=_no_index)
assert any("hal" in c and newer[:12] in c for c in tree.conflicts), tree.conflicts
Activity · 6 steps
test_the_markdown_output_carries_the_product_trace
None test_wiki_composite.test_the_markdown_output_carries_the_product_trace(Path tmp_path)
Product trace in Markdown.
tests/test_wiki_composite.py:352
Checks
assert md.startswith("# Product trace")assert (md.index("`product:REQ-PRD-001`") < md.index("`lib:REQ-LIB-001`") < md.index("`hal:REQ-HAL-001`") )assert "\n - `lib:REQ-LIB-001` Bounded retry **unknown**" in mdassert "not indexed at pin" in md and str((tmp_path / "lib").resolve()) in mdassert ("REQ-PRD-999" in md and "## Nothing on the tree reaches" in md and "`lib:REQ-LIB-002`" in md )assert "<" not in md.replace("<br>", ""), ("plain Markdown: no HTML a Markdown-only host would drop" )assert "Bounded retry" not in product_markdown(tree, Audience(exclude_requirement_text=True))
Result: passed
Verifies
| requirement | linked | path to the implementer |
|---|---|---|
| REQ-DDB-CONFIG-001 | measured | test_the_markdown_output_carries_the_product_trace → _tree → compose → _root_source → declared_catalog → load_guard_config |
| REQ-DDB-CONFIG-003 | measured | test_the_markdown_output_carries_the_product_trace → _tree → compose → _root_source → declared_catalog → _is_flat_req_list |
| REQ-DDB-GUARD-012 | inferred | test_the_markdown_output_carries_the_product_trace → _tree → compose → _root_source → declared_catalog → load_guard_config → read_guard_config → read_requirements_section |
| REQ-DDB-GUARD-024 | inferred | test_the_markdown_output_carries_the_product_trace → _tree → compose → _root_source → declared_catalog → load_guard_config → read_guard_config → load_config → apply_opt_in_languages |
| REQ-DDB-GUARD-027 | measured | test_the_markdown_output_carries_the_product_trace → _tree → compose → _walk → _nested_specs → git_text |
| REQ-DDB-SCHEMA-006 | measured | test_the_markdown_output_carries_the_product_trace → _tree → compose → _root_source → declared_catalog → resolve_catalog_path |
| REQ-DDB-SCHEMA-015 | measured | test_the_markdown_output_carries_the_product_trace → _tree → compose → _nodes → link_ids |
| REQ-DDB-WIKI-015 | measured | test_the_markdown_output_carries_the_product_trace → _tree → compose → _root_source → declared_catalog |
| REQ-DDB-WIKI-040 | measured | test_the_markdown_output_carries_the_product_trace → product_markdown |
| REQ-DDB-WIKI-054 | inferred | test_the_markdown_output_carries_the_product_trace → _tree → compose → _root_source → declared_catalog → _is_flat_req_list → all |
Source · 32 lines
def test_the_markdown_output_carries_the_product_trace(tmp_path: Path) -> None:
"""#73 item 1 (owner Q/A 2026-11-23, 2.1): hosts that take only Markdown (an Azure DevOps code
wiki) could not show the cross-repository tree — it existed only in the HTML site. The Markdown
page has the same tree, the same states (indexed / unknown + why / absent) and the same lists.
@brief Product trace in Markdown.
"""
from clew.wiki.config import Audience
from clew.wiki.productpage import product_markdown
def unknown(dep: Path, pin: str, sha: str | None):
return ("unknown", f"not indexed at pin {pin[:12]}; checkout is at 0000", Path("/x.db"))
tree, _pins = _tree(tmp_path, probe=unknown)
md = product_markdown(tree, Audience())
assert md.startswith("# Product trace")
assert (
md.index("`product:REQ-PRD-001`")
< md.index("`lib:REQ-LIB-001`")
< md.index("`hal:REQ-HAL-001`")
)
assert "\n - `lib:REQ-LIB-001` Bounded retry **unknown**" in md
assert "not indexed at pin" in md and str((tmp_path / "lib").resolve()) in md
assert (
"REQ-PRD-999" in md and "## Nothing on the tree reaches" in md and "`lib:REQ-LIB-002`" in md
)
assert "<" not in md.replace("<br>", ""), (
"plain Markdown: no HTML a Markdown-only host would drop"
)
assert "Bounded retry" not in product_markdown(tree, Audience(exclude_requirement_text=True))
Activity · 12 steps
test_the_page_draws_the_tree_with_each_rows_evidence_state
None test_wiki_composite.test_the_page_draws_the_tree_with_each_rows_evidence_state(Path tmp_path)
Product trace HTML.
tests/test_wiki_composite.py:232
Checks
assert "REQ-PRD-001" in html and "lib:REQ-LIB-001" in html and "hal:REQ-HAL-001" in htmlassert html.index("REQ-PRD-001") < html.index("lib:REQ-LIB-001") < html.index("hal:REQ-HAL-001")assert "not indexed at pin" in html and str((tmp_path / "lib").resolve()) in htmlassert "Bounded retry" in htmlassert "REQ-PRD-999" in html, "a dangling link is listed"assert '<details class="unreached"' in html and "lib:REQ-LIB-002" in html
Result: passed
Verifies
| requirement | linked | path to the implementer |
|---|---|---|
| REQ-DDB-CONFIG-001 | measured | test_the_page_draws_the_tree_with_each_rows_evidence_state → _tree → compose → _root_source → declared_catalog → load_guard_config |
| REQ-DDB-CONFIG-003 | measured | test_the_page_draws_the_tree_with_each_rows_evidence_state → _tree → compose → _root_source → declared_catalog → _is_flat_req_list |
| REQ-DDB-GUARD-012 | inferred | test_the_page_draws_the_tree_with_each_rows_evidence_state → _tree → compose → _root_source → declared_catalog → load_guard_config → read_guard_config → read_requirements_section |
| REQ-DDB-GUARD-024 | inferred | test_the_page_draws_the_tree_with_each_rows_evidence_state → _tree → compose → _root_source → declared_catalog → load_guard_config → read_guard_config → load_config → apply_opt_in_languages |
| REQ-DDB-GUARD-027 | measured | test_the_page_draws_the_tree_with_each_rows_evidence_state → _tree → compose → _walk → _nested_specs → git_text |
| REQ-DDB-SCHEMA-006 | measured | test_the_page_draws_the_tree_with_each_rows_evidence_state → _tree → compose → _root_source → declared_catalog → resolve_catalog_path |
| REQ-DDB-SCHEMA-015 | measured | test_the_page_draws_the_tree_with_each_rows_evidence_state → _tree → compose → _nodes → link_ids |
| REQ-DDB-WIKI-015 | measured | test_the_page_draws_the_tree_with_each_rows_evidence_state → _tree → compose → _root_source → declared_catalog |
| REQ-DDB-WIKI-022 | inferred | test_the_page_draws_the_tree_with_each_rows_evidence_state → product_html → _line → page_of |
| REQ-DDB-WIKI-040 | measured | test_the_page_draws_the_tree_with_each_rows_evidence_state → product_html |
| REQ-DDB-WIKI-054 | inferred | test_the_page_draws_the_tree_with_each_rows_evidence_state → _tree → compose → _root_source → declared_catalog → _is_flat_req_list → all |
Source · 21 lines
def test_the_page_draws_the_tree_with_each_rows_evidence_state(tmp_path: Path) -> None:
"""UNKNOWN SAYS WHY AND WHERE: the note and the local checkout, and no evidence columns.
@brief Product trace HTML.
"""
from clew.wiki.productpage import product_html
from clew.wiki.config import Audience
def unknown(dep: Path, pin: str, sha: str | None):
return ("unknown", f"not indexed at pin {pin[:12]}; checkout is at 0000", Path("/x.db"))
tree, pins = _tree(tmp_path, probe=unknown)
html = product_html(tree, Audience())
assert "REQ-PRD-001" in html and "lib:REQ-LIB-001" in html and "hal:REQ-HAL-001" in html
assert html.index("REQ-PRD-001") < html.index("lib:REQ-LIB-001") < html.index("hal:REQ-HAL-001")
assert "not indexed at pin" in html and str((tmp_path / "lib").resolve()) in html
assert "Bounded retry" in html
assert "REQ-PRD-999" in html, "a dangling link is listed"
assert '<details class="unreached"' in html and "lib:REQ-LIB-002" in html
Activity · 11 steps
test_the_page_obeys_the_audience
None test_wiki_composite.test_the_page_obeys_the_audience(Path tmp_path)
exclude_requirement_text: ids stay, titles go.
tests/test_wiki_composite.py:253
Checks
assert "lib:REQ-LIB-001" in html and "Bounded retry" not in html
Result: passed
Verifies
| requirement | linked | path to the implementer |
|---|---|---|
| REQ-DDB-CONFIG-001 | measured | test_the_page_obeys_the_audience → _tree → compose → _root_source → declared_catalog → load_guard_config |
| REQ-DDB-CONFIG-003 | measured | test_the_page_obeys_the_audience → _tree → compose → _root_source → declared_catalog → _is_flat_req_list |
| REQ-DDB-GUARD-012 | inferred | test_the_page_obeys_the_audience → _tree → compose → _root_source → declared_catalog → load_guard_config → read_guard_config → read_requirements_section |
| REQ-DDB-GUARD-024 | inferred | test_the_page_obeys_the_audience → _tree → compose → _root_source → declared_catalog → load_guard_config → read_guard_config → load_config → apply_opt_in_languages |
| REQ-DDB-GUARD-027 | measured | test_the_page_obeys_the_audience → _tree → compose → _walk → _nested_specs → git_text |
| REQ-DDB-SCHEMA-006 | measured | test_the_page_obeys_the_audience → _tree → compose → _root_source → declared_catalog → resolve_catalog_path |
| REQ-DDB-SCHEMA-015 | measured | test_the_page_obeys_the_audience → _tree → compose → _nodes → link_ids |
| REQ-DDB-WIKI-015 | measured | test_the_page_obeys_the_audience → _tree → compose → _root_source → declared_catalog |
| REQ-DDB-WIKI-022 | inferred | test_the_page_obeys_the_audience → product_html → _line → page_of |
| REQ-DDB-WIKI-040 | measured | test_the_page_obeys_the_audience → product_html |
| REQ-DDB-WIKI-054 | inferred | test_the_page_obeys_the_audience → _tree → compose → _root_source → declared_catalog → _is_flat_req_list → all |
Source · 10 lines
def test_the_page_obeys_the_audience(tmp_path: Path) -> None:
"""@brief exclude_requirement_text: ids stay, titles go."""
from clew.wiki.productpage import product_html
from clew.wiki.config import Audience
tree, _ = _tree(tmp_path)
html = product_html(tree, Audience(exclude_requirement_text=True))
assert "lib:REQ-LIB-001" in html and "Bounded retry" not in html
Activity · 5 steps
test_the_tree_is_composed_transitively_and_namespaced
None test_wiki_composite.test_the_tree_is_composed_transitively_and_namespaced(Path tmp_path)
PRD-001 <- lib:REQ-LIB-001 <- hal:REQ-HAL-001; PRD-002 has no satisfier.
tests/test_wiki_composite.py:94
Checks
assert tree.roots == ("product:REQ-PRD-001", "product:REQ-PRD-002")assert tree.nodes["product:REQ-PRD-001"].satisfied_by == ("lib:REQ-LIB-001",)assert tree.nodes["lib:REQ-LIB-001"].satisfied_by == ("hal:REQ-HAL-001",)assert tree.nodes["product:REQ-PRD-002"].satisfied_by == ()assert tree.nodes["hal:REQ-HAL-001"].pin == pins["hal"]
Result: passed
Verifies
| requirement | linked | path to the implementer |
|---|---|---|
| REQ-DDB-CONFIG-001 | measured | test_the_tree_is_composed_transitively_and_namespaced → compose → _root_source → declared_catalog → load_guard_config |
| REQ-DDB-CONFIG-003 | measured | test_the_tree_is_composed_transitively_and_namespaced → compose → _root_source → declared_catalog → _is_flat_req_list |
| REQ-DDB-GUARD-012 | inferred | test_the_tree_is_composed_transitively_and_namespaced → compose → _root_source → declared_catalog → load_guard_config → read_guard_config → read_requirements_section |
| REQ-DDB-GUARD-024 | inferred | test_the_tree_is_composed_transitively_and_namespaced → compose → _root_source → declared_catalog → load_guard_config → read_guard_config → load_config → apply_opt_in_languages |
| REQ-DDB-GUARD-027 | measured | test_the_tree_is_composed_transitively_and_namespaced → compose → _walk → _nested_specs → git_text |
| REQ-DDB-SCHEMA-006 | measured | test_the_tree_is_composed_transitively_and_namespaced → compose → _root_source → declared_catalog → resolve_catalog_path |
| REQ-DDB-SCHEMA-015 | measured | test_the_tree_is_composed_transitively_and_namespaced → compose → _nodes → link_ids |
| REQ-DDB-WIKI-015 | measured | test_the_tree_is_composed_transitively_and_namespaced → compose → _root_source → declared_catalog |
| REQ-DDB-WIKI-040 | measured | test_the_tree_is_composed_transitively_and_namespaced → compose |
| REQ-DDB-WIKI-054 | inferred | test_the_tree_is_composed_transitively_and_namespaced → compose → _root_source → declared_catalog → _is_flat_req_list → all |
Source · 11 lines
def test_the_tree_is_composed_transitively_and_namespaced(tmp_path: Path) -> None:
"""@brief PRD-001 <- lib:REQ-LIB-001 <- hal:REQ-HAL-001; PRD-002 has no satisfier."""
product, pins = _fixture(tmp_path)
tree = compose(product, "product", _specs(product, pins), probe=_no_index)
assert tree.roots == ("product:REQ-PRD-001", "product:REQ-PRD-002")
assert tree.nodes["product:REQ-PRD-001"].satisfied_by == ("lib:REQ-LIB-001",)
assert tree.nodes["lib:REQ-LIB-001"].satisfied_by == ("hal:REQ-HAL-001",)
assert tree.nodes["product:REQ-PRD-002"].satisfied_by == ()
assert tree.nodes["hal:REQ-HAL-001"].pin == pins["hal"]
Activity · 7 steps
test_unreached_and_dangling_are_reported
None test_wiki_composite.test_unreached_and_dangling_are_reported(Path tmp_path)
LIB-002 reaches nothing on the product's tree; a link to PRD-999 dangles.
tests/test_wiki_composite.py:117
Checks
assert "lib:REQ-LIB-002" in tree.unreachedassert ("lib:REQ-LIB-003", "product:REQ-PRD-999") in tree.dangling
Result: passed
Verifies
| requirement | linked | path to the implementer |
|---|---|---|
| REQ-DDB-CONFIG-001 | measured | test_unreached_and_dangling_are_reported → compose → _root_source → declared_catalog → load_guard_config |
| REQ-DDB-CONFIG-003 | measured | test_unreached_and_dangling_are_reported → compose → _root_source → declared_catalog → _is_flat_req_list |
| REQ-DDB-GUARD-012 | inferred | test_unreached_and_dangling_are_reported → compose → _root_source → declared_catalog → load_guard_config → read_guard_config → read_requirements_section |
| REQ-DDB-GUARD-024 | inferred | test_unreached_and_dangling_are_reported → compose → _root_source → declared_catalog → load_guard_config → read_guard_config → load_config → apply_opt_in_languages |
| REQ-DDB-GUARD-027 | measured | test_unreached_and_dangling_are_reported → compose → _walk → _nested_specs → git_text |
| REQ-DDB-SCHEMA-006 | measured | test_unreached_and_dangling_are_reported → compose → _root_source → declared_catalog → resolve_catalog_path |
| REQ-DDB-SCHEMA-015 | measured | test_unreached_and_dangling_are_reported → compose → _nodes → link_ids |
| REQ-DDB-WIKI-015 | measured | test_unreached_and_dangling_are_reported → compose → _root_source → declared_catalog |
| REQ-DDB-WIKI-040 | measured | test_unreached_and_dangling_are_reported → compose |
| REQ-DDB-WIKI-054 | inferred | test_unreached_and_dangling_are_reported → compose → _root_source → declared_catalog → _is_flat_req_list → all |
Source · 15 lines
def test_unreached_and_dangling_are_reported(tmp_path: Path) -> None:
"""@brief LIB-002 reaches nothing on the product's tree; a link to PRD-999 dangles."""
product, pins = _fixture(tmp_path)
pins["lib"] = _repo(
tmp_path / "lib",
"requirements:\n"
" REQ-LIB-001:\n name: Bounded retry\n satisfies: [product:REQ-PRD-001]\n"
" REQ-LIB-002:\n name: Unused\n"
" REQ-LIB-003:\n name: Broken\n satisfies: product:REQ-PRD-999\n",
)
tree = compose(product, "product", _specs(product, pins), probe=_no_index)
assert "lib:REQ-LIB-002" in tree.unreached
assert ("lib:REQ-LIB-003", "product:REQ-PRD-999") in tree.dangling