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

Show on the map →

Called by none

Calls _fixture, _repo, _specs, compose

Checks

  • assert "hal:REQ-HAL-002" not in tree.nodes

Result: passed

Verifies

requirementlinkedpath to the implementer
REQ-DDB-CONFIG-001measuredtest_a_dependency_catalogue_is_read_at_its_pin → compose → _root_source → declared_catalog → load_guard_config
REQ-DDB-CONFIG-003measuredtest_a_dependency_catalogue_is_read_at_its_pin → compose → _root_source → declared_catalog → _is_flat_req_list
REQ-DDB-GUARD-012inferredtest_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-024inferredtest_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-027measuredtest_a_dependency_catalogue_is_read_at_its_pin → compose → _walk → _nested_specs → git_text
REQ-DDB-SCHEMA-006measuredtest_a_dependency_catalogue_is_read_at_its_pin → compose → _root_source → declared_catalog → resolve_catalog_path
REQ-DDB-SCHEMA-015measuredtest_a_dependency_catalogue_is_read_at_its_pin → compose → _nodes → link_ids
REQ-DDB-WIKI-015measuredtest_a_dependency_catalogue_is_read_at_its_pin → compose → _root_source → declared_catalog
REQ-DDB-WIKI-040measuredtest_a_dependency_catalogue_is_read_at_its_pin → compose
REQ-DDB-WIKI-054inferredtest_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
lines 107–107product, pins = _fixture(tmp_path)lines 108–112_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", )lines 113–113tree = compose(product, "product", _specs(product, pins), probe=_no_index)lines 114–114assert "hal:REQ-HAL-002" not in tree.nodes

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

Show on the map →

Called by none

Calls _fixture, _root_db, _specs, compose

Checks

  • assert "lib:REQ-LIB-002" in tree.implemented_here
  • assert "lib:REQ-LIB-002" not in tree.unreached

Result: passed

Verifies

requirementlinkedpath to the implementer
REQ-DDB-CONFIG-001measuredtest_a_dependency_requirement_implemented_here_is_served_not_unreached → compose → _root_source → declared_catalog → load_guard_config
REQ-DDB-CONFIG-003measuredtest_a_dependency_requirement_implemented_here_is_served_not_unreached → compose → _root_source → declared_catalog → _is_flat_req_list
REQ-DDB-GUARD-012inferredtest_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-024inferredtest_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-027measuredtest_a_dependency_requirement_implemented_here_is_served_not_unreached → compose → _walk → _nested_specs → git_text
REQ-DDB-SCHEMA-006measuredtest_a_dependency_requirement_implemented_here_is_served_not_unreached → compose → _root_source → declared_catalog → resolve_catalog_path
REQ-DDB-SCHEMA-015measuredtest_a_dependency_requirement_implemented_here_is_served_not_unreached → compose → _nodes → link_ids
REQ-DDB-WIKI-015measuredtest_a_dependency_requirement_implemented_here_is_served_not_unreached → compose → _root_source → declared_catalog
REQ-DDB-WIKI-040measuredtest_a_dependency_requirement_implemented_here_is_served_not_unreached → compose
REQ-DDB-WIKI-054inferredtest_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
lines 323–323product, pins = _fixture(tmp_path)lines 324–324db = _root_db(tmp_path / "root.db", ("REQ-LIB-002",))lines 326–327def trace(_db: Path, _rid: str): return ((), ())lines 329–331tree = compose( product, "product", _specs(product, pins), probe=_no_index, trace=trace, root_db=db )lines 332–332assert "lib:REQ-LIB-002" in tree.implemented_herelines 333–333assert "lib:REQ-LIB-002" not in tree.unreached

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

Show on the map →

Called by none

Calls _build_argparser, _fixture, _run_pipeline, build_markdown

Checks

  • assert page.startswith("# Product trace") and "`lib:REQ-LIB-001`" in page
  • assert "Product-trace" in (out / "_Sidebar.md").read_text()

Result: passed

Verifies

