kgmodule-utils 0.29.0__tar.gz → 0.29.2__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 (53) hide show
  1. {kgmodule_utils-0.29.0 → kgmodule_utils-0.29.2}/PKG-INFO +17 -7
  2. {kgmodule_utils-0.29.0 → kgmodule_utils-0.29.2}/README.md +13 -3
  3. {kgmodule_utils-0.29.0 → kgmodule_utils-0.29.2}/pyproject.toml +5 -5
  4. {kgmodule_utils-0.29.0 → kgmodule_utils-0.29.2}/src/kg_utils/__init__.py +1 -1
  5. {kgmodule_utils-0.29.0 → kgmodule_utils-0.29.2}/src/kg_utils/store.py +19 -11
  6. {kgmodule_utils-0.29.0 → kgmodule_utils-0.29.2}/LICENSE +0 -0
  7. {kgmodule_utils-0.29.0 → kgmodule_utils-0.29.2}/src/kg_utils/analysis/__init__.py +0 -0
  8. {kgmodule_utils-0.29.0 → kgmodule_utils-0.29.2}/src/kg_utils/analysis/scores.py +0 -0
  9. {kgmodule_utils-0.29.0 → kgmodule_utils-0.29.2}/src/kg_utils/corpus_embedder.py +0 -0
  10. {kgmodule_utils-0.29.0 → kgmodule_utils-0.29.2}/src/kg_utils/devicepack.py +0 -0
  11. {kgmodule_utils-0.29.0 → kgmodule_utils-0.29.2}/src/kg_utils/embed.py +0 -0
  12. {kgmodule_utils-0.29.0 → kgmodule_utils-0.29.2}/src/kg_utils/embedder.py +0 -0
  13. {kgmodule_utils-0.29.0 → kgmodule_utils-0.29.2}/src/kg_utils/extractor.py +0 -0
  14. {kgmodule_utils-0.29.0 → kgmodule_utils-0.29.2}/src/kg_utils/ingest/__init__.py +0 -0
  15. {kgmodule_utils-0.29.0 → kgmodule_utils-0.29.2}/src/kg_utils/ingest/converters.py +0 -0
  16. {kgmodule_utils-0.29.0 → kgmodule_utils-0.29.2}/src/kg_utils/ingest/derived.py +0 -0
  17. {kgmodule_utils-0.29.0 → kgmodule_utils-0.29.2}/src/kg_utils/ingest/manifest.py +0 -0
  18. {kgmodule_utils-0.29.0 → kgmodule_utils-0.29.2}/src/kg_utils/ingest/pipeline.py +0 -0
  19. {kgmodule_utils-0.29.0 → kgmodule_utils-0.29.2}/src/kg_utils/mcp/__init__.py +0 -0
  20. {kgmodule_utils-0.29.0 → kgmodule_utils-0.29.2}/src/kg_utils/mcp/_names.py +0 -0
  21. {kgmodule_utils-0.29.0 → kgmodule_utils-0.29.2}/src/kg_utils/mcp/cli.py +0 -0
  22. {kgmodule_utils-0.29.0 → kgmodule_utils-0.29.2}/src/kg_utils/mcp/server.py +0 -0
  23. {kgmodule_utils-0.29.0 → kgmodule_utils-0.29.2}/src/kg_utils/module.py +0 -0
  24. {kgmodule_utils-0.29.0 → kgmodule_utils-0.29.2}/src/kg_utils/pipeline.py +0 -0
  25. {kgmodule_utils-0.29.0 → kgmodule_utils-0.29.2}/src/kg_utils/py.typed +0 -0
  26. {kgmodule_utils-0.29.0 → kgmodule_utils-0.29.2}/src/kg_utils/retrieval/__init__.py +0 -0
  27. {kgmodule_utils-0.29.0 → kgmodule_utils-0.29.2}/src/kg_utils/retrieval/hits.py +0 -0
  28. {kgmodule_utils-0.29.0 → kgmodule_utils-0.29.2}/src/kg_utils/semantic.py +0 -0
  29. {kgmodule_utils-0.29.0 → kgmodule_utils-0.29.2}/src/kg_utils/snapshots/__init__.py +0 -0
  30. {kgmodule_utils-0.29.0 → kgmodule_utils-0.29.2}/src/kg_utils/snapshots/manager.py +0 -0
  31. {kgmodule_utils-0.29.0 → kgmodule_utils-0.29.2}/src/kg_utils/snapshots/models.py +0 -0
  32. {kgmodule_utils-0.29.0 → kgmodule_utils-0.29.2}/src/kg_utils/specs.py +0 -0
  33. {kgmodule_utils-0.29.0 → kgmodule_utils-0.29.2}/src/kg_utils/stats.py +0 -0
  34. {kgmodule_utils-0.29.0 → kgmodule_utils-0.29.2}/src/kg_utils/synthesis/__init__.py +0 -0
  35. {kgmodule_utils-0.29.0 → kgmodule_utils-0.29.2}/src/kg_utils/synthesis/_config.py +0 -0
  36. {kgmodule_utils-0.29.0 → kgmodule_utils-0.29.2}/src/kg_utils/synthesis/_image.py +0 -0
  37. {kgmodule_utils-0.29.0 → kgmodule_utils-0.29.2}/src/kg_utils/synthesis/_text.py +0 -0
  38. {kgmodule_utils-0.29.0 → kgmodule_utils-0.29.2}/src/kg_utils/synthesis/factory.py +0 -0
  39. {kgmodule_utils-0.29.0 → kgmodule_utils-0.29.2}/src/kg_utils/temporal.py +0 -0
  40. {kgmodule_utils-0.29.0 → kgmodule_utils-0.29.2}/src/kg_utils/validation.py +0 -0
  41. {kgmodule_utils-0.29.0 → kgmodule_utils-0.29.2}/src/kg_utils/vector_backend.py +0 -0
  42. {kgmodule_utils-0.29.0 → kgmodule_utils-0.29.2}/src/kg_utils/viz/__init__.py +0 -0
  43. {kgmodule_utils-0.29.0 → kgmodule_utils-0.29.2}/src/kg_utils/viz/graph_html.py +0 -0
  44. {kgmodule_utils-0.29.0 → kgmodule_utils-0.29.2}/src/kg_utils/viz/theme.py +0 -0
  45. {kgmodule_utils-0.29.0 → kgmodule_utils-0.29.2}/src/kg_utils/viz/tooltip.py +0 -0
  46. {kgmodule_utils-0.29.0 → kgmodule_utils-0.29.2}/src/kg_utils/viz3d/__init__.py +0 -0
  47. {kgmodule_utils-0.29.0 → kgmodule_utils-0.29.2}/src/kg_utils/viz3d/layout.py +0 -0
  48. {kgmodule_utils-0.29.0 → kgmodule_utils-0.29.2}/src/kg_utils/viz3d/organic.py +0 -0
  49. {kgmodule_utils-0.29.0 → kgmodule_utils-0.29.2}/src/kg_utils/viz3d/qt.py +0 -0
  50. {kgmodule_utils-0.29.0 → kgmodule_utils-0.29.2}/src/kg_utils/viz3d/species.py +0 -0
  51. {kgmodule_utils-0.29.0 → kgmodule_utils-0.29.2}/src/kg_utils/worker/__init__.py +0 -0
  52. {kgmodule_utils-0.29.0 → kgmodule_utils-0.29.2}/src/kg_utils/worker/client.py +0 -0
  53. {kgmodule_utils-0.29.0 → kgmodule_utils-0.29.2}/src/kg_utils/worker/ops.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: kgmodule-utils
