test_cli_apply_scope_refuses_a_rejected_declaration

Tests › tests/test_scope.py

passed Passed in the packaged run.

What this test is for

Why it exists

FIELD-REPORTED: an excludes-only `.clew.yaml` — written by an operator trying to keep a 1.2GB vendored tree out of the index — was silently absorbed into the whole-repo tier (a buildlog WARNING, then the widest possible scope anyway), and cost a real build a 900s doxygen timeout under exactly the tree the declaration was trying to exclude. `_apply_scope` must now refuse instead, before doxygen ever runs.

Verifies REQ-DDB-PIPE-014

Given

  1. root = tmp_path / "repo"
  2. _write(root / "src" / "a.c")
2 more
  1. (root / ".clew.yaml").write_text("index_scope:\n excludes:\n - src\n", encoding="utf-8")
  2. args = _args( tmp_path / "clew.db", doxyfile=str(root / "Doxyfile"), scope=sc.SCOPE_FROM_GUARD, )
→

When

  1. _apply_scope(args, root)
→

Then

  1. ✓ raises SystemExit

What it exercises

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

thread `clew-first-build-` — `_first_build_worker` (clew/mcp_server/server.py) · 8 of 142 steps

… 97 earlier steps

thread startthread startthread startthread startclew/mcp_server/server.pyclew/mcp_server/server.pyclew/mcp_server/server.pyclew/mcp_server/server.pyclew/scope.pyclew/scope.pyclew/scope.pyclew/scope.pyclew/mcp_server/freshness.pyclew/mcp_server/freshness.pyclew/mcp_server/freshness.pyclew/mcp_server/freshness.pyclew/declaration.pyclew/declaration.pyclew/declaration.pyclew/declaration.pyother filesother filesother filesother filestry (line 3260)tryalt (line 1171)altopt (line 529)opt_first_build_worker98. notices → _code_notice98_code_notice99. _run_build_walked → declared_scope_rejection99declared_scope_rejection100. declared_scope_rejection → _declared_index_scope100_declared_index_scope▶ test enters101. _declared_index_scope → load_declaration_located101load_declaration_located102–105. load_declaration_located → _read_mapping102_read_mapping +3 more106. _checked_section → _checked_list_section106_checked_list_section107. _checked_list_section → all107all

… 18 steps between

thread startthread startthread startthread startclew/scope.pyclew/scope.pyclew/scope.pyclew/scope.pyclew/declaration.pyclew/declaration.pyclew/declaration.pyclew/declaration.pyother filesother filesother filesother filesloop (line 598)looploop (line 1416)loop_first_build_worker126–127. _checked_document → _checked_entries126_checked_entries +1 more128. _checked_section → _check_section_keys128_check_section_keys129. _declared_index_scope → _existing_paths129_existing_paths130. _existing_paths → _is_within130_is_within131. _declared_index_scope → _existing_paths131_existing_paths

… 11 later steps

2 more

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

Where the product reaches it

No product flow reaches this code: no product entry point's flow calls any of the functions this test calls.

Call flow

test_cli_apply_scope_refuses_a_rejected_declaration→_write→_args→_apply_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_cli_apply_scope_refuses_a_rejected_declaration_apply_scopedeclared_scope_rejectionREQ-DDB-CONFIG-001 · measured_apply_scope… 6 calls …_validate_nodeREQ-DDB-GUARD-012 · inferred_apply_scope… 6 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.