requirementlinkedpath to the implementer
REQ-DDB-CLI-001measuredtest_a_markdown_wiki_with_pinned_catalogues_has_the_product_trace_page → _run_pipeline → _run_pipeline_inner → report_stats
REQ-DDB-CLI-002inferredtest_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-001measuredtest_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-003measuredtest_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-004measuredtest_a_markdown_wiki_with_pinned_catalogues_has_the_product_trace_page → _run_pipeline → _run_pipeline_inner → _build_stages → resolve_preprocessor
REQ-DDB-CONFIG-005measuredtest_a_markdown_wiki_with_pinned_catalogues_has_the_product_trace_page → _run_pipeline → _run_pipeline_inner → _build_stages → import_kconfig
REQ-DDB-CONFIG-006measuredtest_a_markdown_wiki_with_pinned_catalogues_has_the_product_trace_page → _run_pipeline → _run_pipeline_inner → _recorded_entry_patterns → recorded_explicit
REQ-DDB-CONFIG-007measuredtest_a_markdown_wiki_with_pinned_catalogues_has_the_product_trace_page → _run_pipeline → _run_pipeline_inner → _build_stages → write_build_signature
REQ-DDB-CONFIG-009measuredtest_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-012measuredtest_a_markdown_wiki_with_pinned_catalogues_has_the_product_trace_page → build_markdown → load_wiki_config → _requirements_section → read_requirements_section
REQ-DDB-GUARD-019measuredtest_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-022measured
REQ-DDB-GUARD-024measuredtest_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-027measuredtest_a_markdown_wiki_with_pinned_catalogues_has_the_product_trace_page → build_markdown → compose → _walk → _nested_specs → git_text
REQ-DDB-INDEX-001measuredtest_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-002measuredtest_a_markdown_wiki_with_pinned_catalogues_has_the_product_trace_page → _run_pipeline → build_lock
REQ-DDB-INDEX-003measuredtest_a_markdown_wiki_with_pinned_catalogues_has_the_product_trace_page → _run_pipeline → _run_pipeline_inner → _build_stages → report_index_coverage
REQ-DDB-INDEX-004measuredtest_a_markdown_wiki_with_pinned_catalogues_has_the_product_trace_page → _run_pipeline → _run_pipeline_inner → _build_stages → recover_ast_symbols
REQ-DDB-INDEX-005measuredtest_a_markdown_wiki_with_pinned_catalogues_has_the_product_trace_page → _run_pipeline → _run_pipeline_inner → _build_stages → stamp_external_provenance
REQ-DDB-INDEX-006measuredtest_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-007measuredtest_a_markdown_wiki_with_pinned_catalogues_has_the_product_trace_page → _run_pipeline → _run_pipeline_inner → _build_stages → record_owners
REQ-DDB-INDEX-008measuredtest_a_markdown_wiki_with_pinned_catalogues_has_the_product_trace_page → _run_pipeline → _run_pipeline_inner → _build_stages → ingest_file_licenses
REQ-DDB-INDEX-009measuredtest_a_markdown_wiki_with_pinned_catalogues_has_the_product_trace_page → _run_pipeline → _run_pipeline_inner → _build_stages → ingest_kerneldoc
REQ-DDB-INDEX-010measuredtest_a_markdown_wiki_with_pinned_catalogues_has_the_product_trace_page → _run_pipeline → _run_pipeline_inner → _build_stages → import_ast_includes
REQ-DDB-INDEX-011measuredtest_a_markdown_wiki_with_pinned_catalogues_has_the_product_trace_page → _run_pipeline → _run_pipeline_inner → _build_stages → import_property_keys
REQ-DDB-MCP-001measuredtest_a_markdown_wiki_with_pinned_catalogues_has_the_product_trace_page → _run_pipeline → _run_pipeline_inner → _operator_excludes → meta_section
REQ-DDB-MCP-004measured
REQ-DDB-PIPE-001measuredtest_a_markdown_wiki_with_pinned_catalogues_has_the_product_trace_page → _run_pipeline → _run_pipeline_inner → _build_stages → enrich_database
REQ-DDB-PIPE-003measuredtest_a_markdown_wiki_with_pinned_catalogues_has_the_product_trace_page → _run_pipeline → _run_pipeline_inner → _build_stages → build_call_edges
REQ-DDB-PIPE-004measuredtest_a_markdown_wiki_with_pinned_catalogues_has_the_product_trace_page → _run_pipeline → _run_pipeline_inner → _build_stages → python_entry_seeds
REQ-DDB-PIPE-005measuredtest_a_markdown_wiki_with_pinned_catalogues_has_the_product_trace_page → _run_pipeline → _run_pipeline_inner → _build_stages → write_build_signature
REQ-DDB-PIPE-006measuredtest_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-007measuredtest_a_markdown_wiki_with_pinned_catalogues_has_the_product_trace_page → _run_pipeline → _run_pipeline_inner → _build_stages → import_kconfig_gates
REQ-DDB-PIPE-008measuredtest_a_markdown_wiki_with_pinned_catalogues_has_the_product_trace_page → _run_pipeline → _run_pipeline_inner → _build_stages → ingest_file_docs
REQ-DDB-PIPE-009measuredtest_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-010measuredtest_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-011measuredtest_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-012measuredtest_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-013measuredtest_a_markdown_wiki_with_pinned_catalogues_has_the_product_trace_page → _run_pipeline → _run_pipeline_inner → _build_stages → enrich_python_docstrings
REQ-DDB-PIPE-014measuredtest_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-015measuredtest_a_markdown_wiki_with_pinned_catalogues_has_the_product_trace_page → _run_pipeline → _run_pipeline_inner → _build_stages → import_config_defaults
REQ-DDB-QUERY-001measuredtest_a_markdown_wiki_with_pinned_catalogues_has_the_product_trace_page → build_markdown → _all_flows → entry_point_flows → connect
REQ-DDB-QUERY-003measuredtest_a_markdown_wiki_with_pinned_catalogues_has_the_product_trace_page → build_markdown → _flow_page → derive_flow → qualified_name_of
REQ-DDB-QUERY-010inferredtest_a_markdown_wiki_with_pinned_catalogues_has_the_product_trace_page → build_markdown → _flow_page → derive_flow → _entry_rowids → function_candidates
REQ-DDB-QUERY-011measuredtest_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-001measuredtest_a_markdown_wiki_with_pinned_catalogues_has_the_product_trace_page → _run_pipeline → _run_pipeline_inner → _build_stages → extract_threads
REQ-DDB-SCHEMA-002measuredtest_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-003measuredtest_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-004measuredtest_a_markdown_wiki_with_pinned_catalogues_has_the_product_trace_page → _run_pipeline → _run_pipeline_inner → _build_stages → load_dispatch_manifest
REQ-DDB-SCHEMA-005measuredtest_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-006measuredtest_a_markdown_wiki_with_pinned_catalogues_has_the_product_trace_page → _run_pipeline → _run_pipeline_inner → _build_stages → ingest_requirements_yaml
REQ-DDB-SCHEMA-007measuredtest_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-009measuredtest_a_markdown_wiki_with_pinned_catalogues_has_the_product_trace_page → _run_pipeline → _run_pipeline_inner → _build_stages → import_event_edges
REQ-DDB-SCHEMA-011measuredtest_a_markdown_wiki_with_pinned_catalogues_has_the_product_trace_page → _run_pipeline → _run_pipeline_inner → _build_stages → extract_context_conflicts
REQ-DDB-SCHEMA-012measuredtest_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-013measuredtest_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-014measuredtest_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-015measuredtest_a_markdown_wiki_with_pinned_catalogues_has_the_product_trace_page → build_markdown → compose → _nodes → link_ids
REQ-DDB-WIKI-001inferredtest_a_markdown_wiki_with_pinned_catalogues_has_the_product_trace_page → build_markdown → _flow_page → derive_flow
REQ-DDB-WIKI-002measuredtest_a_markdown_wiki_with_pinned_catalogues_has_the_product_trace_page → build_markdown → _write_ci_summary → ci_summary
REQ-DDB-WIKI-004measured
REQ-DDB-WIKI-005measured
REQ-DDB-WIKI-010measuredtest_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-012measuredtest_a_markdown_wiki_with_pinned_catalogues_has_the_product_trace_page → build_markdown → _requirements → group_of
REQ-DDB-WIKI-015measuredtest_a_markdown_wiki_with_pinned_catalogues_has_the_product_trace_page → build_markdown → compose → _root_source → declared_catalog
REQ-DDB-WIKI-016measured
REQ-DDB-WIKI-018measuredtest_a_markdown_wiki_with_pinned_catalogues_has_the_product_trace_page → build_markdown → _all_flows → entry_point_flows
REQ-DDB-WIKI-022inferredtest_a_markdown_wiki_with_pinned_catalogues_has_the_product_trace_page → build_markdown → _requirements → first
REQ-DDB-WIKI-029inferredtest_a_markdown_wiki_with_pinned_catalogues_has_the_product_trace_page → build_markdown → _flow_page → flow_mermaid
REQ-DDB-WIKI-038measuredtest_a_markdown_wiki_with_pinned_catalogues_has_the_product_trace_page → build_markdown
REQ-DDB-WIKI-040measuredtest_a_markdown_wiki_with_pinned_catalogues_has_the_product_trace_page → build_markdown → compose
REQ-DDB-WIKI-041inferredtest_a_markdown_wiki_with_pinned_catalogues_has_the_product_trace_page → build_markdown → _flow_page → derive_flow
REQ-DDB-WIKI-054inferredtest_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
lines 386–386from clew.cli import _build_argparser, _run_pipelinelines 387–387from clew.wiki.markdown import build_markdownlines 389–389product, pins = _fixture(tmp_path)lines 390–390(product / "m.py").write_text('def go():\n """Go."""\n return 1\n')lines 391–394(product / ".clew.yaml").write_text( "requirements:\n external:\n" f" - {{name: lib, repo: ../lib, rev: {pins['lib']}, path: requirements.yaml}}\n" )lines 395–395db = tmp_path / "product.db"lines 396–396_run_pipeline(_build_argparser().parse_args(["--output", str(db), "--repo-root", str(product)]))lines 397–397out = build_markdown(product, db, tmp_path / "md", "github")lines 398–398page = (out / "Product-trace.md").read_text()lines 399–399assert page.startswith("# Product trace") and "`lib:REQ-LIB-001`" in pagelines 400–400assert "Product-trace" in (out / "_Sidebar.md").read_text()

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