3
- Version: 0.29.0
3
+ Version: 0.29.2
4
4
  Summary: Shared types, graph store, semantic index, and pipeline base for the KGModule SDK
5
5
  License-Expression: Elastic-2.0
6
6
  License-File: LICENSE
@@ -37,14 +37,14 @@ Requires-Dist: numpy (>=1.24.0) ; extra == "viz3d-qt"
37
37
  Requires-Dist: numpy (>=1.24.0) ; extra == "viz3d-render"
38
38
  Requires-Dist: openai (>=1.30.0) ; extra == "synthesis"
39
39
  Requires-Dist: openai (>=1.30.0) ; extra == "synthesis-mflux"
40
- Requires-Dist: pillow (>=10.0.0) ; extra == "synthesis"
41
- Requires-Dist: pillow (>=10.0.0) ; extra == "synthesis-mflux"
40
+ Requires-Dist: pillow (>=13.0.0) ; extra == "synthesis"
41
+ Requires-Dist: pillow (>=13.0.0) ; extra == "synthesis-mflux"
42
42
  Requires-Dist: pymupdf (>=2.0) ; extra == "ingest"
43
43
  Requires-Dist: pymupdf (>=2.0) ; extra == "pdf"
44
44
  Requires-Dist: pyvis (>=0.3.2) ; extra == "viz"
