ctxgraph-code 0.6.0__tar.gz → 0.6.1__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 (39) hide show
  1. {ctxgraph_code-0.6.0 → ctxgraph_code-0.6.1}/PKG-INFO +1 -1
  2. {ctxgraph_code-0.6.0 → ctxgraph_code-0.6.1}/pyproject.toml +1 -1
  3. {ctxgraph_code-0.6.0 → ctxgraph_code-0.6.1}/src/ctxgraph_code/cli.py +14 -21
  4. {ctxgraph_code-0.6.0 → ctxgraph_code-0.6.1}/src/ctxgraph_code/config/hooks.py +1 -49
  5. {ctxgraph_code-0.6.0 → ctxgraph_code-0.6.1}/src/ctxgraph_code.egg-info/PKG-INFO +1 -1
  6. {ctxgraph_code-0.6.0 → ctxgraph_code-0.6.1}/README.md +0 -0
  7. {ctxgraph_code-0.6.0 → ctxgraph_code-0.6.1}/setup.cfg +0 -0
  8. {ctxgraph_code-0.6.0 → ctxgraph_code-0.6.1}/src/ctxgraph_code/__init__.py +0 -0
  9. {ctxgraph_code-0.6.0 → ctxgraph_code-0.6.1}/src/ctxgraph_code/__main__.py +0 -0
  10. {ctxgraph_code-0.6.0 → ctxgraph_code-0.6.1}/src/ctxgraph_code/analyzers/__init__.py +0 -0
  11. {ctxgraph_code-0.6.0 → ctxgraph_code-0.6.1}/src/ctxgraph_code/analyzers/python/__init__.py +0 -0
  12. {ctxgraph_code-0.6.0 → ctxgraph_code-0.6.1}/src/ctxgraph_code/analyzers/python/importer.py +0 -0
  13. {ctxgraph_code-0.6.0 → ctxgraph_code-0.6.1}/src/ctxgraph_code/analyzers/python/semantic.py +0 -0
  14. {ctxgraph_code-0.6.0 → ctxgraph_code-0.6.1}/src/ctxgraph_code/analyzers/python/symbols.py +0 -0
  15. {ctxgraph_code-0.6.0 → ctxgraph_code-0.6.1}/src/ctxgraph_code/analyzers/treesitter/__init__.py +0 -0
  16. {ctxgraph_code-0.6.0 → ctxgraph_code-0.6.1}/src/ctxgraph_code/analyzers/treesitter/analyzer.py +0 -0
  17. {ctxgraph_code-0.6.0 → ctxgraph_code-0.6.1}/src/ctxgraph_code/analyzers/treesitter/languages.py +0 -0
  18. {ctxgraph_code-0.6.0 → ctxgraph_code-0.6.1}/src/ctxgraph_code/config/__init__.py +0 -0
  19. {ctxgraph_code-0.6.0 → ctxgraph_code-0.6.1}/src/ctxgraph_code/config/build_status.py +0 -0
  20. {ctxgraph_code-0.6.0 → ctxgraph_code-0.6.1}/src/ctxgraph_code/config/global_paths.py +0 -0
  21. {ctxgraph_code-0.6.0 → ctxgraph_code-0.6.1}/src/ctxgraph_code/config/init.py +0 -0
  22. {ctxgraph_code-0.6.0 → ctxgraph_code-0.6.1}/src/ctxgraph_code/config/settings.py +0 -0
  23. {ctxgraph_code-0.6.0 → ctxgraph_code-0.6.1}/src/ctxgraph_code/exclude/__init__.py +0 -0
  24. {ctxgraph_code-0.6.0 → ctxgraph_code-0.6.1}/src/ctxgraph_code/exclude/patterns.py +0 -0
  25. {ctxgraph_code-0.6.0 → ctxgraph_code-0.6.1}/src/ctxgraph_code/graph/__init__.py +0 -0
  26. {ctxgraph_code-0.6.0 → ctxgraph_code-0.6.1}/src/ctxgraph_code/graph/builder.py +0 -0
  27. {ctxgraph_code-0.6.0 → ctxgraph_code-0.6.1}/src/ctxgraph_code/graph/models.py +0 -0
  28. {ctxgraph_code-0.6.0 → ctxgraph_code-0.6.1}/src/ctxgraph_code/graph/query.py +0 -0
  29. {ctxgraph_code-0.6.0 → ctxgraph_code-0.6.1}/src/ctxgraph_code/graph/storage.py +0 -0
  30. {ctxgraph_code-0.6.0 → ctxgraph_code-0.6.1}/src/ctxgraph_code/render/__init__.py +0 -0
  31. {ctxgraph_code-0.6.0 → ctxgraph_code-0.6.1}/src/ctxgraph_code/render/_text.py +0 -0
  32. {ctxgraph_code-0.6.0 → ctxgraph_code-0.6.1}/src/ctxgraph_code/render/mermaid.py +0 -0
  33. {ctxgraph_code-0.6.0 → ctxgraph_code-0.6.1}/src/ctxgraph_code/view/__init__.py +0 -0
  34. {ctxgraph_code-0.6.0 → ctxgraph_code-0.6.1}/src/ctxgraph_code/view/visualizer.py +0 -0
  35. {ctxgraph_code-0.6.0 → ctxgraph_code-0.6.1}/src/ctxgraph_code.egg-info/SOURCES.txt +0 -0
  36. {ctxgraph_code-0.6.0 → ctxgraph_code-0.6.1}/src/ctxgraph_code.egg-info/dependency_links.txt +0 -0
  37. {ctxgraph_code-0.6.0 → ctxgraph_code-0.6.1}/src/ctxgraph_code.egg-info/entry_points.txt +0 -0
  38. {ctxgraph_code-0.6.0 → ctxgraph_code-0.6.1}/src/ctxgraph_code.egg-info/requires.txt +0 -0
  39. {ctxgraph_code-0.6.0 → ctxgraph_code-0.6.1}/src/ctxgraph_code.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: ctxgraph-code
