Skip to content
Toprak Ahmet Aydoğmuş edited this page Nov 30, 2026 · 8 revisions

T-Zero Algorithm Wiki

Documentation is not a feature switch: Sidebar entries are reference pages, not enabled capabilities. A feature may require a compatible release, optional dependency, client configuration, credentials, or a separately hosted service. Verify availability in the linked source and current setup before assuming it is active.

T-Zero Algorithm — source-linked engineering handbook

A practical engineering handbook for T-Zero Algorithm Start with the quickstart, find the interface you need, then follow links to implementation details and source documents.

Project stack

Python 3.11+ MCP stdio Rust core AGPL-3.0-only

Choose your path

01 Start
New to the project?
Install T-Zero Algorithm and connect your editor to the local MCP server.
02 Build
Building an integration?
Check the source-backed MCP signatures and keep the hosted HTTP API separate.
03 Understand
Exploring the implementation?
Trace Python, Rust, extension, packaging, and test references back to source.
04 Trust
Reviewing data boundaries?
Read the privacy, network, safety, and evidence notes before sending code remotely.

API Reference · GitHub Repository · Releases · Issues · Security Reporting


What is T-Zero Algorithm?

T-Zero Algorithm is an open-source developer toolset for preparing code context for AI coding assistants. The repository combines a Python package and CLI, an MCP server, AST and source-analysis utilities, editor integrations, Rust crates, a hosted Gradio demonstration, and project automation.

The central workflow is to inspect code structure and produce a smaller, task-relevant representation instead of blindly sending whole files. The repository documents AST-based handling for Python and heuristic or schema-oriented extraction for several other languages. Results depend on the language, parser path, project shape, selected tool, and task.

Project facts from tracked metadata

Item Repository value
Package tzero-mcp
Version in pyproject.toml and server.json 12.3.4
Python requirement >=3.11
MCP transport in registry manifest stdio
License identifier AGPL-3.0-only
Main public API documentation tzero-docs.octri.dev

These are source metadata values. The package installed on a machine or the hosted demo may be on a different revision.

Choose your starting point

Your goal Start here
Install and configure an editor Start-Here
Understand the components and boundaries Repository-Map · Architecture
Follow actual source execution paths Codebase-Internals
Browse Python classes, functions, and docstrings Python-Core-Symbol-Reference
Inspect the actual MCP handler signatures MCP-Tool-Reference
Browse Rust declarations and docs Rust-Source-Reference
Find tests by source declaration Tests-Source-Reference
Understand extension and package boundaries Extension-and-Packaging-Internals
Review safe scope of Anti-REA features Anti-REA-Safe-Overview
Connect an MCP client MCP-and-OpenAPI
Read the API routes for the hosted demo Octri API Reference
Review privacy and network behavior Privacy-and-Network-Behavior
Check security-reporting guidance Security-Reporting
Explore benchmarks and their limitations Local-Benchmark-Report · Evidence-Boundaries
Work on the repository Contributing-Guidelines · Developer-Walkthrough
Find a specific source document or agent skill Source-Index

Interfaces: which one should I use?

Interface How it runs Useful for Important boundary
Local MCP server MCP over stdio Giving an AI editor access to T-Zero Algorithm tools The editor starts the configured local process. The editor may send returned tool output to its configured model provider.
CLI Local command-line process Setup, context tasks, scans, reports, and scripts File or system changes depend on the exact command and options. Read help and use preview modes where available.
VS Code extension Commands and views inside VS Code Editor workflows, status information, and direct commands Extension behavior and available commands can differ by published version.
Hosted Gradio Space Public web app with an HTTP API Trying selected features without a local install Submitted source code is sent to the hosted service. Do not send private code or credentials.
Octri documentation Hosted API reference site Browsing the OpenAPI contract It documents the hosted Gradio API, not the local stdio MCP server.

Do not treat the hosted HTTP API and local MCP server as the same service. See MCP-and-OpenAPI for the distinction and request flow.

A simple first run

Install the Python package

pip install --upgrade tzero-mcp

Configure an MCP client

The repository documents an auto-detection command:

tzero init

It also documents explicit client selectors:

