Skip to content

Commit dd43e82

Browse files
tirth8205claude
andcommitted
fix: resolve CI failures — mypy, ruff, bandit, schema-sync
- Fix store.conn → store._conn in context.py (mypy) - Remove unused full_build/incremental_update imports in cli.py (ruff F401) - Sort imports in graph.py, main.py, tools/__init__.py (ruff I001) - Fix E402 module-level import order in graph.py - Add nosec B105 to _TOKEN_EFFICIENCY_PREAMBLE (bandit false positive) - Bump VS Code extension SUPPORTED_SCHEMA_VERSION 5 → 6 (schema-sync) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 817c012 commit dd43e82

7 files changed

Lines changed: 15 additions & 16 deletions

File tree

code-review-graph-vscode/src/backend/sqlite.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,7 @@ export class SqliteReader {
208208
if (row) {
209209
const version = parseInt(row.value, 10);
210210
// Must match LATEST_VERSION in code_review_graph/migrations.py
211-
const SUPPORTED_SCHEMA_VERSION = 5;
211+
const SUPPORTED_SCHEMA_VERSION = 6;
212212
if (!isNaN(version) && version > SUPPORTED_SCHEMA_VERSION) {
213213
return `Database was created with a newer version (schema v${version}). Update the extension.`;
214214
}

code_review_graph/cli.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -429,9 +429,7 @@ def main() -> None:
429429
from .incremental import (
430430
find_project_root,
431431
find_repo_root,
432-
full_build,
433432
get_db_path,
434-
incremental_update,
435433
watch,
436434
)
437435

code_review_graph/graph.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,22 +8,21 @@
88
from __future__ import annotations
99

1010
import json
11+
import logging
1112
import sqlite3
1213
import threading
1314
import time
1415
from dataclasses import dataclass
1516
from pathlib import Path
1617
from typing import Any, Optional
1718

18-
import logging
19-
2019
import networkx as nx
2120

2221
from .constants import BFS_ENGINE, MAX_IMPACT_DEPTH, MAX_IMPACT_NODES
2322
from .migrations import get_schema_version, run_migrations
23+
from .parser import EdgeInfo, NodeInfo
2424

2525
logger = logging.getLogger(__name__)
26-
from .parser import EdgeInfo, NodeInfo
2726

2827
# ---------------------------------------------------------------------------
2928
# Schema

code_review_graph/main.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,6 @@
2121
apply_refactor_func,
2222
build_or_update_graph,
2323
cross_repo_search_func,
24-
get_minimal_context,
25-
run_postprocess,
2624
detect_changes_func,
2725
embed_graph,
2826
find_large_functions,
@@ -33,6 +31,7 @@
3331
get_docs_section,
3432
get_flow,
3533
get_impact_radius,
34+
get_minimal_context,
3635
get_review_context,
3736
get_wiki_page_func,
3837
list_communities_func,
@@ -41,6 +40,7 @@
4140
list_repos_func,
4241
query_graph,
4342
refactor_func,
43+
run_postprocess,
4444
semantic_search_nodes,
4545
)
4646

code_review_graph/prompts.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@
1212

1313
from __future__ import annotations
1414

15-
_TOKEN_EFFICIENCY_PREAMBLE = """\
15+
_TOKEN_EFFICIENCY_PREAMBLE = ( # nosec B105 — prompt template, not a password
16+
"""\
1617
## Rules for Token-Efficient Graph Usage
1718
1. ALWAYS call `get_minimal_context` first with a task description.
1819
2. Use `detail_level="minimal"` on all tool calls unless the minimal output \
@@ -25,6 +26,7 @@
2526
6. When reviewing changes: detect_changes(detail_level="minimal") → only \
2627
expand on high-risk items.
2728
"""
29+
)
2830

2931

3032
def review_changes_prompt(base: str = "HEAD~1") -> list[dict]:

code_review_graph/tools/__init__.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,16 +46,16 @@
4646
# -- build ------------------------------------------------------------------
4747
from .build import build_or_update_graph, run_postprocess
4848

49-
# -- context ----------------------------------------------------------------
50-
from .context import get_minimal_context
51-
5249
# -- community_tools --------------------------------------------------------
5350
from .community_tools import (
5451
get_architecture_overview_func,
5552
get_community_func,
5653
list_communities_func,
5754
)
5855

56+
# -- context ----------------------------------------------------------------
57+
from .context import get_minimal_context
58+
5959
# -- docs -------------------------------------------------------------------
6060
from .docs import embed_graph, generate_wiki_func, get_docs_section, get_wiki_page_func
6161

code_review_graph/tools/context.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -91,21 +91,21 @@ def get_minimal_context(
9191
# 3. Top 3 communities
9292
communities: list[str] = []
9393
try:
94-
rows = store.conn.execute(
94+
rows = store._conn.execute(
9595
"SELECT name FROM communities ORDER BY size DESC LIMIT 3"
9696
).fetchall()
9797
communities = [r[0] for r in rows]
98-
except Exception:
98+
except Exception: # nosec B110 — table may not exist yet
9999
pass
100100

101101
# 4. Top 3 critical flows
102102
flows: list[str] = []
103103
try:
104-
rows = store.conn.execute(
104+
rows = store._conn.execute(
105105
"SELECT name FROM flows ORDER BY criticality DESC LIMIT 3"
106106
).fetchall()
107107
flows = [r[0] for r in rows]
108-
except Exception:
108+
except Exception: # nosec B110 — table may not exist yet
109109
pass
110110

111111
# 5. Suggest next tools based on task keywords

0 commit comments

Comments
 (0)