passed Passed in the packaged run.
What this test is for Why it exists
A VALID config, no floor, and a staged file with nothing wrong in it: the hook still fails, because the catalog holds a requirement nothing implements. Before PG3 the hook never ran coverage, so this passed (rc 0) and the gap waited for someone to run `coverage` by hand.
Given
root = _repo(tmp_path)(root / "requirements.yaml").write_text( _CATALOG + " REQ-B-002:\n name: nobody implements this\n" )2 more monkeypatch.chdir(root)captured = capsys.readouterr()→ → Then
✓ main(["validate", "--no-git", "src/a.c"]) equals 0✓ main(["src/a.c"]) equals 1✓ captured.out + captured.err contains "REQ-B-002"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.
program launcherprogram launcher program launcherprogram launcher program launcher clew/guard/main.pyclew/guard/main.py clew/guard/main.pyclew/guard/main.py clew/guard/main.py clew/guard/config.pyclew/guard/config.py clew/guard/config.pyclew/guard/config.py clew/guard/config.py other filesother files other filesother files other files try (line 717) try opt (line 730) opt opt (line 733) opt opt (line 705) opt opt (line 445) opt loop (line 417) loop opt (line 420) opt alt (line 421) alt main 1. main → _check_retired_subcommand 1 _check_retired_subcommand ▶ test enters 2. _check_retired_subcommand → _first_positional 2 _first_positional 3–5. main → _run 3 _run +2 more 6. _run → build_parser 6 build_parser 7. build_parser → _add_validate_parser 7 _add_validate_parser 8. _add_validate_parser → list 8 list 9. list → link 9 link 10–14. build_parser → _add_impact_parser 10 _add_impact_parser +4 more 15–17. _run → _has_subcommand 15 _has_subcommand +2 more 18. _run → load_config 18 load_config 19. load_config → refuse_doxygen_guard_leftovers 19 refuse_doxygen_guard_leftovers 20. load_config → _fresh_defaults 20 _fresh_defaults 21–22. load_config → read_requirements_section 21 read_requirements_section +1 more 23–25. _validate_node → _validate_map_of 23 _validate_map_of +2 more 26–27. _validate_node → _validate_dict_node 26 _validate_dict_node +1 more 28. _validate_dict_node → _suggest_key 28 _suggest_key 29. _suggest_key → list 29 list 30. _validate_dict_node → _validate_node 30 _validate_node 31. load_config → _shared_facts 31 _shared_facts 32. _shared_facts → list 32 list 33–34. load_config → read_guard_section 33 read_guard_section +1 more 35–36. load_config → validate_config_schema 35 validate_config_schema +1 more … 8 steps between
program launcherprogram launcher program launcherprogram launcher program launcher program launcher clew/guard/main.pyclew/guard/main.py clew/guard/main.pyclew/guard/main.py clew/guard/main.py clew/guard/main.py clew/guard/config.pyclew/guard/config.py clew/guard/config.pyclew/guard/config.py clew/guard/config.py clew/guard/config.py clew/guard/impact.pyclew/guard/impact.py clew/guard/impact.pyclew/guard/impact.py clew/guard/impact.py clew/guard/impact.py clew/guard/checks.pyclew/guard/checks.py clew/guard/checks.pyclew/guard/checks.py clew/guard/checks.py clew/guard/checks.py other filesother files other filesother files other files other files loop (line 651) loop opt (line 653) opt opt (line 733) opt loop (line 391) loop loop (line 267) loop try (line 269) try opt (line 1336) opt alt (line 1344) alt loop (line 973) loop loop (line 974) loop loop (line 287) loop loop (line 288) loop try (line 345) try loop (line 326) loop loop (line 69) loop opt (line 178) opt main 45. deep_merge → deep_merge 45 deep_merge 46. load_config → deep_merge 46 deep_merge 47. _run → run_precommit 47 run_precommit 48. run_precommit → report_dir 48 report_dir 49. run_precommit → resolve_version_gate 49 resolve_version_gate 50. resolve_version_gate → get_validate 50 get_validate 51. resolve_version_gate → _detect_current_version 51 _detect_current_version 52. _detect_current_version → get_validate 52 get_validate 53–54. run_precommit → _report_violations 53 _report_violations +1 more 55. _validate_files → load_requirements_full 55 load_requirements_full 56. load_requirements_full → _get_requirements_config 56 _get_requirements_config 57. _get_requirements_config → get_requirements 57 get_requirements 58. _get_requirements_config → resolve_contained_path 58 resolve_contained_path 59. load_requirements_full → _validate_requirements 59 _validate_requirements 60. _validate_requirements → get_validate 60 get_validate 61. _validate_requirements → _summarise_id 61 _summarise_id 62. _validate_files → load_external_requirements 62 load_external_requirements 63. load_external_requirements → get_requirements 63 get_requirements 64. load_external_requirements → read_catalog_at 64 read_catalog_at 65–67. read_catalog_at → _refuse_url 65 _refuse_url +2 more 68–69. git_argv → _no_ext_diff 68 _no_ext_diff +1 more 70–71. read_catalog_at → _refuse_url 70 _refuse_url +1 more 72. _validate_files → get_requirements 72 get_requirements 73. _validate_files → check_satisfies 73 check_satisfies 74. check_satisfies → link_ids 74 link_ids 75. link_ids → satisfies_ids 75 satisfies_ids 76. _validate_files → load_failure_mode_ids 76 load_failure_mode_ids 77–78. load_failure_mode_ids → _get_requirements_config 77 _get_requirements_config +1 more 79. load_failure_mode_ids → modes_of 79 modes_of 80. _validate_files → validate_file 80 validate_file 81. validate_file → get_validate 81 get_validate 82. validate_file → excluded_by 82 excluded_by 83–84. excluded_by → compile_globs 83 compile_globs +1 more 85. validate_file → gate_exclusion 85 gate_exclusion 86–87. gate_exclusion → _gate_matcher 86 _gate_matcher +1 more 88–89. load_toolchain_config → _read_toml 88 _read_toml +1 more … 8 steps between
program launcherprogram launcher program launcherprogram launcher program launcher clew/guard/main.pyclew/guard/main.py clew/guard/main.pyclew/guard/main.py clew/guard/main.py clew/guard/config.pyclew/guard/config.py clew/guard/config.pyclew/guard/config.py clew/guard/config.py clew/guard/ts_parser.pyclew/guard/ts_parser.py clew/guard/ts_parser.pyclew/guard/ts_parser.py clew/guard/ts_parser.py other filesother files other filesother files other files opt (line 184) opt loop (line 186) loop opt (line 189) opt opt (line 98) opt opt (line 168) opt loop (line 647) loop opt (line 786) opt opt (line 652) opt main 98–99. load_toolchain_config → _entry_globs 98 _entry_globs +1 more 100. _gate_matcher → compile_globs 100 compile_globs 101. gate_exclusion → matches 101 matches 102. gate_exclusion → binary_file 102 binary_file 103. validate_file → parse_source_file 103 parse_source_file 104–109. parse_source_file → parse_source_file_with_content 104 parse_source_file_with_content +5 more 110. parse_content_for_file → language_for_file 110 language_for_file 111–112. language_for_file → language_for_extension 111 language_for_extension +1 more 113. language_for_file → _language_from_config 113 _language_from_config 114. parse_content_for_file → parse_functions 114 parse_functions 115. parse_functions → parse_functions_ts 115 parse_functions_ts 116. parse_functions_ts → get_parser_for_language 116 get_parser_for_language 117. parse_functions_ts → get_language_spec 117 get_language_spec 118–119. parse_functions_ts → _collect_functions 118 _collect_functions +1 more 120. _is_rust_test_item → _rust_attributes 120 _rust_attributes 121. _collect_functions → _enclosing_class_for 121 _enclosing_class_for 122. _enclosing_class_for → _rust_impl_self_type 122 _rust_impl_self_type 123. _collect_functions → _declared_function 123 _declared_function 124–125. _collect_functions → _append_declaration 124 _append_declaration +1 more … 1 step between
program launcherprogram launcher program launcherprogram launcher program launcher clew/guard/main.pyclew/guard/main.py clew/guard/main.pyclew/guard/main.py clew/guard/main.py clew/guard/config.pyclew/guard/config.py clew/guard/config.pyclew/guard/config.py clew/guard/config.py clew/guard/checks.pyclew/guard/checks.py clew/guard/checks.pyclew/guard/checks.py clew/guard/checks.py clew/guard/ts_parser.pyclew/guard/ts_parser.py clew/guard/ts_parser.pyclew/guard/ts_parser.py clew/guard/ts_parser.py other filesother files other filesother files other files loop (line 647) loop opt (line 377) opt alt (line 380) alt opt (line 383) opt opt (line 384) opt opt (line 400) opt opt (line 658) opt opt (line 681) opt opt (line 683) opt alt (line 684) alt opt (line 227) opt try (line 241) try main 127–128. _append_declaration → _qualified_enclosing 127 _qualified_enclosing +1 more 129–137. _collect_functions → _resolve_function_node 129 _resolve_function_node +8 more 138–140. _find_preceding_doxygen → _collect_rust_doc 138 _collect_rust_doc +2 more 141. _find_preceding_doxygen → _collect_c_comment 141 _collect_c_comment 142. _find_preceding_doxygen → _find_python_docstring_block 142 _find_python_docstring_block 143. _find_preceding_doxygen → parse_doxygen_tags 143 parse_doxygen_tags 144. _find_preceding_doxygen → apply_autobrief 144 apply_autobrief 145. _find_preceding_doxygen → _last_row 145 _last_row 146–149. _collect_functions → _qualified_enclosing 146 _qualified_enclosing +3 more 150. _js_returns_void → _function_carrier 150 _function_carrier 151. _collect_functions → _produced_class 151 _produced_class 152. _produced_class → _function_carrier 152 _function_carrier 153. _collect_functions → _collect_functions 153 _collect_functions 154. _collect_functions → _collect_functions 154 _collect_functions 155. validate_file → unconfigured_language 155 unconfigured_language 156. validate_file → check_file_presence 156 check_file_presence 157. check_file_presence → get_validate 157 get_validate 158–159. check_file_presence → _find_file_doxygen_start 158 _find_file_doxygen_start +1 more … 3 steps between
program launcherprogram launcher program launcherprogram launcher program launcher clew/guard/main.pyclew/guard/main.py clew/guard/main.pyclew/guard/main.py clew/guard/main.py clew/guard/config.pyclew/guard/config.py clew/guard/config.pyclew/guard/config.py clew/guard/config.py clew/guard/impact.pyclew/guard/impact.py clew/guard/impact.pyclew/guard/impact.py clew/guard/impact.py clew/guard/checks.pyclew/guard/checks.py clew/guard/checks.pyclew/guard/checks.py clew/guard/checks.py other filesother files other filesother files other files opt (line 1198) opt loop (line 143) loop opt (line 1171) opt loop (line 181) loop loop (line 118) loop opt (line 120) opt opt (line 247) opt loop (line 631) loop loop (line 635) loop loop (line 638) loop main 163. _extract_file_block_text → _docstring_block 163 _docstring_block 164. _check_file_block_tags → parse_doxygen_tags 164 parse_doxygen_tags 165–170. parse_doxygen_tags → _mask_escaped_at 165 _mask_escaped_at +5 more 171. _check_file_block_tags → apply_autobrief 171 apply_autobrief 172–174. apply_autobrief → _mask_escaped_at 172 _mask_escaped_at +2 more 175. validate_file → check_presence 175 check_presence 176. check_presence → get_validate 176 get_validate 177–180. check_presence → _is_void_function 177 _is_void_function +3 more 181. validate_file → check_return_presence 181 check_return_presence 182. check_return_presence → get_validate 182 get_validate 183–184. check_return_presence → _require_return 183 _require_return +1 more 185. validate_file → check_tags 185 check_tags 186. check_tags → get_validate 186 get_validate 187. check_tags → _validate_tag_value 187 _validate_tag_value 188. validate_file → check_req_coverage 188 check_req_coverage 189. check_req_coverage → get_requirements 189 get_requirements 190. check_req_coverage → _has_active_requirements 190 _has_active_requirements 191. _has_active_requirements → load_requirements_full 191 load_requirements_full 192. _has_active_requirements → filter_requirements_by_version 192 filter_requirements_by_version … 4 steps between
program launcherprogram launcher program launcherprogram launcher clew/guard/main.pyclew/guard/main.py clew/guard/main.pyclew/guard/main.py clew/guard/config.pyclew/guard/config.py clew/guard/config.pyclew/guard/config.py clew/guard/impact.pyclew/guard/impact.py clew/guard/impact.pyclew/guard/impact.py clew/guard/checks.pyclew/guard/checks.py clew/guard/checks.pyclew/guard/checks.py loop (line 361) loop opt (line 374) opt opt (line 251) opt main 197. filter_requirements_by_version → compare_versions 197 compare_versions 198. filter_requirements_by_version → parse_version 198 parse_version 199. check_req_coverage → _has_version_gate 199 _has_version_gate 200. _has_version_gate → get_validate 200 get_validate 201. _has_version_gate → get_requirements 201 get_requirements 202. check_req_coverage → _exemption_hint 202 _exemption_hint 203. validate_file → check_bus_tags 203 check_bus_tags 204. check_bus_tags → get_validate 204 get_validate 205. check_bus_tags → _bus_tags 205 _bus_tags 206. _bus_tags → get_validate 206 get_validate … 2 steps between
program launcherprogram launcher program launcherprogram launcher program launcher clew/guard/main.pyclew/guard/main.py clew/guard/main.pyclew/guard/main.py clew/guard/main.py clew/guard/config.pyclew/guard/config.py clew/guard/config.pyclew/guard/config.py clew/guard/config.py clew/guard/checks.pyclew/guard/checks.py clew/guard/checks.pyclew/guard/checks.py clew/guard/checks.py other filesother files other filesother files other files loop (line 1337) loop loop (line 252) loop loop (line 780) loop opt (line 788) opt loop (line 1022) loop opt (line 1026) opt opt (line 260) opt loop (line 1096) loop opt (line 265) opt loop ×2 (line 598) loop ×2 main 209–210. check_bus_tags → _crosses_bus 209 _crosses_bus +1 more 211. validate_file → check_unknown_tags 211 check_unknown_tags 212. check_unknown_tags → get_validate 212 get_validate 213. check_unknown_tags → _event_tags 213 _event_tags 214–216. check_unknown_tags → _suggest_tag 214 _suggest_tag +2 more 217. _edit_distance → list 217 list 218. validate_file → check_removed_tags 218 check_removed_tags 219. validate_file → check_exemption_reasons 219 check_exemption_reasons 220. check_exemption_reasons → get_validate 220 get_validate 221. validate_file → check_duplicate_tags 221 check_duplicate_tags 222. check_duplicate_tags → get_validate 222 get_validate 223. validate_file → check_req_exists 223 check_req_exists 224. check_req_exists → get_validate 224 get_validate 225. check_req_exists → _uncheckable 225 _uncheckable 226. validate_file → check_fails_when_exists 226 check_fails_when_exists 227. validate_file → check_fails_when_markers 227 check_fails_when_markers 228. check_fails_when_markers → marker 228 marker 229. validate_file → get_file_at_revision 229 get_file_at_revision 230–231. get_file_at_revision → run_git 230 run_git +1 more 232. validate_file → parse_content_for_file 232 parse_content_for_file 233. validate_file → check_version_staleness 233 check_version_staleness 234. check_version_staleness → get_validate 234 get_validate 235–236. check_version_staleness → _index_by_identity 235 _index_by_identity ×2 … 5 steps between
program launcherprogram launcher program launcherprogram launcher program launcher clew/guard/main.pyclew/guard/main.py clew/guard/main.pyclew/guard/main.py clew/guard/main.py clew/guard/config.pyclew/guard/config.py clew/guard/config.pyclew/guard/config.py clew/guard/config.py clew/guard/impact.pyclew/guard/impact.py clew/guard/impact.pyclew/guard/impact.py clew/guard/impact.py clew/guard/checks.pyclew/guard/checks.py clew/guard/checks.pyclew/guard/checks.py clew/guard/checks.py other filesother files other filesother files other files loop (line 607) loop opt (line 482) opt opt (line 853) opt opt (line 114) opt opt (line 116) opt main 242–243. check_version_staleness → _check_one_version 242 _check_one_version +1 more 244. _validate_files → _report_skips 244 _report_skips 245. run_precommit → report_dir 245 report_dir 246. run_precommit → validate_output_path 246 validate_output_path 247. validate_output_path → resolve_contained_path 247 resolve_contained_path 248. run_precommit → get_requirements 248 get_requirements 249. run_precommit → get_branch_diff_range 249 get_branch_diff_range 250–251. get_branch_diff_range → get_merge_base 250 get_merge_base +1 more 252–253. get_branch_diff_range → _rev_parse_head 252 _rev_parse_head +1 more 254. run_precommit → impact_base 254 impact_base 255. run_precommit → impact_report 255 impact_report 256. impact_report → get_changed_files 256 get_changed_files 257. get_changed_files → run_git 257 run_git 258–260. impact_report → collect_changes 258 collect_changes +2 more 261. _get_file_diff → get_staged_diff 261 get_staged_diff 262. get_staged_diff → run_git 262 run_git 263. _get_file_diff → get_diff 263 get_diff 264. get_diff → run_git 264 run_git … 1 step between
program launcherprogram launcher program launcherprogram launcher clew/guard/main.pyclew/guard/main.py clew/guard/main.pyclew/guard/main.py clew/guard/config.pyclew/guard/config.py clew/guard/config.pyclew/guard/config.py clew/guard/impact.pyclew/guard/impact.py clew/guard/impact.pyclew/guard/impact.py other filesother files other filesother files opt (line 94) opt opt (line 98) opt loop (line 188) loop loop (line 583) loop opt (line 587) opt opt (line 482) opt opt (line 673) opt loop (line 684) loop loop ×2 (line 625) loop ×2 main 266. _collect_changed_lines → _get_file_diff 266 _get_file_diff 267. _collect_changed_lines → parse_changed_lines 267 parse_changed_lines 268. collect_changes → _extract_changed_functions 268 _extract_changed_functions 269. _extract_changed_functions → parse_source_file 269 parse_source_file 270. impact_report → find_index 270 find_index 271. find_index → registered_index 271 registered_index 272–275. impact_report → build_report 272 build_report +3 more 276–277. build_report → _place_untagged 276 _place_untagged +1 more 278. run_precommit → _write_report 278 _write_report 279–280. _write_report → validate_output_path 279 validate_output_path ×2 281. _write_report → format_markdown 281 format_markdown 282. format_markdown → _unmapped_markdown 282 _unmapped_markdown 283–284. format_markdown → _markdown_row 283 _markdown_row +1 more … 3 steps between
program launcherprogram launcher program launcherprogram launcher program launcher clew/guard/main.pyclew/guard/main.py clew/guard/main.pyclew/guard/main.py clew/guard/main.py clew/guard/config.pyclew/guard/config.py clew/guard/config.pyclew/guard/config.py clew/guard/config.py clew/guard/impact.pyclew/guard/impact.py clew/guard/impact.pyclew/guard/impact.py clew/guard/impact.py clew/guard/coverage.pyclew/guard/coverage.py clew/guard/coverage.pyclew/guard/coverage.py clew/guard/coverage.py other filesother files other filesother files other files opt (line 482) opt loop (line 179) loop loop (line 182) loop loop (line 208) loop loop (line 150) loop opt (line 57) opt main 288. _markdown_row → _cell 288 _cell 289. format_markdown → _unmapped_markdown 289 _unmapped_markdown 290. _write_report → format_json 290 format_json 291. run_precommit → git_add 291 git_add 292. git_add → run_git 292 run_git 293. run_precommit → format_markdown 293 format_markdown 294. run_precommit → _coverage_gate 294 _coverage_gate 295. _coverage_gate → get_requirements 295 get_requirements 296. _coverage_gate → analyze_coverage 296 analyze_coverage 297. analyze_coverage → load_requirements_full 297 load_requirements_full 298. analyze_coverage → collect_tagged_functions 298 collect_tagged_functions 299. collect_tagged_functions → find_source_files 299 find_source_files 300. find_source_files → get_validate 300 get_validate 301–306. find_source_files → _git_ls_files 301 _git_ls_files +5 more 307. collect_tagged_functions → _process_source_file 307 _process_source_file 308. _process_source_file → parse_source_file_with_content 308 parse_source_file_with_content 309. _process_source_file → _extract_tagged_function 309 _extract_tagged_function 310–312. analyze_coverage → _collect_req_ids 310 _collect_req_ids +2 more 313. _exempt → get_requirements 313 get_requirements 314. _exempt → exemption 314 exemption 315. exemption → list 315 list 316. analyze_coverage → traceability 316 traceability 317. traceability → is_test_path 317 is_test_path 318. is_test_path → _matcher 318 _matcher 319. analyze_coverage → covered_via 319 covered_via 320. covered_via → get_requirements 320 get_requirements … 4 steps between
program launcherprogram launcher program launcherprogram launcher program launcher clew/guard/main.pyclew/guard/main.py clew/guard/main.pyclew/guard/main.py clew/guard/main.py clew/guard/config.pyclew/guard/config.py clew/guard/config.pyclew/guard/config.py clew/guard/config.py clew/guard/impact.pyclew/guard/impact.py clew/guard/impact.pyclew/guard/impact.py clew/guard/impact.py clew/guard/coverage.pyclew/guard/coverage.py clew/guard/coverage.pyclew/guard/coverage.py clew/guard/coverage.py other filesother files other filesother files other files opt (line 250) opt opt (line 368) opt alt (line 608) alt main 325. _tagged_at_pin → git_text 325 git_text 326. _realised → exemption 326 exemption 327. _coverage_gate → coverage_gaps 327 coverage_gaps 328. _coverage_gate → format_coverage_text 328 format_coverage_text 329–331. format_coverage_text → traceability_line 329 traceability_line +2 more 332. _coverage_gate → traceability_line 332 traceability_line 333–336. _run → build_parser 333 build_parser +3 more 337. run_validate → _report_violations 337 _report_violations 338–340. run_validate → resolve_version_gate 338 resolve_version_gate +2 more 341. _dispatch_subcommand → _run_impact_command 341 _run_impact_command 342. _run_impact_command → impact_report 342 impact_report 343. _run_impact_command → format_report 343 format_report 344. format_report → 344 … 1 call not run 345. _run_impact_command → 345 … 2 calls not run 346. _dispatch_subcommand → _run_coverage_command 346 _run_coverage_command 347. _run_coverage_command → run_coverage 347 run_coverage 348–349. run_coverage → analyze_coverage 348 analyze_coverage +1 more 350. _dispatch_subcommand → _run_config_command 350 _run_config_command 351. _run_config_command → build_effective_contract 351 build_effective_contract 352. _run_config_command → build_schema_contract 352 build_schema_contract 353. _dispatch_subcommand → _run_files_command 353 _run_files_command 354. _run_files_command → build_files_contract 354 build_files_contract 355. _dispatch_subcommand → _run_doxyfile_command 355 _run_doxyfile_command 356. _run_doxyfile_command → build_fragment 356 build_fragment 357. _run → load_config 357 load_config 4 more tests/guard/test_guard_ratio_floor.py:84 · its file's page
What it checks (3) assert main(["validate", "--no-git", "src/a.c"]) == 0, "the staged file itself is clean" not attributed assert main(["src/a.c"]) == 1 not attributed assert "REQ-B-002" in captured.out + captured.err not attributed 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_the_pre_commit_hook_runs_the_coverage_gate→ _repo
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.
Also reaches 29 requirements Its run touches their code; that is reach, not proof.