wisdomgraph 0.3.2__tar.gz → 0.3.3__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 (38) hide show
  1. {wisdomgraph-0.3.2/wisdomgraph.egg-info → wisdomgraph-0.3.3}/PKG-INFO +1 -1
  2. {wisdomgraph-0.3.2 → wisdomgraph-0.3.3}/pyproject.toml +1 -1
  3. {wisdomgraph-0.3.2 → wisdomgraph-0.3.3}/tests/test_mcp.py +53 -0
  4. {wisdomgraph-0.3.2 → wisdomgraph-0.3.3}/wisdom/__main__.py +51 -0
  5. {wisdomgraph-0.3.2 → wisdomgraph-0.3.3/wisdomgraph.egg-info}/PKG-INFO +1 -1
  6. {wisdomgraph-0.3.2 → wisdomgraph-0.3.3}/LICENSE +0 -0
  7. {wisdomgraph-0.3.2 → wisdomgraph-0.3.3}/README.md +0 -0
  8. {wisdomgraph-0.3.2 → wisdomgraph-0.3.3}/setup.cfg +0 -0
  9. {wisdomgraph-0.3.2 → wisdomgraph-0.3.3}/tests/test_cache.py +0 -0
  10. {wisdomgraph-0.3.2 → wisdomgraph-0.3.3}/tests/test_classify.py +0 -0
  11. {wisdomgraph-0.3.2 → wisdomgraph-0.3.3}/tests/test_detect.py +0 -0
  12. {wisdomgraph-0.3.2 → wisdomgraph-0.3.3}/tests/test_ingest.py +0 -0
  13. {wisdomgraph-0.3.2 → wisdomgraph-0.3.3}/tests/test_reflect.py +0 -0
  14. {wisdomgraph-0.3.2 → wisdomgraph-0.3.3}/tests/test_security.py +0 -0
  15. {wisdomgraph-0.3.2 → wisdomgraph-0.3.3}/tests/test_validate.py +0 -0
  16. {wisdomgraph-0.3.2 → wisdomgraph-0.3.3}/wisdom/__init__.py +0 -0
  17. {wisdomgraph-0.3.2 → wisdomgraph-0.3.3}/wisdom/cache.py +0 -0
  18. {wisdomgraph-0.3.2 → wisdomgraph-0.3.3}/wisdom/classify.py +0 -0
  19. {wisdomgraph-0.3.2 → wisdomgraph-0.3.3}/wisdom/connect.py +0 -0
  20. {wisdomgraph-0.3.2 → wisdomgraph-0.3.3}/wisdom/detect.py +0 -0
  21. {wisdomgraph-0.3.2 → wisdomgraph-0.3.3}/wisdom/docker.py +0 -0
  22. {wisdomgraph-0.3.2 → wisdomgraph-0.3.3}/wisdom/export.py +0 -0
  23. {wisdomgraph-0.3.2 → wisdomgraph-0.3.3}/wisdom/ingest.py +0 -0
  24. {wisdomgraph-0.3.2 → wisdomgraph-0.3.3}/wisdom/local.py +0 -0
  25. {wisdomgraph-0.3.2 → wisdomgraph-0.3.3}/wisdom/mcp.py +0 -0
  26. {wisdomgraph-0.3.2 → wisdomgraph-0.3.3}/wisdom/merge.py +0 -0
  27. {wisdomgraph-0.3.2 → wisdomgraph-0.3.3}/wisdom/reflect.py +0 -0
  28. {wisdomgraph-0.3.2 → wisdomgraph-0.3.3}/wisdom/report.py +0 -0
  29. {wisdomgraph-0.3.2 → wisdomgraph-0.3.3}/wisdom/security.py +0 -0
  30. {wisdomgraph-0.3.2 → wisdomgraph-0.3.3}/wisdom/skill-claw.md +0 -0
  31. {wisdomgraph-0.3.2 → wisdomgraph-0.3.3}/wisdom/skill.md +0 -0
  32. {wisdomgraph-0.3.2 → wisdomgraph-0.3.3}/wisdom/traverse.py +0 -0
  33. {wisdomgraph-0.3.2 → wisdomgraph-0.3.3}/wisdom/validate.py +0 -0
  34. {wisdomgraph-0.3.2 → wisdomgraph-0.3.3}/wisdomgraph.egg-info/SOURCES.txt +0 -0
  35. {wisdomgraph-0.3.2 → wisdomgraph-0.3.3}/wisdomgraph.egg-info/dependency_links.txt +0 -0
  36. {wisdomgraph-0.3.2 → wisdomgraph-0.3.3}/wisdomgraph.egg-info/entry_points.txt +0 -0
  37. {wisdomgraph-0.3.2 → wisdomgraph-0.3.3}/wisdomgraph.egg-info/requires.txt +0 -0
  38. {wisdomgraph-0.3.2 → wisdomgraph-0.3.3}/wisdomgraph.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: wisdomgraph