Show on the map →

Called by none

Calls _catalogs, _fixture, _repo, _specs, compose

Checks

  • assert "hal:REQ-HAL-001" in tree.nodes

Result: passed

Verifies

requirementlinkedpath to the implementer
REQ-DDB-CONFIG-001measuredtest_a_repository_cycle_terminates → compose → _root_source → declared_catalog → load_guard_config
REQ-DDB-CONFIG-003measuredtest_a_repository_cycle_terminates → compose → _root_source → declared_catalog → _is_flat_req_list
REQ-DDB-GUARD-012inferredtest_a_repository_cycle_terminates → compose → _root_source → declared_catalog → load_guard_config → read_guard_config → read_requirements_section
REQ-DDB-GUARD-024inferredtest_a_repository_cycle_terminates → compose → _root_source → declared_catalog → load_guard_config → read_guard_config → load_config → apply_opt_in_languages
REQ-DDB-GUARD-027measuredtest_a_repository_cycle_terminates → compose → _walk → _nested_specs → git_text
REQ-DDB-SCHEMA-006measuredtest_a_repository_cycle_terminates → compose → _root_source → declared_catalog → resolve_catalog_path
REQ-DDB-SCHEMA-015measuredtest_a_repository_cycle_terminates → compose → _nodes → link_ids
REQ-DDB-WIKI-015measuredtest_a_repository_cycle_terminates → compose → _root_source → declared_catalog
REQ-DDB-WIKI-040measuredtest_a_repository_cycle_terminates → compose
REQ-DDB-WIKI-054inferredtest_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
lines 145–145product, pins = _fixture(tmp_path)lines 146–150hal = _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"])), )lines 151–155pins["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)), )lines 156–156tree = compose(product, "product", _specs(product, pins), probe=_no_index)lines 157–157assert "hal:REQ-HAL-001" in tree.nodes

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