45
45
  Requires-Dist: pyvista (>=0.44.0) ; extra == "viz3d-qt"
46
46
  Requires-Dist: pyvista (>=0.44.0) ; extra == "viz3d-render"
47
- Requires-Dist: quiltwright (>=0.16.0) ; extra == "viz3d-qt"
47
+ Requires-Dist: quiltwright (>=0.17.0) ; extra == "viz3d-qt"
48
48
  Requires-Dist: rich (>=13.0.0,<15.0.0) ; extra == "semantic"
49
49
  Requires-Dist: sentence-transformers (>=5.4.1) ; extra == "semantic"
50
50
  Requires-Dist: sqlite-vec (==0.1.9) ; extra == "semantic"
@@ -57,7 +57,7 @@ Description-Content-Type: text/markdown
57
57
 
58
58
  [![Python](https://img.shields.io/badge/python-3.12%20%7C%203.13-blue.svg)](https://www.python.org/)
59
59
  [![License: Elastic-2.0](https://img.shields.io/badge/License-Elastic%202.0-blue.svg)](https://www.elastic.co/licensing/elastic-license)
60
- [![Version](https://img.shields.io/badge/version-0.29.0-blue.svg)](https://github.com/Flux-Frontiers/KG_utils/releases)
60
+ [![Version](https://img.shields.io/badge/version-0.29.2-blue.svg)](https://github.com/Flux-Frontiers/KG_utils/releases)
61
61
  [![CI](https://github.com/Flux-Frontiers/KG_utils/actions/workflows/ci.yml/badge.svg)](https://github.com/Flux-Frontiers/KG_utils/actions/workflows/ci.yml)
62
62
  [![Poetry](https://img.shields.io/endpoint?url=https://python-poetry.org/badge/v0.json)](https://python-poetry.org/)
63
63
  [![DOI](https://img.shields.io/badge/DOI-10.5281%2Fzenodo.21284866-blue.svg)](https://doi.org/10.5281/zenodo.21284866)
@@ -82,6 +82,16 @@ Fleet modules use it in two ways. [PyCodeKG](https://github.com/Flux-Frontiers/p
82
82
 
83
83
  ## Latest News
84
84
 
85
+ - **0.29.2 (2026-11-02)** -- A security release. The `synthesis` extras
86
+ floor Pillow at 13.0.0 and `viz3d-qt` floors quiltwright at 0.17.0, so a
87
+ fresh install can no longer resolve Pillow 12.3.0 and its 41 advisories.
88
+ No code changed.
89
+ - **0.29.1 (2026-10-27)** -- `resolve_symbols()` no longer links a stub to
90
+ every definition sharing its bare name: an ambiguous name stays
91
+ unresolved, and stubs flagged `scope_local` (per-scope variable nodes) are
92
+ skipped. On ansible this took `RESOLVES_TO` from 7.9M edges to 6,897 and a
93
+ build that never finished to 198 s. Exact matching now also covers `lib/`
94
+ layouts and package `__init__` modules.
85
95
  - **0.29.0 (2026-10-25)** -- New `kg_utils.mcp`: one MCP server base for every
86
96
  KG module (`mcp` extra), with the fleet's canonical tools (`stats`, `query`,
87
97
  `pack`, `get_node`, `neighbors`) and the standard `<tool> mcp` command; new
@@ -866,7 +876,7 @@ If you use kgmodule-utils in research or a project, please cite it:
866
876
 
867
877
  **APA**
868
878
 
869
- > Suchanek, E. G. (2026). *kgmodule-utils: Shared SDK for the KGModule Knowledge-Graph Ecosystem* (Version 0.29.0) [Software]. Flux-Frontiers. https://doi.org/10.5281/zenodo.21284866
879
+ > Suchanek, E. G. (2026). *kgmodule-utils: Shared SDK for the KGModule Knowledge-Graph Ecosystem* (Version 0.29.2) [Software]. Flux-Frontiers. https://doi.org/10.5281/zenodo.21284866
870
880
 
871
881
  **BibTeX**
872
882
 
@@ -874,7 +884,7 @@ If you use kgmodule-utils in research or a project, please cite it:
874
884
  @software{suchanek_kgmodule_utils,
875
885
  author = {Suchanek, Eric G.},
876
886
  title = {{kgmodule-utils}: Shared SDK for the KGModule Knowledge-Graph Ecosystem},
877
- version = {0.29.0},
887
+ version = {0.29.2},
878
888
  year = {2026},
879
889
  publisher = {Flux-Frontiers},
880
890
  url = {https://github.com/Flux-Frontiers/KG_utils},
@@ -1,7 +1,7 @@
1
1
 
2
2
  [![Python](https://img.shields.io/badge/python-3.12%20%7C%203.13-blue.svg)](https://www.python.org/)
3
3
  [![License: Elastic-2.0](https://img.shields.io/badge/License-Elastic%202.0-blue.svg)](https://www.elastic.co/licensing/elastic-license)
4
- [![Version](https://img.shields.io/badge/version-0.29.0-blue.svg)](https://github.com/Flux-Frontiers/KG_utils/releases)
4
+ [![Version](https://img.shields.io/badge/version-0.29.2-blue.svg)](https://github.com/Flux-Frontiers/KG_utils/releases)
5
5
  [![CI](https://github.com/Flux-Frontiers/KG_utils/actions/workflows/ci.yml/badge.svg)](https://github.com/Flux-Frontiers/KG_utils/actions/workflows/ci.yml)
6
6
  [![Poetry](https://img.shields.io/endpoint?url=https://python-poetry.org/badge/v0.json)](https://python-poetry.org/)
7
7
  [![DOI](https://img.shields.io/badge/DOI-10.5281%2Fzenodo.21284866-blue.svg)](https://doi.org/10.5281/zenodo.21284866)
@@ -26,6 +26,16 @@ Fleet modules use it in two ways. [PyCodeKG](https://github.com/Flux-Frontiers/p
26
26
 
27
27
  ## Latest News
28
28
 
29
+ - **0.29.2 (2026-11-02)** -- A security release. The `synthesis` extras
30
+ floor Pillow at 13.0.0 and `viz3d-qt` floors quiltwright at 0.17.0, so a
31
+ fresh install can no longer resolve Pillow 12.3.0 and its 41 advisories.
32
+ No code changed.
33
+ - **0.29.1 (2026-10-27)** -- `resolve_symbols()` no longer links a stub to
34
+ every definition sharing its bare name: an ambiguous name stays
35
+ unresolved, and stubs flagged `scope_local` (per-scope variable nodes) are
36
+ skipped. On ansible this took `RESOLVES_TO` from 7.9M edges to 6,897 and a
37
+ build that never finished to 198 s. Exact matching now also covers `lib/`
38
+ layouts and package `__init__` modules.
29
39
  - **0.29.0 (2026-10-25)** -- New `kg_utils.mcp`: one MCP server base for every
30
40
  KG module (`mcp` extra), with the fleet's canonical tools (`stats`, `query`,
31
41
  `pack`, `get_node`, `neighbors`) and the standard `<tool> mcp` command; new
@@ -810,7 +820,7 @@ If you use kgmodule-utils in research or a project, please cite it:
810
820
 
811
821
  **APA**
812
822
 
813
- > Suchanek, E. G. (2026). *kgmodule-utils: Shared SDK for the KGModule Knowledge-Graph Ecosystem* (Version 0.29.0) [Software]. Flux-Frontiers. https://doi.org/10.5281/zenodo.21284866
823
+ > Suchanek, E. G. (2026). *kgmodule-utils: Shared SDK for the KGModule Knowledge-Graph Ecosystem* (Version 0.29.2) [Software]. Flux-Frontiers. https://doi.org/10.5281/zenodo.21284866
814
824
 
815
825
  **BibTeX**
816
826
 
@@ -818,7 +828,7 @@ If you use kgmodule-utils in research or a project, please cite it:
818
828
  @software{suchanek_kgmodule_utils,
819
829
  author = {Suchanek, Eric G.},
820
830
  title = {{kgmodule-utils}: Shared SDK for the KGModule Knowledge-Graph Ecosystem},
821
- version = {0.29.0},
831
+ version = {0.29.2},
822
832
  year = {2026},
823
833
  publisher = {Flux-Frontiers},
824
834
  url = {https://github.com/Flux-Frontiers/KG_utils},
@@ -9,7 +9,7 @@ build-backend = "poetry.core.masonry.api"
9
9
 
10
10
  [project]
11
11
  name = "kgmodule-utils"
12
- version = "0.29.0"
12
+ version = "0.29.2"
13
13
  description = "Shared types, graph store, semantic index, and pipeline base for the KGModule SDK"
14
14
  readme = "README.md"
15
15
  license = "Elastic-2.0"
@@ -66,8 +66,8 @@ viz3d-qt = [
66
66
  "PyQt5>=5.15.0",
67
67
  # For quiltwright.quilt.resolve_view_cone: the view-cone cap as one shared
68
68
  # function rather than a copy of 35.0 per caller. That landed in 0.14.0;
69
- # the floor tracks the latest release (0.16.0), per the fleet pin rule.
70
- "quiltwright>=0.16.0",
69
+ # the floor is 0.17.0, the first release that floors Pillow at 13.0.0.
70
+ "quiltwright>=0.17.0",
71
71
  ]
72
72
  # Exact pin: pre-1.0, breaking minors possible. Prebuilt wheels everywhere;
73
73
  # also bundled in `semantic`, since it is the vector store.
@@ -96,12 +96,12 @@ pdf = [
96
96
  synthesis = [
97
97
  "httpx>=0.27.0",
98
98
  "openai>=1.30.0",
99
- "pillow>=10.0.0",
99
+ "pillow>=13.0.0",
100
100
  ]
101
101
  synthesis-mflux = [
102
102
  "httpx>=0.27.0",
103
103
  "openai>=1.30.0",
104
- "pillow>=10.0.0",
104
+ "pillow>=13.0.0",
105
105
  "mflux>=0.9.0",
106
106
  ]
107
107
 
@@ -72,4 +72,4 @@ The core install is stdlib-only; everything heavier is opt-in.
72
72
  pip install 'kgmodule-utils[synthesis-mflux]' # + mflux (Apple Silicon local gen)
73
73
  """
74
74
 
75
- __version__ = "0.29.0"
75
+ __version__ = "0.29.2"
@@ -65,7 +65,10 @@ DEFAULT_RELS: tuple[str, ...] = ("CONTAINS", "CALLS", "IMPORTS", "INHERITS")
65
65
 
66
66
 
67
67
  def _module_to_dotted_variants(module_path: str | None) -> tuple[str, ...]:
68
- """Convert a module path to dotted notation, including common src-layout aliases.
68
+ """Convert a module path to dotted notation, including common layout aliases.
69
+
70
+ A ``src/`` or ``lib/`` root is also dropped, and a package's
71
+ ``__init__`` module is also named by its package.
69
72
 
70
73
  :param module_path: Path like ``src/pkg/mod.py``.
71
74
  :return: Tuple of dotted variants, e.g. ``("src.pkg.mod", "pkg.mod")``.
@@ -76,8 +79,9 @@ def _module_to_dotted_variants(module_path: str | None) -> tuple[str, ...]:
76
79
  module_path = module_path[:-3]
77
80
  dotted = module_path.replace("/", ".")
78
81
  variants = [dotted]
79
- if dotted.startswith("src."):
82
+ if dotted.startswith(("src.", "lib.")):
80
83
  variants.append(dotted[4:])
84
+ variants += [v.removesuffix(".__init__") for v in variants if v.endswith(".__init__")]
81
85
  return tuple(dict.fromkeys(v for v in variants if v))
82
86
 
83
87
 
@@ -379,8 +383,12 @@ class GraphStore:
379
383
  is scoped to definitions whose qualname is ``f"{receiver_class}.{name}"``
380
384
  instead of the bare trailing-name match against every definition in the
381
385
  graph. A typed stub that matches nothing does not fall back to the
382
- untyped guess; it simply stays unresolved. Idempotent — duplicate
383
- edges are silently ignored.
386
+ untyped guess; it simply stays unresolved. The same holds for an
387
+ untyped stub whose bare name matches more than one definition: it
388
+ stays unresolved rather than linking to every candidate. A stub whose
389
+ ``metadata`` sets ``scope_local`` (a per-scope variable or attribute
390
+ node, not a reference to a definition) is never resolved.
391
+ Idempotent — duplicate edges are silently ignored.
384
392
 
385
393
  :return: Number of new RESOLVES_TO edges written.
386
394
  """
@@ -417,6 +425,9 @@ class GraphStore:
417
425
  for sym_id, sym_name, sym_qualname, sym_metadata_raw in sym_rows:
418
426
  if not sym_name:
419
427
  continue
428
+ sym_metadata = _load_metadata(sym_metadata_raw)
429
+ if sym_metadata.get("scope_local"):
430
+ continue
420
431
 
421
432
  candidates: list[str] = []
422
433
  mode = "name_fallback"
@@ -431,7 +442,7 @@ class GraphStore:
431
442
 
432
443
  receiver_class = None
433
444
  if not candidates:
434
- receiver_class = _load_metadata(sym_metadata_raw).get("receiver_class")
445
+ receiver_class = sym_metadata.get("receiver_class")
435
446
  if receiver_class:
436
447
  typed = qualname_to_defs.get(f"{receiver_class}.{sym_name}", [])
437
448
  if typed:
@@ -440,10 +451,9 @@ class GraphStore:
440
451
  confidence = "high"
441
452
 
442
453
  if not candidates and not receiver_class:
443
- candidates = name_to_defs.get(sym_name, [])
444
- if len(candidates) > 1:
445
- mode = "name_fallback_ambiguous"
446
- confidence = "low"
454
+ named = name_to_defs.get(sym_name, [])
455
+ if len(named) == 1:
456
+ candidates = named
447
457
 
448
458
  for def_id in candidates:
449
459
  evidence: dict[str, Any] = {
@@ -451,8 +461,6 @@ class GraphStore:
451
461
  "confidence": confidence,
452
462
  "symbol": sym_id,
453
463
  }
454
- if mode == "name_fallback_ambiguous":
455
- evidence["candidate_count"] = len(candidates)
456
464
  edges.append(
457
465
  (
458
466
  sym_id,
File without changes