3
- Version: 0.3.2
3
+ Version: 0.3.3
4
4
  Summary: Graph-native persistent cognition for AI agents using Neo4j, DIKW, and MCP
5
5
  License: MIT
6
6
  Project-URL: Homepage, https://github.com/cklam12345/wisdomGraph
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "wisdomgraph"
7
- version = "0.3.2"
7
+ version = "0.3.3"
8
8
  description = "Graph-native persistent cognition for AI agents using Neo4j, DIKW, and MCP"
9
9
  readme = "README.md"
10
10
  license = {text = "MIT"}
@@ -844,3 +844,56 @@ def test_try_autostart_local_starts_backend_when_docker_present():
844
844
  patch("wisdom.local.up") as up:
845
845
  assert mcp._try_autostart_local() is True
846
846
  up.assert_called_once_with(connect=True)
847
+
848
+
849
+ # ── version / stale-install self-check ─────────────────────────────────────────
850
+
851
+ def test_version_command_prints_code_version(monkeypatch, capsys):
852
+ import wisdom.__main__ as m
853
+
854
+ monkeypatch.setattr(sys, "argv", ["wisdom", "--version"])
855
+ m.main()
856
+ assert f"wisdomgraph {m._CODE_VERSION}" in capsys.readouterr().out
857
+
858
+
859
+ def test_code_version_matches_pyproject():
860
+ import re
861
+ from pathlib import Path
862
+ import wisdom.__main__ as m
863
+
864
+ root = Path(__file__).resolve().parent.parent
865
+ text = (root / "pyproject.toml").read_text(encoding="utf-8")
866
+ match = re.search(r'(?m)^version\s*=\s*"([^"]+)"', text)
867
+ assert match, "version not found in pyproject.toml"
868
+ assert match.group(1) == m._CODE_VERSION, "bump _CODE_VERSION to match pyproject.toml"
869
+
870
+
871
+ def test_warn_if_stale_warns_on_version_mismatch(capsys):
872
+ import wisdom.__main__ as m
873
+
874
+ with patch.object(m, "_dist_version", return_value="0.2.0"):
875
+ m._warn_if_stale()
876
+ err = capsys.readouterr().err
877
+ assert "0.2.0" in err
878
+ assert "pip install -U wisdomgraph" in err
879
+
880
+
881
+ def test_warn_if_stale_silent_when_matching_or_unknown(capsys):
882
+ import wisdom.__main__ as m
883
+
884
+ with patch.object(m, "_dist_version", return_value=m._CODE_VERSION):
885
+ m._warn_if_stale()
886
+ with patch.object(m, "_dist_version", return_value="unknown"):
887
+ m._warn_if_stale()
888
+ assert capsys.readouterr().err == ""
889
+
890
+
891
+ def test_main_skips_stale_check_for_mcp(monkeypatch):
892
+ import wisdom.__main__ as m
893
+
894
+ monkeypatch.setattr(sys, "argv", ["wisdom", "mcp"])
895
+ with patch.object(m, "_warn_if_stale") as warn, \
896
+ patch("wisdom.mcp.run_mcp_server") as run:
897
+ m.main()
898
+ warn.assert_not_called()
899
+ run.assert_called_once()
@@ -8,6 +8,11 @@ import shutil
8
8
  import sys
