test_the_gate_git_path_cannot_run_the_trees_commands¶
Tests › tests/test_gitenv.py
What this test is for
Why it exists
THE SECOND HALF OF C1, MISSED BY THE FIRST PASS AND FOUND BY A TEST FOR SOMETHING ELSE. `clew.guard` deliberately shares no code with the pipeline, so it has its OWN git runner — `run_git(["git", …])` through an injectable `_default_run_command`. Routing the pipeline's five call sites through `git_argv` left all six of the gate's untouched, and the gate is the WORSE context: it runs on a developer's machine, as that developer, on whatever branch they have checked out to review.
Verifies REQ-DDB-PIPE-014
Given
sentinel = tmp_path / "gate-fsmonitor-ran"root = _hostile_config_repo(tmp_path / "hostile", sentinel)
2 more
(root / "src.c").write_text("int main(void) { return 0; }\n", encoding="utf-8")original = Path.cwd()
When
try: os.chdir(root) get_staged_diff("src.c") get_file_at_revision("src.c", "HEAD") finally: os.chdir(original)
Then
- ✓ sentinel.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.
`main` (clew/guard/main.py) · 5 of 357 steps
… 65 earlier steps
… 156 steps between
… 26 steps between
… 93 later steps
4 more
- thread `clew-first-build-` — `_first_build_worker` (clew/mcp_server/server.py) · 2 of 142 steps
- Build this wiki from the index · 2 of 400 steps
- Build, refresh and check the index · 2 of 153 steps
- clew — `main` (clew/cli.py) · 2 of 400 steps
tests/test_gitenv.py:213 · its file's page
What it checks (1)
assert not sentinel.exists(), ( "the pre-commit gate ran a command the inspected repository's own .git/config chose" )not attributed
Where the product reaches it
Call flow
test_the_gate_git_path_cannot_run_the_trees_commands→_hostile_config_repo→get_staged_diff→get_file_at_revisionWhat 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.
Requirements it verifies (1)
| requirement | linked by | implementers exercised |
|---|---|---|
| REQ-DDB-PIPE-014 | catalog | unknown |
Also reaches 2 requirements
Its run touches their code; that is reach, not proof.
- REQ-DDB-CONFIG-001 measured
- REQ-DDB-GUARD-023 measured