codegraph-engine 3.0.0__py3-none-any.whl → 3.0.1__py3-none-any.whl

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 (69) hide show
  1. codegraph/__init__.py +1 -1
  2. codegraph/__main__.py +7 -0
  3. codegraph/agent_brain.py +81 -0
  4. codegraph/agent_capabilities.py +1037 -73
  5. codegraph/agent_rules.py +1 -0
  6. codegraph/architecture_rules.py +123 -0
  7. codegraph/changelog.py +170 -0
  8. codegraph/cli.py +793 -1
  9. codegraph/context.py +97 -13
  10. codegraph/dataflow_propagation.py +118 -0
  11. codegraph/dead_code.py +387 -0
  12. codegraph/epistemic.py +8 -0
  13. codegraph/evidence_contract.py +13 -3
  14. codegraph/federation.py +245 -0
  15. codegraph/frameworks.py +63 -6
  16. codegraph/graph/traversal.py +150 -7
  17. codegraph/graph_csr.py +218 -0
  18. codegraph/incremental.py +150 -0
  19. codegraph/indexing/classifier.py +5 -0
  20. codegraph/indexing/indexer.py +1 -0
  21. codegraph/indexing/languages/__init__.py +1 -0
  22. codegraph/indexing/languages/cpp.py +457 -0
  23. codegraph/indexing/languages/go.py +459 -0
  24. codegraph/indexing/languages/jvm.py +583 -0
  25. codegraph/indexing/languages/rust.py +507 -0
  26. codegraph/indexing/models.py +9 -1
  27. codegraph/indexing/parser.py +146 -9
  28. codegraph/indexing/protocols.py +220 -0
  29. codegraph/indexing/scanner.py +17 -0
  30. codegraph/interrogation.py +80 -20
  31. codegraph/lsp.py +318 -0
  32. codegraph/lsp_bridge/__init__.py +16 -0
  33. codegraph/lsp_bridge/bridge.py +102 -0
  34. codegraph/lsp_bridge/client.py +207 -0
  35. codegraph/lsp_bridge/models.py +71 -0
  36. codegraph/mcp/server.py +312 -1
  37. codegraph/memory/trajectory.py +282 -0
  38. codegraph/multi_agent/__init__.py +13 -0
  39. codegraph/multi_agent/coordinator.py +229 -0
  40. codegraph/multi_agent/models.py +76 -0
  41. codegraph/polymorphism.py +95 -0
  42. codegraph/pr_review.py +296 -0
  43. codegraph/process_lifecycle.py +22 -2
  44. codegraph/reachability.py +198 -0
  45. codegraph/reachability_index.py +74 -0
  46. codegraph/refactor/__init__.py +12 -0
  47. codegraph/refactor/patcher.py +348 -0
  48. codegraph/refactor/renamer.py +3 -3
  49. codegraph/refactor/transactions.py +23 -12
  50. codegraph/repair.py +233 -0
  51. codegraph/resolver.py +155 -2
  52. codegraph/retrieval_policy.py +16 -1
  53. codegraph/roblox.py +2174 -0
  54. codegraph/route_composer.py +7 -0
  55. codegraph/runtime/__init__.py +6 -0
  56. codegraph/runtime/db_watcher.py +2 -2
  57. codegraph/runtime/otel_receiver.py +208 -0
  58. codegraph/sandbox.py +215 -0
  59. codegraph/security/supply_chain.py +188 -0
  60. codegraph/security/taint.py +421 -0
  61. codegraph/test_gen.py +437 -0
  62. codegraph/ui/server.py +200 -39
  63. codegraph/watcher.py +2 -2
  64. {codegraph_engine-3.0.0.dist-info → codegraph_engine-3.0.1.dist-info}/METADATA +255 -69
  65. {codegraph_engine-3.0.0.dist-info → codegraph_engine-3.0.1.dist-info}/RECORD +69 -34
  66. {codegraph_engine-3.0.0.dist-info → codegraph_engine-3.0.1.dist-info}/WHEEL +1 -1
  67. {codegraph_engine-3.0.0.dist-info → codegraph_engine-3.0.1.dist-info}/entry_points.txt +0 -0
  68. {codegraph_engine-3.0.0.dist-info → codegraph_engine-3.0.1.dist-info}/licenses/LICENSE +0 -0
  69. {codegraph_engine-3.0.0.dist-info → codegraph_engine-3.0.1.dist-info}/top_level.txt +0 -0
codegraph/__init__.py CHANGED
@@ -1,6 +1,6 @@
1
1
  """CodeGraph MCP: local, evidence-backed codebase intelligence."""
2
2
 