Show on the map →

Called by none

Calls _fixture, _root_db, _specs, compose

Checks

  • assert "product:REQ-PRD-003" in tree.roots

Result: passed

Verifies

requirementlinkedpath to the implementer
REQ-DDB-CONFIG-001measuredtest_a_tagged_requirement_without_a_catalogue_entry_is_a_root → compose → _root_source → declared_catalog → load_guard_config
REQ-DDB-CONFIG-003measuredtest_a_tagged_requirement_without_a_catalogue_entry_is_a_root → compose → _root_source → declared_catalog → _is_flat_req_list
REQ-DDB-GUARD-012inferredtest_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-024inferredtest_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-027measuredtest_a_tagged_requirement_without_a_catalogue_entry_is_a_root → compose → _walk → _nested_specs → git_text
REQ-DDB-SCHEMA-006measuredtest_a_tagged_requirement_without_a_catalogue_entry_is_a_root → compose → _root_source → declared_catalog → resolve_catalog_path
REQ-DDB-SCHEMA-015measuredtest_a_tagged_requirement_without_a_catalogue_entry_is_a_root → compose → _nodes → link_ids
REQ-DDB-WIKI-015measuredtest_a_tagged_requirement_without_a_catalogue_entry_is_a_root → compose → _root_source → declared_catalog
REQ-DDB-WIKI-040measuredtest_a_tagged_requirement_without_a_catalogue_entry_is_a_root → compose
REQ-DDB-WIKI-054inferredtest_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
lines 305–305product, pins = _fixture(tmp_path)lines 306–306db = _root_db(tmp_path / "root.db", ("REQ-PRD-003",))lines 308–309def trace(_db: Path, _rid: str): return ((), ())lines 311–313tree = compose( product, "product", _specs(product, pins), probe=_no_index, trace=trace, root_db=db )lines 314–314assert "product:REQ-PRD-003" in tree.roots

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