tzero init --cursor
tzero init --claude
tzero init --antigravity
tzero init --windsurf
tzero init --cline
tzero init --vscode
tzero init --zed

Check tzero init --help on your installed version before using a selector.

Verify the installation

tzero-mcp --version
tzero-mcp --help

Restart or reload the editor after changing its MCP configuration. Confirm that T-Zero Algorithm appears in the editor's MCP/tool panel and inspect the editor's server logs if it does not.

Generic MCP configuration

Use the launcher installed on your machine. The Python module example is:

{
  "mcpServers": {
    "tzero": {
      "command": "python",
      "args": ["-m", "tzero_mcp"]
    }
  }
}

The uvx example is:

{
  "mcpServers": {
    "tzero": {
      "command": "uvx",
      "args": ["tzero-mcp"]
    }
  }
}

Do not add both alternatives under the same server name. Pick one launch method and adapt the JSON location to the client you use.

How the main workflow fits together

flowchart TD
    User["Developer"] --> Client["Editor, script, or CLI"]
    Client -->|MCP stdio|     Server["Local T-Zero Algorithm MCP server"]
    Client -->|command| CLI["Local T-Zero CLI"]
    Server --> Tools["Tool catalog"]
    CLI --> Tools
    Tools --> Analysis["AST, context, search, policy, and workflow services"]
    Analysis --> Result["Context, findings, or generated report"]
    Result --> Client
    Public["Hosted Gradio Space"] --> HTTP["Separate public HTTP API"]
Loading

At a high level:

  1. A developer invokes a command or an MCP tool.
  2. The selected operation reads the inputs it needs.
  3. Analysis tools inspect syntax, symbols, dependencies, text, or configured rules.
  4. T-Zero returns a context representation, result, or diagnostic.
  5. The calling client decides how to present or use the result.

This diagram is an orientation aid, not a promise that every command traverses the same modules.

MCP tools: source-verified registration groups

The current Python implementation registers two mutually exclusive decorator groups. The default mode is canonical; setting TZERO_MCP_TOOL_MODE to all, legacy, or 47 selects the alternate group. An AST scan of tzero/tzero_mcp.py finds 14 canonical registrations and 51 alternate registrations, with four names shared between those groups. A nearby source comment still says 47 for the alternate group, and the README advertises a different count. This is a source/documentation discrepancy, not a promise that every installed server exposes all names.

Canonical tool Handler purpose at a glance
build_project_context Build project context.
prune_code_snippet Prune a supplied code snippet.
manage_architecture_rules Read or manage architecture rules.
enforce_architecture_rules Check configured architecture boundaries.
generate_architecture_blueprint Generate an architecture blueprint.
analyze_code_dependencies Inspect dependency relationships.
analyze_change_impact Analyze impact for a requested change.
search_codebase Search the codebase.
audit_code_quality Run code-quality analysis.
verify_security_guard Run the security-guard check.
estimate_token_cost Estimate token-related cost.
query_memory_store Query stored memory.
manage_memory_store Manage memory entries.
orchestrate_agent_swarm Route a goal through the agent orchestration path.

This short list is not the complete API contract. Read MCP-Tool-Reference for all 65 source registrations, signatures, handler names, and source links. For a live client, the server's tools/list result is authoritative.

Language-analysis overview

The repository README distinguishes parser techniques rather than claiming that every language has identical AST fidelity:

Language family documented Technique described Practical note
Python Native Python ast module The README describes preservation of imports, classes, methods, signatures, decorators, and docstrings while pruning function bodies.
TypeScript / JavaScript Heuristic grammar and regular expressions Treat extraction as heuristic; verify edge cases in the current implementation and tests.
Go Heuristic grammar and regular expressions Treat extraction as heuristic; confirm the target construct is recognized.
Rust Heuristic grammar and regular expressions Treat extraction as heuristic; confirm visibility and signature handling.
SQL, Prisma, GraphQL Declarative schema reducer Schema-oriented extraction is different from general-purpose language parsing.

For exact supported constructs and limitations, consult Project-Overview, Codebase-Internals, the symbol references, and tests for the language being used.

The hosted API and its limits