3
- Version: 0.6.0
3
+ Version: 0.6.1
4
4
  Summary: Code knowledge graph for Claude Code. Build a relationship graph of your Python codebase and query it during coding sessions.
5
5
  Author: ctxgraph-code contributors
6
6
  License: MIT
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "ctxgraph-code"
7
- version = "0.6.0"
7
+ version = "0.6.1"
8
8
  description = "Code knowledge graph for Claude Code. Build a relationship graph of your Python codebase and query it during coding sessions."
9
9
  readme = "README.md"
10
10
  license = {text = "MIT"}
@@ -254,29 +254,22 @@ def _write_slash_command(slash_path: Path, path: Path):
254
254
 
255
255
  SLASH_COMMAND_TEMPLATE = """# ctxgraph-code: Code Relationship Graph
256
256
 
257
- **First time in this project?** Tell the user to run `ctxgraph-code setup` in their terminal.
258
-
259
- **Graph needs refresh?** Tell the user to run `ctxgraph-code build`.
260
-
261
257
  **Available graphs:** {available}
262
258
 
263
259
  **Commands:**
264
- - `ctxgraph-code query "terms"` -- Find relevant files, classes, and functions
265
- - `ctxgraph-code probe "question"` -- Search graph and read matching source code inline
266
- - `ctxgraph-code deps <path>` -- Show what a file imports and what calls it
267
- - `ctxgraph-code usedby <path>` -- Show what depends on a file
268
- - `ctxgraph-code overview --dir <name>` -- Show project structure for a specific graph
269
- - `ctxgraph-code symbols <path>` -- List classes/functions defined in a file
270
- - `ctxgraph-code context "task"` -- Generate a focused context summary
271
- - `ctxgraph-code subgraph "task"` -- Extract a focused subgraph with inline source for a task
272
- - `ctxgraph-code diff` -- Compare graph with filesystem to find new/removed/changed files
273
- - `ctxgraph-code mermaid --type classDiagram` -- Export graph as Mermaid diagram
274
- - `ctxgraph-code view --dir <name>` -- Visualize a graph interactively
275
- - `ctxgraph-code build-status` -- Show last build status and timing
276
- - `ctxgraph-code install-slash` -- (Re)install this slash command
277
-
278
- **Tip:** Use `--dir <name>` to scope queries to a per-directory graph.
279
- When passing a file path like `auth/login.py`, the correct graph is auto-detected.
260
+ - `ctxgraph-code query "terms"` -- Files, classes, functions
261
+ - `ctxgraph-code probe "question"` -- Search + read source inline
262
+ - `ctxgraph-code deps <path>` -- Dependencies of a file
263
+ - `ctxgraph-code usedby <path>` -- What depends on a file
264
+ - `ctxgraph-code overview --dir <name>` -- Project structure
265
+ - `ctxgraph-code symbols <path>` -- Classes/functions in a file
266
+ - `ctxgraph-code context "task"` -- Focused context summary
267
+ - `ctxgraph-code subgraph "task"` -- Focused subgraph with source
268
+ - `ctxgraph-code diff` -- Files changed since build
269
+ - `ctxgraph-code mermaid --type classDiagram` -- Mermaid diagram
270
+ - `ctxgraph-code view --dir <name>` -- Interactive D3.js graph
271
+
272
+ Use `--dir <name>` to scope queries. File paths auto-detect the graph dir.
280
273
  """