Show on the map →

Called by none

Calls _fixture, _specs, compose

Checks

  • assert node.evidence == "indexed"
  • assert node.implementers == ("retry_send",) and node.tests == ("test_retry",)

Result: passed

Verifies

requirementlinkedpath to the implementer
REQ-DDB-CONFIG-001measuredtest_an_indexed_dependency_carries_its_trace → compose → _root_source → declared_catalog → load_guard_config
REQ-DDB-CONFIG-003measuredtest_an_indexed_dependency_carries_its_trace → compose → _root_source → declared_catalog → _is_flat_req_list
REQ-DDB-GUARD-012inferredtest_an_indexed_dependency_carries_its_trace → compose → _root_source → declared_catalog → load_guard_config → read_guard_config → read_requirements_section
REQ-DDB-GUARD-024inferredtest_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-027measuredtest_an_indexed_dependency_carries_its_trace → compose → _walk → _nested_specs → git_text
REQ-DDB-SCHEMA-006measuredtest_an_indexed_dependency_carries_its_trace → compose → _root_source → declared_catalog → resolve_catalog_path
REQ-DDB-SCHEMA-015measuredtest_an_indexed_dependency_carries_its_trace → compose → _nodes → link_ids
REQ-DDB-WIKI-015measuredtest_an_indexed_dependency_carries_its_trace → compose → _root_source → declared_catalog
REQ-DDB-WIKI-040measuredtest_an_indexed_dependency_carries_its_trace → compose
REQ-DDB-WIKI-054inferredtest_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
lines 202–202product, pins = _fixture(tmp_path)lines 204–205def indexed(dep: Path, pin: str, sha: str | None): return ("indexed", "", Path(f"/{dep.name}.db"))lines 207–208def trace(db: Path, req_id: str): return (("retry_send",), ("test_retry",)) if req_id == "REQ-LIB-001" else ((), ())lines 210–210tree = compose(product, "product", _specs(product, pins), probe=indexed, trace=trace)lines 211–211node = tree.nodes["lib:REQ-LIB-001"]lines 212–212assert node.evidence == "indexed"lines 213–213assert node.implementers == ("retry_send",) and node.tests == ("test_retry",)

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

Show on the map →

Called by none

Calls _fixture, _git, probe_index

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 note
  • assert state == "unknown" and "uncommitted" in note
  • assert state == "unknown" and pin[:12] in note

Result: passed

Verifies

requirementlinkedpath to the implementer
REQ-DDB-CONFIG-001measuredtest_evidence_is_withheld_unless_the_index_is_at_the_pin → probe_index → git_text → git_argv
REQ-DDB-GUARD-027measuredtest_evidence_is_withheld_unless_the_index_is_at_the_pin → probe_index → git_text
REQ-DDB-WIKI-040measuredtest_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
lines 166–166_, pins = _fixture(tmp_path)lines 167–167lib = tmp_path / "lib"lines 168–168db = tmp_path / "lib.db"lines 169–169db.write_text("")lines 170–170pin = pins["lib"]lines 172–173def probe(locate, stale): return probe_index(lib, pin, pin, locate=locate, is_stale=stale)lines 175–175assert probe(lambda _p: None, lambda *_: False)[0] == "absent"lines 176–176assert probe(lambda _p: db, lambda *_: False)[0] == "indexed"lines 177–177state, note, _ = probe(lambda _p: db, lambda *_: True)lines 178–178assert state == "unknown" and "older than" in notelines 179–179(lib / "requirements.yaml").write_text("requirements: {}\n")lines 180–180state, note, _ = probe(lambda _p: db, lambda *_: False)lines 181–181assert state == "unknown" and "uncommitted" in notelines 182–182_git(lib, "commit", "-qam", "moved")lines 183–183state, note, _ = probe(lambda _p: db, lambda *_: False)lines 184–184assert state == "unknown" and pin[:12] in note

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

