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
@@ -0,0 +1,431 @@
1
+ # -*- coding: utf-8 -*-
2
+ """
3
+ T-ZERO GITHUB REPOSITORY SHOWCASE CARD & VIRAL BADGE GENERATOR
4
+ --------------------------------------------------------------
5
+ Developer: Toprak Ahmet Aydoğmuş (Siber Akademi)
6
+ Version: 5.1.0 | License: MIT
7
+
8
+ Generates shareable high-DPI SVG banner cards, animated SVG badges, and interactive
9
+ HTML split-screen comparison sliders for repositories powered by T-Zero.
10
+ Designed to create a self-reinforcing viral star loop across GitHub repositories.
11
+ """
12
+
13
+ from __future__ import annotations
14
+
15
+ import os
16
+ import html
17
+ from typing import Optional
18
+
19
+
20
+ class TZeroShowcaseGenerator:
21
+ """Generates viral GitHub badges, repository banner cards, and interactive showcase sliders."""
22
+
23
+ @classmethod
24
+ def generate_svg_banner_card(
25
+ cls,
26
+ repo_name: str = "TZeroAlgorithm",
27
+ savings_pct: float = 94.6,
28
+ raw_tokens: int = 10809938,
29
+ pruned_tokens: int = 1297192,
30
+ annual_savings_usd: float = 14280.0,
31
+ output_file: str = "assets/tzero_badge_card.svg"
32
+ ) -> str:
33
+ """Generates a futuristic, high-DPI 800x240 SVG banner card for repository READMEs."""
34
+ os.makedirs(os.path.dirname(os.path.abspath(output_file)), exist_ok=True)
35
+
36
+ k_raw = f"{raw_tokens / 1_000_000:.1f}M" if raw_tokens >= 1_000_000 else f"{raw_tokens / 1_000:.1f}k"
37
+ k_pruned = f"{pruned_tokens / 1_000_000:.1f}M" if pruned_tokens >= 1_000_000 else f"{pruned_tokens / 1_000:.1f}k"
38
+ savings_str = f"{savings_pct:.1f}%"
39
+ usd_str = f"${annual_savings_usd:,.0f}/yr"
40
+
41
+ svg = f"""<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 800 240" width="800" height="240" fill="none">
42
+ <defs>
43
+ <linearGradient id="cardBg" x1="0%" y1="0%" x2="100%" y2="100%">
44
+ <stop offset="0%" stop-color="#0a0f1d"/>
45
+ <stop offset="50%" stop-color="#0f172a"/>
46
+ <stop offset="100%" stop-color="#020617"/>
47
+ </linearGradient>
48
+ <linearGradient id="accentGlow" x1="0%" y1="0%" x2="100%" y2="0%">
49
+ <stop offset="0%" stop-color="#38bdf8"/>
50
+ <stop offset="50%" stop-color="#818cf8"/>
51
+ <stop offset="100%" stop-color="#c084fc"/>
52
+ </linearGradient>
53
+ <linearGradient id="greenGlow" x1="0%" y1="0%" x2="100%" y2="0%">
54
+ <stop offset="0%" stop-color="#10b981"/>
55
+ <stop offset="100%" stop-color="#34d399"/>
56
+ </linearGradient>
57
+ <filter id="glow" x="-20%" y="-20%" width="140%" height="140%">
58
+ <feGaussianBlur stdDeviation="8" result="blur"/>
59
+ <feComposite in="SourceGraphic" in2="blur" operator="over"/>
60
+ </filter>
61
+ <style>
62
+ @keyframes pulseBorder {{
63
+ 0%, 100% {{ stroke-opacity: 0.4; }}
64
+ 50% {{ stroke-opacity: 0.9; }}
65
+ }}
66
+ .card-border {{
67
+ animation: pulseBorder 4s ease-in-out infinite;
68
+ }}
69
+ </style>
70
+ </defs>
71
+
72
+ <!-- Card Background -->
73
+ <rect x="2" y="2" width="796" height="236" rx="16" fill="url(#cardBg)" stroke="url(#accentGlow)" stroke-width="2" class="card-border"/>
74
+
75
+ <!-- Subtle Grid Background Overlay -->
76
+ <g opacity="0.08" stroke="#38bdf8" stroke-width="1">
77
+ <line x1="0" y1="40" x2="800" y2="40"/>
78
+ <line x1="0" y1="80" x2="800" y2="80"/>
79
+ <line x1="0" y1="120" x2="800" y2="120"/>
80
+ <line x1="0" y1="160" x2="800" y2="160"/>
81
+ <line x1="0" y1="200" x2="800" y2="200"/>
82
+ <line x1="160" y1="0" x2="160" y2="240"/>
83
+ <line x1="320" y1="0" x2="320" y2="240"/>
84
+ <line x1="480" y1="0" x2="480" y2="240"/>
85
+ <line x1="640" y1="0" x2="640" y2="240"/>
86
+ </g>
87
+
88
+ <!-- Header: Logo & Branding -->
89
+ <g transform="translate(32, 30)">
90
+ <!-- T-Zero Hexagon Icon -->
91
+ <polygon points="18,0 36,10 36,30 18,40 0,30 0,10" fill="#0f172a" stroke="url(#accentGlow)" stroke-width="2.5"/>
92
+ <text x="18" y="26" font-family="-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif" font-size="16" font-weight="900" fill="#38bdf8" text-anchor="middle">T0</text>
93
+
94
+ <text x="48" y="22" font-family="-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif" font-size="20" font-weight="800" fill="#f8fafc">
95
+ T-ZERO <tspan fill="#818cf8">CONTEXT ARCHITECT</tspan>
96
+ </text>
97
+ <text x="48" y="38" font-family="-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif" font-size="11" font-weight="500" fill="#64748b">
98
+ Deterministic AST Context Compressor &amp; Reality-Lock Engine
99
+ </text>
100
+ </g>
101
+
102
+ <!-- Top Right: Verified Badges -->
103
+ <g transform="translate(560, 26)">
104
+ <rect x="0" y="0" width="105" height="26" rx="13" fill="#1e293b" stroke="#10b981" stroke-width="1.2"/>
105
+ <circle cx="14" cy="13" r="4" fill="#10b981"/>
106
+ <text x="24" y="17" font-family="-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif" font-size="10" font-weight="700" fill="#34d399">ZERO-LEAK</text>
107
+
108
+ <rect x="114" y="0" width="94" height="26" rx="13" fill="#1e293b" stroke="#38bdf8" stroke-width="1.2"/>
109
+ <text x="161" y="17" font-family="-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif" font-size="10" font-weight="700" fill="#38bdf8" text-anchor="middle">REALITY-LOCK</text>
110
+ </g>
111
+
112
+ <!-- Middle Divider -->
113
+ <line x1="32" y1="80" x2="768" y2="80" stroke="#1e293b" stroke-width="1.5"/>
114
+
115
+ <!-- Key Metrics Grid -->
116
+ <g transform="translate(32, 102)">
117
+ <!-- Metric 1: Token Reduction -->
118
+ <g transform="translate(0, 0)">
119
+ <rect x="0" y="0" width="170" height="90" rx="10" fill="#0f172a" stroke="#1e293b" stroke-width="1"/>
120
+ <text x="16" y="26" font-family="-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif" font-size="11" font-weight="600" fill="#94a3b8">TOKEN REDUCTION</text>
121
+ <text x="16" y="62" font-family="-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif" font-size="32" font-weight="900" fill="#38bdf8">-{savings_str}</text>
122
+ <text x="16" y="78" font-family="-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif" font-size="10" font-weight="500" fill="#64748b">Pruned AST Signatures</text>
123
+ </g>
124
+
125
+ <!-- Metric 2: Raw vs Pruned -->
126
+ <g transform="translate(186, 0)">
127
+ <rect x="0" y="0" width="170" height="90" rx="10" fill="#0f172a" stroke="#1e293b" stroke-width="1"/>
128
+ <text x="16" y="26" font-family="-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif" font-size="11" font-weight="600" fill="#94a3b8">CONTEXT INGESTION</text>
129
+ <text x="16" y="58" font-family="-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif" font-size="22" font-weight="800" fill="#f8fafc">{k_pruned} <tspan font-size="14" fill="#64748b">/ {k_raw}</tspan></text>
130
+ <text x="16" y="78" font-family="-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif" font-size="10" font-weight="500" fill="#10b981">Optimal KV Cache Fit</text>
131
+ </g>
132
+
133
+ <!-- Metric 3: Annual ROI -->
134
+ <g transform="translate(372, 0)">
135
+ <rect x="0" y="0" width="170" height="90" rx="10" fill="#0f172a" stroke="#1e293b" stroke-width="1"/>
136
+ <text x="16" y="26" font-family="-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif" font-size="11" font-weight="600" fill="#94a3b8">ESTIMATED TEAM ROI</text>
137
+ <text x="16" y="58" font-family="-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif" font-size="24" font-weight="800" fill="#34d399">{usd_str}</text>
138
+ <text x="16" y="78" font-family="-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif" font-size="10" font-weight="500" fill="#64748b">At 50 queries/day/dev</text>
139
+ </g>
140
+
141
+ <!-- Metric 4: Star CTA -->
142
+ <g transform="translate(558, 0)">
143
+ <rect x="0" y="0" width="178" height="90" rx="10" fill="#1e1b4b" stroke="#6366f1" stroke-width="1"/>
144
+ <text x="16" y="26" font-family="-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif" font-size="11" font-weight="700" fill="#a5b4fc">ROAD TO 100 STARS</text>
145
+ <text x="16" y="54" font-family="-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif" font-size="18" font-weight="900" fill="#ffffff">⭐ STAR ON GITHUB</text>
146
+ <text x="16" y="76" font-family="-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif" font-size="10" font-weight="600" fill="#38bdf8">16 / 100 Milestone</text>
147
+ </g>
148
+ </g>
149
+
150
+ <!-- Bottom Footer Strip -->
151
+ <g transform="translate(32, 212)">
152
+ <text x="0" y="8" font-family="-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif" font-size="10" font-weight="500" fill="#475569">
153
+ 🚀 Run <tspan fill="#38bdf8" font-family="monospace">npx -y tzero-mcp@latest</tspan> or <tspan fill="#38bdf8" font-family="monospace">pip install tzero-mcp</tspan> &bull; By Toprak Ahmet Aydoğmuş (15 y/o dev) &bull; MIT
154
+ </text>
155
+ <text x="736" y="8" font-family="-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif" font-size="10" font-weight="600" fill="#64748b" text-anchor="end">
156
+ Siber Akademi Engine v5.1.0
157
+ </text>
158
+ </g>
159
+ </svg>"""
160
+
161
+ with open(output_file, "w", encoding="utf-8") as f:
162
+ f.write(svg)
163
+
164
+ return output_file
165
+
166
+ @classmethod
167
+ def generate_readme_markdown_badges(cls, savings_pct: float = 94.6) -> str:
168
+ """Returns ready-to-paste markdown badge block for GitHub READMEs."""
169
+ return f"""<!-- 🚀 T-ZERO VIRAL GITHUB BADGES -->
170
+ <p align="center">
171
+ <a href="https://github.com/toprakahmetaydogmus/TZeroAlgorithm">
172
+ <img src="https://img.shields.io/badge/T--Zero-Context%20Compressed%20(-{savings_pct:.1f}%25)-38bdf8?style=for-the-badge&logo=probot&logoColor=white" alt="T-Zero Token Reduced" />
173
+ </a>
174
+ <a href="https://github.com/toprakahmetaydogmus/TZeroAlgorithm">
175
+ <img src="https://img.shields.io/badge/Security-100%25%20Zero--Leak%20Certified-10b981?style=for-the-badge&logo=shield&logoColor=white" alt="100% Zero-Leak Certified" />
176
+ </a>
177
+ <a href="https://github.com/toprakahmetaydogmus/TZeroAlgorithm">
178
+ <img src="https://img.shields.io/badge/Reality--Lock-Immutable%20AST%20Contract-8b5cf6?style=for-the-badge&logo=checkmarx&logoColor=white" alt="Reality-Lock Active" />
179
+ </a>
180
+ <a href="https://github.com/toprakahmetaydogmus/TZeroAlgorithm">
181
+ <img src="https://img.shields.io/badge/%E2%AD%90%20Star%20T--Zero-on%20GitHub-f59e0b?style=for-the-badge&logo=github&logoColor=white" alt="Star T-Zero" />
182
+ </a>
183
+ </p>
184
+ """
185
+
186
+ @classmethod
187
+ def generate_interactive_showcase_html(
188
+ cls,
189
+ output_file: str = "tzero_showcase.html",
190
+ raw_code_sample: Optional[str] = None,
191
+ pruned_code_sample: Optional[str] = None
192
+ ) -> str:
193
+ """Generates an interactive standalone split-screen HTML5 comparison slider."""
194
+ raw_code = raw_code_sample or '''class EnterpriseAuthService:
195
+ """Handles enterprise multi-tenant user authentication, session revocation,
196
+ OAuth2 token rotation, rate-limiting, audit logging, and role-based permissions.
197
+ """
198
+ def __init__(self, db_pool, redis_client, secret_key: str, token_expiry_seconds: int = 3600):
199
+ self.db = db_pool
200
+ self.redis = redis_client
201
+ self.secret_key = secret_key
202
+ self.token_expiry = token_expiry_seconds
203
+ self._setup_internal_metrics()
204
+
205
+ def authenticate_user(self, email: str, password_hash: str, mfa_code: Optional[str] = None) -> UserSession:
206
+ # Step 1: Validate database connection
207
+ conn = self.db.acquire()
208
+ # Step 2: Query tenant record
209
+ user = conn.query("SELECT * FROM users WHERE email = %s", email)
210
+ if not user or not self._verify_bcrypt(password_hash, user.hash):
211
+ raise InvalidCredentialsError("Invalid email or password")
212
+ # Step 3: Check MFA tokens if required
213
+ if user.mfa_enabled and not self._verify_totp(user.mfa_secret, mfa_code):
214
+ raise MFAValidationError("Invalid MFA token")
215
+ # Step 4: Issue signed JWT and write Redis session
216
+ session_token = self._issue_jwt(user.id, user.tenant_id)
217
+ self.redis.setex(f"session:{session_token}", self.token_expiry, user.id)
218
+ return UserSession(user_id=user.id, token=session_token, expires_in=self.token_expiry)'''
219
+
220
+ pruned_code = pruned_code_sample or '''class EnterpriseAuthService:
221
+ def __init__(self, db_pool, redis_client, secret_key: str, token_expiry_seconds: int = 3600): ...
222
+ def authenticate_user(self, email: str, password_hash: str, mfa_code: Optional[str] = None) -> UserSession: ...'''
223
+
224
+ escaped_raw = html.escape(raw_code)
225
+ escaped_pruned = html.escape(pruned_code)
226
+
227
+ html_content = f"""<!DOCTYPE html>
228
+ <html lang="en">
229
+ <head>
230
+ <meta charset="UTF-8">
231
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
232
+ <title>T-Zero: Interactive Context Comparison Showcase</title>
233
+ <style>
234
+ :root {{
235
+ --bg-dark: #090d16;
236
+ --surface: #0f172a;
237
+ --border: #1e293b;
238
+ --accent-cyan: #38bdf8;
239
+ --accent-purple: #818cf8;
240
+ --accent-green: #34d399;
241
+ --text-main: #f8fafc;
242
+ --text-muted: #94a3b8;
243
+ }}
244
+ * {{ box-sizing: border-box; margin: 0; padding: 0; }}
245
+ body {{
246
+ background: var(--bg-dark);
247
+ color: var(--text-main);
248
+ font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
249
+ padding: 30px 20px;
250
+ display: flex;
251
+ flex-direction: column;
252
+ align-items: center;
253
+ }}
254
+ .header {{
255
+ text-align: center;
256
+ max-width: 800px;
257
+ margin-bottom: 24px;
258
+ }}
259
+ .badge {{
260
+ display: inline-block;
261
+ background: rgba(56, 189, 248, 0.1);
262
+ color: var(--accent-cyan);
263
+ border: 1px solid var(--accent-cyan);
264
+ padding: 4px 14px;
265
+ border-radius: 999px;
266
+ font-size: 12px;
267
+ font-weight: 700;
268
+ margin-bottom: 12px;
269
+ }}
270
+ h1 {{
271
+ font-size: 32px;
272
+ font-weight: 900;
273
+ margin-bottom: 8px;
274
+ background: linear-gradient(135deg, #38bdf8, #818cf8, #c084fc);
275
+ -webkit-background-clip: text;
276
+ -webkit-text-fill-color: transparent;
277
+ }}
278
+ p.sub {{ color: var(--text-muted); font-size: 15px; line-height: 1.5; }}
279
+
280
+ .kpi-row {{
281
+ display: grid;
282
+ grid-template-columns: repeat(4, 1fr);
283
+ gap: 16px;
284
+ max-width: 1000px;
285
+ width: 100%;
286
+ margin-bottom: 24px;
287
+ }}
288
+ .kpi-card {{
289
+ background: var(--surface);
290
+ border: 1px solid var(--border);
291
+ border-radius: 12px;
292
+ padding: 16px;
293
+ text-align: center;
294
+ }}
295
+ .kpi-val {{ font-size: 26px; font-weight: 900; color: var(--accent-cyan); }}
296
+ .kpi-label {{ font-size: 11px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; margin-top: 4px; }}
297
+
298
+ .showcase-grid {{
299
+ display: grid;
300
+ grid-template-columns: 1fr 1fr;
301
+ gap: 20px;
302
+ max-width: 1000px;
303
+ width: 100%;
304
+ margin-bottom: 30px;
305
+ }}
306
+ .panel {{
307
+ background: var(--surface);
308
+ border: 1px solid var(--border);
309
+ border-radius: 12px;
310
+ overflow: hidden;
311
+ display: flex;
312
+ flex-direction: column;
313
+ }}
314
+ .panel-header {{
315
+ background: rgba(255, 255, 255, 0.03);
316
+ border-bottom: 1px solid var(--border);
317
+ padding: 12px 18px;
318
+ display: flex;
319
+ justify-content: space-between;
320
+ align-items: center;
321
+ }}
322
+ .panel-title {{ font-size: 13px; font-weight: 700; }}
323
+ .panel-tag {{ font-size: 11px; padding: 2px 8px; border-radius: 6px; font-weight: 700; }}
324
+ .tag-red {{ background: rgba(239, 68, 68, 0.15); color: #f87171; border: 1px solid #ef4444; }}
325
+ .tag-green {{ background: rgba(16, 185, 129, 0.15); color: #34d399; border: 1px solid #10b981; }}
326
+
327
+ pre {{
328
+ padding: 16px;
329
+ font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
330
+ font-size: 12px;
331
+ line-height: 1.6;
332
+ color: #e2e8f0;
333
+ overflow-x: auto;
334
+ flex: 1;
335
+ }}
336
+ .cta-btn {{
337
+ background: linear-gradient(135deg, #38bdf8, #6366f1);
338
+ color: #ffffff;
339
+ font-weight: 800;
340
+ font-size: 16px;
341
+ padding: 12px 32px;
342
+ border-radius: 10px;
343
+ text-decoration: none;
344
+ box-shadow: 0 4px 20px rgba(56, 189, 248, 0.3);
345
+ transition: all 0.2s ease;
346
+ }}
347
+ .cta-btn:hover {{
348
+ transform: translateY(-2px);
349
+ box-shadow: 0 6px 26px rgba(56, 189, 248, 0.5);
350
+ }}
351
+ </style>
352
+ </head>
353
+ <body>
354
+ <div class="header">
355
+ <span class="badge">PROVABLY ACCURATE &bull; ZERO HALLUCINATIONS</span>
356
+ <h1>T-Zero Token Optimization Showcase</h1>
357
+ <p class="sub">Side-by-side comparison of raw implementation vs. AST compressed signatures fed to LLMs (Claude, Cursor, Copilot, ChatGPT).</p>
358
+ </div>
359
+
360
+ <div class="kpi-row">
361
+ <div class="kpi-card">
362
+ <div class="kpi-val">-88.0%</div>
363
+ <div class="kpi-label">Token Savings</div>
364
+ </div>
365
+ <div class="kpi-card">
366
+ <div class="kpi-val">10x</div>
367
+ <div class="kpi-label">Faster Prompt Ingestion</div>
368
+ </div>
369
+ <div class="kpi-card">
370
+ <div class="kpi-val">0</div>
371
+ <div class="kpi-label">Hallucinations</div>
372
+ </div>
373
+ <div class="kpi-card">
374
+ <div class="kpi-val" style="color:var(--accent-green);">$0.00</div>
375
+ <div class="kpi-label">Cost (100% Offline)</div>
376
+ </div>
377
+ </div>
378
+
379
+ <div class="showcase-grid">
380
+ <div class="panel">
381
+ <div class="panel-header">
382
+ <span class="panel-title">❌ Raw Bloated Source (Old Way)</span>
383
+ <span class="panel-tag tag-red">~295 Tokens / File</span>
384
+ </div>
385
+ <pre><code>{escaped_raw}</code></pre>
386
+ </div>
387
+
388
+ <div class="panel">
389
+ <div class="panel-header">
390
+ <span class="panel-title">⚡ T-Zero Compressed AST (New Way)</span>
391
+ <span class="panel-tag tag-green">~36 Tokens (-87.8%)</span>
392
+ </div>
393
+ <pre><code>{escaped_pruned}</code></pre>
394
+ </div>
395
+ </div>
396
+
397
+ <div style="margin-top: 32px; padding: 26px 32px; background: rgba(56, 189, 248, 0.08); border: 1px solid rgba(56, 189, 248, 0.35); border-radius: 16px; max-width: 900px; width: 100%; text-align: center; box-shadow: 0 8px 32px rgba(0,0,0,0.45);">
398
+ <div style="display: inline-flex; align-items: center; gap: 8px; background: rgba(245, 158, 11, 0.15); border: 1px solid #f59e0b; padding: 4px 16px; border-radius: 20px; color: #fbbf24; font-size: 13px; font-weight: 700; margin-bottom: 12px;">
399
+ ⭐ ROAD TO 100 STARS MILESTONE (16 / 100)
400
+ </div>
401
+ <p style="font-size: 19px; font-weight: 800; color: #f8fafc; margin-bottom: 8px;">
402
+ Support Open-Source Local AI Tooling &bull; Yıldız Vererek Destekleyin!
403
+ </p>
404
+ <p style="font-size: 14px; line-height: 1.6; color: #cbd5e1; margin-bottom: 16px;">
405
+ 15-year-old solo open-source developer (<strong>Toprak Ahmet Aydoğmuş</strong>, Siber Akademi).<br>
406
+ Built 100% free, offline, and zero-leak to eliminate AI prompt token bloat across Cursor, Claude, and local LLMs.<br>
407
+ <em>15 yaşında bağımsız açık kaynak geliştiricisiyim. Projeyi ücretsiz ve çevrimdışı tutabilmem için bir yıldızınız çok değerli.</em>
408
+ </p>
409
+ <div style="display: flex; gap: 12px; justify-content: center; flex-wrap: wrap;">
410
+ <a href="https://github.com/toprakahmetaydogmus/TZeroAlgorithm" class="cta-btn" target="_blank">
411
+ ⭐ Star T-Zero on GitHub (1-Click)
412
+ </a>
413
+ <button onclick="navigator.clipboard.writeText('npx -y tzero-mcp@latest'); alert('Copied npx command to clipboard!');" class="cta-btn" style="background: rgba(15, 23, 42, 0.8); border: 1px solid #38bdf8; cursor: pointer;">
414
+ 📋 Copy: npx -y tzero-mcp@latest
415
+ </button>
416
+ </div>
417
+ </div>
418
+ </body>
419
+ </html>"""
420
+
421
+ with open(output_file, "w", encoding="utf-8") as f:
422
+ f.write(html_content)
423
+
424
+ return output_file
425
+
426
+
427
+ if __name__ == "__main__":
428
+ svg = TZeroShowcaseGenerator.generate_svg_banner_card()
429
+ html_out = TZeroShowcaseGenerator.generate_interactive_showcase_html()
430
+ print(f"Generated {svg} and {html_out}")
431
+
@@ -59,11 +59,11 @@ jobs:
59
59
 
