tzero-mcp 10.7.4 → 11.11.0

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 (131) hide show
  1. package/CHANGELOG.md +27 -0
  2. package/LICENSE +21 -21
  3. package/README.md +3 -3
  4. package/bin/tzero-mcp.js +7 -11
  5. package/bin/tzero.js +7 -11
  6. package/index.js +3 -3
  7. package/package.json +3 -2
  8. package/src/addmcp.py +1203 -1194
  9. package/src/app.py +1810 -0
  10. package/src/main.py +60 -60
  11. package/src/pc_fixer_mcp.py +25 -0
  12. package/src/tzero/__init__.py +54 -0
  13. package/src/tzero/__main__.py +6 -0
  14. package/src/tzero/siber_akademi.ico +0 -0
  15. package/src/{siber_akademi_icon.py → tzero/siber_akademi_icon.py} +77 -77
  16. package/src/tzero/tzero_arch_test.py +463 -0
  17. package/src/{tzero_benchmark.py → tzero/tzero_benchmark.py} +2 -2
  18. package/src/tzero/tzero_blackboard.py +257 -0
  19. package/src/{tzero_bridge.py → tzero/tzero_bridge.py} +184 -0
  20. package/src/tzero/tzero_budget.py +195 -0
  21. package/src/tzero/tzero_card.py +431 -0
  22. package/src/{tzero_ci.py → tzero/tzero_ci.py} +7 -7
  23. package/src/{tzero_commit.py → tzero/tzero_commit.py} +1 -1
  24. package/src/tzero/tzero_contracts.py +1093 -0
  25. package/src/{tzero_cost.py → tzero/tzero_cost.py} +4 -1
  26. package/src/{tzero_dashboard.py → tzero/tzero_dashboard.py} +1960 -1448
  27. package/src/tzero/tzero_debt.py +461 -0
  28. package/src/{tzero_deps.py → tzero/tzero_deps.py} +462 -287
  29. package/src/{tzero_drift.py → tzero/tzero_drift.py} +1 -1
  30. package/src/{tzero_explain.py → tzero/tzero_explain.py} +306 -240
  31. package/src/{tzero_features.py → tzero/tzero_features.py} +3024 -3022
  32. package/src/tzero/tzero_federation.py +299 -0
  33. package/src/tzero/tzero_fix.py +557 -0
  34. package/src/{tzero_fixer → tzero/tzero_fixer}/amalgamation.py +334 -334
  35. package/src/{tzero_fixer → tzero/tzero_fixer}/async_io_modernizer.py +1 -1
  36. package/src/{tzero_fixer → tzero/tzero_fixer}/automated_regression_suite.py +8 -8
  37. package/src/{tzero_fixer → tzero/tzero_fixer}/ci_cd_self_healing_gate.py +1 -1
  38. package/src/{tzero_fixer → tzero/tzero_fixer}/code_duplicity_and_refactorer.py +1 -1
  39. package/src/{tzero_fixer → tzero/tzero_fixer}/cwe_remediator.py +1 -1
  40. package/src/{tzero_fixer → tzero/tzero_fixer}/dead_code_eliminator.py +1 -1
  41. package/src/{tzero_fixer → tzero/tzero_fixer}/dependency_vulnerability_auditor.py +1 -1
  42. package/src/{tzero_fixer → tzero/tzero_fixer}/git_advanced_surgeon.py +280 -280
  43. package/src/{tzero_fixer → tzero/tzero_fixer}/hardware_and_disk_doctor.py +325 -325
  44. package/src/{tzero_fixer → tzero/tzero_fixer}/mcp_server.py +489 -447
  45. package/src/{tzero_fixer → tzero/tzero_fixer}/models.py +385 -385
  46. package/src/{tzero_fixer → tzero/tzero_fixer}/orchestrator.py +375 -375
  47. package/src/{tzero_fixer → tzero/tzero_fixer}/packaging_abi_surgeon.py +323 -323
  48. package/src/{tzero_fixer → tzero/tzero_fixer}/pc_fixer_doctor.py +2 -1
  49. package/src/{tzero_fixer → tzero/tzero_fixer}/performance_and_memory_profiler.py +1 -1
  50. package/src/{tzero_fixer → tzero/tzero_fixer}/polyglot_ast_parsers.py +1 -1
  51. package/src/{tzero_fixer → tzero/tzero_fixer}/polyglot_build_healer.py +364 -364
  52. package/src/{tzero_fixer → tzero/tzero_fixer}/polyglot_linters.py +619 -619
  53. package/src/{tzero_fixer → tzero/tzero_fixer}/polyglot_schema_validator.py +1 -1
  54. package/src/{tzero_fixer → tzero/tzero_fixer}/smart_patch_recommender.py +1 -1
  55. package/src/{tzero_fixer → tzero/tzero_fixer}/synthetic_workspace_generator.py +2 -2
  56. package/src/{tzero_fixer → tzero/tzero_fixer}/system_diagnostics_extended.py +493 -493
  57. package/src/{tzero_fixer → tzero/tzero_fixer}/system_repair_recipes.py +1 -1
  58. package/src/tzero/tzero_golden.py +319 -0
  59. package/src/tzero/tzero_graph_hud.html +338 -0
  60. package/src/tzero/tzero_graph_rag.py +263 -0
  61. package/src/tzero/tzero_growth.py +415 -0
  62. package/src/{tzero_guard.py → tzero/tzero_guard.py} +11 -3
  63. package/src/tzero/tzero_hooks.py +565 -0
  64. package/src/{tzero_jarvis → tzero/tzero_jarvis}/__init__.py +11 -1
  65. package/src/{tzero_jarvis → tzero/tzero_jarvis}/causal_graph.py +1 -1
  66. package/src/tzero/tzero_jarvis/creative_director.py +333 -0
  67. package/src/{tzero_jarvis → tzero/tzero_jarvis}/graph_visualizer.py +1 -1
  68. package/src/{tzero_jarvis → tzero/tzero_jarvis}/latent_press.py +2 -2
  69. package/src/{tzero_jarvis → tzero/tzero_jarvis}/memory_consolidation.py +1 -1
  70. package/src/{tzero_jarvis → tzero/tzero_jarvis}/minhash_lsh.py +1 -1
  71. package/src/{tzero_jarvis → tzero/tzero_jarvis}/orchestrator.py +2 -2
  72. package/src/{tzero_jarvis → tzero/tzero_jarvis}/self_healing.py +1 -1
  73. package/src/{tzero_jarvis → tzero/tzero_jarvis}/swarm.py +3 -3
  74. package/src/{tzero_jarvis → tzero/tzero_jarvis}/swarm_bft.py +1 -1
  75. package/src/{tzero_jarvis → tzero/tzero_jarvis}/workspace_orchestrator.py +6 -6
  76. package/src/tzero/tzero_lsp.py +634 -0
  77. package/src/tzero/tzero_mcp.py +5314 -0
  78. package/src/tzero/tzero_mutation.py +358 -0
  79. package/src/{tzero_neural_cortex.py → tzero/tzero_neural_cortex.py} +1425 -1425
  80. package/src/tzero/tzero_packer.py +577 -0
  81. package/src/{tzero_pc_fixer.py → tzero/tzero_pc_fixer.py} +42 -0
  82. package/src/{tzero_pipe.py → tzero/tzero_pipe.py} +1 -1
  83. package/src/tzero/tzero_polyglot.py +799 -0
  84. package/src/tzero/tzero_proxy.py +127 -0
  85. package/src/tzero/tzero_rust_bridge.py +198 -0
  86. package/src/tzero/tzero_scip.py +368 -0
  87. package/src/{tzero_security.py → tzero/tzero_security.py} +573 -570
  88. package/src/tzero/tzero_semantic_merge.py +189 -0
  89. package/src/tzero/tzero_snapshot.py +471 -0
  90. package/src/{tzero_stubs.py → tzero/tzero_stubs.py} +1 -1
  91. package/src/tzero/tzero_subagent_engine.py +459 -0
  92. package/src/{tzero_sync.py → tzero/tzero_sync.py} +2 -2
  93. package/src/{tzero_task_benchmark.py → tzero/tzero_task_benchmark.py} +174 -31
  94. package/src/{tzero_tui.py → tzero/tzero_tui.py} +313 -244
  95. package/src/tzero/tzero_turbo.py +264 -0
  96. package/src/{tzero_v3.py → tzero/tzero_v3.py} +9997 -9435
  97. package/src/tzero.py +6 -58
  98. package/src/tzero_mcp.py +25 -4858
  99. package/test/package.test.js +14 -2
  100. package/src/tzero/jarvis/semantic_compressor.py +0 -373
  101. package/src/tzero_fix.py +0 -228
  102. package/src/tzero_gateway.py +0 -885
  103. package/src/tzero_packer.py +0 -370
  104. package/src/tzero_polyglot.py +0 -422
  105. package/src/tzero_snapshot.py +0 -258
  106. /package/src/{tzero_fixer → tzero/tzero_fixer}/__init__.py +0 -0
  107. /package/src/{tzero_fixer → tzero/tzero_fixer}/ast_syntax_healer.py +0 -0
  108. /package/src/{tzero_fixer → tzero/tzero_fixer}/ast_type_modernizer.py +0 -0
  109. /package/src/{tzero_fixer → tzero/tzero_fixer}/benchmarks_and_diagnostics.py +0 -0
  110. /package/src/{tzero_fixer → tzero/tzero_fixer}/code_smells_healer.py +0 -0
  111. /package/src/{tzero_fixer → tzero/tzero_fixer}/import_graph_healer.py +0 -0
  112. /package/src/{tzero_fixer → tzero/tzero_fixer}/interactive_tui.py +0 -0
  113. /package/src/{tzero_fixer → tzero/tzero_fixer}/knowledge_base.py +0 -0
  114. /package/src/{tzero_fixer → tzero/tzero_fixer}/knowledge_base_extended.py +0 -0
  115. /package/src/{tzero_fixer → tzero/tzero_fixer}/linters_and_static_analyzer.py +0 -0
  116. /package/src/{tzero_fixer → tzero/tzero_fixer}/os_doctor.py +0 -0
  117. /package/src/{tzero_fixer → tzero/tzero_fixer}/polyglot_config_healer.py +0 -0
  118. /package/src/{tzero_fixer → tzero/tzero_fixer}/polyglot_doctor.py +0 -0
  119. /package/src/{tzero_fixer → tzero/tzero_fixer}/security_cwe_database.py +0 -0
  120. /package/src/{tzero_fixer → tzero/tzero_fixer}/security_deep_rules.py +0 -0
  121. /package/src/{tzero_fixer → tzero/tzero_fixer}/security_rules_catalog.py +0 -0
  122. /package/src/{tzero_fixer → tzero/tzero_fixer}/security_zero_leak.py +0 -0
  123. /package/src/{tzero_fixer → tzero/tzero_fixer}/venv_doctor.py +0 -0
  124. /package/src/{tzero_infra.py → tzero/tzero_infra.py} +0 -0
  125. /package/src/{tzero_jarvis → tzero/tzero_jarvis}/hybrid_search.py +0 -0
  126. /package/src/{tzero_jarvis → tzero/tzero_jarvis}/semantic_compressor.py +0 -0
  127. /package/src/{tzero_jarvis → tzero/tzero_jarvis}/zero_key_router.py +0 -0
  128. /package/src/{tzero_patch.py → tzero/tzero_patch.py} +0 -0
  129. /package/src/{tzero_reachability.py → tzero/tzero_reachability.py} +0 -0
  130. /package/src/{tzero_replay.py → tzero/tzero_replay.py} +0 -0
  131. /package/src/{tzero_superdesign.py → tzero/tzero_superdesign.py} +0 -0