3
- __version__ = "3.0.0"
3
+ __version__ = "3.0.1"
4
4
  from codegraph.errors import (
5
5
  CodeGraphError,
6
6
  ErrorCode,
codegraph/__main__.py ADDED
@@ -0,0 +1,7 @@
1
+ """Entrypoint for `python -m codegraph`."""
2
+ from __future__ import annotations
3
+
4
+ from codegraph.cli import app
5
+
6
+ if __name__ == "__main__":
7
+ app()
codegraph/agent_brain.py CHANGED
@@ -814,6 +814,86 @@ RELATIONSHIP_SEMANTICS_REGISTRY: dict[str, RelationshipSemanticsSpec] = {
814
814
  common_tool="trace_path / find_callees / get_context",
815
815
  example="`prompt_template` -> `PIPELINE_STEP` (`DATAFLOW_VERIFIED`) -> `chat_model`",
816
816
  ),
817
+ "REQUIRES_MODULE": RelationshipSemanticsSpec(
818
+ relationship="REQUIRES_MODULE",
819
+ meaning="Luau or Roblox module requires another ModuleScript via `require(...)` using Rojo DataModel paths or `script.Parent` traversal.",
820
+ typical_source="Caller Luau module or function (`ClientController`, `InventoryService`)",
821
+ typical_target="Target ModuleScript (`Packages.Knit`, `src.shared.Types`)",
822
+ proves="Deterministic module dependency via Rojo project mapping (`ROJO_VERIFIED`) or bounded relative script path (`AST_VERIFIED`).",
823
+ does_not_prove="Does not prove runtime execution order when `require` is inside a conditional branch.",
824
+ common_tool="get_imports / trace_path / get_context",
825
+ example="`InventoryService` -> `REQUIRES_MODULE` (`ROJO_VERIFIED`) -> `Packages.Knit`",
826
+ ),
827
+ "CLIENT_DISPATCHES_REMOTE": RelationshipSemanticsSpec(
828
+ relationship="CLIENT_DISPATCHES_REMOTE",
829
+ meaning="Roblox client script or controller dispatches a `RemoteEvent:FireServer(...)` or `RemoteFunction:InvokeServer(...)` call across the client-server boundary.",
830
+ typical_source="Client controller or LocalScript (`ClientController.RequestInventoryUpdate`)",
831
+ typical_target="Canonical Roblox Remote node (`ReplicatedStorage.Remotes.Inventory`)",
832
+ proves="Client-to-server network dispatch targeting the resolved Remote instance (`ROJO_VERIFIED` or `FRAMEWORK_VERIFIED`).",
833
+ does_not_prove="Never collapsed into generic `CALLS`; does not prove server validation success at runtime.",
834
+ common_tool="trace_path / find_callees / get_context",
835
+ example="`ClientController` -> `CLIENT_DISPATCHES_REMOTE` (`ROJO_VERIFIED`) -> `ReplicatedStorage.Remotes.Inventory`",
836
+ ),
837
+ "SERVER_HANDLES_REMOTE": RelationshipSemanticsSpec(
838
+ relationship="SERVER_HANDLES_REMOTE",
839
+ meaning="Roblox server script or service connects a handler to `RemoteEvent.OnServerEvent:Connect(...)` or assigns `RemoteFunction.OnServerInvoke`.",
840
+ typical_source="Canonical Roblox Remote node (`ReplicatedStorage.Remotes.Inventory`)",
841
+ typical_target="Server service or handler method (`InventoryService.KnitInit`, `InventoryService`)",
842
+ proves="Server-side network handler registration for the canonical Remote channel (`ROJO_VERIFIED` or `FRAMEWORK_VERIFIED`).",
843
+ does_not_prove="Never collapsed into generic `CALLS`; does not prove payload schema validation.",
844
+ common_tool="trace_path / find_callers / get_context",
845
+ example="`ReplicatedStorage.Remotes.Inventory` -> `SERVER_HANDLES_REMOTE` (`ROJO_VERIFIED`) -> `InventoryService`",
846
+ ),
847
+ "PROVIDES_SERVICE": RelationshipSemanticsSpec(
848
+ relationship="PROVIDES_SERVICE",
849
+ meaning="Knit (`Knit.CreateService`) or Flamework (`@Service`, `@Controller`) declares a named singleton service or controller.",
850
+ typical_source="Service class or table symbol (`src.server.Services.InventoryService.InventoryService`)",
851
+ typical_target="Registered service identifier (`InventoryService`, `CombatService`)",
852
+ proves="Framework service provider registration (`FRAMEWORK_VERIFIED`).",
853
+ does_not_prove="Does not prove `Knit.Start()` has completed at runtime.",
854
+ common_tool="trace_path / find_references / get_context",
855
+ example="`InventoryService` -> `PROVIDES_SERVICE` (`FRAMEWORK_VERIFIED`) -> `InventoryService`",
856
+ ),
857
+ "GETS_SERVICE": RelationshipSemanticsSpec(
858
+ relationship="GETS_SERVICE",
859
+ meaning="Knit (`Knit.GetService(...)`) or Flamework (`Dependency<T>()`) resolves a framework service or controller dependency.",
860
+ typical_source="Consumer controller or service method (`RewardService.GrantStarterPack`, `CombatController`)",
861
+ typical_target="Target service symbol (`src.server.Services.InventoryService.InventoryService`)",
862
+ proves="Framework dependency resolution linking consumer to service provider (`FRAMEWORK_VERIFIED`).",
863
+ does_not_prove="Does not prove runtime initialization order.",
864
+ common_tool="trace_path / find_callees / analyze_impact",
865
+ example="`RewardService.GrantStarterPack` -> `GETS_SERVICE` (`FRAMEWORK_VERIFIED`) -> `InventoryService`",
866
+ ),
867
+ "CONFIGURES_PERSISTENCE": RelationshipSemanticsSpec(
868
+ relationship="CONFIGURES_PERSISTENCE",
869
+ meaning="Roblox server service configures a `DataStoreService:GetDataStore(...)` or `ProfileService.GetProfileStore(...)` persistence store.",
870
+ typical_source="Server service or module (`InventoryService`)",
871
+ typical_target="Canonical Roblox persistence entity (`persistence.roblox.datastore.<name>`)",
872
+ proves="Static persistence store binding (`FRAMEWORK_VERIFIED`), kept distinct from SQL tables.",
873
+ does_not_prove="Does not prove Roblox Studio API Services are enabled at runtime.",
874
+ common_tool="trace_path / analyze_impact / get_context",
875
+ example="`InventoryService` -> `CONFIGURES_PERSISTENCE` (`FRAMEWORK_VERIFIED`) -> `persistence.roblox.datastore.PlayerInventory_v1`",
876
+ ),
877
+ "READS_PERSISTENCE": RelationshipSemanticsSpec(
878
+ relationship="READS_PERSISTENCE",
879
+ meaning="Function or method reads from a Roblox DataStore or ProfileStore (`GetAsync`, `LoadProfileAsync`).",
880
+ typical_source="Service method (`InventoryService.HandleInventoryRequest`)",
881
+ typical_target="Canonical Roblox persistence entity (`persistence.roblox.datastore.<name>`)",
882
+ proves="Static persistence read operation targeting the store (`FRAMEWORK_VERIFIED`).",
883
+ does_not_prove="Does not prove key existence or throttling budget at runtime.",
884
+ common_tool="trace_path / analyze_impact / get_context",
885
+ example="`InventoryService.HandleInventoryRequest` -> `READS_PERSISTENCE` (`FRAMEWORK_VERIFIED`) -> `persistence.roblox.datastore.PlayerInventory_v1`",
886
+ ),
887
+ "WRITES_PERSISTENCE": RelationshipSemanticsSpec(
888
+ relationship="WRITES_PERSISTENCE",
889
+ meaning="Function or method writes or mutates a Roblox DataStore or ProfileStore (`SetAsync`, `UpdateAsync`, `IncrementAsync`, `RemoveAsync`, `Save`).",
890
+ typical_source="Service method (`InventoryService.HandleInventoryRequest`)",
891
+ typical_target="Canonical Roblox persistence entity (`persistence.roblox.datastore.<name>`)",
892
+ proves="Static persistence mutation targeting the store (`FRAMEWORK_VERIFIED`).",
893
+ does_not_prove="Does not prove runtime `pcall` success or DataStore queue limits.",
894
+ common_tool="trace_path / analyze_impact / get_context",
895
+ example="`InventoryService.HandleInventoryRequest` -> `WRITES_PERSISTENCE` (`FRAMEWORK_VERIFIED`) -> `persistence.roblox.datastore.PlayerInventory_v1`",
896
+ ),
817
897
  }