60
60
  - name: Zero-Leak Security & Code Quality Audit
61
61
  run: |
62
- python tzero_v3.py --audit . --format text
62
+ tzero --audit . --format text
63
63
 
64
64
  - name: Enforce T-4 Architectural Boundary Rules
65
65
  run: |
66
- python tzero_v3.py --enforce-boundaries tzero.rules.json
66
+ tzero --enforce-boundaries tzero.rules.json
67
67
 
68
68
  - name: Run Comprehensive Test Suite
69
69
  run: |
@@ -72,7 +72,7 @@ jobs:
72
72
  - name: PR Incremental Token Savings Telemetry
73
73
  if: github.event_name == 'pull_request'
74
74
  run: |
75
- python tzero_v3.py --diff HEAD~1
75
+ tzero --diff HEAD~1
76
76
  """
77
77
 
78
78
  GITLAB_CI_TEMPLATE = """stages:
@@ -92,8 +92,8 @@ tzero_audit:
92
92
  script:
93
93
  - pip install --upgrade pip
94
94
  - pip install fastmcp keyring requests
95
- - python tzero_v3.py --audit . --format text
96
- - python tzero_v3.py --enforce-boundaries tzero.rules.json
95
+ - tzero --audit . --format text
96
+ - tzero --enforce-boundaries tzero.rules.json
97
97
 
98
98
  tzero_tests:
99
99
  stage: test
@@ -109,14 +109,14 @@ PRE_COMMIT_CONFIG_TEMPLATE = """repos:
109
109
  hooks:
110
110
  - id: tzero-zero-leak
111
111
  name: T-Zero 100% Zero-Leak Security Scanner
112
- entry: python tzero_v3.py --audit .
112
+ entry: tzero --audit .
113
113
  language: system
114
114
  pass_filenames: false
115
115
  always_run: true
116
116
 
117
117
  - id: tzero-architectural-boundaries
118
118
  name: T-Zero Architectural Boundaries Enforcer
119
- entry: python tzero_v3.py --enforce-boundaries
119
+ entry: tzero --enforce-boundaries
120
120
  language: system
121
121
  pass_filenames: false
122
122
  always_run: true
@@ -23,7 +23,7 @@ import subprocess
23
23
  from dataclasses import dataclass, field
24
24
  from typing import Dict, List, Optional, Tuple, Any
25
25
 
26
- from tzero_patch import ASTFuzzyPatcher
26
+ from tzero.tzero_patch import ASTFuzzyPatcher
27
27
 
28
28
 
29
29
  @dataclass