codegraph-brain 0.23.2__py3-none-any.whl → 0.23.3__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.
- cgis/api/mcp_server.py +39 -14
- {codegraph_brain-0.23.2.dist-info → codegraph_brain-0.23.3.dist-info}/METADATA +1 -1
- {codegraph_brain-0.23.2.dist-info → codegraph_brain-0.23.3.dist-info}/RECORD +6 -6
- {codegraph_brain-0.23.2.dist-info → codegraph_brain-0.23.3.dist-info}/WHEEL +0 -0
- {codegraph_brain-0.23.2.dist-info → codegraph_brain-0.23.3.dist-info}/entry_points.txt +0 -0
- {codegraph_brain-0.23.2.dist-info → codegraph_brain-0.23.3.dist-info}/licenses/LICENSE +0 -0
cgis/api/mcp_server.py
CHANGED
|
@@ -364,13 +364,21 @@ def cgis_trace_flow(
|
|
|
364
364
|
int,
|
|
365
365
|
Field(
|
|
366
366
|
description="Maximum edge hops downstream. Every edge type counts as a hop — "
|
|
367
|
-
"
|
|
368
|
-
"
|
|
367
|
+
"calls, imports, inheritance, DI dependencies, references and containment — so "
|
|
368
|
+
"from a module or class the first hop is mostly its own members and imports."
|
|
369
369
|
),
|
|
370
370
|
] = 3,
|
|
371
371
|
output_format: OutputFormat = "mermaid",
|
|
372
372
|
) -> str:
|
|
373
|
-
"""
|
|
373
|
+
"""Downstream subgraph of one FQN: everything it reaches within ``depth`` hops.
|
|
374
|
+
|
|
375
|
+
Every edge type counts — calls, imports, inheritance, DI dependencies,
|
|
376
|
+
references, and containment (so from a module or class the first hop includes
|
|
377
|
+
its own members) — so this answers "what does X depend on?". For what depends
|
|
378
|
+
on X use
|
|
379
|
+
``cgis_analyze_impact``; for only the members of a module or class,
|
|
380
|
+
``cgis_get_structure``; for a source-included brief to read before editing
|
|
381
|
+
one symbol, ``cgis_context``.
|
|
374
382
|
|
|
375
383
|
``output_format="mermaid"`` (default) returns a human-readable diagram;
|
|
376
384
|
``"json"`` returns a joinable ``{root, nodes, edges, coverage}`` payload
|
|
@@ -417,15 +425,22 @@ def cgis_analyze_impact(
|
|
|
417
425
|
int,
|
|
418
426
|
Field(
|
|
419
427
|
description="Maximum edge hops upstream. Every edge type counts as a hop — "
|
|
420
|
-
"
|
|
421
|
-
"
|
|
428
|
+
"callers, importers, subclasses, type references, DI dependents and the "
|
|
429
|
+
"enclosing class or file all appear alongside each other."
|
|
422
430
|
),
|
|
423
431
|
] = 3,
|
|
424
432
|
output_format: OutputFormat = "mermaid",
|
|
425
433
|
) -> str:
|
|
426
|
-
"""
|
|
434
|
+
"""Upstream subgraph of one FQN: everything that reaches it within ``depth`` hops.
|
|
435
|
+
|
|
436
|
+
Every edge type counts — callers, but also importers, subclasses, type
|
|
437
|
+
references, DI dependents and the enclosing class or file — so this answers
|
|
438
|
+
"what breaks if I change X?". For what X depends on use
|
|
439
|
+
``cgis_trace_flow``; for only the members of a module or class,
|
|
440
|
+
``cgis_get_structure``; for a source-included brief to read before editing
|
|
441
|
+
one symbol, ``cgis_context``.
|
|
427
442
|
|
|
428
|
-
|
|
443
|
+
``output_format="mermaid"`` (default)
|
|
429
444
|
returns a diagram; ``"json"`` returns a joinable ``{root, nodes, edges,
|
|
430
445
|
coverage}`` payload with real FQNs — letting an agent compute set
|
|
431
446
|
differences (e.g. "which route handlers never reach ``verify_ownership``?")
|
|
@@ -471,10 +486,13 @@ def cgis_get_structure(
|
|
|
471
486
|
] = 2,
|
|
472
487
|
output_format: OutputFormat = "mermaid",
|
|
473
488
|
) -> str:
|
|
474
|
-
"""
|
|
489
|
+
"""Members of a module or class: the classes, functions and methods it contains.
|
|
475
490
|
|
|
476
|
-
|
|
477
|
-
|
|
491
|
+
Follows containment (CONTAINS/DECLARES) only, so no call or import appears.
|
|
492
|
+
For how the code connects use ``cgis_trace_flow`` (what it depends on) or
|
|
493
|
+
``cgis_analyze_impact`` (what depends on it).
|
|
494
|
+
|
|
495
|
+
Matches the CLI ``structure`` command. ``output_format="mermaid"`` (default) returns a
|
|
478
496
|
diagram of the hierarchy rooted at the given FQN; ``"json"`` returns the
|
|
479
497
|
joinable ``{root, nodes, edges}`` payload with real FQNs.
|
|
480
498
|
"""
|
|
@@ -785,7 +803,14 @@ def cgis_context(
|
|
|
785
803
|
),
|
|
786
804
|
] = "",
|
|
787
805
|
) -> str:
|
|
788
|
-
"""
|
|
806
|
+
"""Prompt-ready brief on one FQN: its source, class, direct callers and callees.
|
|
807
|
+
|
|
808
|
+
Call this before editing a symbol, instead of reading its files. It follows
|
|
809
|
+
calls only, one hop by default. Source is included when the file is found
|
|
810
|
+
(see ``source_root``), and the domain when the graph was tagged with one.
|
|
811
|
+
For a multi-hop subgraph
|
|
812
|
+
over every edge type without source, use ``cgis_trace_flow`` (downstream) or
|
|
813
|
+
``cgis_analyze_impact`` (upstream).
|
|
789
814
|
|
|
790
815
|
Returns an XML-tagged prompt — the focal node's source, its enclosing class,
|
|
791
816
|
its architectural domain boundary, direct callers (upstream ripple) and
|
|
@@ -836,7 +861,7 @@ def cgis_metrics(
|
|
|
836
861
|
),
|
|
837
862
|
] = None,
|
|
838
863
|
) -> str:
|
|
839
|
-
"""Whole-graph architectural metrics — coupling bottlenecks
|
|
864
|
+
"""Whole-graph architectural metrics — coupling bottlenecks, God classes, PageRank.
|
|
840
865
|
|
|
841
866
|
Returns JSON ``{bottlenecks, god_classes, critical}`` computed with vectorized
|
|
842
867
|
DuckDB aggregations over the whole graph (fan-in/fan-out coupling,
|
|
@@ -894,7 +919,7 @@ def cgis_find_orphans(
|
|
|
894
919
|
bool, Field(description="Include machine-generated classes, which are hidden by default.")
|
|
895
920
|
] = False,
|
|
896
921
|
) -> str:
|
|
897
|
-
"""Classes nothing in production builds, extends or names — dead-code candidates
|
|
922
|
+
"""Classes nothing in production builds, extends or names — dead-code candidates.
|
|
898
923
|
|
|
899
924
|
Finds classes that no test, type checker or linter flags, because each is
|
|
900
925
|
still imported somewhere: a package re-export keeps a class importable long
|
|
@@ -976,7 +1001,7 @@ def cgis_audit_reachability(
|
|
|
976
1001
|
Field(description="Maximum reachability depth; a longer path is reported as a gap."),
|
|
977
1002
|
] = 5,
|
|
978
1003
|
) -> str:
|
|
979
|
-
"""Reachability/authorization audit — which sources never reach a checkpoint
|
|
1004
|
+
"""Reachability/authorization audit — which sources never reach a checkpoint.
|
|
980
1005
|
|
|
981
1006
|
The headline use is **IDOR/authz coverage**: list every route handler that does
|
|
982
1007
|
NOT transitively reach an ownership check. Reachability follows behavioral edges
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.5
|
|
2
2
|
Name: codegraph-brain
|
|
3
|
-
Version: 0.23.
|
|
3
|
+
Version: 0.23.3
|
|
4
4
|
Summary: Semantic code graph for AI agents — deterministic FQN resolution, impact analysis and architectural drift gates, exposed over MCP.
|
|
5
5
|
Project-URL: Homepage, https://github.com/zaebee/codegraph-brain
|
|
6
6
|
Project-URL: Repository, https://github.com/zaebee/codegraph-brain
|
|
@@ -5,7 +5,7 @@ cgis/pipeline.py,sha256=c-z6MJb9H06hWZQfvVwGQL2PUN3k0-Am-PCAHfMK0nQ,17048
|
|
|
5
5
|
cgis/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
6
6
|
cgis/api/.gitkeep,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
7
7
|
cgis/api/__init__.py,sha256=wvFZK6oZspFGmonBz2rDg1aXxK7DHuE87or_w_cwY28,91
|
|
8
|
-
cgis/api/mcp_server.py,sha256=
|
|
8
|
+
cgis/api/mcp_server.py,sha256=16ffe6JzLxeKp-LHeVybo1olYjMft_LKW1AJsZ55uU4,45995
|
|
9
9
|
cgis/core/.gitkeep,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
10
10
|
cgis/core/coverage.py,sha256=AmeZ_mij5Q382MAqtUmDRmJ_lHLPsV73k0_zksaWc6c,2469
|
|
11
11
|
cgis/core/freshness.py,sha256=s1ahMqizX5jRo5Sj6T-2YfNq1d-jsRqisfne5m4yagw,1395
|
|
@@ -87,8 +87,8 @@ cgis/resolver/symbols.py,sha256=A88dOb7ciEfWaS4KCK0Ho4cBC2IZisNrBfYp-f1LFYs,1254
|
|
|
87
87
|
cgis/resolver/uplift.py,sha256=Hkye1q-kI-gKO6GIBYv3gUZj1AC0-_mkpoIpmwVsG4g,9591
|
|
88
88
|
cgis/storage/.gitkeep,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
89
89
|
cgis/storage/sqlite_store.py,sha256=tlkg9kbiAFm0rth7ndsRPyv3cjDCj3dpvs7Pp_FTBno,45671
|
|
90
|
-
codegraph_brain-0.23.
|
|
91
|
-
codegraph_brain-0.23.
|
|
92
|
-
codegraph_brain-0.23.
|
|
93
|
-
codegraph_brain-0.23.
|
|
94
|
-
codegraph_brain-0.23.
|
|
90
|
+
codegraph_brain-0.23.3.dist-info/METADATA,sha256=WDW2c61SDo1CdZHnbESLw2VnwG_EgWSJoo1vS8R8Di4,11771
|
|
91
|
+
codegraph_brain-0.23.3.dist-info/WHEEL,sha256=zOwg4jB6zX2kU910N-cMawjivD6tO8NEWvE12je1bVk,87
|
|
92
|
+
codegraph_brain-0.23.3.dist-info/entry_points.txt,sha256=mWajEQlAoWuiLyCQdD1TvvguloKQFmzKb52-g9PB_R4,123
|
|
93
|
+
codegraph_brain-0.23.3.dist-info/licenses/LICENSE,sha256=1X36nOG5VocDaEGzAZqIv7uawy_7sWlFoiwECwx5aBI,1065
|
|
94
|
+
codegraph_brain-0.23.3.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|