Skip to content

Commit b299fe2

Browse files
committed
from repo template
1 parent f3cc954 commit b299fe2

1 file changed

Lines changed: 14 additions & 10 deletions

File tree

tools/graphify_map_repo.py

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@
1111
import subprocess
1212

1313

14-
MODEL = "qwen2.5-coder:7b-instruct"
14+
CLAUDE_LABEL_MODEL = "sonnet"
15+
OLLAMA_MODEL = "qwen2.5-coder:7b-instruct"
1516
GRAPHIFY_PACKAGE = "graphifyy[ollama,sql,terraform]"
1617
LABEL_BACKEND = "claude-cli"
1718
OLLAMA_BACKEND = "ollama"
@@ -41,9 +42,9 @@ def build_parser() -> argparse.ArgumentParser:
4142
" With no mode, update graphify-out/graph.json when it exists; otherwise extract a\n"
4243
" fresh graph. Updates perform only Graphify's incremental update before rewriting\n"
4344
" manager context. Fresh builds upgrade Graphify, extract, fully label, and benchmark.\n"
44-
" Claude CLI is the default label backend; --ollama selects the local model for fresh\n"
45-
" builds. Context prints orientation without running Graphify. Before the first map\n"
46-
" exists, context prints this help instead.\n"
45+
f" Claude CLI uses {CLAUDE_LABEL_MODEL} for labels. --ollama selects the local model for\n"
46+
" fresh builds. Context prints orientation without running\n"
47+
" Graphify. Before the first map exists, context prints this help instead.\n"
4748
"\n"
4849
"Examples:\n"
4950
" %(prog)s # automatically choose fresh or update\n"
@@ -53,7 +54,7 @@ def build_parser() -> argparse.ArgumentParser:
5354
" %(prog)s --context # print orientation without rebuilding\n"
5455
"\n"
5556
f"Fresh-build setup: pip upgrades {GRAPHIFY_PACKAGE}.\n"
56-
f"Label backend: Claude CLI by default; --ollama pulls {MODEL}.\n"
57+
f"Label backend: Claude CLI with {CLAUDE_LABEL_MODEL}; --ollama pulls {OLLAMA_MODEL}.\n"
5758
"Run graphify benchmark directly for measurements outside a fresh build.\n"
5859
f"Manager context: {OUTPUT_DIR_NAME}/{MANAGER_CONTEXT_FILE_NAME}"
5960
)
@@ -93,7 +94,7 @@ def build_parser() -> argparse.ArgumentParser:
9394
dest="label_backend",
9495
action="store_const",
9596
const=OLLAMA_BACKEND,
96-
help=f"use local Ollama model {MODEL} for fresh builds",
97+
help=f"use local Ollama model {OLLAMA_MODEL} for fresh builds",
9798
)
9899
parser.set_defaults(mode=MODE_AUTO, label_backend=LABEL_BACKEND)
99100
return parser
@@ -201,8 +202,8 @@ def prepare_label_backend(repo_root: pathlib.Path, label_backend: str) -> None:
201202
"ollama" if label_backend == OLLAMA_BACKEND else "claude"
202203
)
203204
if label_backend == OLLAMA_BACKEND:
204-
print_step(f"PULLING OLLAMA MODEL: {MODEL}")
205-
run_command([backend_executable, "pull", MODEL], repo_root)
205+
print_step(f"PULLING OLLAMA MODEL: {OLLAMA_MODEL}")
206+
run_command([backend_executable, "pull", OLLAMA_MODEL], repo_root)
206207

207208

208209
#============================================
@@ -254,14 +255,17 @@ def label_graph(
254255
# ASVS 2.2.1: accept only the two documented label backends.
255256
if label_backend not in (LABEL_BACKEND, OLLAMA_BACKEND):
256257
raise ValueError(f"Unsupported Graphify label backend: {label_backend}")
258+
label_model = (
259+
OLLAMA_MODEL if label_backend == OLLAMA_BACKEND else CLAUDE_LABEL_MODEL
260+
)
261+
# ASVS 1.2.5: fixed backend and model values remain isolated in the argv list.
257262
command = [
258263
graphify_executable,
259264
"label",
260265
".",
261266
f"--backend={label_backend}",
267+
f"--model={label_model}",
262268
]
263-
if label_backend == OLLAMA_BACKEND:
264-
command.append(f"--model={MODEL}")
265269
run_command(command, repo_root)
266270

267271

0 commit comments

Comments
 (0)