818
898
 
819
899
 
@@ -1938,6 +2018,7 @@ def render_tool_capabilities_summary() -> str:
1938
2018
  | **`STATIC_VERIFIED`** | Proven by static SQL DDL/DML or migration parsing | Rely on table/column/query/migration relationship as verified static fact. |
1939
2019
  | **`FRAMEWORK_VERIFIED`** | Proven by deterministic framework rules | Rely on route/ORM/DI/task/event relationship as verified framework fact. |
1940
2020
  | **`DATAFLOW_VERIFIED`** | Proven by conservative local/container binding | Rely on resolved target as verified dataflow fact. |
2021
+ | **`ROJO_VERIFIED`** | Proven by deterministic Rojo `default.project.json` DataModel mapping | Rely on virtual-to-physical Luau module resolution as verified fact. |
1941
2022
  | **`RUNTIME_OBSERVED`** | Observed in an ingested runtime trace (`observation_count >= 1`) | Treat as verified runtime execution fact; never promote to static `AST_VERIFIED` proof. |
1942
2023
  | **`RUNTIME_UNOBSERVED`** | Not observed in the ingested runtime trace sample | Never claim the static path is dead code or impossible at runtime. |
1943
2024
  | **`POSSIBLE`** | Plausible candidate, not statically guaranteed | Treat as lead; verify with targeted `get_file` / `read_file` before claiming as fact. |