Repository navigation
Whitepaper
Repository source:
docs/WHITE_PAPER_TZERO_V10.md
Snapshot of the source document; follow the repository link for the current version.
Status and evidence: This is a historical, project-authored technical note, not an independently validated specification or security certification. Benchmark figures, performance guarantees, deployment availability, and claims about zero leakage or zero hallucinations may not match the current implementation. Confirm behavior against the linked source, tests, and Evidence-Boundaries.
License note: Current repository metadata declares
AGPL-3.0-only; the original MIT statement in this whitepaper conflicts with that metadata. See the repository's LICENSE and pyproject.toml. This archived page is not a license grant.
Author: Toprak Ahmet Aydoğmuş (Siber Akademi)
Affiliation: Siber Akademi Open-Source AI Research Lab
Contact: GitHub repository and Security Reporting
License: See the note above and the repository's current LICENSE; pricing and third-party service costs depend on the selected workflow.
Frontier Large Language Models (LLMs)—including Anthropic Claude 3.7 Sonnet, OpenAI GPT-4o, Google Gemini 2.5 Pro, and DeepSeek-V3—possess theoretical context windows spanning from 128,000 to 2,000,000 tokens. However, in enterprise software engineering practice, expanding prompt context with raw source code triggers three catastrophic failure modes:
-
Quadratic Cost Inflation (
$O(N)$ Financial Drain): Injecting an entire repository of 50,000–100,000 lines of code consumes between 500,000 and 1,200,000 tokens per prompt invocation. For a 10-developer team executing 30 AI agent queries per day, raw context injection costs between $9,000 and $18,000 per month in cloud inference fees. - Attention Degradation ("Lost-in-the-Middle"): Empirical transformer research demonstrates that effective multi-needle recall degrades precipitously when procedural implementation bodies (loops, SQL queries, DOM mutations, verbose logging) dilute the attention weights allocated to critical class and interface contracts.
- The Hallucination Cascade: When an AI coding agent lacks a deterministic symbolic representation of surrounding module interfaces, it speculatively predicts method names, argument positions, and import paths based on general pre-training probability distributions rather than the physical reality of the workspace AST.
T-Zero (Token Zero) is designed to address this limitation through AST-based context extraction:
- Instead of naive file concatenation (e.g., Repomix) or lossy heuristic text chunking (standard RAG), T-Zero extracts formal interface contracts across 15+ programming languages.
- Compresses code context by up to 95.0% in less than 1.0 millisecond on local CPU hardware.
- Includes static symbol checks intended to catch some unsupported references; these checks do not prove that hallucinations or runtime errors are impossible.
- Offers local analysis paths, but this does not guarantee that data never leaves the machine. Optional integrations and connected clients may make network requests; see Privacy-and-Network-Behavior.
flowchart LR
subgraph Raw ["1. Raw Codebase"]
F1["Raw Python/TS/Rust Files"]
F2["Implementation Boilerplate"]
F3["Hardcoded API Keys / Secrets"]
end
subgraph TZero ["2. T-Zero Autonomous Engine"]
AST["Deterministic AST Parser"]
ENT["Adaptive Entropy Classifier"]
ZL["Zero-Leak Entropy Scanner"]
RL["Reality-Lock Contract Verifier"]
end
subgraph Pruned ["3. Compressed Topological Context"]
S1["Clean AST Interface Signatures"]
S2["Dataclass / Pydantic Schemas"]
S3["Workspace symbol graph (scope-limited)"]
end
subgraph LLM ["4. Frontier Coding Agents"]
Agent["Cursor / Claude / Copilot / Windsurf"]
end
Raw --> TZero
TZero --> Pruned
Pruned --> LLM
LLM -.->|"Context reduction varies; no zero-hallucination guarantee"| Agent
Let a software codebase
Each source file
The node set
-
Interface Contract Nodes (
$\mathcal{K}_i$ ):$$\mathcal{K}_i = {v \in V_i \mid \text{type}(v) \in {\text{ClassDef}, \text{FunctionDef}, \text{AsyncFunctionDef}, \text{AnnAssign}, \text{Import}, \text{ImportFrom}}}$$ -
Procedural Implementation Nodes (
$\mathcal{P}_i$ ):$$\mathcal{P}_i = V_i \setminus \mathcal{K}_i = {v \in V_i \mid \text{type}(v) \in {\text{While}, \text{For}, \text{If}, \text{Try}, \text{Assign}, \text{Expr}, \dots}}$$
The T-Zero Compression Operator
For any non-trivial module
Because
Let
-
$\mathcal{S}$ is the set of all declared classes, functions, methods, and constants across all$f \in \mathcal{C}$ . -
$\mathcal{D}$ is the set of directed dependency edges representing import topologies and cross-module calls.
When an AI agent proposes a code patch
Scope: This describes an intended static name-existence check, not a guarantee. A passing result cannot prove runtime imports, API compatibility, test outcomes, or eliminate all hallucinated references.
The rules below describe the source document's proposed detection approach. They are not a guarantee that every credential will be detected or redacted, and the behavior of any automation must be verified in the current code before use.
To prevent secret leakage without reliance on cloud DLP APIs, T-Zero combines deterministic regex signatures
where
A candidate substring
When detected, the T-Zero Auto-Vault automatically executes surgical AST replacement:
- Generates an encrypted key identifier in
.env. - Replaces the plaintext string with
os.environ.get("..."). - Encrypts the raw secret into OS Keyring using PBKDF2 HMAC-SHA256.
The T-Zero Polyglot Bridge @dataclass and Pydantic AST representations into strongly typed native schemas across five programming language targets:
Evaluated on TZeroAlgorithm codebase using exact tiktoken BPE tokenizer (cl100k_base):
- Raw Baseline Context: 987,796 tokens (exceeds standard 128k/200k context windows)
- T-Zero Tier-2 Smart AST Context: 54,328 tokens
- Net Token Volume Reduction: -933,468 tokens (-94.5%)
-
Time to First Token (TTFT) Speedup: 28.3x faster (7,218 ms
$\to$ 255.2 ms) - AI Coding Hallucination Rate: 0.0% (vs 18.4% baseline without AST interface grounding)
Calculated at 30 queries per developer per day across 22 working days per month (6,600 queries/month):
flowchart TD
P1["Pillar 1: Deterministic AST Skeletons<br/><i>90-95% Token Reduction</i>"]
P2["Pillar 2: Reality-Lock Guard<br/><i>0% AI Hallucination</i>"]
P3["Pillar 3: Zero-Leak Shannon Security<br/><i>100% Offline Key Auto-Vault</i>"]
P4["Pillar 4: Blast Radius & Dependency Tree<br/><i>PageRank 0-100 Risk Engine</i>"]
P5["Pillar 5: Polyglot Type Transpiler<br/><i>Py ⟷ TS ⟷ Rust ⟷ Go ⟷ KT ⟷ Swift</i>"]
P6["Pillar 6: 48-Tool Enterprise MCP Engine<br/><i>Stdio Protocol for Cursor/Claude</i>"]
P7["Pillar 7: Autonomous PC-Doctor<br/><i>100+ Error Diagnostic Knowledge Base</i>"]
P1 --- P2
P2 --- P3
P3 --- P4
P4 --- P5
P5 --- P6
P6 --- P7
- Pillar 1 — Deterministic Multi-Language AST Skeletonization: Native grammatical parsers across Python, TypeScript, Rust, Go, Java, Kotlin, Swift, C/C++, Solidity, Ruby, PHP, Dart, Scala, and Elixir.
- Pillar 2 — Reality-Lock Static Verification Gate: Compile-time AST topological verification eliminating phantom method invocations and fictional package imports.
- Pillar 3 — Zero-Leak Shannon Entropy Security Guard: Local regex + entropy credential detection and automatic migration into OS-level secure credential storage.
- Pillar 4 — Blast Radius & Centrality Engine: Graph-theoretic PageRank evaluation over module call trees, computing downstream change risk scores prior to code modification.
-
Pillar 5 — Universal Polyglot Type Bridge: Zero-cost offline transpilation from Python
@dataclassand Pydantic models directly into idiomatic TypeScript, Rust, Go, Kotlin, and Swift. - Pillar 6 — 48-Tool Enterprise Model Context Protocol (MCP) Server: High-throughput JSON-RPC 2.0 stdio server seamlessly interfacing Cursor, Claude Desktop, Windsurf, VS Code Copilot, and Cline.
- Pillar 7 — Autonomous PC-Fixer & Codebase Doctor: Encyclopedic knowledge base covering 100+ formal diagnostic error codes with automated self-healing execution routines.
The source document listed the following distribution channels at the time it was written. Availability, package names, download counts, and support status must be checked at the linked release/package pages before relying on them:
-
Microsoft Windows: Official WinGet manifest (
winget install SiberAkademi.TZero) & Scoop bucket (scoop install tzero). -
macOS & Linux: Official Homebrew tap (
brew tap toprakahmetaydogmus/tzero && brew install tzero). -
IDE Extensions: VS Code Marketplace & Open VSX Registry (
siber-akademi.tzero-vscode). - Python Ecosystem: PyPI package availability and current installation instructions should be checked on the package page.
-
CI/CD Integration: Turnkey GitHub Action (
uses: toprakahmetaydogmus/TZeroAlgorithm@main) and pre-commit hook (tzero-guard).
T-Zero establishes a new milestone in context engineering for artificial intelligence: maximum semantic density at minimum token cost with mathematical correctness guarantees. By shifting from brute-force token ingestion to deterministic AST topological synthesis, T-Zero transforms AI-assisted software engineering from an unpredictable, expensive experiment into a cost-effective, deterministic discipline.
Copyright and licensing are governed by the repository's current LICENSE and NOTICE files; this archived text does not override them.