Show on the map →

Called by none

Calls _fixture, _repo, _specs, compose

Checks

  • assert any("hal" in c and newer[:12] in c for c in tree.conflicts), tree.conflicts

Result: passed

Verifies

requirementlinkedpath to the implementer
REQ-DDB-CONFIG-001measuredtest_one_repository_pinned_twice_is_a_conflict → compose → _root_source → declared_catalog → load_guard_config
REQ-DDB-CONFIG-003measuredtest_one_repository_pinned_twice_is_a_conflict → compose → _root_source → declared_catalog → _is_flat_req_list
REQ-DDB-GUARD-012inferredtest_one_repository_pinned_twice_is_a_conflict → compose → _root_source → declared_catalog → load_guard_config → read_guard_config → read_requirements_section
REQ-DDB-GUARD-024inferredtest_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-027measuredtest_one_repository_pinned_twice_is_a_conflict → compose → _walk → _nested_specs → git_text
REQ-DDB-SCHEMA-006measuredtest_one_repository_pinned_twice_is_a_conflict → compose → _root_source → declared_catalog → resolve_catalog_path
REQ-DDB-SCHEMA-015measuredtest_one_repository_pinned_twice_is_a_conflict → compose → _nodes → link_ids
REQ-DDB-WIKI-015measuredtest_one_repository_pinned_twice_is_a_conflict → compose → _root_source → declared_catalog
REQ-DDB-WIKI-040measuredtest_one_repository_pinned_twice_is_a_conflict → compose
REQ-DDB-WIKI-054inferredtest_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
lines 134–134product, pins = _fixture(tmp_path)lines 135–135newer = _repo(tmp_path / "hal", "requirements:\n REQ-HAL-001:\n name: Timer v2\n")lines 136–136from clew.wiki.config import CatalogSpeclines 138–138specs = [*_specs(product, pins), CatalogSpec("hal2", "../hal", newer, "requirements.yaml")]lines 139–139tree = compose(product, "product", specs, probe=_no_index)lines 140–140assert any("hal" in c and newer[:12] in c for c in tree.conflicts), tree.conflicts

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

Show on the map →

Called by none

Calls _tree, product_markdown

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 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))

Result: passed

Verifies

requirementlinkedpath to the implementer
REQ-DDB-CONFIG-001measuredtest_the_markdown_output_carries_the_product_trace → _tree → compose → _root_source → declared_catalog → load_guard_config
REQ-DDB-CONFIG-003measuredtest_the_markdown_output_carries_the_product_trace → _tree → compose → _root_source → declared_catalog → _is_flat_req_list
REQ-DDB-GUARD-012inferredtest_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-024inferredtest_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-027measuredtest_the_markdown_output_carries_the_product_trace → _tree → compose → _walk → _nested_specs → git_text
REQ-DDB-SCHEMA-006measuredtest_the_markdown_output_carries_the_product_trace → _tree → compose → _root_source → declared_catalog → resolve_catalog_path
REQ-DDB-SCHEMA-015measuredtest_the_markdown_output_carries_the_product_trace → _tree → compose → _nodes → link_ids
REQ-DDB-WIKI-015measuredtest_the_markdown_output_carries_the_product_trace → _tree → compose → _root_source → declared_catalog
REQ-DDB-WIKI-040measuredtest_the_markdown_output_carries_the_product_trace → product_markdown
REQ-DDB-WIKI-054inferredtest_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
lines 359–359from clew.wiki.config import Audiencelines 360–360from clew.wiki.productpage import product_markdownlines 362–363def unknown(dep: Path, pin: str, sha: str | None): return ("unknown", f"not indexed at pin {pin[:12]}; checkout is at 0000", Path("/x.db"))lines 365–365tree, _pins = _tree(tmp_path, probe=unknown)lines 366–366md = product_markdown(tree, Audience())lines 367–367assert md.startswith("# Product trace")lines 368–372assert ( md.index("`product:REQ-PRD-001`") < md.index("`lib:REQ-LIB-001`") < md.index("`hal:REQ-HAL-001`") )lines 373–373assert "\n - `lib:REQ-LIB-001` Bounded retry **unknown**" in mdlines 374–374assert "not indexed at pin" in md and str((tmp_path / "lib").resolve()) in mdlines 375–377assert ( "REQ-PRD-999" in md and "## Nothing on the tree reaches" in md and "`lib:REQ-LIB-002`" in md )lines 378–380assert "<" not in md.replace("<br>", ""), ( "plain Markdown: no HTML a Markdown-only host would drop" )lines 381–381assert "Bounded retry" not in product_markdown(tree, Audience(exclude_requirement_text=True))

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

