codmap 0.0.50__tar.gz → 0.0.51__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (225) hide show
  1. {codmap-0.0.50/codmap.egg-info → codmap-0.0.51}/PKG-INFO +2 -2
  2. {codmap-0.0.50 → codmap-0.0.51}/README.md +1 -1
  3. {codmap-0.0.50 → codmap-0.0.51}/codemap/extract/behavior.py +14 -7
  4. codmap-0.0.51/codemap/extract/external.py +145 -0
  5. {codmap-0.0.50 → codmap-0.0.51}/codemap/extract/griffe_extractor.py +7 -2
  6. {codmap-0.0.50 → codmap-0.0.51}/codemap/extract/roots.py +8 -15
  7. {codmap-0.0.50 → codmap-0.0.51}/codemap/incremental.py +6 -6
  8. {codmap-0.0.50 → codmap-0.0.51}/codemap/query.py +16 -9
  9. {codmap-0.0.50 → codmap-0.0.51}/codemap/serve/audit.py +7 -8
  10. {codmap-0.0.50 → codmap-0.0.51/codmap.egg-info}/PKG-INFO +2 -2
  11. {codmap-0.0.50 → codmap-0.0.51}/codmap.egg-info/SOURCES.txt +2 -0
  12. {codmap-0.0.50 → codmap-0.0.51}/pyproject.toml +1 -1
  13. codmap-0.0.51/tests/test_r1c106_dead_code.py +282 -0
  14. {codmap-0.0.50 → codmap-0.0.51}/tests/test_r1c46_shadowed_definitions.py +1 -1
  15. {codmap-0.0.50 → codmap-0.0.51}/LICENSE +0 -0
  16. {codmap-0.0.50 → codmap-0.0.51}/codemap/__init__.py +0 -0
  17. {codmap-0.0.50 → codmap-0.0.51}/codemap/__main__.py +0 -0
  18. {codmap-0.0.50 → codmap-0.0.51}/codemap/advise/__init__.py +0 -0
  19. {codmap-0.0.50 → codmap-0.0.51}/codemap/advise/data/feed.json +0 -0
  20. {codmap-0.0.50 → codmap-0.0.51}/codemap/advise/data/matrix.toml +0 -0
  21. {codmap-0.0.50 → codmap-0.0.51}/codemap/advise/refresh.py +0 -0
  22. {codmap-0.0.50 → codmap-0.0.51}/codemap/advise/render.py +0 -0
  23. {codmap-0.0.50 → codmap-0.0.51}/codemap/apidiff.py +0 -0
  24. {codmap-0.0.50 → codmap-0.0.51}/codemap/arch.py +0 -0
  25. {codmap-0.0.50 → codmap-0.0.51}/codemap/atomic.py +0 -0
  26. {codmap-0.0.50 → codmap-0.0.51}/codemap/cli.py +0 -0
  27. {codmap-0.0.50 → codmap-0.0.51}/codemap/devkit/__init__.py +0 -0
  28. {codmap-0.0.50 → codmap-0.0.51}/codemap/devkit/artifacts.py +0 -0
  29. {codmap-0.0.50 → codmap-0.0.51}/codemap/devkit/hooks.py +0 -0
  30. {codmap-0.0.50 → codmap-0.0.51}/codemap/devkit/install.py +0 -0
  31. {codmap-0.0.50 → codmap-0.0.51}/codemap/devkit/ratchet.py +0 -0
  32. {codmap-0.0.50 → codmap-0.0.51}/codemap/devkit/state.py +0 -0
  33. {codmap-0.0.50 → codmap-0.0.51}/codemap/devkit/templates/agents_block.md +0 -0
  34. {codmap-0.0.50 → codmap-0.0.51}/codemap/devkit/templates/agents_block.ru.md +0 -0
  35. {codmap-0.0.50 → codmap-0.0.51}/codemap/devkit/templates/brief.txt +0 -0
  36. {codmap-0.0.50 → codmap-0.0.51}/codemap/devkit/templates/claude_hooks.json +0 -0
  37. {codmap-0.0.50 → codmap-0.0.51}/codemap/devkit/templates/codex_region.toml +0 -0
  38. {codmap-0.0.50 → codmap-0.0.51}/codemap/devkit/templates/contract_head.toml +0 -0
  39. {codmap-0.0.50 → codmap-0.0.51}/codemap/devkit/templates/cycles_region.toml +0 -0
  40. {codmap-0.0.50 → codmap-0.0.51}/codemap/devkit/templates/github-workflow.yml +0 -0
  41. {codmap-0.0.50 → codmap-0.0.51}/codemap/devkit/templates/gitlab-ci.yml +0 -0
  42. {codmap-0.0.50 → codmap-0.0.51}/codemap/devkit/templates/mcp_claude.args +0 -0
  43. {codmap-0.0.50 → codmap-0.0.51}/codemap/devkit/templates/post-commit.sh +0 -0
  44. {codmap-0.0.50 → codmap-0.0.51}/codemap/devkit/templates/ratchet_region.toml +0 -0
  45. {codmap-0.0.50 → codmap-0.0.51}/codemap/devkit/usage.py +0 -0
  46. {codmap-0.0.50 → codmap-0.0.51}/codemap/diagnostics.py +0 -0
  47. {codmap-0.0.50 → codmap-0.0.51}/codemap/extract/__init__.py +0 -0
  48. {codmap-0.0.50 → codmap-0.0.51}/codemap/extract/attrflow.py +0 -0
  49. {codmap-0.0.50 → codmap-0.0.51}/codemap/extract/dataflow.py +0 -0
  50. {codmap-0.0.50 → codmap-0.0.51}/codemap/extract/dispatch.py +0 -0
  51. {codmap-0.0.50 → codmap-0.0.51}/codemap/extract/gsource.py +0 -0
  52. {codmap-0.0.50 → codmap-0.0.51}/codemap/extract/probe.py +0 -0
  53. {codmap-0.0.50 → codmap-0.0.51}/codemap/extract/union.py +0 -0
  54. {codmap-0.0.50 → codmap-0.0.51}/codemap/freshness.py +0 -0
  55. {codmap-0.0.50 → codmap-0.0.51}/codemap/integrations/__init__.py +0 -0
  56. {codmap-0.0.50 → codmap-0.0.51}/codemap/integrations/base.py +0 -0
  57. {codmap-0.0.50 → codmap-0.0.51}/codemap/integrations/cocoindex.py +0 -0
  58. {codmap-0.0.50 → codmap-0.0.51}/codemap/integrations/gate.py +0 -0
  59. {codmap-0.0.50 → codmap-0.0.51}/codemap/integrations/gitnexus.py +0 -0
  60. {codmap-0.0.50 → codmap-0.0.51}/codemap/integrations/registry.py +0 -0
  61. {codmap-0.0.50 → codmap-0.0.51}/codemap/integrations/transport.py +0 -0
  62. {codmap-0.0.50 → codmap-0.0.51}/codemap/model.py +0 -0
  63. {codmap-0.0.50 → codmap-0.0.51}/codemap/provenance.py +0 -0
  64. {codmap-0.0.50 → codmap-0.0.51}/codemap/scope.py +0 -0
  65. {codmap-0.0.50 → codmap-0.0.51}/codemap/serve/__init__.py +0 -0
  66. {codmap-0.0.50 → codmap-0.0.51}/codemap/serve/_scip_pb2.py +0 -0
  67. {codmap-0.0.50 → codmap-0.0.51}/codemap/serve/api_surface.py +0 -0
  68. {codmap-0.0.50 → codmap-0.0.51}/codemap/serve/apidiff.py +0 -0
  69. {codmap-0.0.50 → codmap-0.0.51}/codemap/serve/architecture.py +0 -0
  70. {codmap-0.0.50 → codmap-0.0.51}/codemap/serve/check.py +0 -0
  71. {codmap-0.0.50 → codmap-0.0.51}/codemap/serve/ctags.py +0 -0
  72. {codmap-0.0.50 → codmap-0.0.51}/codemap/serve/currency.py +0 -0
  73. {codmap-0.0.50 → codmap-0.0.51}/codemap/serve/impact.py +0 -0
  74. {codmap-0.0.50 → codmap-0.0.51}/codemap/serve/limits.py +0 -0
  75. {codmap-0.0.50 → codmap-0.0.51}/codemap/serve/livingdocs.py +0 -0
  76. {codmap-0.0.50 → codmap-0.0.51}/codemap/serve/mcp_server.py +0 -0
  77. {codmap-0.0.50 → codmap-0.0.51}/codemap/serve/mermaid.py +0 -0
  78. {codmap-0.0.50 → codmap-0.0.51}/codemap/serve/pack.py +0 -0
  79. {codmap-0.0.50 → codmap-0.0.51}/codemap/serve/rag.py +0 -0
  80. {codmap-0.0.50 → codmap-0.0.51}/codemap/serve/review.py +0 -0
  81. {codmap-0.0.50 → codmap-0.0.51}/codemap/serve/scip.py +0 -0
  82. {codmap-0.0.50 → codmap-0.0.51}/codemap/serve/semantic.py +0 -0
  83. {codmap-0.0.50 → codmap-0.0.51}/codemap/serve/server.py +0 -0
  84. {codmap-0.0.50 → codmap-0.0.51}/codemap/serve/session.py +0 -0
  85. {codmap-0.0.50 → codmap-0.0.51}/codemap/serve/subsystems.py +0 -0
  86. {codmap-0.0.50 → codmap-0.0.51}/codemap/serve/vault.py +0 -0
  87. {codmap-0.0.50 → codmap-0.0.51}/codemap/store.py +0 -0
  88. {codmap-0.0.50 → codmap-0.0.51}/codemap/tomlio.py +0 -0
  89. {codmap-0.0.50 → codmap-0.0.51}/codemap/watch.py +0 -0
  90. {codmap-0.0.50 → codmap-0.0.51}/codmap.egg-info/dependency_links.txt +0 -0
  91. {codmap-0.0.50 → codmap-0.0.51}/codmap.egg-info/entry_points.txt +0 -0
  92. {codmap-0.0.50 → codmap-0.0.51}/codmap.egg-info/requires.txt +0 -0
  93. {codmap-0.0.50 → codmap-0.0.51}/codmap.egg-info/top_level.txt +0 -0
  94. {codmap-0.0.50 → codmap-0.0.51}/setup.cfg +0 -0
  95. {codmap-0.0.50 → codmap-0.0.51}/tests/test_epistemic.py +0 -0
  96. {codmap-0.0.50 → codmap-0.0.51}/tests/test_fast_field_and_usage.py +0 -0
  97. {codmap-0.0.50 → codmap-0.0.51}/tests/test_gitnexus_router.py +0 -0
  98. {codmap-0.0.50 → codmap-0.0.51}/tests/test_impact_depth.py +0 -0
  99. {codmap-0.0.50 → codmap-0.0.51}/tests/test_integrations.py +0 -0
  100. {codmap-0.0.50 → codmap-0.0.51}/tests/test_issue3_serve_freshness.py +0 -0
  101. {codmap-0.0.50 → codmap-0.0.51}/tests/test_livingdocs.py +0 -0
  102. {codmap-0.0.50 → codmap-0.0.51}/tests/test_m0_api_surface.py +0 -0
  103. {codmap-0.0.50 → codmap-0.0.51}/tests/test_m11_argcontract.py +0 -0
  104. {codmap-0.0.50 → codmap-0.0.51}/tests/test_m12_dataflow.py +0 -0
  105. {codmap-0.0.50 → codmap-0.0.51}/tests/test_m15_review.py +0 -0
  106. {codmap-0.0.50 → codmap-0.0.51}/tests/test_m16_architecture.py +0 -0
  107. {codmap-0.0.50 → codmap-0.0.51}/tests/test_m17_mcp.py +0 -0
  108. {codmap-0.0.50 → codmap-0.0.51}/tests/test_m18_freshness.py +0 -0
  109. {codmap-0.0.50 → codmap-0.0.51}/tests/test_m1_5_semantics.py +0 -0
  110. {codmap-0.0.50 → codmap-0.0.51}/tests/test_m1_query.py +0 -0
  111. {codmap-0.0.50 → codmap-0.0.51}/tests/test_m2_views.py +0 -0
  112. {codmap-0.0.50 → codmap-0.0.51}/tests/test_m32_watch.py +0 -0
  113. {codmap-0.0.50 → codmap-0.0.51}/tests/test_m3_serve.py +0 -0
  114. {codmap-0.0.50 → codmap-0.0.51}/tests/test_m4_behavior.py +0 -0
  115. {codmap-0.0.50 → codmap-0.0.51}/tests/test_m5_deep.py +0 -0
  116. {codmap-0.0.50 → codmap-0.0.51}/tests/test_m6_repo_scope.py +0 -0
  117. {codmap-0.0.50 → codmap-0.0.51}/tests/test_m7_dispatch.py +0 -0
  118. {codmap-0.0.50 → codmap-0.0.51}/tests/test_m9_family.py +0 -0
  119. {codmap-0.0.50 → codmap-0.0.51}/tests/test_mcp_surface_contract.py +0 -0
  120. {codmap-0.0.50 → codmap-0.0.51}/tests/test_pack_honesty.py +0 -0
  121. {codmap-0.0.50 → codmap-0.0.51}/tests/test_r1c108_devkit.py +0 -0
  122. {codmap-0.0.50 → codmap-0.0.51}/tests/test_r1c109_namespace_source.py +0 -0
  123. {codmap-0.0.50 → codmap-0.0.51}/tests/test_r1c110_advise.py +0 -0
  124. {codmap-0.0.50 → codmap-0.0.51}/tests/test_r1c111_recipe.py +0 -0
  125. {codmap-0.0.50 → codmap-0.0.51}/tests/test_r1c114_devkit_graph.py +0 -0
  126. {codmap-0.0.50 → codmap-0.0.51}/tests/test_r1c115_agents_block.py +0 -0
  127. {codmap-0.0.50 → codmap-0.0.51}/tests/test_r1c116_known_cycles.py +0 -0
  128. {codmap-0.0.50 → codmap-0.0.51}/tests/test_r1c118_dead_code.py +0 -0
  129. {codmap-0.0.50 → codmap-0.0.51}/tests/test_r1c119_first_build.py +0 -0
  130. {codmap-0.0.50 → codmap-0.0.51}/tests/test_r1c120_dispatch_absorbed.py +0 -0
  131. {codmap-0.0.50 → codmap-0.0.51}/tests/test_r1c121_devkit_trust.py +0 -0
  132. {codmap-0.0.50 → codmap-0.0.51}/tests/test_r1c122_serve_robust.py +0 -0
  133. {codmap-0.0.50 → codmap-0.0.51}/tests/test_r1c124_atomic_writes.py +0 -0
  134. {codmap-0.0.50 → codmap-0.0.51}/tests/test_r1c125_graph_trust.py +0 -0
  135. {codmap-0.0.50 → codmap-0.0.51}/tests/test_r1c126_scope_roles.py +0 -0
  136. {codmap-0.0.50 → codmap-0.0.51}/tests/test_r1c127_require_current.py +0 -0
  137. {codmap-0.0.50 → codmap-0.0.51}/tests/test_r1c132_harness.py +0 -0
  138. {codmap-0.0.50 → codmap-0.0.51}/tests/test_r1c133_pin_links.py +0 -0
  139. {codmap-0.0.50 → codmap-0.0.51}/tests/test_r1c134_refresh_recipe.py +0 -0
  140. {codmap-0.0.50 → codmap-0.0.51}/tests/test_r1c135_advise_generations.py +0 -0
  141. {codmap-0.0.50 → codmap-0.0.51}/tests/test_r1c13_callgraph_accuracy.py +0 -0
  142. {codmap-0.0.50 → codmap-0.0.51}/tests/test_r1c13_grep_vs_graph.py +0 -0
  143. {codmap-0.0.50 → codmap-0.0.51}/tests/test_r1c151_pack_projection.py +0 -0
  144. {codmap-0.0.50 → codmap-0.0.51}/tests/test_r1c16_semantic.py +0 -0
  145. {codmap-0.0.50 → codmap-0.0.51}/tests/test_r1c20_attribute_edges.py +0 -0
  146. {codmap-0.0.50 → codmap-0.0.51}/tests/test_r1c21_flat_layout.py +0 -0
  147. {codmap-0.0.50 → codmap-0.0.51}/tests/test_r1c22_source_visible_refs.py +0 -0
  148. {codmap-0.0.50 → codmap-0.0.51}/tests/test_r1c23_hard_python.py +0 -0
  149. {codmap-0.0.50 → codmap-0.0.51}/tests/test_r1c24_test_mapping.py +0 -0
  150. {codmap-0.0.50 → codmap-0.0.51}/tests/test_r1c25_provenance.py +0 -0
  151. {codmap-0.0.50 → codmap-0.0.51}/tests/test_r1c26_deep_union.py +0 -0
  152. {codmap-0.0.50 → codmap-0.0.51}/tests/test_r1c27_config_honesty.py +0 -0
  153. {codmap-0.0.50 → codmap-0.0.51}/tests/test_r1c28_limit_envelope.py +0 -0
  154. {codmap-0.0.50 → codmap-0.0.51}/tests/test_r1c29_lazy_imports.py +0 -0
  155. {codmap-0.0.50 → codmap-0.0.51}/tests/test_r1c2_ctags.py +0 -0
  156. {codmap-0.0.50 → codmap-0.0.51}/tests/test_r1c30_local_import_calls.py +0 -0
  157. {codmap-0.0.50 → codmap-0.0.51}/tests/test_r1c30f1_reexport_calls.py +0 -0
  158. {codmap-0.0.50 → codmap-0.0.51}/tests/test_r1c30f2_check_scope.py +0 -0
  159. {codmap-0.0.50 → codmap-0.0.51}/tests/test_r1c31_path_origin.py +0 -0
  160. {codmap-0.0.50 → codmap-0.0.51}/tests/test_r1c32_report_json.py +0 -0
  161. {codmap-0.0.50 → codmap-0.0.51}/tests/test_r1c33_query_signature.py +0 -0
  162. {codmap-0.0.50 → codmap-0.0.51}/tests/test_r1c34_signature_kinds.py +0 -0
  163. {codmap-0.0.50 → codmap-0.0.51}/tests/test_r1c35_contract_location.py +0 -0
  164. {codmap-0.0.50 → codmap-0.0.51}/tests/test_r1c36_target_resolution.py +0 -0
  165. {codmap-0.0.50 → codmap-0.0.51}/tests/test_r1c37_rule_mutation.py +0 -0
  166. {codmap-0.0.50 → codmap-0.0.51}/tests/test_r1c38_tool_drift.py +0 -0
  167. {codmap-0.0.50 → codmap-0.0.51}/tests/test_r1c39_edge_resolution.py +0 -0
  168. {codmap-0.0.50 → codmap-0.0.51}/tests/test_r1c3_arch_contract.py +0 -0
  169. {codmap-0.0.50 → codmap-0.0.51}/tests/test_r1c3_dogfood.py +0 -0
  170. {codmap-0.0.50 → codmap-0.0.51}/tests/test_r1c40_flow_reach.py +0 -0
  171. {codmap-0.0.50 → codmap-0.0.51}/tests/test_r1c41_scope_membership.py +0 -0
  172. {codmap-0.0.50 → codmap-0.0.51}/tests/test_r1c42_deep_tier_stability.py +0 -0
  173. {codmap-0.0.50 → codmap-0.0.51}/tests/test_r1c43_incremental_splice.py +0 -0
  174. {codmap-0.0.50 → codmap-0.0.51}/tests/test_r1c44_absent_answers.py +0 -0
  175. {codmap-0.0.50 → codmap-0.0.51}/tests/test_r1c45_repeat_union.py +0 -0
  176. {codmap-0.0.50 → codmap-0.0.51}/tests/test_r1c47_incremental_resample.py +0 -0
  177. {codmap-0.0.50 → codmap-0.0.51}/tests/test_r1c48_type_checking_imports.py +0 -0
  178. {codmap-0.0.50 → codmap-0.0.51}/tests/test_r1c49_type_only_cycles.py +0 -0
  179. {codmap-0.0.50 → codmap-0.0.51}/tests/test_r1c4_complexity.py +0 -0
  180. {codmap-0.0.50 → codmap-0.0.51}/tests/test_r1c50_flow_entry_points.py +0 -0
  181. {codmap-0.0.50 → codmap-0.0.51}/tests/test_r1c53_narrowing_declared.py +0 -0
  182. {codmap-0.0.50 → codmap-0.0.51}/tests/test_r1c54_deterministic_rendering.py +0 -0
  183. {codmap-0.0.50 → codmap-0.0.51}/tests/test_r1c55_override_grade.py +0 -0
  184. {codmap-0.0.50 → codmap-0.0.51}/tests/test_r1c56_stub_files.py +0 -0
  185. {codmap-0.0.50 → codmap-0.0.51}/tests/test_r1c57_facade_package.py +0 -0
  186. {codmap-0.0.50 → codmap-0.0.51}/tests/test_r1c58_cycle_tangles.py +0 -0
  187. {codmap-0.0.50 → codmap-0.0.51}/tests/test_r1c59_completeness_drop.py +0 -0
  188. {codmap-0.0.50 → codmap-0.0.51}/tests/test_r1c5_apidiff.py +0 -0
  189. {codmap-0.0.50 → codmap-0.0.51}/tests/test_r1c60_nested_definitions.py +0 -0
  190. {codmap-0.0.50 → codmap-0.0.51}/tests/test_r1c62_phantom_rules.py +0 -0
  191. {codmap-0.0.50 → codmap-0.0.51}/tests/test_r1c63_answer_format.py +0 -0
  192. {codmap-0.0.50 → codmap-0.0.51}/tests/test_r1c64_dependency_probe.py +0 -0
  193. {codmap-0.0.50 → codmap-0.0.51}/tests/test_r1c66_pack_direction.py +0 -0
  194. {codmap-0.0.50 → codmap-0.0.51}/tests/test_r1c68_dotted_imports.py +0 -0
  195. {codmap-0.0.50 → codmap-0.0.51}/tests/test_r1c69_contract_validation.py +0 -0
  196. {codmap-0.0.50 → codmap-0.0.51}/tests/test_r1c6_pack.py +0 -0
  197. {codmap-0.0.50 → codmap-0.0.51}/tests/test_r1c70_check_graph_currency.py +0 -0
  198. {codmap-0.0.50 → codmap-0.0.51}/tests/test_r1c71_attribute_chain_calls.py +0 -0
  199. {codmap-0.0.50 → codmap-0.0.51}/tests/test_r1c72_flat_inference_in_packages.py +0 -0
  200. {codmap-0.0.50 → codmap-0.0.51}/tests/test_r1c73_cli_version.py +0 -0
  201. {codmap-0.0.50 → codmap-0.0.51}/tests/test_r1c74_call_site_conservation.py +0 -0
  202. {codmap-0.0.50 → codmap-0.0.51}/tests/test_r1c75_reexported_class_calls.py +0 -0
  203. {codmap-0.0.50 → codmap-0.0.51}/tests/test_r1c76_contract_table_typo.py +0 -0
  204. {codmap-0.0.50 → codmap-0.0.51}/tests/test_r1c77_gate_probe_battery.py +0 -0
  205. {codmap-0.0.50 → codmap-0.0.51}/tests/test_r1c78_forbidden_chains.py +0 -0
  206. {codmap-0.0.50 → codmap-0.0.51}/tests/test_r1c7_edge_vocab.py +0 -0
  207. {codmap-0.0.50 → codmap-0.0.51}/tests/test_r1c80_tests_through_helpers.py +0 -0
  208. {codmap-0.0.50 → codmap-0.0.51}/tests/test_r1c81_protocol_dispatch.py +0 -0
  209. {codmap-0.0.50 → codmap-0.0.51}/tests/test_r1c82_review_changed_lines.py +0 -0
  210. {codmap-0.0.50 → codmap-0.0.51}/tests/test_r1c83_foreign_graph_paths.py +0 -0
  211. {codmap-0.0.50 → codmap-0.0.51}/tests/test_r1c84_missing_roots.py +0 -0
  212. {codmap-0.0.50 → codmap-0.0.51}/tests/test_r1c85_mcp_graph_currency.py +0 -0
  213. {codmap-0.0.50 → codmap-0.0.51}/tests/test_r1c86_incremental_repo_scope.py +0 -0
  214. {codmap-0.0.50 → codmap-0.0.51}/tests/test_r1c87_review_path_base.py +0 -0
  215. {codmap-0.0.50 → codmap-0.0.51}/tests/test_r1c89_review_docs.py +0 -0
  216. {codmap-0.0.50 → codmap-0.0.51}/tests/test_r1c8_deadcode.py +0 -0
  217. {codmap-0.0.50 → codmap-0.0.51}/tests/test_r1c90_currency_without_recipe.py +0 -0
  218. {codmap-0.0.50 → codmap-0.0.51}/tests/test_r1c91_route_vocabulary.py +0 -0
  219. {codmap-0.0.50 → codmap-0.0.51}/tests/test_r1c92_sidecar_pair.py +0 -0
  220. {codmap-0.0.50 → codmap-0.0.51}/tests/test_r1c94_root_builds.py +0 -0
  221. {codmap-0.0.50 → codmap-0.0.51}/tests/test_r1c95_r1c96_foreign_trees.py +0 -0
  222. {codmap-0.0.50 → codmap-0.0.51}/tests/test_r1c9_incremental.py +0 -0
  223. {codmap-0.0.50 → codmap-0.0.51}/tests/test_scip_export.py +0 -0
  224. {codmap-0.0.50 → codmap-0.0.51}/tests/test_scope.py +0 -0
  225. {codmap-0.0.50 → codmap-0.0.51}/tests/test_subsystems.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: codmap
3
- Version: 0.0.50
3
+ Version: 0.0.51
4
4
  Summary: Static analyzer that turns a package's source into a queryable code graph.
5
5
  Author-email: kogriv <kogriv@gmail.com>
6
6
  License-Expression: MIT
@@ -54,7 +54,7 @@ without a release.
54
54
 
55
55
  [![CI](https://github.com/kogriv/codemap/actions/workflows/ci.yml/badge.svg)](https://github.com/kogriv/codemap/actions/workflows/ci.yml)
56
56
 
57
- **Status:** 🟢 M0–M20 implemented + research track (R1/R2) — schema 0.13, **1527 tests with no failures on
57
+ **Status:** 🟢 M0–M20 implemented + research track (R1/R2) — schema 0.13, **1534 tests with no failures on
58
58
  Python 3.11–3.14** ([in CI](docs/ci.md): the full suite including the dogfood pass, a determinism check, a
59
59
  wheel smoke test, and ctags/SCIP interop against the real CLIs), warm serve surface with 32 ops (29 exposed
60
60
  as MCP tools), and SCIP export. See **[DESIGN.md](DESIGN.md)** (product design &
@@ -18,7 +18,7 @@ without a release.
18
18
 
19
19
  [![CI](https://github.com/kogriv/codemap/actions/workflows/ci.yml/badge.svg)](https://github.com/kogriv/codemap/actions/workflows/ci.yml)
20
20
 
21
- **Status:** 🟢 M0–M20 implemented + research track (R1/R2) — schema 0.13, **1527 tests with no failures on
21
+ **Status:** 🟢 M0–M20 implemented + research track (R1/R2) — schema 0.13, **1534 tests with no failures on
22
22
  Python 3.11–3.14** ([in CI](docs/ci.md): the full suite including the dogfood pass, a determinism check, a
23
23
  wheel smoke test, and ctags/SCIP interop against the real CLIs), warm serve surface with 32 ops (29 exposed
24
24
  as MCP tools), and SCIP export. See **[DESIGN.md](DESIGN.md)** (product design &
@@ -418,17 +418,19 @@ def _shadow_map(tree) -> tuple[set[int], dict, list[tuple[int, int]]]:
418
418
 
419
419
  R1-C46: griffe keeps the **last** body of a name defined twice and drops the first
420
420
  without a word; the AST walkers here used to visit *both* and attribute both bodies'
421
- calls to the one surviving node — an edge from code that can never run. So every
422
- walker skips the shadowed subtree, and the surviving node records what it shadowed.
421
+ calls to the one surviving node. Every walker skips the replaced subtree,
422
+ and the surviving node records which bindings it replaced. A decorator on
423
+ an earlier definition can retain its object independently of that binding.
423
424
 
424
425
  Only a *direct* statement of a module, class or function body shadows or is
425
426
  shadowed. A definition under ``if`` / ``try`` / ``with`` is conditional on either
426
427
  side (``if TYPE_CHECKING:``, an ``except ImportError`` fallback): it neither replaces
427
428
  nor is replaced, and both bodies keep being walked — the honest over-approximation.
428
429
 
429
- Returns ``(ids of AST nodes to skip, records, dead line ranges)``; ``records`` maps
430
- ``(scope chain, name) -> {"linenos": [...], "node": bool}`` where ``node`` says the
431
- chain is classes only, i.e. the survivor is a definition node the graph holds.
430
+ Returns ``(ids of AST nodes to skip, records, replaced line ranges)``; ``records`` maps
431
+ ``(scope chain, name)`` to all replaced ``linenos`` and, when present, a
432
+ ``decorated`` subset. ``node`` marks a class-only scope chain, where the survivor
433
+ has a canonical definition node.
432
434
  """
433
435
  skip: set[int] = set()
434
436
  records: dict[tuple[tuple[str, ...], str], dict] = {}
@@ -447,6 +449,8 @@ def _shadow_map(tree) -> tuple[set[int], dict, list[tuple[int, int]]]:
447
449
  rec = records.setdefault((tuple(scope), stmt.name),
448
450
  {"linenos": [], "node": all(k == "c" for k in kinds)})
449
451
  rec["linenos"].append(prev.lineno)
452
+ if prev.decorator_list:
453
+ rec.setdefault("decorated", []).append(prev.lineno)
450
454
  last[stmt.name] = stmt
451
455
  for child in ast.iter_child_nodes(node):
452
456
  if id(child) in skip:
@@ -463,13 +467,16 @@ def _shadow_map(tree) -> tuple[set[int], dict, list[tuple[int, int]]]:
463
467
 
464
468
 
465
469
  def _stamp_shadows(graph, tree, prefix: str) -> None:
466
- """Write ``extras.shadows`` on every surviving definition node under ``prefix``."""
470
+ """Record replaced bindings and any earlier decorated lines on the survivor."""
467
471
  for (scope, name), rec in _shadow_map(tree)[1].items():
468
472
  if not rec["node"]:
469
473
  continue
470
474
  nid = ".".join([prefix, *scope, name])
471
475
  if nid in graph.nodes:
472
- graph.nodes[nid].extras["shadows"] = sorted(rec["linenos"])
476
+ extras = graph.nodes[nid].extras
477
+ extras["shadows"] = sorted(rec["linenos"])
478
+ if rec.get("decorated"):
479
+ extras["decorated_shadows"] = sorted(rec["decorated"])
473
480
 
474
481
 
475
482
  def _named_functions(tree):
@@ -0,0 +1,145 @@
1
+ """Source-only evidence of private methods declared on external ancestors."""
2
+
3
+ from __future__ import annotations
4
+
5
+ import sys
6
+ import tokenize
7
+ from collections import defaultdict, deque
8
+ from importlib.machinery import EXTENSION_SUFFIXES
9
+ from pathlib import Path
10
+
11
+ import griffe
12
+
13
+ _SUFFIXES = (*EXTENSION_SUFFIXES, ".py", ".pyc", ".pyi")
14
+ _SOURCE_SUFFIXES = {".py", ".pyi"}
15
+
16
+
17
+ class _ExternalSource:
18
+ """Resolve qualified names using only direct file probes and Griffe's AST visitor."""
19
+
20
+ def __init__(self, search_path: Path):
21
+ self.paths = (search_path, *(Path(p) for p in sys.path if isinstance(p, str)))
22
+ self.locations = {}
23
+ self.modules = {}
24
+
25
+ def _location(self, name: str) -> tuple[Path | None, tuple[Path, ...]]:
26
+ if name not in self.locations:
27
+ parent, _, leaf = name.rpartition(".")
28
+ paths = self._location(parent)[1] if parent else self.paths
29
+ self.locations[name] = (
30
+ (None, ()) if name in sys.builtin_module_names else self._find(leaf, paths)
31
+ )
32
+ return self.locations[name]
33
+
34
+ @staticmethod
35
+ def _find(name, paths) -> tuple[Path | None, tuple[Path, ...]]:
36
+ namespaces = []
37
+ for path in paths:
38
+ folder = path / name
39
+ try:
40
+ if folder.is_dir():
41
+ for suffix in _SUFFIXES:
42
+ init = folder / ("__init__" + suffix)
43
+ if init.is_file():
44
+ return init, (folder,)
45
+ namespaces.append(folder)
46
+ for suffix in _SUFFIXES:
47
+ module = path / (name + suffix)
48
+ if module.is_file():
49
+ return module, ()
50
+ except OSError:
51
+ return None, ()
52
+ return None, tuple(namespaces)
53
+
54
+ def _module(self, name: str):
55
+ if name not in self.modules:
56
+ path, _ = self._location(name)
57
+ module = None
58
+ if path is not None and path.suffix in _SOURCE_SUFFIXES:
59
+ parent, _, leaf = name.rpartition(".")
60
+ try:
61
+ with tokenize.open(path) as source:
62
+ module = griffe.visit(
63
+ leaf, path, source.read(),
64
+ parent=griffe.Module(parent) if parent else None,
65
+ )
66
+ except (OSError, UnicodeError, SyntaxError, ValueError):
67
+ pass
68
+ self.modules[name] = module
69
+ return self.modules[name]
70
+
71
+ def find_class(self, target: str):
72
+ seen = set()
73
+ # Bound re-export chains, including aliases that keep lengthening the path.
74
+ while target not in seen and len(seen) < 32:
75
+ parts = target.split(".")
76
+ if len(parts) < 2 or len(parts) > 32 or not all(p.isidentifier() for p in parts):
77
+ return None
78
+ seen.add(target)
79
+ obj = None
80
+ for i, part in enumerate(parts):
81
+ prefix = ".".join(parts[:i + 1])
82
+ member = obj.members.get(part) if obj is not None else None
83
+ if member is not None and member.is_alias:
84
+ if not member.runtime:
85
+ return None
86
+ if member.target_path != prefix:
87
+ target = ".".join([member.target_path, *parts[i + 1:]])
88
+ break
89
+ member = None # e.g. a package importing its own submodule
90
+ if member is not None and member.is_class and member.runtime:
91
+ obj = member
92
+ elif member is None and (obj is None or obj.is_module):
93
+ obj = self._module(prefix)
94
+ path, locations = self._location(prefix)
95
+ if obj is None and (path is not None or not locations):
96
+ return None
97
+ else:
98
+ return None
99
+ else:
100
+ return obj if obj is not None and obj.is_class else None
101
+ return None
102
+
103
+
104
+ def stamp_external_overrides(graph, external_bases, search_path: Path) -> None:
105
+ """Record one canonical external declaration for each matching private method."""
106
+ if not external_bases:
107
+ return
108
+ parents = defaultdict(list)
109
+ for edge in graph.edges:
110
+ if edge.type == "inherits" and not edge.extras.get("external"):
111
+ parents[edge.source].append(edge.target)
112
+
113
+ source = _ExternalSource(search_path)
114
+ methods = defaultdict(dict)
115
+ for node in graph.nodes.values():
116
+ if node.kind == "function" and node.visibility == "private":
117
+ parent, _, name = node.id.rpartition(".")
118
+ if parent in parents or parent in external_bases:
119
+ methods[parent][name] = node
120
+
121
+ for cls, pending in methods.items():
122
+ local = [cls]
123
+ local_seen = {cls}
124
+ queue = deque()
125
+ for base in local:
126
+ queue.extend(external_bases.get(base, ()))
127
+ for parent in parents.get(base, ()):
128
+ if parent not in local_seen:
129
+ local_seen.add(parent)
130
+ local.append(parent)
131
+ seen = set()
132
+ while queue and pending:
133
+ target = queue.popleft()
134
+ if target in seen:
135
+ continue
136
+ seen.add(target)
137
+ ancestor = source.find_class(target)
138
+ if ancestor is None or ancestor.path in graph.nodes:
139
+ continue
140
+ for name in pending.keys() & ancestor.members.keys():
141
+ method = ancestor.members[name]
142
+ if not method.is_alias and method.is_function and method.runtime:
143
+ pending.pop(name).extras["external_override"] = method.path
144
+ queue.extend(path for base in ancestor.bases
145
+ if (path := getattr(base, "reference_path", None)))
@@ -32,6 +32,7 @@ from codemap.extract.behavior import add_behavior
32
32
  from codemap.extract.dataflow import add_dataflow
33
33
  from codemap.extract.dispatch import (add_dispatch, add_family_links, add_protocol_dispatch,
34
34
  add_structural_implements)
35
+ from codemap.extract.external import stamp_external_overrides
35
36
  from codemap.extract.gsource import (DOTTED_IMPORT_HINT, NESTED_IMPORT_HINT, KnownModules,
36
37
  deepest_module, flat_resolve, module_file, module_identity)
37
38
  from codemap.extract.union import merge_samples
@@ -50,6 +51,7 @@ SKIP_ENCODING, SKIP_SYNTAX, SKIP_IO, SKIP_UNREAD = "encoding", "syntax", "io", "
50
51
  class _Walk:
51
52
  """What one structural walk accumulates besides nodes and edges."""
52
53
 
54
+ external_bases: dict[str, list[str]] = field(default_factory=dict)
53
55
  aliases: list = field(default_factory=list) # (parent_module, name, target, public)
54
56
  #: (module_id, target_symbol_path, scope) — scope is "module" or, since R1-C29,
55
57
  #: "function" for an import written inside a function body.
@@ -255,6 +257,7 @@ def build_structural(package_path: str | Path):
255
257
 
256
258
  _collect(graph, root, search_path, module_name, walk)
257
259
  _resolve_edges(graph, module_name, walk.aliases, walk.imports)
260
+ stamp_external_overrides(graph, walk.external_bases, search_path)
258
261
  # R1-C23/D2: an input the extractor could not read used to vanish without a word,
259
262
  # and the graph then reported on a tree it had not fully seen. Record what was
260
263
  # missed *in the artifact*, so a consumer holding only the graph is told.
@@ -648,7 +651,7 @@ def _collect(graph, obj, root, target_pkg, walk) -> None:
648
651
  graph.add_edge(Edge("contains", obj.canonical_path, member.canonical_path))
649
652
  _emit_decorated_by(graph, member)
650
653
  if member.kind.value == "class":
651
- _emit_inherits(graph, member, target_pkg)
654
+ _emit_inherits(graph, member, target_pkg, walk)
652
655
  if member.kind.value in {"module", "class"}:
653
656
  _collect(graph, member, root, target_pkg, walk)
654
657
 
@@ -676,11 +679,13 @@ def _claim(module, walk) -> bool:
676
679
 
677
680
  # -- semantic edges resolvable inline (griffe gives absolute targets) --------
678
681
 
679
- def _emit_inherits(graph, cls, target_pkg) -> None:
682
+ def _emit_inherits(graph, cls, target_pkg, walk) -> None:
680
683
  """One `inherits` edge per base; griffe resolves the base to a canonical path."""
681
684
  for base in getattr(cls, "bases", None) or []:
682
685
  target = getattr(base, "canonical_path", None) or str(base)
683
686
  internal = target == target_pkg or target.startswith(target_pkg + ".")
687
+ if not internal and "." in target and getattr(base, "reference_path", None) == target:
688
+ walk.external_bases.setdefault(cls.canonical_path, []).append(target)
684
689
  graph.add_edge(
685
690
  Edge(
686
691
  "inherits",
@@ -32,7 +32,7 @@ import os
32
32
  import re
33
33
  from pathlib import Path
34
34
 
35
- from codemap.extract.behavior import _arg_contract, _arg_shape, _shadow_map
35
+ from codemap.extract.behavior import _arg_contract, _arg_shape, _shadow_map, _stamp_shadows
36
36
  from codemap.extract.griffe_extractor import extract
37
37
  from codemap.provenance import canonicalize
38
38
  from codemap.model import Edge, Graph, Node
@@ -306,9 +306,8 @@ def _scan_consumer_module(graph, py, base, label, tree, index, mode, origin=None
306
306
  if isinstance(n, ast.Attribute) and isinstance(n.value, ast.Attribute)
307
307
  }
308
308
  func_ranges = _func_ranges(tree) if mode == "full" else []
309
- # R1-C46: a use inside a body that a later definition replaced is not a use — it
310
- # would attribute a reference (or a call) to code that never runs, in either mode.
311
- dead = _shadow_map(tree)[2]
309
+ # R1-C46: uses in replaced bodies do not belong to the surviving node.
310
+ replaced = _shadow_map(tree)[2]
312
311
  # R1-C80 D0: in full mode, a use of the module's own top-level function or class is an
313
312
  # edge too — a test calling `_vector` in its own module. Without it the walk from a core
314
313
  # symbol stopped at the helper. Names that an import also binds are left to the import.
@@ -320,7 +319,7 @@ def _scan_consumer_module(graph, py, base, label, tree, index, mode, origin=None
320
319
 
321
320
  for node in ast.walk(tree):
322
321
  line = getattr(node, "lineno", None)
323
- if line is not None and any(a <= line <= b for a, b in dead):
322
+ if line is not None and any(a <= line <= b for a, b in replaced):
324
323
  continue
325
324
  target = None
326
325
  use_node = node
@@ -351,7 +350,7 @@ def _scan_consumer_module(graph, py, base, label, tree, index, mode, origin=None
351
350
  if mode == "full":
352
351
  # R1-C81 D4: `fc = _spec().build().fit(df); fc.band(…)` — calls on objects whose
353
352
  # type a constructor or a return annotation names.
354
- for src, target, res in _typed_calls(graph, tree, mod_id, symbol_map, index, func_ranges, dead):
353
+ for src, target, res in _typed_calls(graph, tree, mod_id, symbol_map, index, func_ranges, replaced):
355
354
  if (src, target) not in uses:
356
355
  uses[(src, target)] = {"called": True, "shapes": [], "local": False, "typed": res}
357
356
 
@@ -494,14 +493,14 @@ class _Typer:
494
493
  return env
495
494
 
496
495
 
497
- def _typed_calls(graph, tree, mod_id, symbol_map, index, func_ranges, dead):
496
+ def _typed_calls(graph, tree, mod_id, symbol_map, index, func_ranges, replaced):
498
497
  """(source id, core method id, resolution) for calls on typed receivers in a consumer module."""
499
498
  typer = _Typer(graph, tree, symbol_map, index)
500
499
  out: set[tuple[str, str]] = set()
501
500
  for fnode in ast.walk(tree):
502
501
  if not isinstance(fnode, (ast.FunctionDef, ast.AsyncFunctionDef)):
503
502
  continue
504
- if any(a <= fnode.lineno <= b for a, b in dead):
503
+ if any(a <= fnode.lineno <= b for a, b in replaced):
505
504
  continue
506
505
  env = typer.env_of(fnode)
507
506
  for call in ast.walk(fnode):
@@ -603,13 +602,7 @@ def _materialize_defs(graph, tree, mod_id, label, file: str | None = None) -> No
603
602
  extras={"root": label}))
604
603
  parent = ".".join([mod_id, *class_stack]) if class_stack else mod_id
605
604
  graph.add_edge(Edge("contains", parent, node_id))
606
- # R1-C46: one node and one `contains` per definition that can run (issue #16 found
607
- # the record twice); the survivor says which earlier bodies it replaced.
608
- for (scope, name), rec in _shadow_map(tree)[1].items():
609
- if rec["node"]:
610
- nid = ".".join([mod_id, *scope, name])
611
- if nid in graph.nodes:
612
- graph.nodes[nid].extras["shadows"] = sorted(rec["linenos"])
605
+ _stamp_shadows(graph, tree, mod_id)
613
606
 
614
607
 
615
608
  def _defs(tree):
@@ -66,19 +66,19 @@ from codemap.scope import diff_scopes
66
66
  # R1-C45: the same set is the class `--repeat` merges by quality — what is spliced and
67
67
  # what is unstable are one list, so it is defined once, beside the merge.
68
68
  _BEHAVIOR_CALL_RES = BEHAVIOR_CALL_RES
69
- # R1-C22: `references` resolutions the behavioral pass owns (a name used as a value, or
70
- # as a type annotation). The consumer/doc references carry other resolutions and belong
69
+ # References from names, type annotations, and bound methods belong to the behavioral
70
+ # pass. The consumer/doc references carry other resolutions and belong
71
71
  # to the repo-scope pass, which the incremental path does not touch.
72
- _BEHAVIOR_REF_RES = frozenset({"name", "annotation"})
72
+ _BEHAVIOR_REF_RES = frozenset({"name", "annotation", "self"})
73
73
  # Node-extras keys owned by the two jedi-sensitive passes (spliced for unaffected).
74
- # `shadows` (R1-C46) is stamped by the behavioral pass too, so an unaffected module keeps
75
- # it — or the fast tier's byte-identity to a full build (R1-C9) breaks on it.
74
+ # Shadow metadata (R1-C46/R1-C106) is stamped by the behavioral pass too, so an
75
+ # unaffected module keeps it for parity with a full fast build (R1-C9).
76
76
  # R1-C86: `calls_nested` (calls inside nested defs, counted on the owner) and
77
77
  # `calls_shadowed` (on the module node) are stamped by the same pass and were missing,
78
78
  # so every unaffected module with a nested def lost them: on a bquant commit replay, 26
79
79
  # nodes differed from a full build. A guard now derives the set from the passes.
80
80
  _BEHAVIORAL_EXTRAS = ("calls", "control", "complexity", "attr_access", "shadows",
81
- "calls_nested", "calls_shadowed")
81
+ "decorated_shadows", "calls_nested", "calls_shadowed")
82
82
  # Old edge types whose target landing in a changed/removed module makes the source
83
83
  # module stale (it must re-resolve). Only the spliced passes matter here — and the serve
84
84
  # layer reads the same set to know which ops answer from a spliced class (R1-C44).
@@ -663,9 +663,9 @@ class Query:
663
663
  is what cuts the false positives a call-only tool (vulture) can't:
664
664
 
665
665
  - **high** — no inbound edge of *any* kind (call / reference / re-export) and
666
- no decorator or registry hook: the strongest dead signal.
666
+ no decorator, registry hook, or detected ancestor method.
667
667
  - **medium** — no inbound reference, but a decorator or registry membership
668
- could invoke it implicitly (a framework hook, dispatched impl).
668
+ could invoke it implicitly, or an ancestor declares the same method.
669
669
  - **low** — something *references* it (a re-export, a name put in a list, a
670
670
  registration): probably alive; the reason names who, so you can judge.
671
671
 
@@ -816,6 +816,10 @@ class Query:
816
816
  reasons.append(
817
817
  f"registered as {registry.get('key', '?')!r} — may be dispatched")
818
818
  confidence = "medium"
819
+ elif ancestor := n.extras.get("external_override"):
820
+ reasons = [f"overrides {ancestor}, declared in external source — "
821
+ "may be reached by dispatch"]
822
+ confidence = "medium"
819
823
  else:
820
824
  reasons = ["no inbound calls, references, or decorators"]
821
825
  confidence = "high"
@@ -823,20 +827,23 @@ class Query:
823
827
  "root": self.root_of(n.id), "reasons": reasons}
824
828
 
825
829
  def shadowed_definitions(self) -> list[dict]:
826
- """Definitions that replaced an earlier definition of the same name (R1-C46).
830
+ """Replaced definition lines eligible for the definite report section.
827
831
 
828
- Not a graded candidate: a body a later ``def`` in the same scope replaced can
829
- never run, and no inbound edge changes that — so it is listed apart from
830
- :meth:`dead_code`, whose bands all mean "probably". Read from ``extras.shadows``,
831
- which the extractor stamps on the surviving node (``extract/behavior.py``).
832
+ The graph keeps all replaced binding lines in ``extras.shadows``. Earlier
833
+ decorators may retain their original objects, so omit those lines when
834
+ source-derived ``extras.decorated_shadows`` is available.
832
835
  """
833
836
  out = []
834
837
  for n in self.graph.nodes.values():
835
- shadows = n.extras.get("shadows")
838
+ replaced = n.extras.get("shadows")
839
+ if not replaced:
840
+ continue
841
+ decorated = set(n.extras.get("decorated_shadows", ()))
842
+ shadows = [line for line in replaced if line not in decorated]
836
843
  if shadows:
837
844
  out.append({"id": n.id, "kind": n.kind, "root": self.root_of(n.id),
838
845
  "file": n.file, "lineno": n.lineno,
839
- "shadows": list(shadows)})
846
+ "shadows": shadows})
840
847
  out.sort(key=lambda d: d["id"])
841
848
  return out
842
849
 
@@ -95,7 +95,7 @@ def build_dead_code(query: Query, *, whitelist: tuple[str, ...] = (),
95
95
  "candidates": dead,
96
96
  "totals": {c: sum(1 for d in dead if d["confidence"] == c)
97
97
  for c in ("high", "medium", "low")},
98
- # R1-C46: certain, not graded — a body a later definition replaced cannot run.
98
+ # Definite replaced bindings after excluding earlier decorated definitions.
99
99
  "shadowed": query.shadowed_definitions(),
100
100
  "whitelist": {"patterns": list(whitelist), "error": whitelist_error},
101
101
  "min_confidence": min_confidence,
@@ -154,8 +154,7 @@ def build_behavior(query: Query) -> dict:
154
154
  "kind": "behavior",
155
155
  "target": graph.target,
156
156
  "call_sites": {**agg, "functions_with_coverage": len(with_cov),
157
- # R1-C74: the whole and its parts; they sum to every call in the source
158
- # that can run (shadowed bodies are named, not walked).
157
+ # R1-C74: walked and skipped sites together account for source calls.
159
158
  "by_scope": sites["by_scope"],
160
159
  "shadowed_not_walked": sites["shadowed_not_walked"]},
161
160
  "calls_edges": {"total": sum(by_res.values()), "by_resolution": dict(sorted(by_res.items()))},
@@ -227,20 +226,20 @@ def render_dead_code(query: Query, *, whitelist: tuple[str, ...] = (),
227
226
  f"_{breakdown} — tests/examples/scripts/research are never imported; "
228
227
  "expected orphan. Excluded from dead-code candidates (F8)._"
229
228
  )
230
- # R1-C46: a name defined twice in one scope. Ahead of the graded list and worded as
231
- # a certainty, because it is one: the earlier body cannot run whatever calls it.
229
+ # R1-C46/R1-C106: definite replaced bindings, ahead of the graded list.
232
230
  shadowed = query.shadowed_definitions()
233
231
  if shadowed:
234
232
  lines.append("")
235
233
  lines.append(f"## Shadowed definitions — certain: {len(shadowed)}")
236
234
  lines.append("")
237
235
  lines.append("_A later definition of the same name in the same scope replaced "
238
- "these; the earlier body can never run. Not a heuristic._")
236
+ "these bindings. Earlier decorated definitions are omitted when "
237
+ "the graph records their decorators._")
239
238
  lines.append("")
240
239
  for s in shadowed:
241
240
  earlier = ", ".join(str(ln) for ln in s["shadows"])
242
241
  lines.append(f"- `{s['id']}` — defined at line {s['lineno']} shadows the "
243
- f"definition at line {earlier}; the earlier body can never run.")
242
+ f"definition at line {earlier}.")
244
243
  # R1-C8: uncalled private functions, graded by confidence with a provenance reason.
245
244
  lines.append("")
246
245
  filt = f" (min-confidence: {min_confidence})" if min_confidence else ""
@@ -326,7 +325,7 @@ def render_behavior(query: Query) -> str:
326
325
  f"_{by['function']['out']} in function bodies, {by['nested']['out']} in nested functions, "
327
326
  f"{by['module']['out']} at module level, {by['class_body']['out']} in class bodies"
328
327
  + (f"; {shadow} more sit in bodies replaced by a later definition and are not walked "
329
- "(they cannot run)" if shadow else "")
328
+ "under the surviving definition" if shadow else "")
330
329
  + "._")
331
330
  lines.append("")
332
331
  lines.append(f"- resolved to internal edges: **{agg['resolved']}** ({100*agg['resolved']/total:.1f}%)")
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: codmap
3
- Version: 0.0.50
3
+ Version: 0.0.51
4
4
  Summary: Static analyzer that turns a package's source into a queryable code graph.
5
5
  Author-email: kogriv <kogriv@gmail.com>
6
6
  License-Expression: MIT
@@ -54,7 +54,7 @@ without a release.
54
54
 
55
55
  [![CI](https://github.com/kogriv/codemap/actions/workflows/ci.yml/badge.svg)](https://github.com/kogriv/codemap/actions/workflows/ci.yml)
56
56
 
57
- **Status:** 🟢 M0–M20 implemented + research track (R1/R2) — schema 0.13, **1527 tests with no failures on
57
+ **Status:** 🟢 M0–M20 implemented + research track (R1/R2) — schema 0.13, **1534 tests with no failures on
58
58
  Python 3.11–3.14** ([in CI](docs/ci.md): the full suite including the dogfood pass, a determinism check, a
59
59
  wheel smoke test, and ctags/SCIP interop against the real CLIs), warm serve surface with 32 ops (29 exposed
60
60
  as MCP tools), and SCIP export. See **[DESIGN.md](DESIGN.md)** (product design &
@@ -46,6 +46,7 @@ codemap/extract/attrflow.py
46
46
  codemap/extract/behavior.py
47
47
  codemap/extract/dataflow.py
48
48
  codemap/extract/dispatch.py
49
+ codemap/extract/external.py
49
50
  codemap/extract/griffe_extractor.py
50
51
  codemap/extract/gsource.py
51
52
  codemap/extract/probe.py
@@ -113,6 +114,7 @@ tests/test_m7_dispatch.py
113
114
  tests/test_m9_family.py
114
115
  tests/test_mcp_surface_contract.py
115
116
  tests/test_pack_honesty.py
117
+ tests/test_r1c106_dead_code.py
116
118
  tests/test_r1c108_devkit.py
117
119
  tests/test_r1c109_namespace_source.py
118
120
  tests/test_r1c110_advise.py
@@ -9,7 +9,7 @@ build-backend = "setuptools.build_meta"
9
9
  # version. README says this plainly, since `pip install codmap` / `import codemap` is a
10
10
  # seam a reader will otherwise hit by surprise.
11
11
  name = "codmap"
12
- version = "0.0.50"
12
+ version = "0.0.51"
13
13
  description = "Static analyzer that turns a package's source into a queryable code graph."
14
14
  readme = "README.md"
15
15
  # M20/D1: measured, not assumed. Each release of the declared range runs the full suite in