@@ -13,8 +13,11 @@ License: MIT
13
13
  import ast
14
14
  import json
15
15
  import os
16
+ import re
16
17
  import sys
17
18
  import time
19
+ import urllib.error
20
+ import urllib.request
18
21
  from dataclasses import dataclass, field, asdict
19
22
  from typing import Dict, List, Any, Optional
20
23
 
@@ -37,6 +40,24 @@ def count_bpe_tokens(text: str, model_encoding: str = "cl100k_base") -> int:
37
40
  return max(1, len(text) // 4)
38
41
 
39
42
 
43
+ def detect_installed_ollama_model(ollama_url: str = "http://127.0.0.1:11434") -> Optional[str]:
44
+ """Auto-detects already installed models on local Ollama without triggering any downloads."""
45
+ try:
46
+ url = ollama_url.rstrip("/") + "/api/tags"
47
+ req = urllib.request.Request(url, method="GET")
48
+ with urllib.request.urlopen(req, timeout=3) as resp:
49
+ data = json.loads(resp.read().decode("utf-8"))
50
+ models = [m.get("name", "") for m in data.get("models", []) if m.get("name")]
51
+ for m in models:
52
+ if "qwen" in m.lower():
53
+ return m
54
+ if models:
55
+ return models[0]
56
+ except Exception:
57
+ pass
58
+ return None
59
+
60
+
40
61
  @dataclass
41
62
  class TaskEvaluationResult:
42
63
  task_id: str
@@ -54,7 +75,7 @@ class TaskEvaluationResult:
54
75
 
55
76
  @dataclass
56
77
  class TaskBenchmarkReport:
57
- version: str = "10.7.0"
78
+ version: str = "11.11.0"
58
79
  tokenizer: str = "tiktoken (cl100k_base)" if TIKTOKEN_AVAILABLE else "character-ratio fallback"
59
80
  total_tasks: int = 0
60
81
  passed_tasks: int = 0
@@ -257,54 +278,156 @@ def analyze_symbol_impact(symbol_path: str, table: SymbolTable, dag: CallGraphDA
257
278
 
258
279
  @classmethod
259
280
  def evaluate_all(cls) -> TaskBenchmarkReport:
260
- """Executes full benchmark evaluation across all test tasks."""
281
+ """Executes standard 3-task offline benchmark evaluation."""
282
+ return cls.evaluate_suite(suite="core")
283
+
284
+ @classmethod
285
+ def _build_adversarial_tasks(cls) -> List[Dict[str, str]]:
286
+ """Synthesizes 8 multi-file cross-domain verification tasks for adversarial accuracy audits."""
287
+ specs = [
288
+ ("ADV-01", "Order Settlement Contract", "OrderLedger", "settle_invoice", "tx_id: str, cents: int", "bool"),
289
+ ("ADV-02", "Zero-Leak Token Masker", "SecretVault", "redact_payload", "raw_text: str", "str"),
290
+ ("ADV-03", "AST Dependency Graph", "ImportResolver", "topological_order", "nodes: list", "list"),
291
+ ("ADV-04", "Budget Allocator Pack", "WindowPacker", "allocate_tiers", "limit: int, items: list", "dict"),
292
+ ("ADV-05", "Merkle Chunk Signer", "ChunkVerifier", "compute_root", "hashes: list", "str"),
293
+ ("ADV-06", "Polyglot Signature Extractor", "SyntaxScanner", "extract_headers", "source: str, ext: str", "str"),
294
+ ("ADV-07", "Mutation Killer Evaluator", "MutantHarness", "evaluate_mutant", "module_path: str", "float"),
295
+ ("ADV-08", "Semantic Merge Healer", "ConflictResolver", "reconcile_hunk", "left: str, right: str", "str"),
296
+ ]
297
+ tasks: List[Dict[str, str]] = []
298
+ for tid, title, cls_name, method_name, sig_args, ret_type in specs:
299
+ body_lines = "\n".join(
300
+ f" step_{i} = len(str({sig_args.split(':')[0].strip()})) + {i * 7}"
301
+ for i in range(18)
302
+ )
303
+ return_value = 'True' if ret_type == 'bool' else ('1.0' if ret_type == 'float' else ('[]' if ret_type == 'list' else ('{}' if ret_type == 'dict' else '"ok"')))
304
+ dep_code = (
305
+ f"class {cls_name}:\n"
306
+ f' """{title} domain contract."""\n'
307
+ f" def __init__(self, strict: bool = True):\n"
308
+ f" self.strict = strict\n\n"
309
+ f" def {method_name}(self, {sig_args}) -> {ret_type}:\n"
310
+ f"{body_lines}\n"
311
+ f" return {return_value}\n"
312
+ )
313
+ call_args = ", ".join(
314
+ '""' if "str" in a else ("[]" if "list" in a else "128")
315
+ for a in sig_args.split(",")
316
+ )
317
+ target_impl = (
318
+ f"def run_{tid.lower().replace('-', '_')}(svc):\n"
319
+ f" return svc.{method_name}({call_args})\n"
320
+ )
321
+ tasks.append({
322
+ "id": tid,
323
+ "title": title,
324
+ "description": f"Verify AST skeleton preserves {cls_name}.{method_name} under adversarial load.",
325
+ "dependency_code": dep_code,
326
+ "target_implementation": target_impl,
327
+ })
328
+ return tasks
329
+
330
+ @staticmethod
331
+ def _query_ollama_implementation(
332
+ pruned_dep: str,
333
+ task_title: str,
334
+ ollama_model: str,
335
+ ollama_url: str,
336
+ ) -> str:
337
+ prompt = (
338
+ f"You are an expert Python engineer. You are given these existing classes and method signatures:\n"
339
+ f"```python\n{pruned_dep}\n```\n\n"
340
+ f"Task: Write a Python helper function that implements '{task_title}'.\n"
341
+ f"Requirements:\n"
342
+ f"1. You MUST use and call the methods on the classes defined above.\n"
343
+ f"2. Do NOT redefine the classes.\n"
344
+ f"3. Return executable Python code only enclosed in ```python ``` code block."
345
+ )
346
+ req = urllib.request.Request(
347
+ ollama_url,
348
+ data=json.dumps({
349
+ "model": ollama_model,
350
+ "prompt": prompt,
351
+ "stream": False,
352
+ "options": {"temperature": 0.1, "num_predict": 512}
353
+ }).encode("utf-8"),
354
+ headers={"Content-Type": "application/json"},
355
+ method="POST",
356
+ )
357
+ with urllib.request.urlopen(req, timeout=15) as resp:
358
+ data = json.loads(resp.read().decode("utf-8"))
359
+ raw = str(data.get("response") or "")
360
+ fence = re.search(r"```(?:python)?\s*(.*?)```", raw, re.DOTALL)
361
+ return fence.group(1).strip() if fence else raw.strip()
362
+
363
+ @classmethod
364
+ def evaluate_suite(
365
+ cls,
366
+ suite: str = "core",
367
+ ollama_model: Optional[str] = None,
368
+ ollama_url: str = "http://127.0.0.1:11434/api/generate",
369
+ limit_tasks: Optional[int] = None,
370
+ ) -> TaskBenchmarkReport:
371
+ """Executes benchmark evaluation across 'core' (3 tasks) or 'adversarial' (8 tasks), optionally querying Ollama."""
261
372
  report = TaskBenchmarkReport()
262
373
  total_raw = 0
263
374
  total_tzero = 0
264
375
  reductions = []
265
376
 
266
- for task in cls.TASKS:
377
+ task_list = cls._build_adversarial_tasks() if suite == "adversarial" else list(cls.TASKS)
378
+ if limit_tasks is not None:
379
+ task_list = task_list[:limit_tasks]
380
+
381
+ for task in task_list:
267
382
  t0 = time.perf_counter()
268
383
  dep_code = task["dependency_code"]
269
384
  target_impl = task["target_implementation"]
270
385
 
271
- # Mode A: Raw Full Ingestion
272
386
  raw_context = dep_code + "\n" + target_impl
273
387
  raw_tokens = count_bpe_tokens(raw_context)
274
388
 
275
- # Mode B: T-Zero Smart Skeleton (Pruned Dependency + Full Target)
276
389
  pruned_dep = cls.prune_to_ast_skeleton(dep_code)
277
390
  tzero_context = pruned_dep + "\n" + target_impl
278
391
  tzero_tokens = count_bpe_tokens(tzero_context)
279
392
 
280
- # Token savings
393
+ if ollama_model:
394
+ try:
395
+ target_impl = cls._query_ollama_implementation(
396
+ pruned_dep=pruned_dep,
397
+ task_title=task["title"],
398
+ ollama_model=ollama_model,
399
+ ollama_url=ollama_url,
400
+ )
401
+ except (urllib.error.URLError, OSError, ValueError) as exc:
402
+ print(f"[WARN] Ollama benchmark query failed for {task['id']}: {exc}", file=sys.stderr)
403
+ target_impl = ""
404
+
281
405
  saved = raw_tokens - tzero_tokens
282
406
  savings_pct = (saved / raw_tokens * 100.0) if raw_tokens else 0.0
283
407
 
284
- # Syntax validation of synthesized target code
285
- try:
286
- target_ast = ast.parse(target_impl)
287
- syntax_valid = True
288
- except SyntaxError:
289
- syntax_valid = False
408
+ target_ast = None
409
+ syntax_valid = False
410
+ if target_impl.strip():
411
+ try:
412
+ target_ast = ast.parse(target_impl)
413
+ syntax_valid = True
414
+ except SyntaxError:
415
+ syntax_valid = False
290
416
 
291
- # Verify that target calls match methods declared in skeleton
292
417
  dep_ast = ast.parse(pruned_dep)
293
- declared_methods = set()
294
- for node in ast.walk(dep_ast):
295
- if isinstance(node, (ast.FunctionDef, ast.AsyncFunctionDef)):
296
- declared_methods.add(node.name)
418
+ declared_methods = {
419
+ node.name
420
+ for node in ast.walk(dep_ast)
421
+ if isinstance(node, (ast.FunctionDef, ast.AsyncFunctionDef))
422
+ }
297
423
 
298
424
  called_methods = set()
299
- for node in ast.walk(target_ast):
300
- if isinstance(node, ast.Call) and isinstance(node.func, ast.Attribute):
301
- called_methods.add(node.func.attr)
302
-
303
- hallucinations = 0
304
- for cm in called_methods:
305
- if cm not in declared_methods:
306
- hallucinations += 1
425
+ if target_ast is not None:
426
+ for node in ast.walk(target_ast):
427
+ if isinstance(node, ast.Call) and isinstance(node.func, ast.Attribute):
428
+ called_methods.add(node.func.attr)
307
429
 
430
+ hallucinations = sum(1 for cm in called_methods if cm not in declared_methods)
308
431
  retention_pct = 100.0 if not hallucinations else max(0.0, 100.0 - (hallucinations * 25.0))
309
432
  task_success = syntax_valid and (hallucinations == 0)
310
433
 
@@ -321,17 +444,17 @@ def analyze_symbol_impact(symbol_path: str, table: SymbolTable, dag: CallGraphDA
321
444
  hallucination_count=hallucinations,
322
445
  task_success=task_success,
323
446
  latency_ms=round(latency_ms, 2),
324
- description=task["description"]
447
+ description=task["description"],
325
448
  )
326
449
  report.results.append(res)
327
450
  total_raw += raw_tokens
328
451
  total_tzero += tzero_tokens
329
452
  reductions.append(savings_pct)
330
453
 
331
- report.total_tasks = len(cls.TASKS)
454
+ report.total_tasks = len(task_list)
332
455
  report.passed_tasks = sum(1 for r in report.results if r.task_success)
333
- report.success_rate_pct = round(report.passed_tasks / report.total_tasks * 100.0, 1)
334
- report.average_token_reduction_pct = round(sum(reductions) / len(reductions), 1)
456
+ report.success_rate_pct = round(report.passed_tasks / max(1, report.total_tasks) * 100.0, 1)
457
+ report.average_token_reduction_pct = round(sum(reductions) / max(1, len(reductions)), 1)
335
458
  report.total_raw_tokens = total_raw
336
459
  report.total_tzero_tokens = total_tzero
337
460
 
@@ -342,7 +465,7 @@ def analyze_symbol_impact(symbol_path: str, table: SymbolTable, dag: CallGraphDA
342
465
  """Formats ANSI-styled benchmark summary table."""
343
466
  lines = []
344
467
  lines.append("=" * 78)
345
- lines.append(" T-ZERO TASK-COMPLETION & BPE TOKENIZER BENCHMARK REPORT (v10.7.0)")
468
+ lines.append(" T-ZERO TASK-COMPLETION & BPE TOKENIZER BENCHMARK REPORT (v11.11.0)")
346
469
  lines.append(f" Tokenizer: {report.tokenizer} | Tasks Evaluated: {report.total_tasks}")
347
470
  lines.append("=" * 78)
348
471
  lines.append(f"{'Task ID':<10} | {'Raw BPE':<8} | {'T-Zero':<8} | {'Saved %':<8} | {'Contract %':<10} | {'Status'}")
@@ -359,5 +482,25 @@ def analyze_symbol_impact(symbol_path: str, table: SymbolTable, dag: CallGraphDA
359
482
 
360
483
 
361
484
  if __name__ == "__main__":
362
- rep = TaskCompletionBenchmark.evaluate_all()
485
+ import argparse
486
+ parser = argparse.ArgumentParser(description="T-Zero Task-Completion & Real Tokenizer Benchmark Engine")
487
+ parser.add_argument("--suite", choices=["core", "adversarial"], default="core", help="Benchmark suite to evaluate")
488
+ parser.add_argument("--ollama", action="store_true", help="Query local Ollama instance without pulling extra models")
489
+ parser.add_argument("--model", type=str, default=None, help="Local Ollama model name (auto-detects if omitted)")
490
+ args = parser.parse_args()
491
+
492
+ selected_model = args.model
493
+ if args.ollama and not selected_model:
494
+ selected_model = detect_installed_ollama_model()
495
+ if not selected_model:
496
+ print("[WARN] No local Ollama model detected. Running offline AST benchmark.", file=sys.stderr)
497
+
498
+ if selected_model:
499
+ print(f"🤖 Running benchmark with local Ollama model: {selected_model}")
500
+ rep = TaskCompletionBenchmark.evaluate_suite(suite=args.suite, ollama_model=selected_model)
501
+ elif args.suite == "adversarial":
502
+ rep = TaskCompletionBenchmark.evaluate_suite(suite="adversarial")
503
+ else:
504
+ rep = TaskCompletionBenchmark.evaluate_all()
505
+
363
506
  print(TaskCompletionBenchmark.format_terminal_summary(rep))