Show on the map →

Called by none

Calls _tree, product_html

Checks

  • 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

Result: passed

Verifies

requirementlinkedpath to the implementer
REQ-DDB-CONFIG-001measuredtest_the_page_draws_the_tree_with_each_rows_evidence_state → _tree → compose → _root_source → declared_catalog → load_guard_config
REQ-DDB-CONFIG-003measuredtest_the_page_draws_the_tree_with_each_rows_evidence_state → _tree → compose → _root_source → declared_catalog → _is_flat_req_list
REQ-DDB-GUARD-012inferredtest_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-024inferredtest_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-027measuredtest_the_page_draws_the_tree_with_each_rows_evidence_state → _tree → compose → _walk → _nested_specs → git_text
REQ-DDB-SCHEMA-006measuredtest_the_page_draws_the_tree_with_each_rows_evidence_state → _tree → compose → _root_source → declared_catalog → resolve_catalog_path
REQ-DDB-SCHEMA-015measuredtest_the_page_draws_the_tree_with_each_rows_evidence_state → _tree → compose → _nodes → link_ids
REQ-DDB-WIKI-015measuredtest_the_page_draws_the_tree_with_each_rows_evidence_state → _tree → compose → _root_source → declared_catalog
REQ-DDB-WIKI-022inferredtest_the_page_draws_the_tree_with_each_rows_evidence_state → product_html → _line → page_of
REQ-DDB-WIKI-040measuredtest_the_page_draws_the_tree_with_each_rows_evidence_state → product_html
REQ-DDB-WIKI-054inferredtest_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
lines 237–237from clew.wiki.productpage import product_htmllines 238–238from clew.wiki.config import Audiencelines 240–241def unknown(dep: Path, pin: str, sha: str | None): return ("unknown", f"not indexed at pin {pin[:12]}; checkout is at 0000", Path("/x.db"))lines 243–243tree, pins = _tree(tmp_path, probe=unknown)lines 244–244html = product_html(tree, Audience())lines 245–245assert "REQ-PRD-001" in html and "lib:REQ-LIB-001" in html and "hal:REQ-HAL-001" in htmllines 246–246assert html.index("REQ-PRD-001") < html.index("lib:REQ-LIB-001") < html.index("hal:REQ-HAL-001")lines 247–247assert "not indexed at pin" in html and str((tmp_path / "lib").resolve()) in htmllines 248–248assert "Bounded retry" in htmllines 249–249assert "REQ-PRD-999" in html, "a dangling link is listed"lines 250–250assert '<details class="unreached"' in html and "lib:REQ-LIB-002" in html

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

Show on the map →

Called by none

Calls _tree, product_html

Checks

  • assert "lib:REQ-LIB-001" in html and "Bounded retry" not in html

Result: passed

Verifies

requirementlinkedpath to the implementer
REQ-DDB-CONFIG-001measuredtest_the_page_obeys_the_audience → _tree → compose → _root_source → declared_catalog → load_guard_config
REQ-DDB-CONFIG-003measuredtest_the_page_obeys_the_audience → _tree → compose → _root_source → declared_catalog → _is_flat_req_list
REQ-DDB-GUARD-012inferredtest_the_page_obeys_the_audience → _tree → compose → _root_source → declared_catalog → load_guard_config → read_guard_config → read_requirements_section
REQ-DDB-GUARD-024inferredtest_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-027measuredtest_the_page_obeys_the_audience → _tree → compose → _walk → _nested_specs → git_text
REQ-DDB-SCHEMA-006measuredtest_the_page_obeys_the_audience → _tree → compose → _root_source → declared_catalog → resolve_catalog_path
REQ-DDB-SCHEMA-015measuredtest_the_page_obeys_the_audience → _tree → compose → _nodes → link_ids
REQ-DDB-WIKI-015measuredtest_the_page_obeys_the_audience → _tree → compose → _root_source → declared_catalog
REQ-DDB-WIKI-022inferredtest_the_page_obeys_the_audience → product_html → _line → page_of
REQ-DDB-WIKI-040measuredtest_the_page_obeys_the_audience → product_html
REQ-DDB-WIKI-054inferredtest_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
lines 255–255from clew.wiki.productpage import product_htmllines 256–256from clew.wiki.config import Audiencelines 258–258tree, _ = _tree(tmp_path)lines 259–259html = product_html(tree, Audience(exclude_requirement_text=True))lines 260–260assert "lib:REQ-LIB-001" in html and "Bounded retry" not in html

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 &lt;- lib:REQ-LIB-001 &lt;- hal:REQ-HAL-001; PRD-002 has no satisfier.

