Skip to content

Claude/determined volhard#2

Merged
cklam12345 merged 6 commits into
mainfrom
claude/determined-volhard
Apr 8, 2026
Merged

Claude/determined volhard#2
cklam12345 merged 6 commits into
mainfrom
claude/determined-volhard

Conversation

@cklam12345
Copy link
Copy Markdown
Owner

No description provided.

chin-keong-lam and others added 6 commits April 8, 2026 02:17
Complete implementation of the wisdomGraph pip package:

wisdom/ — Neo4j-native DIKW wisdom accumulation library
  __init__.py      — package version
  __main__.py      — CLI: install, connect, docker, ask, reflect, path, explain, god-nodes, export, purge
  connect.py       — Neo4j driver lifecycle, schema setup (indexes + full-text), graph status
  detect.py        — file discovery + type classification (.wisdomignore support)
  cache.py         — SHA256 extraction cache (incremental re-runs)
  security.py      — URL/path/label validation, Cypher injection prevention
  validate.py      — extraction schema validation before MERGE
  classify.py      — DIKW tier assignment (heuristics + LLM-explicit tiers)
  merge.py         — idempotent Neo4j MERGE for nodes, edges, sources
  reflect.py       — DIKW promotion engine: K→E→I→W + REINFORCES feedback
  traverse.py      — full-text search, DIKW path walk, god-nodes, answer_question
  report.py        — WISDOM_REPORT.md generator (always-on context doc)
  export.py        — Cypher dump, graph.json (graphify-compatible), Obsidian vault
  ingest.py        — URL fetcher with HTML→text conversion
  docker.py        — DozerDB container lifecycle (up/down/status)
  skill.md         — Claude Code /wisdom skill (full pipeline orchestration)
  skill-claw.md    — OpenClaw /wisdom skill (sequential extraction)

pyproject.toml     — wisdomgraph pip package, optional[ast|pdf|office|all]

Key design decisions:
- MERGE everywhere: idempotent, accumulative across sessions
- DIKW classification in classify.py: tier assignment from heuristics + explicit LLM output
- reflect() is additive: never deletes, only promotes upward
- Wisdom generation deferred to LLM in skill.md (needs language understanding)
- Password stored as env var name in config, never in plain config files
- Full-text Neo4j index for semantic search at query time (no embeddings needed)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Tests (67 passing, no Neo4j required):
  tests/test_security.py   — URL validation, label sanitization, sensitive paths
  tests/test_validate.py   — DIKW extraction schema validation
  tests/test_classify.py   — tier assignment heuristics, DIKW edge building
  tests/test_cache.py      — SHA256 cache read/write/invalidation
  tests/test_detect.py     — file discovery, .wisdomignore, paper detection
  tests/test_ingest.py     — HTML stripping, entity decoding

Bug fix:
  wisdom/__main__.py — _get_arg had duplicate 'flag' parameter name causing
  a Python SyntaxError. Renamed to is_flag=, fixed call sites.

Chinese README:
  README.zh-CN.md — full translation with technical accuracy preserved

CI:
  ci.sh — creates venv, installs pytest, runs tests (no Docker needed)
  .gitignore — excludes __pycache__, .venv, wisdom-out, .wisdom/

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
report.py:
  - render_report() was calling status(None) because _get_driver_from_session
    returned None. Replaced with inline per-tier COUNT queries that use the
    session directly. Removed dead _get_driver_from_session helper.

reflect.py:
  - All three find_*_candidates() functions used session.begin_transaction()
    which is deprecated in neo4j-python-driver >= 5.x. Replaced with direct
    session.run() calls.

Verified against live DozerDB (graphstack/dozerdb:5.26.3.0):
  ✓ Connected + schema
  ✓ MERGE: 4 nodes, 3 edges (project-1)
  ✓ MERGE project-2
  ✓ Reflect: 2 experience promoted, contradictions detected
  ✓ Query: 5 nodes returned, top tier=experience
  ✓ God nodes surfaced across projects
  ✓ WISDOM_REPORT.md generated correctly
  ✓ 67 unit tests still passing

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Runs unit tests on Python 3.10/3.11/3.12, then builds the wheel+sdist
and uploads as a dist artifact — no Neo4j required.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Use SPDX string format (license = "MIT") + license-files per PEP 639.
Removes setuptools deprecation warning during builds.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- README/README.zh-CN: add PyPI version badge pointing to wisdomgraph
- ci.yml: add `publish` job triggered on v* tags using PyPI trusted
  publishing (OIDC, no token secret needed) — needs `pypi` environment
  configured in GitHub repo settings

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@cklam12345 cklam12345 merged commit 144c01f into main Apr 8, 2026
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant