test_a_planted_external_diff_never_runs

Tests › tests/test_security_surface.py

passed Passed in the packaged run.

What this test is for

Why it exists

diff.external in the tree's own config: not executed, and the diff still answers.

Verifies REQ-DDB-PIPE-014

Given

  1. repo = _repo_with_change(tmp_path)
  2. marker = tmp_path / "ran"
4 more
  1. script = tmp_path / "ext.sh"
  2. script.write_text(f"#!/bin/sh\ntouch {marker}\n")
  3. script.chmod(0o755)
  4. subprocess.run(["git", "config", "diff.external", str(script)], cwd=repo, check=True)
→

When

  1. for args in (("diff", "--cached"), ("log", "-p", "-1"), ("show", "HEAD")): out = subprocess.run(git_argv(*args), cwd=repo, capture_output=True, text=True) assert out.returncode == 0, (args, out.stderr)
  2. subprocess.run(git_argv("diff", "HEAD"), cwd=repo, capture_output=True, text=True)
→

Then

  1. ✓ marker.exists() is false

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) · 2 of 142 steps

… 2 earlier steps

thread startthread startthread startthread startclew/scope.pyclew/scope.pyclew/scope.pyclew/scope.pyother filesother filesother filesother filestry (line 1003)try_first_build_worker3. whole_repo_scope → _gitignored_paths3_gitignored_paths4. _gitignored_paths → git_argv4git_argv5. git_argv → _no_ext_diff5_no_ext_diff▶ test enters6. git_argv → list6list7. list → link7link8. _gitignored_paths → git_env8git_env

… 134 later steps

4 more

tests/test_security_surface.py:215 · its file's page

What it checks (2)

  1. assert out.returncode == 0, (args, out.stderr) observes git_argv via out
  2. assert not marker.exists(), "the tree's external diff program ran" not attributed

Where the product reaches it

  • build_wiki → _build_site → _commit → git_argv (flow)

Call flow

test_a_planted_external_diff_never_runs→_repo_with_change→git_argv

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_planted_external_diff_never_runs · 2 checksgit_argvREQ-DDB-CONFIG-001 · measured

Requirements it verifies (1)

requirementlinked byimplementers exercised
REQ-DDB-PIPE-014catalogunknown
Also reaches 1 requirement

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