9
9
  from pathlib import Path
10
10
 
11
+ # Baked into the source so it identifies the code actually running, independent
12
+ # of whatever distribution metadata happens to resolve on sys.path. Keep in sync
13
+ # with pyproject.toml (guarded by test_code_version_matches_pyproject).
14
+ _CODE_VERSION = "0.3.3"
15
+
11
16
  try:
12
17
  from importlib.metadata import version as _pkg_version
13
18
  __version__ = _pkg_version("wisdomgraph")
@@ -15,6 +20,41 @@ except Exception:
15
20
  __version__ = "unknown"
16
21
 
17
22
 
23
+ def _dist_version() -> str:
24
+ """Version of the installed `wisdomgraph` distribution metadata (may differ
25
+ from the running code if more than one install is on PATH)."""
26
+ try:
27
+ from importlib.metadata import version
28
+ return version("wisdomgraph")
29
+ except Exception:
30
+ return "unknown"
31
+
32
+
33
+ def _print_version() -> None:
34
+ print(f"wisdomgraph {_CODE_VERSION}")
35
+ dist = _dist_version()
36
+ if dist not in (_CODE_VERSION, "unknown"):
37
+ print(
38
+ f" note: installed distribution metadata reports {dist} — "
39
+ "more than one wisdomgraph install is on PATH.",
40
+ file=sys.stderr,
41
+ )
42
+
43
+
44
+ def _warn_if_stale() -> None:
45
+ """Warn when the running code and the installed distribution disagree — the
46
+ classic 'wisdom on PATH is an old shim' trap."""
47
+ dist = _dist_version()
48
+ if dist not in (_CODE_VERSION, "unknown"):
49
+ print(
50
+ f"warning: this 'wisdom' runs code v{_CODE_VERSION} but the installed "
51
+ f"wisdomgraph distribution is v{dist} — you likely have more than one "
52
+ "install on PATH.",
53
+ file=sys.stderr,
54
+ )
55
+ print(" Fix: pip install -U wisdomgraph (check with: which -a wisdom)", file=sys.stderr)
56
+
57
+
18
58
  # ── Hook / registration strings ──────────────────────────────────────────────
19
59
 
20
60
  _SETTINGS_HOOK = {
@@ -380,6 +420,15 @@ def main() -> None:
380
420
 
381
421
  cmd = sys.argv[1]
382
422
 
423
+ if cmd in ("--version", "-V", "version"):
424
+ _print_version()
425
+ return
426
+
427
+ # Surface stale-install mismatches, but never on `mcp` — that speaks JSON-RPC
428
+ # over stdio and its stderr is reserved for the host's logs.
429
+ if cmd != "mcp":
430
+ _warn_if_stale()
431
+
383
432
  if cmd == "install":
384
433
  default_p = "windows" if _platform_mod.system() == "Windows" else "claude"
385
434
  chosen = default_p
@@ -635,6 +684,8 @@ def _print_explain(result: dict) -> None:
635
684
  def _print_help() -> None:
636
685
  print("Usage: wisdom <command>")
637
686
  print()
687
+ print(" --version print the running wisdomgraph version")
688
+ print()
638
689
  print("Setup:")
639
690
  print(" quickstart [--storage local|aura|existing] [--host claude|codex|all|none]")
640
691
  print(" doctor check Neo4j, local backend, and MCP host readiness")
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: wisdomgraph
3
- Version: 0.3.2
3
+ Version: 0.3.3
4
4
  Summary: Graph-native persistent cognition for AI agents using Neo4j, DIKW, and MCP
5
5
  License: MIT
6
6
  Project-URL: Homepage, https://github.com/cklam12345/wisdomGraph
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes