test_a_declared_exclude_outside_the_repository_is_dropped

Tests › tests/test_scope.py

passed Passed in the packaged run.

What this test is for

Why it exists

The same resolution bug on the quieter half. An exclude cannot leak a tree, but one pointing outside the repo silently excludes NOTHING while reading as honoured — the accepted-but-unread failure this module fixes everywhere else.

Verifies REQ-DDB-PIPE-014

Given

  1. root = tmp_path / "repo"
  2. (root / "src").mkdir(parents=True)
2 more
  1. (tmp_path / "outside").mkdir()
  2. (root / ".clew.yaml").write_text( "index_scope:\n roots: [src]\n excludes:\n - ../outside\n", encoding="utf-8" )
→

When

  1. derived = sc.derive_scope(root)
→

Then

  1. ✓ derived.source equals sc.SOURCE_DECLARED
  2. ✓ derived.excludes equals ()

What it exercises

The parts of the system's flows this test ran, measured by per-test coverage: lit steps ran in this test, dimmed ones did not, and ▶ marks where the test called in. Each title opens the whole flow with these steps lit.

clew — `main` (clew/cli.py) · 11 of 400 steps

… 10 earlier steps

command-line usercommand-line usercommand-line usercommand-line userclew/scope.pyclew/scope.pyclew/scope.pyclew/scope.pyother filesother filesother filesother filesalt (line 1171)altopt (line 529)optmain11. propose → build_context11build_context12. build_context → derive_scope12derive_scope13. derive_scope → _declared_index_scope13_declared_index_scope▶ test enters14. _declared_index_scope → load_declaration_located14load_declaration_located15–18. load_declaration_located → _read_mapping15_read_mapping +3 more19–20. _checked_section → _checked_list_section19_checked_list_section +1 more

… 18 steps between

command-line usercommand-line usercommand-line usercommand-line userclew/scope.pyclew/scope.pyclew/scope.pyclew/scope.pyother filesother filesother filesother filesloop (line 598)loopopt (line 696)optmain39–40. _checked_document → _checked_entries39_checked_entries +1 more41. _checked_section → _check_section_keys41_check_section_keys42–44. _declared_index_scope → _existing_paths42_existing_paths +2 more45–46. derive_scope → whole_repo_scope45whole_repo_scope +1 more

… 20 steps between

command-line usercommand-line usercommand-line usercommand-line userclew/scope.pyclew/scope.pyclew/scope.pyclew/scope.pyother filesother filesother filesother filesmain67–68. whole_repo_scope → _vendored_clause67_vendored_clause +1 more69. derive_scope → whole_repo_scope69whole_repo_scope▶ test enters70–71. build_context → repo_source_files70repo_source_files +1 more

… 329 later steps

2 more

tests/test_scope.py:634 · its file's page

What it checks (2)

  1. assert derived.source == sc.SOURCE_DECLARED observes derive_scope via derived
  2. assert derived.excludes == (), ( f"an exclude outside the repository must be dropped, not resolved; got {derived.excludes}" ) observes derive_scope via derived

Where the product reaches it

  • main → propose_main → propose → build_context → derive_scope (flow)

Call flow

test_a_declared_exclude_outside_the_repository_is_dropped→derive_scope

What it reaches

Each row runs from this test, through the calls it makes, to the code a requirement names. If that code breaks, the test's checks are what should catch it. Reaching is not proving: a check only proves what it observes. No mutation records were given, so these rows say what the test REACHES.

test_a_declared_exclude_outside_the_repository_is_dropped · 2 checksderive_scopeREQ-DDB-CONFIG-001 · measuredderive_scope… 5 calls …_validate_nodeREQ-DDB-GUARD-012 · inferredderive_scope… 5 calls …allREQ-DDB-WIKI-054 · inferred

Requirements it verifies (1)

requirementlinked byimplementers exercised
REQ-DDB-PIPE-014catalogunknown
Also reaches 3 requirements

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