codmap 0.0.43__tar.gz → 0.0.45__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.
- {codmap-0.0.43/codmap.egg-info → codmap-0.0.45}/PKG-INFO +2 -2
- {codmap-0.0.43 → codmap-0.0.45}/README.md +1 -1
- {codmap-0.0.43 → codmap-0.0.45}/codemap/arch.py +22 -1
- {codmap-0.0.43 → codmap-0.0.45}/codemap/devkit/install.py +7 -3
- {codmap-0.0.43 → codmap-0.0.45}/codemap/devkit/ratchet.py +2 -1
- {codmap-0.0.43 → codmap-0.0.45}/codemap/extract/behavior.py +50 -0
- {codmap-0.0.43 → codmap-0.0.45}/codemap/model.py +3 -0
- {codmap-0.0.43 → codmap-0.0.45}/codemap/serve/check.py +13 -5
- {codmap-0.0.43 → codmap-0.0.45/codmap.egg-info}/PKG-INFO +2 -2
- {codmap-0.0.43 → codmap-0.0.45}/codmap.egg-info/SOURCES.txt +1 -0
- {codmap-0.0.43 → codmap-0.0.45}/pyproject.toml +1 -1
- codmap-0.0.45/tests/test_r1c120_dispatch_absorbed.py +110 -0
- {codmap-0.0.43 → codmap-0.0.45}/tests/test_r1c13_grep_vs_graph.py +4 -2
- {codmap-0.0.43 → codmap-0.0.45}/tests/test_r1c39_edge_resolution.py +16 -2
- {codmap-0.0.43 → codmap-0.0.45}/LICENSE +0 -0
- {codmap-0.0.43 → codmap-0.0.45}/codemap/__init__.py +0 -0
- {codmap-0.0.43 → codmap-0.0.45}/codemap/__main__.py +0 -0
- {codmap-0.0.43 → codmap-0.0.45}/codemap/advise/__init__.py +0 -0
- {codmap-0.0.43 → codmap-0.0.45}/codemap/advise/data/feed.json +0 -0
- {codmap-0.0.43 → codmap-0.0.45}/codemap/advise/data/matrix.toml +0 -0
- {codmap-0.0.43 → codmap-0.0.45}/codemap/advise/refresh.py +0 -0
- {codmap-0.0.43 → codmap-0.0.45}/codemap/advise/render.py +0 -0
- {codmap-0.0.43 → codmap-0.0.45}/codemap/apidiff.py +0 -0
- {codmap-0.0.43 → codmap-0.0.45}/codemap/cli.py +0 -0
- {codmap-0.0.43 → codmap-0.0.45}/codemap/devkit/__init__.py +0 -0
- {codmap-0.0.43 → codmap-0.0.45}/codemap/devkit/artifacts.py +0 -0
- {codmap-0.0.43 → codmap-0.0.45}/codemap/devkit/hooks.py +0 -0
- {codmap-0.0.43 → codmap-0.0.45}/codemap/devkit/state.py +0 -0
- {codmap-0.0.43 → codmap-0.0.45}/codemap/devkit/templates/agents_block.md +0 -0
- {codmap-0.0.43 → codmap-0.0.45}/codemap/devkit/templates/agents_block.ru.md +0 -0
- {codmap-0.0.43 → codmap-0.0.45}/codemap/devkit/templates/brief.txt +0 -0
- {codmap-0.0.43 → codmap-0.0.45}/codemap/devkit/templates/claude_hooks.json +0 -0
- {codmap-0.0.43 → codmap-0.0.45}/codemap/devkit/templates/codex_region.toml +0 -0
- {codmap-0.0.43 → codmap-0.0.45}/codemap/devkit/templates/contract_head.toml +0 -0
- {codmap-0.0.43 → codmap-0.0.45}/codemap/devkit/templates/cycles_region.toml +0 -0
- {codmap-0.0.43 → codmap-0.0.45}/codemap/devkit/templates/github-workflow.yml +0 -0
- {codmap-0.0.43 → codmap-0.0.45}/codemap/devkit/templates/gitlab-ci.yml +0 -0
- {codmap-0.0.43 → codmap-0.0.45}/codemap/devkit/templates/mcp_claude.args +0 -0
- {codmap-0.0.43 → codmap-0.0.45}/codemap/devkit/templates/post-commit.sh +0 -0
- {codmap-0.0.43 → codmap-0.0.45}/codemap/devkit/templates/ratchet_region.toml +0 -0
- {codmap-0.0.43 → codmap-0.0.45}/codemap/devkit/usage.py +0 -0
- {codmap-0.0.43 → codmap-0.0.45}/codemap/diagnostics.py +0 -0
- {codmap-0.0.43 → codmap-0.0.45}/codemap/extract/__init__.py +0 -0
- {codmap-0.0.43 → codmap-0.0.45}/codemap/extract/attrflow.py +0 -0
- {codmap-0.0.43 → codmap-0.0.45}/codemap/extract/dataflow.py +0 -0
- {codmap-0.0.43 → codmap-0.0.45}/codemap/extract/dispatch.py +0 -0
- {codmap-0.0.43 → codmap-0.0.45}/codemap/extract/griffe_extractor.py +0 -0
- {codmap-0.0.43 → codmap-0.0.45}/codemap/extract/gsource.py +0 -0
- {codmap-0.0.43 → codmap-0.0.45}/codemap/extract/probe.py +0 -0
- {codmap-0.0.43 → codmap-0.0.45}/codemap/extract/roots.py +0 -0
- {codmap-0.0.43 → codmap-0.0.45}/codemap/extract/union.py +0 -0
- {codmap-0.0.43 → codmap-0.0.45}/codemap/freshness.py +0 -0
- {codmap-0.0.43 → codmap-0.0.45}/codemap/incremental.py +0 -0
- {codmap-0.0.43 → codmap-0.0.45}/codemap/integrations/__init__.py +0 -0
- {codmap-0.0.43 → codmap-0.0.45}/codemap/integrations/base.py +0 -0
- {codmap-0.0.43 → codmap-0.0.45}/codemap/integrations/cocoindex.py +0 -0
- {codmap-0.0.43 → codmap-0.0.45}/codemap/integrations/gate.py +0 -0
- {codmap-0.0.43 → codmap-0.0.45}/codemap/integrations/gitnexus.py +0 -0
- {codmap-0.0.43 → codmap-0.0.45}/codemap/integrations/registry.py +0 -0
- {codmap-0.0.43 → codmap-0.0.45}/codemap/integrations/transport.py +0 -0
- {codmap-0.0.43 → codmap-0.0.45}/codemap/provenance.py +0 -0
- {codmap-0.0.43 → codmap-0.0.45}/codemap/query.py +0 -0
- {codmap-0.0.43 → codmap-0.0.45}/codemap/scope.py +0 -0
- {codmap-0.0.43 → codmap-0.0.45}/codemap/serve/__init__.py +0 -0
- {codmap-0.0.43 → codmap-0.0.45}/codemap/serve/_scip_pb2.py +0 -0
- {codmap-0.0.43 → codmap-0.0.45}/codemap/serve/api_surface.py +0 -0
- {codmap-0.0.43 → codmap-0.0.45}/codemap/serve/apidiff.py +0 -0
- {codmap-0.0.43 → codmap-0.0.45}/codemap/serve/architecture.py +0 -0
- {codmap-0.0.43 → codmap-0.0.45}/codemap/serve/audit.py +0 -0
- {codmap-0.0.43 → codmap-0.0.45}/codemap/serve/ctags.py +0 -0
- {codmap-0.0.43 → codmap-0.0.45}/codemap/serve/currency.py +0 -0
- {codmap-0.0.43 → codmap-0.0.45}/codemap/serve/impact.py +0 -0
- {codmap-0.0.43 → codmap-0.0.45}/codemap/serve/limits.py +0 -0
- {codmap-0.0.43 → codmap-0.0.45}/codemap/serve/livingdocs.py +0 -0
- {codmap-0.0.43 → codmap-0.0.45}/codemap/serve/mcp_server.py +0 -0
- {codmap-0.0.43 → codmap-0.0.45}/codemap/serve/mermaid.py +0 -0
- {codmap-0.0.43 → codmap-0.0.45}/codemap/serve/pack.py +0 -0
- {codmap-0.0.43 → codmap-0.0.45}/codemap/serve/rag.py +0 -0
- {codmap-0.0.43 → codmap-0.0.45}/codemap/serve/review.py +0 -0
- {codmap-0.0.43 → codmap-0.0.45}/codemap/serve/scip.py +0 -0
- {codmap-0.0.43 → codmap-0.0.45}/codemap/serve/semantic.py +0 -0
- {codmap-0.0.43 → codmap-0.0.45}/codemap/serve/server.py +0 -0
- {codmap-0.0.43 → codmap-0.0.45}/codemap/serve/session.py +0 -0
- {codmap-0.0.43 → codmap-0.0.45}/codemap/serve/subsystems.py +0 -0
- {codmap-0.0.43 → codmap-0.0.45}/codemap/serve/vault.py +0 -0
- {codmap-0.0.43 → codmap-0.0.45}/codemap/store.py +0 -0
- {codmap-0.0.43 → codmap-0.0.45}/codemap/tomlio.py +0 -0
- {codmap-0.0.43 → codmap-0.0.45}/codemap/watch.py +0 -0
- {codmap-0.0.43 → codmap-0.0.45}/codmap.egg-info/dependency_links.txt +0 -0
- {codmap-0.0.43 → codmap-0.0.45}/codmap.egg-info/entry_points.txt +0 -0
- {codmap-0.0.43 → codmap-0.0.45}/codmap.egg-info/requires.txt +0 -0
- {codmap-0.0.43 → codmap-0.0.45}/codmap.egg-info/top_level.txt +0 -0
- {codmap-0.0.43 → codmap-0.0.45}/setup.cfg +0 -0
- {codmap-0.0.43 → codmap-0.0.45}/tests/test_epistemic.py +0 -0
- {codmap-0.0.43 → codmap-0.0.45}/tests/test_gitnexus_router.py +0 -0
- {codmap-0.0.43 → codmap-0.0.45}/tests/test_impact_depth.py +0 -0
- {codmap-0.0.43 → codmap-0.0.45}/tests/test_integrations.py +0 -0
- {codmap-0.0.43 → codmap-0.0.45}/tests/test_issue3_serve_freshness.py +0 -0
- {codmap-0.0.43 → codmap-0.0.45}/tests/test_livingdocs.py +0 -0
- {codmap-0.0.43 → codmap-0.0.45}/tests/test_m0_api_surface.py +0 -0
- {codmap-0.0.43 → codmap-0.0.45}/tests/test_m11_argcontract.py +0 -0
- {codmap-0.0.43 → codmap-0.0.45}/tests/test_m12_dataflow.py +0 -0
- {codmap-0.0.43 → codmap-0.0.45}/tests/test_m15_review.py +0 -0
- {codmap-0.0.43 → codmap-0.0.45}/tests/test_m16_architecture.py +0 -0
- {codmap-0.0.43 → codmap-0.0.45}/tests/test_m17_mcp.py +0 -0
- {codmap-0.0.43 → codmap-0.0.45}/tests/test_m18_freshness.py +0 -0
- {codmap-0.0.43 → codmap-0.0.45}/tests/test_m1_5_semantics.py +0 -0
- {codmap-0.0.43 → codmap-0.0.45}/tests/test_m1_query.py +0 -0
- {codmap-0.0.43 → codmap-0.0.45}/tests/test_m2_views.py +0 -0
- {codmap-0.0.43 → codmap-0.0.45}/tests/test_m32_watch.py +0 -0
- {codmap-0.0.43 → codmap-0.0.45}/tests/test_m3_serve.py +0 -0
- {codmap-0.0.43 → codmap-0.0.45}/tests/test_m4_behavior.py +0 -0
- {codmap-0.0.43 → codmap-0.0.45}/tests/test_m5_deep.py +0 -0
- {codmap-0.0.43 → codmap-0.0.45}/tests/test_m6_repo_scope.py +0 -0
- {codmap-0.0.43 → codmap-0.0.45}/tests/test_m7_dispatch.py +0 -0
- {codmap-0.0.43 → codmap-0.0.45}/tests/test_m9_family.py +0 -0
- {codmap-0.0.43 → codmap-0.0.45}/tests/test_pack_honesty.py +0 -0
- {codmap-0.0.43 → codmap-0.0.45}/tests/test_r1c108_devkit.py +0 -0
- {codmap-0.0.43 → codmap-0.0.45}/tests/test_r1c109_namespace_source.py +0 -0
- {codmap-0.0.43 → codmap-0.0.45}/tests/test_r1c110_advise.py +0 -0
- {codmap-0.0.43 → codmap-0.0.45}/tests/test_r1c111_recipe.py +0 -0
- {codmap-0.0.43 → codmap-0.0.45}/tests/test_r1c114_devkit_graph.py +0 -0
- {codmap-0.0.43 → codmap-0.0.45}/tests/test_r1c115_agents_block.py +0 -0
- {codmap-0.0.43 → codmap-0.0.45}/tests/test_r1c116_known_cycles.py +0 -0
- {codmap-0.0.43 → codmap-0.0.45}/tests/test_r1c118_dead_code.py +0 -0
- {codmap-0.0.43 → codmap-0.0.45}/tests/test_r1c119_first_build.py +0 -0
- {codmap-0.0.43 → codmap-0.0.45}/tests/test_r1c13_callgraph_accuracy.py +0 -0
- {codmap-0.0.43 → codmap-0.0.45}/tests/test_r1c16_semantic.py +0 -0
- {codmap-0.0.43 → codmap-0.0.45}/tests/test_r1c20_attribute_edges.py +0 -0
- {codmap-0.0.43 → codmap-0.0.45}/tests/test_r1c21_flat_layout.py +0 -0
- {codmap-0.0.43 → codmap-0.0.45}/tests/test_r1c22_source_visible_refs.py +0 -0
- {codmap-0.0.43 → codmap-0.0.45}/tests/test_r1c23_hard_python.py +0 -0
- {codmap-0.0.43 → codmap-0.0.45}/tests/test_r1c24_test_mapping.py +0 -0
- {codmap-0.0.43 → codmap-0.0.45}/tests/test_r1c25_provenance.py +0 -0
- {codmap-0.0.43 → codmap-0.0.45}/tests/test_r1c26_deep_union.py +0 -0
- {codmap-0.0.43 → codmap-0.0.45}/tests/test_r1c27_config_honesty.py +0 -0
- {codmap-0.0.43 → codmap-0.0.45}/tests/test_r1c28_limit_envelope.py +0 -0
- {codmap-0.0.43 → codmap-0.0.45}/tests/test_r1c29_lazy_imports.py +0 -0
- {codmap-0.0.43 → codmap-0.0.45}/tests/test_r1c2_ctags.py +0 -0
- {codmap-0.0.43 → codmap-0.0.45}/tests/test_r1c30_local_import_calls.py +0 -0
- {codmap-0.0.43 → codmap-0.0.45}/tests/test_r1c30f1_reexport_calls.py +0 -0
- {codmap-0.0.43 → codmap-0.0.45}/tests/test_r1c30f2_check_scope.py +0 -0
- {codmap-0.0.43 → codmap-0.0.45}/tests/test_r1c31_path_origin.py +0 -0
- {codmap-0.0.43 → codmap-0.0.45}/tests/test_r1c32_report_json.py +0 -0
- {codmap-0.0.43 → codmap-0.0.45}/tests/test_r1c33_query_signature.py +0 -0
- {codmap-0.0.43 → codmap-0.0.45}/tests/test_r1c34_signature_kinds.py +0 -0
- {codmap-0.0.43 → codmap-0.0.45}/tests/test_r1c35_contract_location.py +0 -0
- {codmap-0.0.43 → codmap-0.0.45}/tests/test_r1c36_target_resolution.py +0 -0
- {codmap-0.0.43 → codmap-0.0.45}/tests/test_r1c37_rule_mutation.py +0 -0
- {codmap-0.0.43 → codmap-0.0.45}/tests/test_r1c38_tool_drift.py +0 -0
- {codmap-0.0.43 → codmap-0.0.45}/tests/test_r1c3_arch_contract.py +0 -0
- {codmap-0.0.43 → codmap-0.0.45}/tests/test_r1c3_dogfood.py +0 -0
- {codmap-0.0.43 → codmap-0.0.45}/tests/test_r1c40_flow_reach.py +0 -0
- {codmap-0.0.43 → codmap-0.0.45}/tests/test_r1c41_scope_membership.py +0 -0
- {codmap-0.0.43 → codmap-0.0.45}/tests/test_r1c42_deep_tier_stability.py +0 -0
- {codmap-0.0.43 → codmap-0.0.45}/tests/test_r1c43_incremental_splice.py +0 -0
- {codmap-0.0.43 → codmap-0.0.45}/tests/test_r1c44_absent_answers.py +0 -0
- {codmap-0.0.43 → codmap-0.0.45}/tests/test_r1c45_repeat_union.py +0 -0
- {codmap-0.0.43 → codmap-0.0.45}/tests/test_r1c46_shadowed_definitions.py +0 -0
- {codmap-0.0.43 → codmap-0.0.45}/tests/test_r1c47_incremental_resample.py +0 -0
- {codmap-0.0.43 → codmap-0.0.45}/tests/test_r1c48_type_checking_imports.py +0 -0
- {codmap-0.0.43 → codmap-0.0.45}/tests/test_r1c49_type_only_cycles.py +0 -0
- {codmap-0.0.43 → codmap-0.0.45}/tests/test_r1c4_complexity.py +0 -0
- {codmap-0.0.43 → codmap-0.0.45}/tests/test_r1c50_flow_entry_points.py +0 -0
- {codmap-0.0.43 → codmap-0.0.45}/tests/test_r1c53_narrowing_declared.py +0 -0
- {codmap-0.0.43 → codmap-0.0.45}/tests/test_r1c54_deterministic_rendering.py +0 -0
- {codmap-0.0.43 → codmap-0.0.45}/tests/test_r1c55_override_grade.py +0 -0
- {codmap-0.0.43 → codmap-0.0.45}/tests/test_r1c56_stub_files.py +0 -0
- {codmap-0.0.43 → codmap-0.0.45}/tests/test_r1c57_facade_package.py +0 -0
- {codmap-0.0.43 → codmap-0.0.45}/tests/test_r1c58_cycle_tangles.py +0 -0
- {codmap-0.0.43 → codmap-0.0.45}/tests/test_r1c59_completeness_drop.py +0 -0
- {codmap-0.0.43 → codmap-0.0.45}/tests/test_r1c5_apidiff.py +0 -0
- {codmap-0.0.43 → codmap-0.0.45}/tests/test_r1c60_nested_definitions.py +0 -0
- {codmap-0.0.43 → codmap-0.0.45}/tests/test_r1c62_phantom_rules.py +0 -0
- {codmap-0.0.43 → codmap-0.0.45}/tests/test_r1c63_answer_format.py +0 -0
- {codmap-0.0.43 → codmap-0.0.45}/tests/test_r1c64_dependency_probe.py +0 -0
- {codmap-0.0.43 → codmap-0.0.45}/tests/test_r1c66_pack_direction.py +0 -0
- {codmap-0.0.43 → codmap-0.0.45}/tests/test_r1c68_dotted_imports.py +0 -0
- {codmap-0.0.43 → codmap-0.0.45}/tests/test_r1c69_contract_validation.py +0 -0
- {codmap-0.0.43 → codmap-0.0.45}/tests/test_r1c6_pack.py +0 -0
- {codmap-0.0.43 → codmap-0.0.45}/tests/test_r1c70_check_graph_currency.py +0 -0
- {codmap-0.0.43 → codmap-0.0.45}/tests/test_r1c71_attribute_chain_calls.py +0 -0
- {codmap-0.0.43 → codmap-0.0.45}/tests/test_r1c72_flat_inference_in_packages.py +0 -0
- {codmap-0.0.43 → codmap-0.0.45}/tests/test_r1c73_cli_version.py +0 -0
- {codmap-0.0.43 → codmap-0.0.45}/tests/test_r1c74_call_site_conservation.py +0 -0
- {codmap-0.0.43 → codmap-0.0.45}/tests/test_r1c75_reexported_class_calls.py +0 -0
- {codmap-0.0.43 → codmap-0.0.45}/tests/test_r1c76_contract_table_typo.py +0 -0
- {codmap-0.0.43 → codmap-0.0.45}/tests/test_r1c77_gate_probe_battery.py +0 -0
- {codmap-0.0.43 → codmap-0.0.45}/tests/test_r1c78_forbidden_chains.py +0 -0
- {codmap-0.0.43 → codmap-0.0.45}/tests/test_r1c7_edge_vocab.py +0 -0
- {codmap-0.0.43 → codmap-0.0.45}/tests/test_r1c80_tests_through_helpers.py +0 -0
- {codmap-0.0.43 → codmap-0.0.45}/tests/test_r1c81_protocol_dispatch.py +0 -0
- {codmap-0.0.43 → codmap-0.0.45}/tests/test_r1c82_review_changed_lines.py +0 -0
- {codmap-0.0.43 → codmap-0.0.45}/tests/test_r1c83_foreign_graph_paths.py +0 -0
- {codmap-0.0.43 → codmap-0.0.45}/tests/test_r1c84_missing_roots.py +0 -0
- {codmap-0.0.43 → codmap-0.0.45}/tests/test_r1c85_mcp_graph_currency.py +0 -0
- {codmap-0.0.43 → codmap-0.0.45}/tests/test_r1c86_incremental_repo_scope.py +0 -0
- {codmap-0.0.43 → codmap-0.0.45}/tests/test_r1c87_review_path_base.py +0 -0
- {codmap-0.0.43 → codmap-0.0.45}/tests/test_r1c89_review_docs.py +0 -0
- {codmap-0.0.43 → codmap-0.0.45}/tests/test_r1c8_deadcode.py +0 -0
- {codmap-0.0.43 → codmap-0.0.45}/tests/test_r1c90_currency_without_recipe.py +0 -0
- {codmap-0.0.43 → codmap-0.0.45}/tests/test_r1c91_route_vocabulary.py +0 -0
- {codmap-0.0.43 → codmap-0.0.45}/tests/test_r1c92_sidecar_pair.py +0 -0
- {codmap-0.0.43 → codmap-0.0.45}/tests/test_r1c94_root_builds.py +0 -0
- {codmap-0.0.43 → codmap-0.0.45}/tests/test_r1c95_r1c96_foreign_trees.py +0 -0
- {codmap-0.0.43 → codmap-0.0.45}/tests/test_r1c9_incremental.py +0 -0
- {codmap-0.0.43 → codmap-0.0.45}/tests/test_scip_export.py +0 -0
- {codmap-0.0.43 → codmap-0.0.45}/tests/test_scope.py +0 -0
- {codmap-0.0.43 → codmap-0.0.45}/tests/test_subsystems.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: codmap
|
|
3
|
-
Version: 0.0.
|
|
3
|
+
Version: 0.0.45
|
|
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
|
[](https://github.com/kogriv/codemap/actions/workflows/ci.yml)
|
|
56
56
|
|
|
57
|
-
**Status:** 🟢 M0–M20 implemented + research track (R1/R2) — schema 0.13, **
|
|
57
|
+
**Status:** 🟢 M0–M20 implemented + research track (R1/R2) — schema 0.13, **1421 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
|
[](https://github.com/kogriv/codemap/actions/workflows/ci.yml)
|
|
20
20
|
|
|
21
|
-
**Status:** 🟢 M0–M20 implemented + research track (R1/R2) — schema 0.13, **
|
|
21
|
+
**Status:** 🟢 M0–M20 implemented + research track (R1/R2) — schema 0.13, **1421 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 &
|
|
@@ -434,12 +434,33 @@ def known_stale(query, contract: ArchitectureContract) -> dict[str, list[frozens
|
|
|
434
434
|
query.type_only_import_tangles)):
|
|
435
435
|
if known:
|
|
436
436
|
now = [set(t["modules"]) for t in tangles()]
|
|
437
|
-
stale = [k for k in known if not any(m <= k for m in now)]
|
|
437
|
+
stale = [k for k in known if not any(m <= k for m in now) and not _absorbing(k, now)]
|
|
438
438
|
if stale:
|
|
439
439
|
out[key] = stale
|
|
440
440
|
return out
|
|
441
441
|
|
|
442
442
|
|
|
443
|
+
def _absorbing(group: frozenset[str], now: list[set[str]]) -> set[str] | None:
|
|
444
|
+
"""A current tangle that holds ≥2 of ``group``'s modules without fitting inside it (R1-C120): the known
|
|
445
|
+
cycle is alive, inside a larger new one — not gone."""
|
|
446
|
+
return next((m for m in now if len(m & group) >= 2 and not m <= group), None)
|
|
447
|
+
|
|
448
|
+
|
|
449
|
+
def known_absorbed(query, contract: ArchitectureContract) -> dict[str, list[tuple[frozenset[str], list[str]]]]:
|
|
450
|
+
"""Listed groups now inside a larger tangle, with that tangle (R1-C120). Never a tighten candidate."""
|
|
451
|
+
out: dict[str, list[tuple[frozenset[str], list[str]]]] = {}
|
|
452
|
+
for key, known, tangles in (("known_lazy_cycles", contract.known_lazy_cycles, query.lazy_import_tangles),
|
|
453
|
+
("known_type_only_cycles", contract.known_type_only_cycles,
|
|
454
|
+
query.type_only_import_tangles)):
|
|
455
|
+
if known:
|
|
456
|
+
now = [set(t["modules"]) for t in tangles()]
|
|
457
|
+
rows = [(k, sorted(m)) for k in known
|
|
458
|
+
if not any(n <= k for n in now) for m in [_absorbing(k, now)] if m]
|
|
459
|
+
if rows:
|
|
460
|
+
out[key] = rows
|
|
461
|
+
return out
|
|
462
|
+
|
|
463
|
+
|
|
443
464
|
def _grew(tangle: dict, known: tuple[frozenset[str], ...] | None) -> str:
|
|
444
465
|
overlap = [k for k in known or () if k & set(tangle["modules"])]
|
|
445
466
|
if not overlap:
|
|
@@ -116,11 +116,11 @@ def context(st: dict, pin: list[str], codemap_version: str, root: Path | None =
|
|
|
116
116
|
"pin_args_toml": "".join(json.dumps(a) + ", " for a in pin[1:]),
|
|
117
117
|
# Codex resolves a relative `cwd` against `.codex/`; an absolute root leaves nothing to assume.
|
|
118
118
|
"root_toml": json.dumps(str(root) if root is not None else "."),
|
|
119
|
-
"outside_languages": outside_languages(root),
|
|
119
|
+
"outside_languages": outside_languages(root, st.get("agents_lang", "en")),
|
|
120
120
|
}
|
|
121
121
|
|
|
122
122
|
|
|
123
|
-
def outside_languages(root: Path | None) -> str:
|
|
123
|
+
def outside_languages(root: Path | None, lang: str = "en") -> str:
|
|
124
124
|
"""R1-C110 D4: the languages under the root that codemap does not read, named in the rules block.
|
|
125
125
|
Names only, never counts: a count would turn the block "outdated" on every new file."""
|
|
126
126
|
if root is None:
|
|
@@ -128,7 +128,11 @@ def outside_languages(root: Path | None) -> str:
|
|
|
128
128
|
from codemap.advise import detect_languages
|
|
129
129
|
# Shell scripts are glue, not a code graph anyone asks codemap about: naming them is noise.
|
|
130
130
|
langs = sorted(k for k in detect_languages(root) if k not in ("python", "shell"))
|
|
131
|
-
|
|
131
|
+
if not langs:
|
|
132
|
+
return ""
|
|
133
|
+
if lang == "ru": # R1-C120: the Russian block named them in English
|
|
134
|
+
return f"; в этом репозитории есть ещё {', '.join(langs)}, их codemap не читает"
|
|
135
|
+
return f"; this repository also has {', '.join(langs)}, which it does not read"
|
|
132
136
|
|
|
133
137
|
|
|
134
138
|
def mcp_entry(ctx: dict, pin: list[str]) -> str:
|
|
@@ -235,7 +235,8 @@ def edit_cycles_region(root: Path, now: dict[str, list[frozenset[str]]], *, tigh
|
|
|
235
235
|
if g:
|
|
236
236
|
group = frozenset(re.findall(r'"([^"]+)"', g.group(1)))
|
|
237
237
|
tangles = now.get(key, [])
|
|
238
|
-
if tighten and not any(t <= group for t in tangles)
|
|
238
|
+
if tighten and not any(t <= group for t in tangles) and not any(
|
|
239
|
+
len(t & group) >= 2 for t in tangles): # absorbed: alive inside a larger one
|
|
239
240
|
res.removed.setdefault(key, []).append(group)
|
|
240
241
|
continue
|
|
241
242
|
have[key].append(group)
|
|
@@ -127,6 +127,9 @@ def add_behavior(graph, griffe_root, target_pkg: str, *, deep: bool = False,
|
|
|
127
127
|
return _resolve(call, modpath, "", _im, _mm, {}, reexports, nodes)
|
|
128
128
|
mod_resolve = (_deep_then_fast(graph, script, target_pkg, mod_fast, modpath, known_modules)
|
|
129
129
|
if script else mod_fast)
|
|
130
|
+
# R1-C120/f1: the module is the scope — a factory returning `import_module(...)` and the functions that
|
|
131
|
+
# `getattr` the module it returns are usually different functions of one runner module.
|
|
132
|
+
_emit_dispatch_references(graph, modpath, list(ast.walk(tree)))
|
|
130
133
|
_process_module_level(graph, modpath, tree, mod_resolve, imports, modmembers,
|
|
131
134
|
reexports, shadow_skip=shadow_skip)
|
|
132
135
|
# R1-C74: class bodies run at import time and were walked by nobody.
|
|
@@ -1012,6 +1015,53 @@ def _emit_self_references(graph, src_id, fnode, members) -> None:
|
|
|
1012
1015
|
extras={"resolution": "self", "sites": counts[target]}))
|
|
1013
1016
|
|
|
1014
1017
|
|
|
1018
|
+
def _import_prefix(call) -> str | None:
|
|
1019
|
+
"""``"pkg.sub."`` from ``import_module(f"pkg.sub.{x}")`` / ``import_module("pkg.sub." + x)``, else None."""
|
|
1020
|
+
f = call.func
|
|
1021
|
+
name = f.attr if isinstance(f, ast.Attribute) else f.id if isinstance(f, ast.Name) else None
|
|
1022
|
+
if name != "import_module" or not call.args:
|
|
1023
|
+
return None
|
|
1024
|
+
arg = call.args[0]
|
|
1025
|
+
head = None
|
|
1026
|
+
if isinstance(arg, ast.JoinedStr) and arg.values and isinstance(arg.values[0], ast.Constant):
|
|
1027
|
+
head = arg.values[0].value
|
|
1028
|
+
elif (isinstance(arg, ast.BinOp) and isinstance(arg.op, ast.Add) and isinstance(arg.left, ast.Constant)):
|
|
1029
|
+
head = arg.left.value
|
|
1030
|
+
if not isinstance(head, str) or not head.endswith("."):
|
|
1031
|
+
return None # not a package prefix: nothing to claim about
|
|
1032
|
+
return head
|
|
1033
|
+
|
|
1034
|
+
|
|
1035
|
+
def _emit_dispatch_references(graph, src_id, nodes) -> None:
|
|
1036
|
+
"""`references` edges for dispatch by name (R1-C120): a module that imports ``pkg.sub.<name>`` from a
|
|
1037
|
+
string with a literal prefix and reads ``getattr(<x>, "run")`` reaches every ``pkg.sub.<mod>.run``.
|
|
1038
|
+
|
|
1039
|
+
The scope is the whole module, sourced from the module node (R1-C120/f1): in the consumer's runner the
|
|
1040
|
+
factory (`module_for` → `import_module(...)`) and the readers (`getattr(module, "run")`, `"empty"`) are three
|
|
1041
|
+
different functions, and pairing within one function claimed nothing there.
|
|
1042
|
+
|
|
1043
|
+
The commonest plugin shape — a runner that loads a module by name and calls its ``run`` — made no edge, so
|
|
1044
|
+
each plugin's ``run`` read as uncalled public code, graded high. Claimed only with both halves in one scope:
|
|
1045
|
+
a literal package prefix (ending in a dot) and a literal attribute name. Every module directly under the
|
|
1046
|
+
prefix is taken as reachable; that is what the runner can load.
|
|
1047
|
+
"""
|
|
1048
|
+
prefixes = {pre for n in nodes if isinstance(n, ast.Call) for pre in [_import_prefix(n)] if pre}
|
|
1049
|
+
if not prefixes:
|
|
1050
|
+
return
|
|
1051
|
+
attrs = {n.args[1].value for n in nodes
|
|
1052
|
+
if isinstance(n, ast.Call) and isinstance(n.func, ast.Name) and n.func.id in ("getattr", "hasattr")
|
|
1053
|
+
and len(n.args) >= 2 and isinstance(n.args[1], ast.Constant) and isinstance(n.args[1].value, str)}
|
|
1054
|
+
if not attrs:
|
|
1055
|
+
return
|
|
1056
|
+
for pre in sorted(prefixes):
|
|
1057
|
+
for nid, node in graph.nodes.items():
|
|
1058
|
+
if node.kind != "function" or not nid.startswith(pre) or nid == src_id:
|
|
1059
|
+
continue
|
|
1060
|
+
mod, _, attr = nid[len(pre):].rpartition(".")
|
|
1061
|
+
if attr in attrs and mod and "." not in mod:
|
|
1062
|
+
graph.add_edge(Edge("references", src_id, nid, extras={"resolution": "dispatch"}))
|
|
1063
|
+
|
|
1064
|
+
|
|
1015
1065
|
def _process_module_level(graph, modpath, tree, resolve, imports, modmembers,
|
|
1016
1066
|
reexports=None, shadow_skip=None) -> None:
|
|
1017
1067
|
"""Calls and value-references in module-level code, sourced from the module (D1/D2).
|
|
@@ -221,6 +221,9 @@ RESOLUTIONS: dict[tuple[str, str], dict[str, str]] = {
|
|
|
221
221
|
"how": "the symbol appears in a type annotation"},
|
|
222
222
|
("references", "name"): {"means": "site", "confidence": "exact",
|
|
223
223
|
"how": "the symbol is named as a value (dict entry, default=…)"},
|
|
224
|
+
("references", "dispatch"): {"means": "site", "confidence": "heuristic",
|
|
225
|
+
"how": "loaded by name: `import_module(\"pkg.sub.\" + x)` and `getattr(m, \"run\")` "
|
|
226
|
+
"in one scope reach every `pkg.sub.<mod>.run` (R1-C120)"},
|
|
224
227
|
("references", "self"): {"means": "site", "confidence": "exact",
|
|
225
228
|
"how": "a bound method `self.m` / `cls.m` handed on as a value, not called "
|
|
226
229
|
"(a callback, `prepare=self.m`) (R1-C118)"},
|
|
@@ -8,7 +8,8 @@ mechanical.
|
|
|
8
8
|
|
|
9
9
|
from __future__ import annotations
|
|
10
10
|
|
|
11
|
-
from codemap.arch import ArchitectureContract, Violation, allowed_unused, applicability,
|
|
11
|
+
from codemap.arch import (ArchitectureContract, Violation, allowed_unused, applicability, known_absorbed,
|
|
12
|
+
known_stale)
|
|
12
13
|
|
|
13
14
|
_EDGE_CAP = 25 # offending edges listed per rule before "+N more"
|
|
14
15
|
|
|
@@ -252,14 +253,21 @@ def _known_count(known) -> str:
|
|
|
252
253
|
|
|
253
254
|
|
|
254
255
|
def _stale_note(query, contract: ArchitectureContract) -> str:
|
|
255
|
-
"""Known-cycle groups that hold no tangle any more (R1-C116), or nothing — silent when none.
|
|
256
|
+
"""Known-cycle groups that hold no tangle any more (R1-C116), or nothing — silent when none.
|
|
257
|
+
A group swallowed by a larger new tangle is said apart, with no advice to tighten (R1-C120)."""
|
|
258
|
+
absorbed = known_absorbed(query, contract)
|
|
259
|
+
text = ""
|
|
260
|
+
for k, rows in absorbed.items():
|
|
261
|
+
for group, bigger in rows:
|
|
262
|
+
text += (f"\n_`{k}`: the known group ({', '.join(sorted(group))}) is absorbed into a larger new tangle "
|
|
263
|
+
f"({', '.join(bigger)}) — its cycle is still there; keep the group._\n")
|
|
256
264
|
stale = known_stale(query, contract)
|
|
257
265
|
if not stale:
|
|
258
|
-
return
|
|
266
|
+
return text
|
|
259
267
|
parts = [f"`{k}`: " + "; ".join("(" + ", ".join(sorted(g)) + ")" for g in v) for k, v in stale.items()]
|
|
260
268
|
n = sum(len(v) for v in stale.values())
|
|
261
|
-
return (f"\n_{n} known cycle group(s) no longer hold a tangle — {' · '.join(parts)}. The ratchet can "
|
|
262
|
-
|
|
269
|
+
return text + (f"\n_{n} known cycle group(s) no longer hold a tangle — {' · '.join(parts)}. The ratchet can "
|
|
270
|
+
"tighten: `codemap devkit ratchet --tighten` removes them._\n")
|
|
263
271
|
|
|
264
272
|
|
|
265
273
|
def _unused_note(query, contract: ArchitectureContract) -> str:
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: codmap
|
|
3
|
-
Version: 0.0.
|
|
3
|
+
Version: 0.0.45
|
|
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
|
[](https://github.com/kogriv/codemap/actions/workflows/ci.yml)
|
|
56
56
|
|
|
57
|
-
**Status:** 🟢 M0–M20 implemented + research track (R1/R2) — schema 0.13, **
|
|
57
|
+
**Status:** 🟢 M0–M20 implemented + research track (R1/R2) — schema 0.13, **1421 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 &
|
|
@@ -119,6 +119,7 @@ tests/test_r1c115_agents_block.py
|
|
|
119
119
|
tests/test_r1c116_known_cycles.py
|
|
120
120
|
tests/test_r1c118_dead_code.py
|
|
121
121
|
tests/test_r1c119_first_build.py
|
|
122
|
+
tests/test_r1c120_dispatch_absorbed.py
|
|
122
123
|
tests/test_r1c13_callgraph_accuracy.py
|
|
123
124
|
tests/test_r1c13_grep_vs_graph.py
|
|
124
125
|
tests/test_r1c16_semantic.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.
|
|
12
|
+
version = "0.0.45"
|
|
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
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
"""R1-C120 — dispatch by name, a known cycle absorbed into a larger one, the Russian languages tail.
|
|
2
|
+
|
|
3
|
+
Expectations A1–A3, B1–B3, C1 are in BACKLOG.md (R1-C120), written before the change.
|
|
4
|
+
"""
|
|
5
|
+
|
|
6
|
+
from __future__ import annotations
|
|
7
|
+
|
|
8
|
+
import tomllib
|
|
9
|
+
from pathlib import Path
|
|
10
|
+
|
|
11
|
+
from codemap import arch
|
|
12
|
+
from codemap.devkit import install, template
|
|
13
|
+
from codemap.devkit.ratchet import edit_cycles_region, tangles_now
|
|
14
|
+
from codemap.extract import extract_repo
|
|
15
|
+
from codemap.query import Query
|
|
16
|
+
from codemap.serve.audit import build_dead_code
|
|
17
|
+
from codemap.serve.check import render_check
|
|
18
|
+
|
|
19
|
+
RUNNER = {
|
|
20
|
+
"f": 'import importlib\n\n\ndef load(short):\n m = importlib.import_module(f"pkg.tools.{short}")\n'
|
|
21
|
+
' fn = getattr(m, "run", None)\n return fn and fn()\n',
|
|
22
|
+
"plus": 'import importlib\n\n\ndef load(short):\n m = importlib.import_module("pkg.tools." + short)\n'
|
|
23
|
+
' return getattr(m, "run")()\n',
|
|
24
|
+
"noprefix": 'import importlib\n\n\ndef load(name):\n m = importlib.import_module(name)\n'
|
|
25
|
+
' return getattr(m, "run")()\n',
|
|
26
|
+
"nogetattr": 'import importlib\n\n\ndef load(short):\n return importlib.import_module(f"pkg.tools.{short}")\n',
|
|
27
|
+
# R1-C120/f1: the consumer's shape — a factory, and the getattr calls in other functions of the module
|
|
28
|
+
"factory": 'import importlib\nfrom types import ModuleType\n\n\ndef module_for(short) -> ModuleType:\n'
|
|
29
|
+
' return importlib.import_module(f"pkg.tools.{short}")\n\n\n'
|
|
30
|
+
'def emptiness(module: ModuleType):\n return getattr(module, "empty", None)\n\n\n'
|
|
31
|
+
'class Session:\n def go(self, short):\n module = module_for(short)\n'
|
|
32
|
+
' probe = getattr(module, "run", None)\n return probe()\n',
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
def _q(tmp_path: Path, runner: str) -> Query:
|
|
37
|
+
files = {"pkg/__init__.py": "", "pkg/runner.py": runner, "pkg/tools/__init__.py": "",
|
|
38
|
+
"pkg/tools/a.py": "def run():\n return 1\n\n\ndef helper():\n return 2\n",
|
|
39
|
+
"pkg/tools/b.py": "def run():\n return 3\n",
|
|
40
|
+
"tests/test_a.py": "from pkg.tools import a\n\n\ndef test_a():\n assert a.run() == 1\n"}
|
|
41
|
+
for rel, text in files.items():
|
|
42
|
+
(tmp_path / rel).parent.mkdir(parents=True, exist_ok=True)
|
|
43
|
+
(tmp_path / rel).write_text(text)
|
|
44
|
+
return Query(extract_repo(str(tmp_path / "pkg"), consumers=[str(tmp_path / "tests")]))
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
def test_a1_a_runner_reaches_every_run_under_its_prefix(tmp_path):
|
|
48
|
+
for i, shape in enumerate(("f", "plus", "factory")):
|
|
49
|
+
q = _q(tmp_path / str(i), RUNNER[shape])
|
|
50
|
+
out = build_dead_code(q, public=True)
|
|
51
|
+
public = {c["id"] for c in out["uncalled_public"]["candidates"]}
|
|
52
|
+
outside = {c["id"] for c in out["called_only_from_outside"]}
|
|
53
|
+
assert "pkg.tools.b.run" not in public and "pkg.tools.a.run" not in outside, (shape, public, outside)
|
|
54
|
+
assert "pkg.tools.a.helper" in public # control: not named by the getattr
|
|
55
|
+
refs = [e for e in q.graph.edges if e.type == "references" and e.extras.get("resolution") == "dispatch"]
|
|
56
|
+
assert {e.target for e in refs} == {"pkg.tools.a.run", "pkg.tools.b.run"}
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
def test_a2_a3_no_claim_without_both_halves(tmp_path):
|
|
60
|
+
for i, shape in enumerate(("noprefix", "nogetattr")):
|
|
61
|
+
q = _q(tmp_path / str(i), RUNNER[shape])
|
|
62
|
+
assert not [e for e in q.graph.edges if e.extras.get("resolution") == "dispatch"], shape
|
|
63
|
+
public = {c["id"] for c in build_dead_code(q, public=True)["uncalled_public"]["candidates"]}
|
|
64
|
+
assert "pkg.tools.b.run" in public
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
LAZY = "def f():\n from pkg import {0}\n return {0}\n"
|
|
68
|
+
EAGER = "import pkg.{0}\n"
|
|
69
|
+
|
|
70
|
+
|
|
71
|
+
def _cyc(tmp_path: Path, files: dict[str, str]) -> Query:
|
|
72
|
+
for rel, text in {"pkg/__init__.py": "", **files}.items():
|
|
73
|
+
(tmp_path / rel).parent.mkdir(parents=True, exist_ok=True)
|
|
74
|
+
(tmp_path / rel).write_text(text)
|
|
75
|
+
return Query(extract_repo(str(tmp_path / "pkg")))
|
|
76
|
+
|
|
77
|
+
|
|
78
|
+
def test_b1_b2_an_absorbed_group_is_kept_and_said_apart(tmp_path):
|
|
79
|
+
# known pair (s, p); a third module w joins: s → p (eager), p ⇢ w, w ⇢ s — one tangle of three
|
|
80
|
+
q = _cyc(tmp_path, {"pkg/s.py": EAGER.format("p"), "pkg/p.py": LAZY.format("w"), "pkg/w.py": LAZY.format("s")})
|
|
81
|
+
(tmp_path / "codemap.toml").write_text('[architecture]\n'
|
|
82
|
+
'# >>> codemap-devkit cycles v5 — test\n'
|
|
83
|
+
'known_lazy_cycles = [\n ["pkg.p", "pkg.s"],\n]\n'
|
|
84
|
+
'known_type_only_cycles = [\n]\n# <<< codemap-devkit cycles\n')
|
|
85
|
+
c = arch.load_contract(tmp_path)
|
|
86
|
+
vs = arch.check_contract(q, c)
|
|
87
|
+
assert vs and "grew from the known (pkg.p, pkg.s)" in vs[0].modules[0]
|
|
88
|
+
md = render_check(q, c, vs)
|
|
89
|
+
assert "is absorbed into a larger new tangle (pkg.p, pkg.s, pkg.w)" in md and "--tighten" not in md, md
|
|
90
|
+
assert arch.known_stale(q, c) == {}
|
|
91
|
+
now = tangles_now(q)
|
|
92
|
+
edit_cycles_region(tmp_path, {k: [] for k in now} | {"known_lazy_cycles": now["known_lazy_cycles"]},
|
|
93
|
+
tighten=True)
|
|
94
|
+
kept = arch.load_contract(tmp_path).known_lazy_cycles
|
|
95
|
+
assert frozenset({"pkg.p", "pkg.s"}) in kept and frozenset({"pkg.p", "pkg.s", "pkg.w"}) in kept
|
|
96
|
+
|
|
97
|
+
|
|
98
|
+
def test_b3_a_group_that_is_gone_is_still_stale(tmp_path):
|
|
99
|
+
q = _cyc(tmp_path, {"pkg/s.py": "x = 1\n", "pkg/p.py": "y = 2\n"})
|
|
100
|
+
c = arch.parse_contract(tomllib.loads('[architecture]\nknown_lazy_cycles = [["pkg.p", "pkg.s"]]\n')["architecture"])
|
|
101
|
+
assert arch.known_stale(q, c) == {"known_lazy_cycles": [frozenset({"pkg.p", "pkg.s"})]}
|
|
102
|
+
assert "--tighten" in render_check(q, c, [])
|
|
103
|
+
|
|
104
|
+
|
|
105
|
+
def test_c1_the_russian_block_names_other_languages_in_russian(tmp_path):
|
|
106
|
+
(tmp_path / "web").mkdir()
|
|
107
|
+
(tmp_path / "web/app.js").write_text("export const x = 1;\n")
|
|
108
|
+
assert install.outside_languages(tmp_path, "ru") == "; в этом репозитории есть ещё javascript, их codemap не читает"
|
|
109
|
+
assert "which it does not read" in install.outside_languages(tmp_path)
|
|
110
|
+
assert "{{outside_languages}}" in template("agents_block.ru.md")
|
|
@@ -57,8 +57,10 @@ def test_grep_less_precise_at_calls_than_defs(measured):
|
|
|
57
57
|
|
|
58
58
|
def test_def_find_precision_is_near_one(measured):
|
|
59
59
|
# grep already nails locations → the graph earns no "where-defined" advantage.
|
|
60
|
-
|
|
61
|
-
|
|
60
|
+
# On the sample, not per symbol (as above): the repo's own tests carry code inside strings, so a short name
|
|
61
|
+
# drawn from the self-graph (`load`, 0.0.44) can have fixture `def`s beside the real one.
|
|
62
|
+
dps = sorted(r["grep_def_precision"] for r in measured if r["grep_def_precision"] is not None)
|
|
63
|
+
assert dps and dps[len(dps) // 2] >= 0.4 and sum(dps) / len(dps) >= 0.5, dps
|
|
62
64
|
|
|
63
65
|
|
|
64
66
|
def test_deterministic(measured):
|
|
@@ -103,6 +103,18 @@ def _self_reference_probe(tmp: Path):
|
|
|
103
103
|
return extract(core)
|
|
104
104
|
|
|
105
105
|
|
|
106
|
+
def _dispatch_probe(tmp: Path):
|
|
107
|
+
"""R1-C120: `import_module("dpkg.tools." + x)` and `getattr(m, "run")` — `references` with `dispatch`."""
|
|
108
|
+
core = tmp / "dpkg"
|
|
109
|
+
(core / "tools").mkdir(parents=True)
|
|
110
|
+
(core / "__init__.py").write_text("")
|
|
111
|
+
(core / "tools" / "__init__.py").write_text("")
|
|
112
|
+
(core / "tools" / "a.py").write_text("def run():\n return 1\n")
|
|
113
|
+
(core / "runner.py").write_text("import importlib\n\n\ndef load(x):\n"
|
|
114
|
+
" return getattr(importlib.import_module('dpkg.tools.' + x), 'run')()\n")
|
|
115
|
+
return extract(core)
|
|
116
|
+
|
|
117
|
+
|
|
106
118
|
@pytest.fixture(scope="module")
|
|
107
119
|
def builds():
|
|
108
120
|
"""Every build the table is measured against — fixtures only, so CI needs no target."""
|
|
@@ -118,6 +130,7 @@ def builds():
|
|
|
118
130
|
out["protocol"] = _protocol_probe(tmp)
|
|
119
131
|
out["consumer-local"] = _consumer_local_probe(tmp)
|
|
120
132
|
out["self-reference"] = _self_reference_probe(tmp)
|
|
133
|
+
out["dispatch"] = _dispatch_probe(tmp)
|
|
121
134
|
return out
|
|
122
135
|
|
|
123
136
|
|
|
@@ -184,9 +197,10 @@ def test_no_grade_is_a_number():
|
|
|
184
197
|
def test_the_over_approximation_is_the_only_heuristic(builds):
|
|
185
198
|
"""A factory fanned out across a registry family, and a Protocol call fanned out to
|
|
186
199
|
its implementers (R1-C81), are the routes that did not find a target — everything
|
|
187
|
-
else was a binding or an inference.
|
|
200
|
+
else was a binding or an inference. R1-C120 adds the third fan-out: a module loaded by name, its attribute
|
|
201
|
+
read by a literal, reaching that attribute in every module under the prefix."""
|
|
188
202
|
heuristic = {k for k, v in RESOLUTIONS.items() if v["confidence"] == "heuristic"}
|
|
189
|
-
assert heuristic == {("calls", "registry-candidate"), ("calls", "protocol")}
|
|
203
|
+
assert heuristic == {("calls", "registry-candidate"), ("calls", "protocol"), ("references", "dispatch")}
|
|
190
204
|
inferred = {k for k, v in RESOLUTIONS.items() if v["confidence"] == "inferred"}
|
|
191
205
|
assert inferred == {("calls", "deep"), ("accesses", "deep")}
|
|
192
206
|
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|