tests/test_wiki_composite.py:94

Show on the map →

Called by none

Calls _fixture, _specs, compose

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

requirementlinkedpath to the implementer
REQ-DDB-CONFIG-001measuredtest_the_tree_is_composed_transitively_and_namespaced → compose → _root_source → declared_catalog → load_guard_config
REQ-DDB-CONFIG-003measuredtest_the_tree_is_composed_transitively_and_namespaced → compose → _root_source → declared_catalog → _is_flat_req_list
REQ-DDB-GUARD-012inferredtest_the_tree_is_composed_transitively_and_namespaced → compose → _root_source → declared_catalog → load_guard_config → read_guard_config → read_requirements_section
REQ-DDB-GUARD-024inferredtest_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-027measuredtest_the_tree_is_composed_transitively_and_namespaced → compose → _walk → _nested_specs → git_text
REQ-DDB-SCHEMA-006measuredtest_the_tree_is_composed_transitively_and_namespaced → compose → _root_source → declared_catalog → resolve_catalog_path
REQ-DDB-SCHEMA-015measuredtest_the_tree_is_composed_transitively_and_namespaced → compose → _nodes → link_ids
REQ-DDB-WIKI-015measuredtest_the_tree_is_composed_transitively_and_namespaced → compose → _root_source → declared_catalog
REQ-DDB-WIKI-040measuredtest_the_tree_is_composed_transitively_and_namespaced → compose
REQ-DDB-WIKI-054inferredtest_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
lines 96–96product, pins = _fixture(tmp_path)lines 97–97tree = compose(product, "product", _specs(product, pins), probe=_no_index)lines 98–98assert tree.roots == ("product:REQ-PRD-001", "product:REQ-PRD-002")lines 99–99assert tree.nodes["product:REQ-PRD-001"].satisfied_by == ("lib:REQ-LIB-001",)lines 100–100assert tree.nodes["lib:REQ-LIB-001"].satisfied_by == ("hal:REQ-HAL-001",)lines 101–101assert tree.nodes["product:REQ-PRD-002"].satisfied_by == ()lines 102–102assert tree.nodes["hal:REQ-HAL-001"].pin == pins["hal"]

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

Show on the map →

Called by none

Calls _fixture, _repo, _specs, compose

Checks

  • assert "lib:REQ-LIB-002" in tree.unreached
  • assert ("lib:REQ-LIB-003", "product:REQ-PRD-999") in tree.dangling

Result: passed

Verifies

requirementlinkedpath to the implementer
REQ-DDB-CONFIG-001measuredtest_unreached_and_dangling_are_reported → compose → _root_source → declared_catalog → load_guard_config
REQ-DDB-CONFIG-003measuredtest_unreached_and_dangling_are_reported → compose → _root_source → declared_catalog → _is_flat_req_list
REQ-DDB-GUARD-012inferredtest_unreached_and_dangling_are_reported → compose → _root_source → declared_catalog → load_guard_config → read_guard_config → read_requirements_section
REQ-DDB-GUARD-024inferredtest_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-027measuredtest_unreached_and_dangling_are_reported → compose → _walk → _nested_specs → git_text
REQ-DDB-SCHEMA-006measuredtest_unreached_and_dangling_are_reported → compose → _root_source → declared_catalog → resolve_catalog_path
REQ-DDB-SCHEMA-015measuredtest_unreached_and_dangling_are_reported → compose → _nodes → link_ids
REQ-DDB-WIKI-015measuredtest_unreached_and_dangling_are_reported → compose → _root_source → declared_catalog
REQ-DDB-WIKI-040measuredtest_unreached_and_dangling_are_reported → compose
REQ-DDB-WIKI-054inferredtest_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

Activity · 5 steps
lines 119–119product, pins = _fixture(tmp_path)lines 120–126pins["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", )lines 127–127tree = compose(product, "product", _specs(product, pins), probe=_no_index)lines 128–128assert "lib:REQ-LIB-002" in tree.unreachedlines 129–129assert ("lib:REQ-LIB-003", "product:REQ-PRD-999") in tree.dangling