281
274
 
282
275
 
@@ -1110,7 +1103,7 @@ def version():
1110
1103
  try:
1111
1104
  ver = _v("ctxgraph-code")
1112
1105
  except Exception:
1113
- ver = "0.6.0"
1106
+ ver = "0.6.1"
1114
1107
  console.print(f"ctxgraph-code version [bold]{ver}[/bold]")
1115
1108
 
1116
1109
 
@@ -79,8 +79,6 @@ def uninstall_hooks(project_path: Path, local: bool = False) -> bool:
79
79
 
80
80
 
81
81
  def compute_hint_summary(repo_path: Path) -> Optional[str]:
82
- import hashlib
83
-
84
82
  avail = get_available_graphs(repo_path)
85
83
  if not avail["_combined"] and not avail["dirs"]:
86
84
  return None
@@ -100,8 +98,6 @@ def compute_hint_summary(repo_path: Path) -> Optional[str]:
100
98
  total_edges = stats.get("edges", 0)
101
99
  types = stats.get("types", {})
102
100
 
103
- top_files = _get_top_files(storage, 5)
104
-
105
101
  file_count = types.get("file", 0)
106
102
  class_count = types.get("class", 0)
107
103
  func_count = types.get("function", 0)
@@ -112,55 +108,11 @@ def compute_hint_summary(repo_path: Path) -> Optional[str]:
112
108
  ]
113
109
  if file_count:
114
110
  lines.append(f"Files: {file_count} | Classes: {class_count} | Functions: {func_count}.")
115
- if top_files:
116
- lines.append(f"Key files: {', '.join(top_files)}.")
117
-
118
- # ── Tamper detection ──────────────────────────────────────
119
- hashes_json = storage.get_metadata("content_hashes")
120
- tampered: int = 0
121
- if hashes_json:
122
- try:
123
- stored_hashes = json.loads(hashes_json)
124
- for rel_path, stored_hash in stored_hashes.items():
125
- fp = repo_path / rel_path
126
- if not fp.is_file():
127
- tampered += 1
128
- continue
129
- try:
130
- actual = hashlib.sha256(
131
- fp.read_text(encoding="utf-8", errors="replace")
132
- .encode("utf-8")
133
- ).hexdigest()
134
- if actual != stored_hash:
135
- tampered += 1
136
- except OSError:
137
- tampered += 1
138
- except (json.JSONDecodeError, OSError):
139
- pass
140
- if tampered:
141
- lines.append(
142
- f"Warning: {tampered} file(s) have changed since graph was built. "
143
- "Run `ctxgraph-code build --incremental` to update."
144
- )
145
111
 
146
112
  lines.append(
147
- "Use `ctxgraph-code probe \"<question>\"`, "
148
- "`ctxgraph-code subgraph \"<task>\"`, or "
149
- "`/ctxgraph-code` for help."
113
+ "Use `ctxgraph-code probe` or `/ctxgraph-code` for help."
150
114
  )
151
115
 
152
116
  return "\n".join(lines)
153
117
  finally:
154
118
  storage.close()
155
-
156
-
157
- def _get_top_files(storage, limit: int = 5) -> list[str]:
158
- try:
159
- rows = storage.conn.execute(
160
- "SELECT path FROM nodes WHERE type = 'file' AND path IS NOT NULL "
161
- "ORDER BY size_bytes DESC LIMIT ?",
162
- (limit,),
163
- ).fetchall()
164
- return [r[0] for r in rows if r[0]]
165
- except Exception:
166
- return []
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: ctxgraph-code
3
- Version: 0.6.0
3
+ Version: 0.6.1
4
4
  Summary: Code knowledge graph for Claude Code. Build a relationship graph of your Python codebase and query it during coding sessions.
5
5
  Author: ctxgraph-code contributors
6
6
  License: MIT
File without changes
File without changes