The OpenAPI document in the repository describes named routes exposed by the public Gradio Space. Its request flow is asynchronous:

  1. POST /gradio_api/call/{api_name} with an ordered data array.
  2. Read the returned event_id.
  3. GET /gradio_api/call/{api_name}/{event_id} to read the Server-Sent Events stream.

The curated spec lists:

  • process_code_compression
  • run_hallucination_guard_controller
  • run_impact_analysis_controller
  • run_auto_vault_controller
  • run_code_healer_controller
  • calculate_roi_controller
  • generate_mcp_config_controller
  • _run_anti_rea_audit_controller

The hosted Space can change independently of the repository. Check the live API reference and version note before integrating it. Never send secrets or confidential source code to a public demo.

Privacy and security in plain language

Activity What to keep in mind
Local AST analysis and lexical search The repository privacy document says these process workspace data on the machine running T-Zero.
MCP tool output Returned source excerpts, paths, or findings go to the connected client. The client/model provider's settings determine subsequent processing.
Optional AI-assisted generation Prompts, paths, relationships, and excerpts may be sent to the provider explicitly selected by the user. Review provider and client policies.
Hosted Gradio API Submitted code leaves the local machine and reaches the public Space. Do not send confidential code, tokens, or real credentials.
Package installation and metrics Package managers, public registry lookups, tokenizer downloads, and optional project metrics can use the network.
Repair and setup commands Some commands may modify files, configuration, PATH, or system state. Read command help and review effects before execution.

The repository contains secret-scanning and other security-related features, but no project page, test result, or tool can guarantee that software is "100% secure." Choose a workflow that matches your threat model and review Privacy-and-Network-Behavior.

Benchmarks: read the conditions

Benchmark results depend on the repository, language, selection strategy, tokenizer, model, hardware, runtime version, and baseline. A percentage reported for one workload is not a universal guarantee.

Before using a benchmark to make a product or cost decision:

  1. Open the linked report.
  2. Record the revision, environment, input set, and command.
  3. Re-run it on representative data.
  4. Compare the same baseline and tokenizer.
  5. Separate measured results from projections and marketing language.

Start with Local-Benchmark-Report, Hallucination-Guard-Report, and Evidence-Boundaries.

Development and verification

The repository includes Python tests, Rust workspace crates, CI workflows, package publishing workflows, and security workflows.

python -m pytest
cargo test
cargo clippy

The exact commands and gates are defined by the current CI workflows and repository instructions. A local command passing does not prove that every OS-specific, packaging, or hosted deployment path works.

For contribution requirements, use Contributing-Guidelines. For the current source layout, use Repository-Map.

Wiki navigation

User and integration guides

Architecture and engineering

Security and evidence

History and reference library

Frequently asked questions

Is the local MCP server an HTTP API?

The registry manifest in the repository declares stdio transport. The OpenAPI file is a separate description of the hosted Gradio application.

Does “local-first” mean that no data can ever leave my machine?

No. Local analysis is one path, but client/model settings, explicitly selected remote providers, public hosted demos, package downloads, metrics, and optional search can involve network requests. Read Privacy-and-Network-Behavior.

Does a listed tool or feature exist in every release?

Not necessarily. Check the installed version, current tool catalog, package metadata, release notes, and tests for that version.

Does the roadmap confirm a feature shipped?

No. Roadmap documents include planned work. Use release notes, source code, and tests to confirm shipped behavior.

Are published token-savings figures guaranteed?

No. Results depend on workload and measurement method. Reproduce the benchmark using your own inputs.

Where do I report a vulnerability?

Follow the repository's Security Reporting policy. Do not post exploit details publicly before coordinating with the maintainers.

Sources and maintenance

This Wiki is organized around the repository's tracked documentation and metadata. Source-linked pages point back to the repository so readers can compare this snapshot with the latest revision.

  • Source-Index lists the imported Markdown documents and their source paths.
  • Changelog and the version-specific release pages are historical records.
  • server.json, pyproject.toml, openapi.yaml, source modules, and tests are the best references for machine-readable contracts and implementation details.
  • The hosted OpenAPI spec and the source package may describe different deployment versions.

License: T-Zero Algorithm declares AGPL-3.0-only; see the repository's LICENSE and NOTICE.

Clone this wiki locally