Repository navigation
Python Core Workflow Reference
Coverage: 23 modules | 130 classes | 408 functions | 22599 source lines.
Generated from the canonical Python package in the T-Zero Algorithm source tree.
Scope: Workspace workflows, editor setup, maintenance, reporting, automation, and supporting integration modules. Some commands can write or execute; inspect their source before use.
License note: Copied module-level License: MIT strings are source comments, not authoritative package licensing. The repository's current metadata declares AGPL-3.0-only; see its LICENSE.
- Declarations are extracted from Python AST and linked to source line ranges.
- Signatures show parsed arguments and annotations. Defaults are quoted after personal-identifier, contact, and wallet redaction.
- Docstrings are source text, not independently verified promises; personal identifiers, contact details, and wallet-like values are redacted.
- Missing docstrings are explicitly marked. This catalog does not guess behavior.
- This is a symbol map, not a line-by-line rewrite of every function body; use the linked implementation to inspect control flow and side effects.
Source: tzero/addmcp.py
Source size: 18 lines | 0 classes | 0 functions
Module docstring:
T-Zero MCP Installer Bridge Module.
Exposes addmcp functionality within the tzero package namespace.
Source: tzero/desktop_updater.py
Source size: 169 lines | 0 classes | 9 functions
Module docstring:
Optional startup updater for the standalone Windows desktop executable.
Kind: Function
Source: tzero/desktop_updater.py:24-26
Signature:
def _version(value):Source docstring: none; consult the linked implementation instead of inferring behavior.
Kind: Function
Source: tzero/desktop_updater.py:29-51
Signature:
def _get_release():Source docstring: none; consult the linked implementation instead of inferring behavior.
Kind: Function
Source: tzero/desktop_updater.py:54-77
Signature:
def _download(asset, destination, cancelled):Source docstring: none; consult the linked implementation instead of inferring behavior.
Kind: Function
Source: tzero/desktop_updater.py:80-108
Signature:
def _start_replacement(current, staged, digest):Source docstring: none; consult the linked implementation instead of inferring behavior.
Kind: Nested function
Source: tzero/desktop_updater.py:82-83
Signature:
def encoded(value):Source docstring: none; consult the linked implementation instead of inferring behavior.
Kind: Function
Source: tzero/desktop_updater.py:111-169
Signature:
def check_on_startup():Source docstring:
Return True only when a verified update helper was launched.
Kind: Nested function
Source: tzero/desktop_updater.py:133-135
Signature:
def close():Source docstring: none; consult the linked implementation instead of inferring behavior.
Kind: Nested function
Source: tzero/desktop_updater.py:138-156
Signature:
def worker():Source docstring: none; consult the linked implementation instead of inferring behavior.
Kind: Nested function
Source: tzero/desktop_updater.py:160-166
Signature:
def poll():Source docstring: none; consult the linked implementation instead of inferring behavior.
Source: tzero/siber_akademi_icon.py
Source size: 83 lines | 0 classes | 3 functions
Module docstring:
Embedded Siber Akademi Brand Icon and Logo Assets for 100% Reliable Rendering.
Kind: Function
Source: tzero/siber_akademi_icon.py:16-41
Signature:
def get_icon_file_path() -> str:Source docstring:
Returns a guaranteed valid file path to siber_akademi.ico.
Kind: Function
Source: tzero/siber_akademi_icon.py:43-68
Signature:
def get_logo_photo_image(size: Tuple[int, int] = (36, 36), circle: bool = False):Source docstring:
Returns an ImageTk.PhotoImage of the official Siber Akademi logo at the requested size.
Kind: Function
Source: tzero/siber_akademi_icon.py:70-83
Signature:
def apply_window_icon(root) -> None:Source docstring:
Applies Siber Akademi icon to Tk or Toplevel window for taskbar and titlebar.
Source: tzero/tzero_card.py
Source size: 433 lines | 1 classes | 3 functions
Module docstring:
T-ZERO GITHUB REPOSITORY SHOWCASE CARD & VIRAL BADGE GENERATOR
--------------------------------------------------------------
Developer: [redacted] (Siber Akademi)
Version: 5.1.0 | License: MIT
Generates shareable high-DPI SVG banner cards, animated SVG badges, and interactive
HTML split-screen comparison sliders for repositories powered by T-Zero.
Designed to create a self-reinforcing viral star loop across GitHub repositories.
Kind: Class
Source: tzero/tzero_card.py:20-426
Declaration:
class TZeroShowcaseGenerator:Source docstring:
Generates viral GitHub badges, repository banner cards, and interactive showcase sliders.
Kind: Method
Source: tzero/tzero_card.py:24-165
Signature:
def generate_svg_banner_card(cls, repo_name: str = 'TZeroAlgorithm', savings_pct: float = 94.6, raw_tokens: int = 10809938, pruned_tokens: int = 1297192, annual_savings_usd: float = 14280.0, current_stars: int = 32, output_file: str = 'assets/tzero_badge_card.svg') -> str:Source docstring:
Generates a futuristic, high-DPI 800x240 SVG banner card for repository READMEs.
Kind: Method
Source: tzero/tzero_card.py:168-185
Signature:
def generate_readme_markdown_badges(cls, savings_pct: float = 94.6) -> str:Source docstring:
Returns ready-to-paste markdown badge block for GitHub READMEs.
Kind: Method
Source: tzero/tzero_card.py:188-426
Signature:
def generate_interactive_showcase_html(cls, output_file: str = 'tzero_showcase.html', raw_code_sample: Optional[str] = None, pruned_code_sample: Optional[str] = None, current_stars: int = 32) -> str:Source docstring:
Generates an interactive standalone split-screen HTML5 comparison slider.
Source: tzero/tzero_ci.py
Source size: 802 lines | 4 classes | 19 functions
Module docstring:
Siber Akademi — T-Zero Local CI Suite & Pre-Push Verification Engine.
Developer: [redacted] (Siber Akademi)
Repository: https://github.com/toprakahmetaydogmus/TZeroAlgorithm
License: MIT
Features:
1. Local CI Verification Pipeline:
- Stage 1: Release Metadata & Manifests Sync Gate
- Stage 2: 100% Zero-Leak Security & Personal Data Guard
- Stage 3: AST Syntax Integrity & Architectural Boundaries Guard
- Stage 4: Static Code Quality & Linter Gate
- Stage 5: Comprehensive Automated Unit & Regression Tests
- Stage 6: Cross-Ecosystem Smoke Gate (Node.js & VS Code Extensions)
- Stage 7: M8ven MCP Compliance Gate
2. Automated Git Pre-Push Hook:
- Automatically intercepts `git push` on developer's machine
- Runs local verification in seconds; blocks push if any check fails
- Eliminates remote GitHub Actions failures and saves 100% of runner quota
3. Turnkey CI Template Generator (GitHub Actions, GitLab CI, Pre-commit)
Kind: Class
Source: tzero/tzero_ci.py:158-185
Declaration:
class CIPipelineGenerator:Source docstring:
Turnkey generator for automated enterprise CI/CD verification workflows.
Kind: Method
Source: tzero/tzero_ci.py:162-169
Signature:
def install_github_workflow(cls, repo_dir: str = '.') -> Tuple[bool, str]:Source docstring:
Installs GitHub Actions workflow into .github/workflows/tzero_guard.yml.
Kind: Method
Source: tzero/tzero_ci.py:172-177
Signature:
def install_gitlab_ci(cls, repo_dir: str = '.') -> Tuple[bool, str]:Source docstring:
Installs GitLab CI configuration into .gitlab-ci.yml.
Kind: Method
Source: tzero/tzero_ci.py:180-185
Signature:
def install_pre_commit(cls, repo_dir: str = '.') -> Tuple[bool, str]:Source docstring:
Installs pre-commit configuration into .pre-commit-config.yaml.
Kind: Class
Source: tzero/tzero_ci.py:223-234
Declaration:
class LocalCIStepResult:Source docstring: none; consult the linked implementation instead of inferring behavior.
Kind: Method
Source: tzero/tzero_ci.py:233-234
Signature:
def to_dict(self) -> Dict[str, Any]:Source docstring: none; consult the linked implementation instead of inferring behavior.
Kind: Class
Source: tzero/tzero_ci.py:238-258
Declaration:
class LocalCIReport:Source docstring: none; consult the linked implementation instead of inferring behavior.
Kind: Method
Source: tzero/tzero_ci.py:248-258
Signature:
def to_dict(self) -> Dict[str, Any]:Source docstring: none; consult the linked implementation instead of inferring behavior.
Kind: Function
Source: tzero/tzero_ci.py:261-268
Signature:
def get_python_executable() -> str:Source docstring:
Returns the real python executable, even when running inside a frozen PyInstaller binary.
Kind: Class
Source: tzero/tzero_ci.py:271-746
Declaration:
class LocalCIRunner:Source docstring:
Enterprise Local CI Pipeline Runner & Pre-Push Shield.
Executes complete verification batteries locally on the developer machine:
- 0 runner minutes consumed
- 0 remote CI failures & spam emails
- 100% offline-ready & private
Kind: Method
Source: tzero/tzero_ci.py:280-283
Signature:
def __init__(self, repo_dir: str = '.', quick: bool = False, auto_fix: bool = False):Source docstring: none; consult the linked implementation instead of inferring behavior.
Kind: Method
Source: tzero/tzero_ci.py:288-333
Signature:
def check_metadata_sync(self) -> LocalCIStepResult:Source docstring: none; consult the linked implementation instead of inferring behavior.
Kind: Method
Source: tzero/tzero_ci.py:338-387
Signature:
def check_zero_leak_security(self) -> LocalCIStepResult:Source docstring: none; consult the linked implementation instead of inferring behavior.
Kind: Method
Source: tzero/tzero_ci.py:392-429
Signature:
def check_ast_and_boundaries(self) -> LocalCIStepResult:Source docstring: none; consult the linked implementation instead of inferring behavior.
Kind: Method
Source: tzero/tzero_ci.py:434-465
Signature:
def check_code_quality_lint(self) -> LocalCIStepResult:Source docstring: none; consult the linked implementation instead of inferring behavior.
Kind: Method
Source: tzero/tzero_ci.py:470-515
Signature:
def check_unit_tests(self) -> LocalCIStepResult:Source docstring: none; consult the linked implementation instead of inferring behavior.
Kind: Method
Source: tzero/tzero_ci.py:520-576
Signature:
def check_node_ecosystem(self) -> LocalCIStepResult:Source docstring: none; consult the linked implementation instead of inferring behavior.
Kind: Method
Source: tzero/tzero_ci.py:581-612
Signature:
def check_m8ven_compliance(self) -> LocalCIStepResult:Source docstring: none; consult the linked implementation instead of inferring behavior.
Kind: Method
Source: tzero/tzero_ci.py:617-645
Signature:
def run(self) -> LocalCIReport:Source docstring: none; consult the linked implementation instead of inferring behavior.
Kind: Method
Source: tzero/tzero_ci.py:651-693
Signature:
def install_git_pre_push_hook(cls, repo_dir: str = '.') -> Tuple[bool, str]:Source docstring:
Installs pre-push hook into .git/hooks/pre-push to automatically run Local CI.
Kind: Method
Source: tzero/tzero_ci.py:696-705
Signature:
def uninstall_git_pre_push_hook(cls, repo_dir: str = '.') -> Tuple[bool, str]:Source docstring:
Removes .git/hooks/pre-push.
Kind: Method
Source: tzero/tzero_ci.py:711-746
Signature:
def render_terminal_report(cls, report: LocalCIReport) -> str:Source docstring: none; consult the linked implementation instead of inferring behavior.
Kind: Function
Source: tzero/tzero_ci.py:753-798
Signature:
def main():Source docstring: none; consult the linked implementation instead of inferring behavior.
Source: tzero/tzero_commit.py
Source size: 192 lines | 2 classes | 4 functions
Module docstring:
Siber Akademi — T-Zero Local Semantic Git Commit & Changelog Synthesizer.
Developer: [redacted] (Siber Akademi)
License: AGPL-3.0-only
Analyzes staged or unstaged AST git diffs locally (100% offline, $0 cost) to
synthesize Conventional Commit messages and structured CHANGELOG entries
without transmitting code to cloud LLMs.
Kind: Class
Source: tzero/tzero_commit.py:30-38
Declaration:
class DiffSemantics:Source docstring:
Analyzed semantics of a git diff.
Kind: Class
Source: tzero/tzero_commit.py:41-192
Declaration:
class LocalSemanticCommitSynthesizer:Source docstring:
Zero-cost local synthesizer for Conventional Commits and release notes.
Kind: Method
Source: tzero/tzero_commit.py:45-57
Signature:
def get_git_diff(cls, repo_dir: str = '.', staged: bool = True) -> str:Source docstring:
Retrieves staged or unstaged git diff.
Kind: Method
Source: tzero/tzero_commit.py:60-165
Signature:
def analyze_diff(cls, diff_text: str) -> DiffSemantics:Source docstring:
Parses diff hunks and infers conventional commit type, scope, and bullets.
Kind: Method
Source: tzero/tzero_commit.py:168-178
Signature:
def generate_commit_message(cls, repo_dir: str = '.', staged: bool = True, diff_override: Optional[str] = None) -> str:Source docstring:
Generates a Conventional Commit message from local AST git diff.
Kind: Method
Source: tzero/tzero_commit.py:181-192
Signature:
def generate_changelog_entry(cls, version: str = 'v8.1.0', repo_dir: str = '.') -> str:Source docstring:
Generates a Markdown release changelog entry from git history.
Source: tzero/tzero_dashboard.py
Source size: 1999 lines | 1 classes | 9 functions
Module docstring:
Siber Akademi T-Zero — Modern Developer Console & Control Center.
Runs a zero-dependency local web server on port 8421 serving a modern,
clean developer interface with real-time 4D Causal-Temporal Graph visualization,
PBFT Multi-Agent Swarm Consensus, Superdesign Canvas launcher, and live
Polyglot Token Reducer sandbox.
Developer: [redacted] (Siber Akademi)
License: MIT
Kind: Function
Source: tzero/tzero_dashboard.py:1477-1562
Signature:
def compute_live_dashboard_stats(workspace_dir: str = '.') -> Dict[str, Any]:Source docstring:
Computes cached live workspace and MCP telemetry for /api/stats.
Kind: Class
Source: tzero/tzero_dashboard.py:1565-1970
Declaration:
class DashboardRequestHandler(http.server.BaseHTTPRequestHandler):Source docstring: none; consult the linked implementation instead of inferring behavior.
Kind: Method
Source: tzero/tzero_dashboard.py:1567-1583
Signature:
def _resolve_safe_api_path(raw_path: str) -> str:Source docstring:
Restricts dashboard API file/workspace paths to CWD or temp directory.
Kind: Method
Source: tzero/tzero_dashboard.py:1586-1588
Signature:
def log_message(self, format, *args):Source docstring: none; consult the linked implementation instead of inferring behavior.
Kind: Method
Source: tzero/tzero_dashboard.py:1590-1597
Signature:
def _read_json_body(self) -> Dict[str, Any]:Source docstring:
Reads and parses a JSON object request body safely.
Kind: Method
Source: tzero/tzero_dashboard.py:1599-1604
Signature:
def _send_json(self, payload: Dict[str, Any], status: int = 200) -> None:Source docstring:
Writes a UTF-8 JSON response with standard headers.
Kind: Method
Source: tzero/tzero_dashboard.py:1606-1694
Signature:
def do_GET(self):Source docstring: none; consult the linked implementation instead of inferring behavior.
Kind: Method
Source: tzero/tzero_dashboard.py:1696-1970
Signature:
def do_POST(self):Source docstring: none; consult the linked implementation instead of inferring behavior.
Kind: Function
Source: tzero/tzero_dashboard.py:1973-1985
Signature:
def start_dashboard_server(port: int = DASHBOARD_PORT, open_browser: bool = True) -> http.server.HTTPServer:Source docstring:
Starts the T-Zero Control Center dashboard server.
Kind: Function
Source: tzero/tzero_dashboard.py:1988-1995
Signature:
def main():Source docstring:
Entry point for python tzero_dashboard.py.
Source: tzero/tzero_explain.py
Source size: 306 lines | 3 classes | 5 functions
Module docstring:
T-Zero Explain: Ultra-Dense AST Architectural Passport Generator.
Generates high-density, prompt-ready architectural passports for codebases and files,
delivering maximum semantic grounding to LLMs (Claude, GPT, Gemini, DeepSeek) with
up to 95% token savings compared to raw file ingestion.
Author: [redacted] (Siber Akademi)
Version: 12.3.4
Kind: Class
Source: tzero/tzero_explain.py:31-37
Declaration:
class SymbolPassport:Source docstring: none; consult the linked implementation instead of inferring behavior.
Kind: Class
Source: tzero/tzero_explain.py:41-53
Declaration:
class ModulePassport:Source docstring: none; consult the linked implementation instead of inferring behavior.
Kind: Class
Source: tzero/tzero_explain.py:56-297
Declaration:
class ArchitecturalPassportGenerator:Source docstring:
Extracts ultra-dense AST architecture passports for LLM prompts.
Kind: Method
Source: tzero/tzero_explain.py:60-61
Signature:
def _estimate_tokens(text: str) -> int:Source docstring: none; consult the linked implementation instead of inferring behavior.
Kind: Method
Source: tzero/tzero_explain.py:64-73
Signature:
def _compute_complexity(cls, node: ast.AST) -> int:Source docstring:
Calculate cyclomatic complexity of an AST node.
Kind: Method
Source: tzero/tzero_explain.py:76-87
Signature:
def _classify_role(cls, path_str: str, symbols: List[SymbolPassport]) -> str:Source docstring: none; consult the linked implementation instead of inferring behavior.
Kind: Method
Source: tzero/tzero_explain.py:90-281
Signature:
def explain_file(cls, file_path: str) -> ModulePassport:Source docstring:
Generate high-density AST passport for a single Python file.
Kind: Method
Source: tzero/tzero_explain.py:284-297
Signature:
def render_cli(cls, passport: ModulePassport):Source docstring:
Render passport output to stdout.
Source: tzero/tzero_federation.py
Source size: 311 lines | 1 classes | 7 functions
Module docstring:
T-Zero Cryptographic Multi-Repo AST Federation Sync (tzero_federation.py).
Exports signed, Zero-Leak sanitized AST interface contracts (no function bodies,
no secrets) for safe peer-repository sharing, verification, and cross-repo impact lookup.
100% Free, Local, Offline, Zero-Leak Certified.
Kind: Class
Source: tzero/tzero_federation.py:30-264
Declaration:
class FederationSyncEngine:Source docstring:
Exports, cryptographically verifies, and imports cross-repo AST interface contracts.
Kind: Method
Source: tzero/tzero_federation.py:34-41
Signature:
def _canonical_digest(payload: Dict[str, Any]) -> str:Source docstring: none; consult the linked implementation instead of inferring behavior.
Kind: Method
Source: tzero/tzero_federation.py:44-95
Signature:
def export_manifest(cls, workspace_dir: str = '.', repo_name: Optional[str] = None, out_file: Optional[str] = None) -> Dict[str, Any]:Source docstring: none; consult the linked implementation instead of inferring behavior.
Kind: Method
Source: tzero/tzero_federation.py:98-103
Signature:
def verify_manifest(cls, manifest: Dict[str, Any]) -> bool:Source docstring: none; consult the linked implementation instead of inferring behavior.
Kind: Method
Source: tzero/tzero_federation.py:106-128
Signature:
def import_manifest(cls, workspace_dir: str, manifest_path: str) -> Dict[str, Any]:Source docstring: none; consult the linked implementation instead of inferring behavior.
Kind: Method
Source: tzero/tzero_federation.py:131-150
Signature:
def list_peers(cls, workspace_dir: str = '.') -> List[Dict[str, Any]]:Source docstring: none; consult the linked implementation instead of inferring behavior.
Kind: Method
Source: tzero/tzero_federation.py:153-264
Signature:
def analyze_cross_repo_impact(cls, workspace_dir: str, symbol_name: str, scip_path: Optional[str] = None) -> Dict[str, Any]:Source docstring: none; consult the linked implementation instead of inferring behavior.
Kind: Function
Source: tzero/tzero_federation.py:267-310
Signature:
def run_federation_cli(action: str = 'list', workspace_dir: str = '.', target_file: Optional[str] = None, repo_name: Optional[str] = None, symbol_name: Optional[str] = None, scip_path: Optional[str] = None) -> int:Source docstring: none; consult the linked implementation instead of inferring behavior.
Source: tzero/tzero_fix.py
Source size: 557 lines | 5 classes | 15 functions
Module docstring:
Siber Akademi — T-Zero Self-Healing AST Hallucination Auto-Corrector.
Developer: [redacted] (Siber Akademi)
License: MIT
Statically inspects candidate code against verified workspace AST symbol tables.
Detects phantom imports, misspelled identifiers, and hallucinated method calls,
and automatically rewrites the AST to the correct valid local identifier.
Kind: Function
Source: tzero/tzero_fix.py:75-100
Signature:
def find_best_symbol_match(target: str, candidates: Set[str], cutoff: float = 0.5) -> Tuple[Optional[str], float]:Source docstring:
Hybrid symbol matcher combining token-level Jaccard overlap, prefix boost, and SequenceMatcher.
Kind: Class
Source: tzero/tzero_fix.py:104-110
Declaration:
class HealingAction:Source docstring: none; consult the linked implementation instead of inferring behavior.
Kind: Class
Source: tzero/tzero_fix.py:114-120
Declaration:
class HealingReport:Source docstring: none; consult the linked implementation instead of inferring behavior.
Kind: Class
Source: tzero/tzero_fix.py:123-226
Declaration:
class _ASTHealerTransformer(ast.NodeTransformer):Source docstring: none; consult the linked implementation instead of inferring behavior.
Kind: Method
Source: tzero/tzero_fix.py:124-137
Signature:
def __init__(self, known_functions: Set[str], known_imports: Set[str], known_methods: Set[str], module_symbol_map: Optional[Dict[str, Set[str]]] = None):Source docstring: none; consult the linked implementation instead of inferring behavior.
Kind: Method
Source: tzero/tzero_fix.py:139-178
Signature:
def visit_ImportFrom(self, node: ast.ImportFrom) -> ast.AST:Source docstring: none; consult the linked implementation instead of inferring behavior.
Kind: Method
Source: tzero/tzero_fix.py:180-183
Signature:
def visit_Name(self, node: ast.Name) -> ast.AST:Source docstring: none; consult the linked implementation instead of inferring behavior.
Kind: Method
Source: tzero/tzero_fix.py:185-226
Signature:
def visit_Call(self, node: ast.Call) -> ast.AST:Source docstring: none; consult the linked implementation instead of inferring behavior.
Kind: Class
Source: tzero/tzero_fix.py:229-246
Declaration:
class WorkspaceSymbolsResult:Source docstring:
Container for collected symbols supporting both 3-element unpacking and module map.
Kind: Method
Source: tzero/tzero_fix.py:231-235
Signature:
def __init__(self, funcs: Set[str], imports: Set[str], methods: Set[str], module_map: Optional[Dict[str, Set[str]]] = None):Source docstring: none; consult the linked implementation instead of inferring behavior.
Kind: Method
Source: tzero/tzero_fix.py:237-240
Signature:
def __iter__(self):Source docstring: none; consult the linked implementation instead of inferring behavior.
Kind: Method
Source: tzero/tzero_fix.py:242-243
Signature:
def __getitem__(self, idx):Source docstring: none; consult the linked implementation instead of inferring behavior.
Kind: Method
Source: tzero/tzero_fix.py:245-246
Signature:
def __len__(self):Source docstring: none; consult the linked implementation instead of inferring behavior.
Kind: Class
Source: tzero/tzero_fix.py:249-556
Declaration:
class ASTHallucinationAutoCorrector:Source docstring:
Self-healing engine to detect and repair hallucinated AI symbols.
Kind: Method
Source: tzero/tzero_fix.py:258-303
Signature:
def collect_workspace_symbols(cls, workspace_dir: str) -> WorkspaceSymbolsResult:Source docstring:
Collects all real functions, imports, and methods defined across workspace.
Kind: Method
Source: tzero/tzero_fix.py:306-430
Signature:
def heal_code(cls, code: str, workspace_dir: str = '.', precomputed_symbols: Optional[Any] = None) -> HealingReport:Source docstring:
Parses candidate code, fixes hallucinated symbols, and returns report.
Kind: Method
Source: tzero/tzero_fix.py:433-449
Signature:
def heal_file(cls, file_path: str, workspace_dir: str = '.', apply_write: bool = False, precomputed_symbols: Optional[Tuple[Set[str], Set[str], Set[str]]] = None) -> HealingReport:Source docstring:
Reads file, applies healing, optionally overwrites if apply_write is True.
Kind: Method
Source: tzero/tzero_fix.py:452-476
Signature:
def render_cli(cls, rep: HealingReport, target_hint: str = ''):Source docstring: none; consult the linked implementation instead of inferring behavior.
Kind: Method
Source: tzero/tzero_fix.py:479-528
Signature:
def heal_workspace(cls, target_dir: str = '.', workspace_dir: Optional[str] = None, apply_write: bool = False, exclude_dirs: Optional[Set[str]] = None) -> Dict[str, Any]:Source docstring:
Recursively scans and self-heals all Python source files across target_dir.
Kind: Method
Source: tzero/tzero_fix.py:531-556
Signature:
def render_workspace_cli(cls, summary: Dict[str, Any], target_hint: str = ''):Source docstring: none; consult the linked implementation instead of inferring behavior.
Source: tzero/tzero_growth.py
Source size: 573 lines | 0 classes | 18 functions
Module docstring:
T-ZERO $0.00 BUDGET VIRAL MARKETING & COMMUNITY GROWTH ENGINE
-------------------------------------------------------------
Developer: [redacted] (Siber Akademi)
License: MIT | Version: 12.3.4
Strictly $0.00 budget: Zero paid ads, zero paid APIs, zero cloud tokens.
Pure organic developer-to-developer growth engine engineered to drive 100+ GitHub stars.
Generates tailored, high-converting launch copy for Reddit, Hacker News, Product Hunt,
Twitter/X, LinkedIn, Dev.to, Turkish Tech Hubs, and Awesome-Lists.
Kind: Function
Source: tzero/tzero_growth.py:41-42
Signature:
def _community_cache_path() -> Path:Source docstring: none; consult the linked implementation instead of inferring behavior.
Kind: Function
Source: tzero/tzero_growth.py:45-51
Signature:
def next_star_milestone(stars: int) -> int:Source docstring:
Return the next community star milestone strictly above current count.
Kind: Function
Source: tzero/tzero_growth.py:54-59
Signature:
def format_downloads_label(count: int) -> str:Source docstring:
Format package download totals concisely (e.g., 22914 -> '22,900+').
Kind: Function
Source: tzero/tzero_growth.py:62-71
Signature:
def _read_community_cache() -> Dict[str, Any]:Source docstring: none; consult the linked implementation instead of inferring behavior.
Kind: Function
Source: tzero/tzero_growth.py:74-85
Signature:
def _write_community_cache(stars: int, downloads: int) -> None:Source docstring: none; consult the linked implementation instead of inferring behavior.
Kind: Function
Source: tzero/tzero_growth.py:88-99
Signature:
def _build_community_stats(stars: int, downloads: int, source: str) -> Dict[str, Any]:Source docstring: none; consult the linked implementation instead of inferring behavior.
Kind: Function
Source: tzero/tzero_growth.py:102-111
Signature:
def get_cached_community_stats(max_age_sec: int = COMMUNITY_CACHE_TTL_SEC) -> Dict[str, Any]:Source docstring:
Return instantaneous cached (or baseline) community stats without blocking on network.
Kind: Function
Source: tzero/tzero_growth.py:114-140
Signature:
def _fetch_live_downloads(timeout: float = 2.0) -> int:Source docstring: none; consult the linked implementation instead of inferring behavior.
Kind: Function
Source: tzero/tzero_growth.py:143-172
Signature:
def get_live_github_stars(timeout: float = 2.0, force_refresh: bool = False) -> int:Source docstring:
Fetch current GitHub stargazers count with local TTL cache and resilient fallback.
Kind: Function
Source: tzero/tzero_growth.py:175-197
Signature:
def get_live_community_stats(timeout: float = 2.0, force_refresh: bool = False, include_downloads: bool = False) -> Dict[str, Any]:Source docstring:
Fetch live GitHub star count and registry downloads with TTL cache + offline fallback.
Kind: Function
Source: tzero/tzero_growth.py:200-205
Signature:
def render_progress_bar(current: int, target: int = 100, length: int = 30) -> str:Source docstring:
Renders visual ASCII progress bar.
Kind: Function
Source: tzero/tzero_growth.py:208-334
Signature:
def generate_reddit_posts() -> Dict[str, Dict[str, str]]:Source docstring:
Generates copy-paste ready Reddit launch posts.
Kind: Function
Source: tzero/tzero_growth.py:337-367
Signature:
def generate_show_hn() -> Dict[str, str]:Source docstring:
Generates Hacker News Show HN submission.
Kind: Function
Source: tzero/tzero_growth.py:370-431
Signature:
def generate_twitter_thread() -> List[str]:Source docstring:
Generates 7-tweet viral X/Twitter thread.
Kind: Function
Source: tzero/tzero_growth.py:434-465
Signature:
def generate_product_hunt() -> Dict[str, str]:Source docstring:
Generates Product Hunt launch kit.
Kind: Function
Source: tzero/tzero_growth.py:468-483
Signature:
def generate_awesome_lists_prs() -> Dict[str, str]:Source docstring:
Generates Markdown entries ready to submit as PRs to curated awesome lists.
Kind: Function
Source: tzero/tzero_growth.py:486-552
Signature:
def export_all_marketing_materials(output_dir: Path) -> None:Source docstring:
Exports all marketing copy to markdown files organized by platform.
Kind: Function
Source: tzero/tzero_growth.py:555-568
Signature:
def main():Source docstring: none; consult the linked implementation instead of inferring behavior.
Source: tzero/tzero_hooks.py
Source size: 565 lines | 0 classes | 13 functions
Module docstring:
T-Zero 2026 Lifecycle Hook Runner (PreToolUse / PostToolUse).
Supports Claude Code, Gemini CLI, and Cursor native hook JSON protocols:
- PreToolUse: Blocks writes/edits/commands containing leaked credentials or layer violations (exit code 2).
- PostToolUse: Auto-prunes oversized file reads into compact AST skeletons cleanly.
100% Free, Local, Offline, Zero-Leak Certified.
Kind: Function
Source: tzero/tzero_hooks.py:62-77
Signature:
def _extract_write_blobs(tool_input: Dict[str, Any]) -> List[str]:Source docstring: none; consult the linked implementation instead of inferring behavior.
Kind: Function
Source: tzero/tzero_hooks.py:80-92
Signature:
def _is_sensitive_file_read(file_path: str) -> bool:Source docstring: none; consult the linked implementation instead of inferring behavior.
Kind: Function
Source: tzero/tzero_hooks.py:95-126
Signature:
def _is_shell_exfiltration(cmd: str) -> bool:Source docstring: none; consult the linked implementation instead of inferring behavior.
Kind: Function
Source: tzero/tzero_hooks.py:129-142
Signature:
def _matches_layer_pattern(file_rel: str, patterns: List[str]) -> bool:Source docstring: none; consult the linked implementation instead of inferring behavior.
Kind: Function
Source: tzero/tzero_hooks.py:145-164
Signature:
def _find_file_layer(file_path: str, layers: Dict[str, List[str]], workspace_dir: str) -> Optional[str]:Source docstring: none; consult the linked implementation instead of inferring behavior.
Kind: Function
Source: tzero/tzero_hooks.py:167-190
Signature:
def _extract_imported_modules(blob: str, filename: str) -> Set[str]:Source docstring: none; consult the linked implementation instead of inferring behavior.
Kind: Function
Source: tzero/tzero_hooks.py:193-205
Signature:
def _resolve_module_layer(mod: str, layers: Dict[str, List[str]]) -> Optional[str]:Source docstring: none; consult the linked implementation instead of inferring behavior.
Kind: Function
Source: tzero/tzero_hooks.py:208-288
Signature:
def _check_architecture_rules(file_path: str, blobs: List[str], workspace_dir: str) -> Optional[Dict[str, Any]]:Source docstring: none; consult the linked implementation instead of inferring behavior.
Kind: Function
Source: tzero/tzero_hooks.py:291-385
Signature:
def evaluate_pre_tool_use(payload: Dict[str, Any], workspace_dir: str = '.') -> Dict[str, Any]:Source docstring:
Evaluates PreToolUse payload for Zero-Leak credential and architecture violations.
Kind: Function
Source: tzero/tzero_hooks.py:388-442
Signature:
def evaluate_post_tool_use(payload: Dict[str, Any], workspace_dir: str = '.', max_chars: int = 16000) -> Dict[str, Any]:Source docstring:
Auto-prunes oversized PostToolUse file read responses using T-Zero AST reduction.
Kind: Function
Source: tzero/tzero_hooks.py:445-462
Signature:
def build_claude_cursor_hook_config() -> Dict[str, Any]:Source docstring:
Generates declarative PreToolUse/PostToolUse configuration snippet for AI coding tools.
Kind: Function
Source: tzero/tzero_hooks.py:465-528
Signature:
def install_hooks(workspace_dir: str = '.', client: str = 'all') -> Dict[str, Any]:Source docstring:
Installs PreToolUse/PostToolUse hooks idempotently into Claude, Cursor, or Gemini settings.
Kind: Function
Source: tzero/tzero_hooks.py:531-561
Signature:
def run_hook_cli(event: str = 'PreToolUse', payload_json: Optional[str] = None, workspace_dir: str = '.', max_chars: int = 16000, install_client: Optional[str] = None) -> int:Source docstring:
CLI entrypoint parsing hook JSON payload and emitting decision JSON.
Source: tzero/tzero_patch.py
Source size: 624 lines | 4 classes | 10 functions
Module docstring:
Siber Akademi — T-Zero Smart Micro-Patch & AST-Tolerant Fuzzy Patcher.
Developer: [redacted] (Siber Akademi)
License: MIT
1. SmartMicroPatcher: Compresses standard git diffs and unified diffs into ultra-dense
semantic AST micro-patches, reducing token payload by 80% to 90% for LLM workflows.
2. ASTFuzzyPatcher: Applies AI/LLM diffs and patches to codebase files with multi-tier
tolerance against line-drift, whitespace discrepancies, indentation mismatches,
AST symbol boundary shifts, and sliding-window fuzzy similarity.
Kind: Class
Source: tzero/tzero_patch.py:34-129
Declaration:
class SmartMicroPatcher:Source docstring:
Condenses Git diffs and file deltas into semantic AST micro-patches.
Kind: Method
Source: tzero/tzero_patch.py:38-114
Signature:
def compress_diff(raw_diff: str, max_context_lines: int = 1) -> Tuple[str, float]:Source docstring:
Compresses unified git diff into a compact semantic patch.
Args:
raw_diff: Standard output from 'git diff' or unified diff.
max_context_lines: Maximum surrounding context lines to retain per hunk (default 1).
Returns:
(compact_micro_patch, token_savings_percentage)
Kind: Nested function
Source: tzero/tzero_patch.py:59-66
Signature:
def flush_hunk():Source docstring: none; consult the linked implementation instead of inferring behavior.
Kind: Method
Source: tzero/tzero_patch.py:117-129
Signature:
def format_micro_patch_report(raw_diff: str, max_context_lines: int = 1) -> str:Source docstring:
Formats an AI-ready Markdown report containing the micro-patch.
Kind: Class
Source: tzero/tzero_patch.py:137-147
Declaration:
class PatchHunk:Source docstring:
Represents a parsed diff hunk with context, removals, and additions.
Kind: Class
Source: tzero/tzero_patch.py:151-155
Declaration:
class FilePatch:Source docstring:
Represents hunks targeting a specific file path.
Kind: Class
Source: tzero/tzero_patch.py:158-618
Declaration:
class ASTFuzzyPatcher:Source docstring:
Multi-tier AST-Tolerant and Whitespace-Agnostic Fuzzy Patcher.
Tiers of tolerance:
1. exact: Line-exact match at hunk header coordinates.
2. line_drift: Content-exact match across entire file regardless of line offset.
3. whitespace_normalized: Strips leading/trailing spaces and adapts indentation.
4. ast_symbol_boundary: Bounded search within enclosing function/class/method AST scope.
5. fuzzy_similarity: Sliding-window Levenshtein / SequenceMatcher match (ratio >= tolerance).
Kind: Method
Source: tzero/tzero_patch.py:170-257
Signature:
def parse_patch(cls, patch_text: str) -> List[FilePatch]:Source docstring:
Parses unified diff, git diff, or raw hunks into FilePatch structures.
Kind: Method
Source: tzero/tzero_patch.py:260-269
Signature:
def extract_symbol_name(cls, scope_hint: str) -> Optional[str]:Source docstring:
Extracts identifier name from hunk symbol scope header (e.g., 'def charge(x):').
Kind: Method
Source: tzero/tzero_patch.py:272-307
Signature:
def find_symbol_range(cls, lines: List[str], symbol_name: str) -> Optional[Tuple[int, int]]:Source docstring:
Finds line range [start, end] for a symbol in lines using AST or polyglot indentation.
Kind: Method
Source: tzero/tzero_patch.py:310-341
Signature:
def adjust_indentation(cls, target_lines: List[str], match_idx: int, old_lines: List[str], new_lines: List[str]) -> List[str]:Source docstring:
Adjusts leading indentation of new_lines to match target_lines at match_idx.
Kind: Method
Source: tzero/tzero_patch.py:344-443
Signature:
def match_hunk(cls, target_lines: List[str], hunk: PatchHunk, fuzzy: bool = True, tolerance: float = 0.75) -> Tuple[bool, int, int, str, float, List[str]]:Source docstring:
Finds match slice [start_idx : end_idx] for hunk with multi-tier tolerance.
Returns:
(matched, start_idx, end_idx, strategy, confidence, adjusted_new_lines)
Kind: Method
Source: tzero/tzero_patch.py:446-553
Signature:
def apply_fuzzy_patch(cls, source_content: str, patch_content: str, fuzzy: bool = True, tolerance: float = 0.75, dry_run: bool = False, reverse: bool = False) -> Tuple[bool, str, Dict[str, Any]]:Source docstring:
Applies patch to source_content with multi-tier tolerance.
Args:
source_content: Original file source code.
patch_content: Unified diff, git diff, or hunk text.
fuzzy: Enable whitespace, AST, and similarity tolerance (default: True).
tolerance: Minimum similarity ratio for Tier 5 fuzzy match (default: 0.75).
dry_run: Validate applicability without returning mutated code.
reverse: Un-apply patch (swaps old_lines and new_lines).
Returns:
(success, patched_content, metadata_report)
Kind: Method
Source: tzero/tzero_patch.py:556-618
Signature:
def patch_file(cls, target_file_path: str, patch_text_or_path: str, in_place: bool = True, fuzzy: bool = True, tolerance: float = 0.75, dry_run: bool = False, backup: bool = False) -> Dict[str, Any]:Source docstring:
Patches a file on disk using AST-tolerant fuzzy matching.
Args:
target_file_path: Absolute or relative path to target file.
patch_text_or_path: Diff string or path to .diff/.patch file.
in_place: Write changes directly to target_file_path (default: True).
fuzzy: Enable fuzzy and AST matching (default: True).
tolerance: Fuzzy matching threshold (default: 0.75).
dry_run: Verify patch applicability without writing to disk.
backup: Create .bak file before modifying (default: False).
Returns:
Dictionary with operation status and hunk metrics.
Source: tzero/tzero_pc_fixer.py
Source size: 12717 lines | 96 classes | 228 functions
Module docstring:
T-Zero PC-Fixer & Codebase Doctor (Master Single-File Edition)
============================================================
Version: 10.5.0 Master Edition | Zero-Leak Certified | 100% Free & Local
Architectural Specification: Monolithic Self-Healing Operating System & Codebase Doctor
Components Integrated:
1. Operating System, PATH, File Lock, & Registry Diagnostics
2. Virtual Environment (venv, conda, poetry) Integrity & Recovery
3. AST Syntax Error & Delimiter Surgical Healer
4. Import Dependency Graph Analyzer & Tarjan's SCC Cycle Resolver
5. Code Smells, Anti-Patterns, & Deprecated API Modernizer
6. PEP 585 / PEP 604 Dynamic Type System Modernizer
7. 100% Zero-Leak Secret Scanner, Sanitizer, & .env Migrator
8. Polyglot Configuration Healers (JSON, YAML, Makefile, Dockerfile, TOML, SQL)
9. Multi-Language Syntax Parsers (JavaScript, TypeScript, Rust, Go, Shell)
10. Performance & Memory Profiler (O(N^2) quadratic string concats, reduction allocs)
11. Code Duplicity & AST Clone Refactoring Engine
12. 120+ Diagnostic Knowledge Base & CWE/OWASP Vulnerability Taxonomy
13. CI/CD Quality Gate, Hook Integrator, SARIF 2.1.0, & JUnit Exporters
14. Synthetic Multi-Tier Workspace Generator & Stress Testbed
15. Transactional Rollback Manifest & Backup Manager
16. Backward-Compatible PCFixerDoctor API for MCP and CLI
Author: [redacted] & Siber Akademi T-Zero R&D Team
License: MIT License (100% Free, Local Offline, Zero-Leak)
Kind: Class
Source: tzero/tzero_pc_fixer.py:85-115
Declaration:
class SeverityLevel(enum.Enum):Source docstring:
Severity classification for diagnostic issues.
Kind: Method
Source: tzero/tzero_pc_fixer.py:94-103
Signature:
def ansi_color(self) -> str:Source docstring: none; consult the linked implementation instead of inferring behavior.
Kind: Method
Source: tzero/tzero_pc_fixer.py:106-115
Signature:
def badge(self) -> str:Source docstring: none; consult the linked implementation instead of inferring behavior.
Kind: Class
Source: tzero/tzero_pc_fixer.py:118-131
Declaration:
class DiagnosticCategory(enum.Enum):Source docstring:
Category classification for doctor checks.
Kind: Class
Source: tzero/tzero_pc_fixer.py:142-157
Declaration:
class SystemPlatform(enum.Enum):Source docstring:
Host operating system platform.
Kind: Method
Source: tzero/tzero_pc_fixer.py:150-157
Signature:
def current(cls) -> 'SystemPlatform':Source docstring: none; consult the linked implementation instead of inferring behavior.
Kind: Class
Source: tzero/tzero_pc_fixer.py:161-174
Declaration:
class DiffHunk:Source docstring:
Represents a unified diff modification hunk.
Kind: Method
Source: tzero/tzero_pc_fixer.py:171-174
Signature:
def to_unified_string(self) -> str:Source docstring: none; consult the linked implementation instead of inferring behavior.
Kind: Class
Source: tzero/tzero_pc_fixer.py:178-252
Declaration:
class DiagnosticIssue:Source docstring:
Represents a single detected diagnostic defect in codebase or environment.
Kind: Method
Source: tzero/tzero_pc_fixer.py:192-226
Signature:
def __init__(self, category: Union[str, DiagnosticCategory] = 'syntax', severity: Union[str, SeverityLevel] = 'warning', file_path: Optional[str] = None, line: Optional[int] = None, column: Optional[int] = None, error_code: str = '', message: str = '', suggested_fix: str = '', auto_fixable: bool = True, confidence_score: float = 1.0, metadata: Optional[Dict[str, Any]] = None, code: Optional[str] = None, remediation: Optional[str] = None, line_number: Optional[int] = None, suggested_action: Any = None, **extra: Any):Source docstring: none; consult the linked implementation instead of inferring behavior.
Kind: Method
Source: tzero/tzero_pc_fixer.py:229-230
Signature:
def code(self) -> str:Source docstring: none; consult the linked implementation instead of inferring behavior.
Kind: Method
Source: tzero/tzero_pc_fixer.py:233-234
Signature:
def remediation(self) -> str:Source docstring: none; consult the linked implementation instead of inferring behavior.
Kind: Method
Source: tzero/tzero_pc_fixer.py:237-238
Signature:
def line_number(self) -> Optional[int]:Source docstring: none; consult the linked implementation instead of inferring behavior.
Kind: Method
Source: tzero/tzero_pc_fixer.py:240-241
Signature:
def to_dict(self) -> Dict[str, Any]:Source docstring: none; consult the linked implementation instead of inferring behavior.
Kind: Method
Source: tzero/tzero_pc_fixer.py:244-252
Signature:
def formatted_location(self) -> str:Source docstring: none; consult the linked implementation instead of inferring behavior.
Kind: Class
Source: tzero/tzero_pc_fixer.py:256-308
Declaration:
class HealAction:Source docstring:
Record of a surgical repair action executed on disk or in memory.
Kind: Method
Source: tzero/tzero_pc_fixer.py:268-301
Signature:
def __init__(self, category: Optional[Any] = None, file_path: Optional[str] = None, description: str = '', success: bool = True, diff: Optional[str] = None, action_type: str = 'patch', backup_path: Optional[str] = None, duration_ms: float = 0.0, metadata: Optional[Dict[str, Any]] = None, issue: Optional[Any] = None, details: Optional[str] = None, **extra: Any):Source docstring: none; consult the linked implementation instead of inferring behavior.
Kind: Method
Source: tzero/tzero_pc_fixer.py:304-305
Signature:
def details(self) -> str:Source docstring: none; consult the linked implementation instead of inferring behavior.
Kind: Method
Source: tzero/tzero_pc_fixer.py:307-308
Signature:
def to_dict(self) -> Dict[str, Any]:Source docstring: none; consult the linked implementation instead of inferring behavior.
Kind: Class
Source: tzero/tzero_pc_fixer.py:312-319
Declaration:
class ToolStatus:Source docstring:
Status of an external development tool on system PATH.
Kind: Class
Source: tzero/tzero_pc_fixer.py:323-339
Declaration:
class EnvironmentSnapshot:Source docstring:
Detailed health matrix of the host operating system and execution runtime.
Kind: Class
Source: tzero/tzero_pc_fixer.py:343-405
Declaration:
class DiagnosticReport:Source docstring:
Complete diagnostic audit result across all categories.
Kind: Method
Source: tzero/tzero_pc_fixer.py:367-368
Signature:
def to_dict(self) -> Dict[str, Any]:Source docstring: none; consult the linked implementation instead of inferring behavior.
Kind: Method
Source: tzero/tzero_pc_fixer.py:370-405
Signature:
def to_sarif(self) -> Dict[str, Any]:Source docstring:
Convert diagnostic issues to standard OASIS SARIF v2.1.0 format.
Kind: Class
Source: tzero/tzero_pc_fixer.py:409-425
Declaration:
class RollbackManifest:Source docstring:
Manifest of files backed up before autonomous healing for atomic rollback.
Kind: Method
Source: tzero/tzero_pc_fixer.py:417-419
Signature:
def save(self, manifest_file: str):Source docstring: none; consult the linked implementation instead of inferring behavior.
Kind: Method
Source: tzero/tzero_pc_fixer.py:422-425
Signature:
def load(cls, manifest_file: str) -> 'RollbackManifest':Source docstring: none; consult the linked implementation instead of inferring behavior.
Kind: Class
Source: tzero/tzero_pc_fixer.py:429-448
Declaration:
class HealReport:Source docstring:
Comprehensive outcome report of autonomous self-healing execution.
Kind: Method
Source: tzero/tzero_pc_fixer.py:443-444
Signature:
def to_dict(self) -> Dict[str, Any]:Source docstring: none; consult the linked implementation instead of inferring behavior.
Kind: Method
Source: tzero/tzero_pc_fixer.py:447-448
Signature:
def is_fully_healthy(self) -> bool:Source docstring: none; consult the linked implementation instead of inferring behavior.
Kind: Class
Source: tzero/tzero_pc_fixer.py:457-521
Declaration:
class InteractiveFixerTUI:Source docstring:
Terminal UI renderer for T-Zero Autonomous Doctor.
Kind: Method
Source: tzero/tzero_pc_fixer.py:461-473
Signature:
def render_gauge(percentage: int, width: int = 30) -> str:Source docstring:
Render a colored ASCII health progress bar gauge.
Kind: Method
Source: tzero/tzero_pc_fixer.py:476-508
Signature:
def render_cockpit(cls, diag: DiagnosticReport, heal: Optional[HealReport] = None):Source docstring:
Render full interactive cockpit view.
Kind: Method
Source: tzero/tzero_pc_fixer.py:511-521
Signature:
def render_diff(cls, diff_text: str):Source docstring:
Render a unified diff with ANSI syntax colors.
Kind: Class
Source: tzero/tzero_pc_fixer.py:531-546
Declaration:
class CWERuleDefinition:Source docstring:
Taxonomy definition for a specific Common Weakness Enumeration.
Kind: Method
Source: tzero/tzero_pc_fixer.py:545-546
Signature:
def to_dict(self) -> Dict[str, Any]:Source docstring: none; consult the linked implementation instead of inferring behavior.
Kind: Class
Source: tzero/tzero_pc_fixer.py:549-946
Declaration:
class CWESecurityDatabase:Source docstring:
Master registry of security weaknesses and automated patch strategies.
Kind: Method
Source: tzero/tzero_pc_fixer.py:928-929
Signature:
def get_by_cwe(cls, cwe_id: str) -> Optional[CWERuleDefinition]:Source docstring: none; consult the linked implementation instead of inferring behavior.
Kind: Method
Source: tzero/tzero_pc_fixer.py:932-934
Signature:
def list_by_owasp(cls, owasp_cat: str) -> List[CWERuleDefinition]:Source docstring: none; consult the linked implementation instead of inferring behavior.
Kind: Method
Source: tzero/tzero_pc_fixer.py:937-942
Signature:
def search_rules(cls, query: str) -> List[CWERuleDefinition]:Source docstring: none; consult the linked implementation instead of inferring behavior.
Kind: Method
Source: tzero/tzero_pc_fixer.py:945-946
Signature:
def export_catalog_json(cls) -> str:Source docstring: none; consult the linked implementation instead of inferring behavior.
Kind: Class
Source: tzero/tzero_pc_fixer.py:954-962
Declaration:
class DetailedSecurityRule(NamedTuple):Source docstring: none; consult the linked implementation instead of inferring behavior.
Kind: Class
Source: tzero/tzero_pc_fixer.py:1044-1053
Declaration:
class DeepSecurityCatalog:Source docstring:
Registry engine providing fast rule matching and compliance checks.
Kind: Method
Source: tzero/tzero_pc_fixer.py:1048-1049
Signature:
def get_rules(cls) -> List[DetailedSecurityRule]:Source docstring: none; consult the linked implementation instead of inferring behavior.
Kind: Method
Source: tzero/tzero_pc_fixer.py:1052-1053
Signature:
def get_count(cls) -> int:Source docstring: none; consult the linked implementation instead of inferring behavior.
Kind: Class
Source: tzero/tzero_pc_fixer.py:1061-1068
Declaration:
class SecurityRule(NamedTuple):Source docstring: none; consult the linked implementation instead of inferring behavior.
Kind: Class
Source: tzero/tzero_pc_fixer.py:1140-1156
Declaration:
class SecurityRulesCatalog:Source docstring:
Catalog manager providing indexed lookups and rule evaluation.
Kind: Method
Source: tzero/tzero_pc_fixer.py:1144-1145
Signature:
def get_all_rules(cls) -> List[SecurityRule]:Source docstring: none; consult the linked implementation instead of inferring behavior.
Kind: Method
Source: tzero/tzero_pc_fixer.py:1148-1149
Signature:
def get_rules_by_vendor(cls, vendor: str) -> List[SecurityRule]:Source docstring: none; consult the linked implementation instead of inferring behavior.
Kind: Method
Source: tzero/tzero_pc_fixer.py:1152-1156
Signature:
def get_rule_by_id(cls, rule_id: str) -> SecurityRule:Source docstring: none; consult the linked implementation instead of inferring behavior.
Kind: Class
Source: tzero/tzero_pc_fixer.py:1164-1173
Declaration:
class ErrorSpecification(NamedTuple):Source docstring: none; consult the linked implementation instead of inferring behavior.
Kind: Class
Source: tzero/tzero_pc_fixer.py:1430-1439
Declaration:
class KnowledgeBaseManager:Source docstring:
Provides query access and lookup for the diagnostic knowledge base.
Kind: Method
Source: tzero/tzero_pc_fixer.py:1434-1435
Signature:
def get_spec(cls, error_code: str) -> Optional[ErrorSpecification]:Source docstring: none; consult the linked implementation instead of inferring behavior.
Kind: Method
Source: tzero/tzero_pc_fixer.py:1438-1439
Signature:
def get_all_codes(cls) -> List[str]:Source docstring: none; consult the linked implementation instead of inferring behavior.
Kind: Class
Source: tzero/tzero_pc_fixer.py:1449-1495
Declaration:
class ExtendedKnowledgeEntry:Source docstring:
Detailed encyclopedia entry for a specific diagnostic defect.
Kind: Method
Source: tzero/tzero_pc_fixer.py:1464-1465
Signature:
def to_dict(self) -> Dict[str, Any]:Source docstring: none; consult the linked implementation instead of inferring behavior.
Kind: Method
Source: tzero/tzero_pc_fixer.py:1467-1495
Signature:
def to_markdown(self) -> str:Source docstring: none; consult the linked implementation instead of inferring behavior.
Kind: Class
Source: tzero/tzero_pc_fixer.py:1498-2362
Declaration:
class ExtendedKnowledgeBase:Source docstring:
Master repository and index for software defects and automated repair knowledge.
Kind: Method
Source: tzero/tzero_pc_fixer.py:2328-2329
Signature:
def get_entry(cls, code: str) -> Optional[ExtendedKnowledgeEntry]:Source docstring: none; consult the linked implementation instead of inferring behavior.
Kind: Method
Source: tzero/tzero_pc_fixer.py:2332-2334
Signature:
def list_by_category(cls, category: str) -> List[ExtendedKnowledgeEntry]:Source docstring: none; consult the linked implementation instead of inferring behavior.
Kind: Method
Source: tzero/tzero_pc_fixer.py:2337-2339
Signature:
def list_by_severity(cls, severity: str) -> List[ExtendedKnowledgeEntry]:Source docstring: none; consult the linked implementation instead of inferring behavior.
Kind: Method
Source: tzero/tzero_pc_fixer.py:2342-2351
Signature:
def search_by_keyword(cls, query: str) -> List[ExtendedKnowledgeEntry]:Source docstring: none; consult the linked implementation instead of inferring behavior.
Kind: Method
Source: tzero/tzero_pc_fixer.py:2354-2358
Signature:
def export_all_markdown(cls) -> str:Source docstring: none; consult the linked implementation instead of inferring behavior.
Kind: Method
Source: tzero/tzero_pc_fixer.py:2361-2362
Signature:
def export_all_json(cls) -> str:Source docstring: none; consult the linked implementation instead of inferring behavior.
Kind: Class
Source: tzero/tzero_pc_fixer.py:2373-2385
Declaration:
class SystemRepairRecipe:Source docstring:
Executable repair recipe for a specific operating system or toolchain defect.
Kind: Class
Source: tzero/tzero_pc_fixer.py:2388-2783
Declaration:
class SystemRepairPlaybooks:Source docstring:
Exhaustive catalog and execution engine for cross-platform system repair recipes.
Kind: Method
Source: tzero/tzero_pc_fixer.py:2746-2747
Signature:
def get_recipe(cls, recipe_id: str) -> Optional[SystemRepairRecipe]:Source docstring: none; consult the linked implementation instead of inferring behavior.
Kind: Method
Source: tzero/tzero_pc_fixer.py:2750-2751
Signature:
def find_recipe_for_issue(cls, diagnostic_code: str) -> Optional[SystemRepairRecipe]:Source docstring: none; consult the linked implementation instead of inferring behavior.
Kind: Method
Source: tzero/tzero_pc_fixer.py:2754-2758
Signature:
def list_recipes_for_platform(cls, target_platform: SystemPlatform) -> List[SystemRepairRecipe]:Source docstring: none; consult the linked implementation instead of inferring behavior.
Kind: Method
Source: tzero/tzero_pc_fixer.py:2761-2783
Signature:
def execute_recipe_command(cls, recipe: SystemRepairRecipe, dry_run: bool = False) -> Tuple[bool, str]:Source docstring:
Executes the appropriate platform command for a given repair recipe.
Kind: Class
Source: tzero/tzero_pc_fixer.py:2792-3256
Declaration:
class OSDoctor:Source docstring:
Enterprise-grade diagnostic engine for OS, hardware, filesystem, and CLI tools.
Kind: Method
Source: tzero/tzero_pc_fixer.py:2821-2822
Signature:
def get_system_platform(cls) -> SystemPlatform:Source docstring: none; consult the linked implementation instead of inferring behavior.
Kind: Method
Source: tzero/tzero_pc_fixer.py:2825-2878
Signature:
def get_hardware_metrics(cls) -> Tuple[float, float, int]:Source docstring:
Returns (total_ram_gb, available_ram_gb, cpu_cores).
Kind: Class
Source: tzero/tzero_pc_fixer.py:2846-2857
Declaration:
class MEMORYSTATUSEX(ctypes.Structure):Source docstring: none; consult the linked implementation instead of inferring behavior.
Kind: Method
Source: tzero/tzero_pc_fixer.py:2881-2926
Signature:
def probe_tool(cls, name: str, min_version: str = '0.0.0', purpose: str = '') -> ToolStatus:Source docstring:
Probe executable existence, PATH location, and version string.
Kind: Method
Source: tzero/tzero_pc_fixer.py:2931-2941
Signature:
def probe_all_tools(cls, use_cache: bool = True) -> Dict[str, ToolStatus]:Source docstring:
Run deep toolchain detection across critical and secondary developer tools.
Kind: Method
Source: tzero/tzero_pc_fixer.py:2944-2980
Signature:
def check_windows_registry_settings(cls) -> List[DiagnosticIssue]:Source docstring:
Inspect critical Windows registry settings (LongPathsEnabled, Python shims).
Kind: Method
Source: tzero/tzero_pc_fixer.py:2983-3029
Signature:
def check_path_environment(cls) -> List[DiagnosticIssue]:Source docstring:
Check system PATH for invalid directories, dead shims, and redundant entries.
Kind: Method
Source: tzero/tzero_pc_fixer.py:3032-3083
Signature:
def check_file_locks_and_permissions(cls, workspace_dir: str = '.') -> List[DiagnosticIssue]:Source docstring:
Inspect workspace files for exclusive file locks, read-only bits, and stale git locks.
Kind: Method
Source: tzero/tzero_pc_fixer.py:3086-3134
Signature:
def check_bytecode_and_temp_bloat(cls, workspace_dir: str = '.') -> List[DiagnosticIssue]:Source docstring:
Scan for orphaned .pyc files, corrupted __pycache__, and test cache bloat.
Kind: Method
Source: tzero/tzero_pc_fixer.py:3137-3166
Signature:
def capture_snapshot(cls, workspace_dir: str = '.') -> EnvironmentSnapshot:Source docstring:
Capture comprehensive state snapshot of the active host environment.
Kind: Method
Source: tzero/tzero_pc_fixer.py:3169-3256
Signature:
def execute_os_heals(cls, issues: List[DiagnosticIssue], dry_run: bool = False) -> List[HealAction]:Source docstring:
Execute autonomous healing on OS, file lock, and cache issues.
Kind: Class
Source: tzero/tzero_pc_fixer.py:3267-3274
Declaration:
class DiskPartitionHealth:Source docstring: none; consult the linked implementation instead of inferring behavior.
Kind: Class
Source: tzero/tzero_pc_fixer.py:3278-3283
Declaration:
class NetworkPortStatus:Source docstring: none; consult the linked implementation instead of inferring behavior.
Kind: Class
Source: tzero/tzero_pc_fixer.py:3287-3297
Declaration:
class ExtendedDiagnosticSummary:Source docstring: none; consult the linked implementation instead of inferring behavior.
Kind: Class
Source: tzero/tzero_pc_fixer.py:3300-3716
Declaration:
class ExtendedSystemDiagnostics:Source docstring:
Exhaustive low-overhead system inspection engine for software engineering workstations.
Strictly reads OS signals without modifying system state or making external API calls.
Kind: Method
Source: tzero/tzero_pc_fixer.py:3325-3327
Signature:
def __init__(self, workspace_path: Optional[str] = None):Source docstring: none; consult the linked implementation instead of inferring behavior.
Kind: Method
Source: tzero/tzero_pc_fixer.py:3329-3337
Signature:
def _detect_platform(self) -> SystemPlatform:Source docstring: none; consult the linked implementation instead of inferring behavior.
Kind: Method
Source: tzero/tzero_pc_fixer.py:3342-3421
Signature:
def inspect_disk_health(self) -> Tuple[List[DiskPartitionHealth], List[DiagnosticIssue]]:Source docstring:
Scans mount points and current working drive for disk space thresholds.
Emits warning (>85% used) and critical (>95% used or <2GB free) issues.
Kind: Method
Source: tzero/tzero_pc_fixer.py:3423-3452
Signature:
def inspect_temp_directory_exhaustion(self) -> Tuple[bool, List[DiagnosticIssue]]:Source docstring:
Checks if system temp directory is cluttered with >5,000 stale temp files
or large abandoned build directories.
Kind: Method
Source: tzero/tzero_pc_fixer.py:3457-3495
Signature:
def inspect_dev_ports(self) -> Tuple[List[NetworkPortStatus], List[DiagnosticIssue]]:Source docstring:
Fast local socket scan across standard development server ports.
Identifies ports already bound which might cause 'EADDRINUSE' errors.
Kind: Method
Source: tzero/tzero_pc_fixer.py:3500-3571
Signature:
def inspect_windows_registry_policies(self) -> List[DiagnosticIssue]:Source docstring:
Checks critical Windows developer settings via registry inspection:
1. LongPathsEnabled (avoids 260 character MAX_PATH failures in node_modules and python venvs)
2. DeveloperMode (allows symlink creation without UAC elevation)
Kind: Method
Source: tzero/tzero_pc_fixer.py:3576-3624
Signature:
def inspect_posix_permissions(self) -> List[DiagnosticIssue]:Source docstring:
Verifies correct permissions on user SSH keys, git credentials, and tmp directory.
Kind: Method
Source: tzero/tzero_pc_fixer.py:3629-3676
Signature:
def inspect_stale_build_artifacts(self) -> Tuple[List[str], List[DiagnosticIssue]]:Source docstring:
Detects massive accumulations of build artifacts, test caches, and orphaned locks
in the workspace (`.pytest_cache`, `.mypy_cache`, `.ruff_cache`, `target/`, `dist/`).
Kind: Method
Source: tzero/tzero_pc_fixer.py:3681-3716
Signature:
def run_all_extended_diagnostics(self) -> Tuple[ExtendedDiagnosticSummary, List[DiagnosticIssue]]:Source docstring:
Executes all extended diagnostics in parallel-safe, zero-side-effect mode.
Returns aggregate summary and normalized DiagnosticIssues.
Kind: Class
Source: tzero/tzero_pc_fixer.py:3726-4002
Declaration:
class VenvDoctor:Source docstring:
Specialized doctor for Python virtual environments and dependency topologies.
Kind: Method
Source: tzero/tzero_pc_fixer.py:3732-3740
Signature:
def detect_workspace_venvs(cls, workspace_dir: str = '.') -> List[Path]:Source docstring:
Locate all local virtualenv directories in workspace root.
Kind: Method
Source: tzero/tzero_pc_fixer.py:3743-3757
Signature:
def parse_pyvenv_cfg(cls, cfg_path: Path) -> Dict[str, str]:Source docstring:
Parse key-value pairs from a pyvenv.cfg file.
Kind: Method
Source: tzero/tzero_pc_fixer.py:3760-3786
Signature:
def inspect_virtualenv(cls, venv_dir: Path) -> Tuple[bool, Optional[str], Dict[str, Any]]:Source docstring:
Validate virtualenv structure, pyvenv.cfg, and interpreter binary.
Kind: Method
Source: tzero/tzero_pc_fixer.py:3789-3809
Signature:
def parse_requirements_file(cls, req_file: Path) -> List[Tuple[str, Optional[str]]]:Source docstring:
Extract package names and version specifiers from requirements.txt.
Kind: Method
Source: tzero/tzero_pc_fixer.py:3812-3844
Signature:
def check_dependency_drift(cls, workspace_dir: str = '.') -> List[DiagnosticIssue]:Source docstring:
Cross-reference requirements against currently installed packages.
Kind: Method
Source: tzero/tzero_pc_fixer.py:3847-3884
Signature:
def check_corrupted_site_packages(cls, venv_dir: Path) -> List[DiagnosticIssue]:Source docstring:
Scan site-packages for empty or corrupted .dist-info / .egg-info remnants.
Kind: Method
Source: tzero/tzero_pc_fixer.py:3887-3930
Signature:
def diagnose(cls, workspace_dir: str = '.') -> List[DiagnosticIssue]:Source docstring:
Run complete virtualenv diagnostic suite.
Kind: Method
Source: tzero/tzero_pc_fixer.py:3933-4002
Signature:
def execute_venv_heals(cls, issues: List[DiagnosticIssue], dry_run: bool = False) -> List[HealAction]:Source docstring:
Execute autonomous healing on virtualenv configurations and corruptions.
Kind: Class
Source: tzero/tzero_pc_fixer.py:4011-4440
Declaration:
class ASTSyntaxHealer:Source docstring:
Enterprise AST parser and surgical auto-repair engine for source code syntax defects.
Kind: Method
Source: tzero/tzero_pc_fixer.py:4022-4063
Signature:
def scan_encoding_and_invisible_chars(cls, file_path: str, raw_bytes: bytes) -> List[DiagnosticIssue]:Source docstring:
Detect UTF-8 BOM and phantom zero-width spaces that disrupt lexers.
Kind: Method
Source: tzero/tzero_pc_fixer.py:4066-4112
Signature:
def detect_mixed_indentation(cls, file_path: str, content: str) -> List[DiagnosticIssue]:Source docstring:
Detect mixed tabs and spaces causing TabError or inconsistent blocks.
Kind: Method
Source: tzero/tzero_pc_fixer.py:4115-4161
Signature:
def analyze_syntax_error(cls, file_path: str, content: str, err: SyntaxError) -> DiagnosticIssue:Source docstring:
Analyze Python SyntaxError traceback to determine surgical repair strategy.
Kind: Method
Source: tzero/tzero_pc_fixer.py:4164-4218
Signature:
def scan_python_idioms_and_regex(cls, file_path: str, content: str) -> List[DiagnosticIssue]:Source docstring:
Detect legacy Python 2 idioms and invalid regex escape sequences.
Kind: Method
Source: tzero/tzero_pc_fixer.py:4221-4251
Signature:
def heal_string(cls, content: str, filename: str = 'snippet.py') -> Any:Source docstring:
In-memory string healing helper for syntax errors, colons, BOM, and legacy idioms.
Kind: Class
Source: tzero/tzero_pc_fixer.py:4224-4228
Declaration:
class StringHealResult:Source docstring: none; consult the linked implementation instead of inferring behavior.
Kind: Method
Source: tzero/tzero_pc_fixer.py:4254-4297
Signature:
def diagnose_file(cls, file_path: str) -> List[DiagnosticIssue]:Source docstring:
Scan a single source file for all syntax, encoding, and idiom defects.
Kind: Method
Source: tzero/tzero_pc_fixer.py:4300-4440
Signature:
def execute_syntax_heals(cls, issues: List[DiagnosticIssue], dry_run: bool = False) -> List[HealAction]:Source docstring:
Execute surgical regex and line-level patches to heal syntax flaws.
Kind: Class
Source: tzero/tzero_pc_fixer.py:4449-4831
Declaration:
class ImportGraphHealer:Source docstring:
Graph-theoretic dependency analyzer and surgical import injector.
Kind: Method
Source: tzero/tzero_pc_fixer.py:4546-4568
Signature:
def check_stdlib_shadowing(cls, workspace_dir: str = '.') -> List[DiagnosticIssue]:Source docstring:
Detect workspace files that dangerously shadow Python standard library modules.
Kind: Method
Source: tzero/tzero_pc_fixer.py:4571-4591
Signature:
def scan_file_imports_and_references(cls, file_path: str, tree: ast.AST) -> Tuple[Set[str], Set[str], List[ast.AST]]:Source docstring:
Extract imported symbols, referenced names, and import AST nodes.
Kind: Method
Source: tzero/tzero_pc_fixer.py:4594-4616
Signature:
def detect_missing_stdlib_imports(cls, file_path: str, content: str, tree: ast.AST) -> List[DiagnosticIssue]:Source docstring:
Detect standard library symbols used in code without being imported.
Kind: Method
Source: tzero/tzero_pc_fixer.py:4619-4638
Signature:
def detect_wildcard_imports(cls, file_path: str, tree: ast.AST) -> List[DiagnosticIssue]:Source docstring:
Detect wildcard 'from module import *' anti-patterns.
Kind: Method
Source: tzero/tzero_pc_fixer.py:4641-4680
Signature:
def build_workspace_import_graph(cls, workspace_dir: str = '.') -> Tuple[Dict[str, Set[str]], Dict[str, str]]:Source docstring:
Construct directed import graph (module_name -> set of imported module_names).
Kind: Method
Source: tzero/tzero_pc_fixer.py:4683-4722
Signature:
def find_circular_import_cycles(cls, graph: Dict[str, Set[str]]) -> List[List[str]]:Source docstring:
Find all circular import cycles using Tarjan's Strongly Connected Components algorithm.
Kind: Nested function
Source: tzero/tzero_pc_fixer.py:4692-4716
Signature:
def strongconnect(node: str):Source docstring: none; consult the linked implementation instead of inferring behavior.
Kind: Method
Source: tzero/tzero_pc_fixer.py:4725-4768
Signature:
def diagnose_workspace(cls, workspace_dir: str = '.') -> List[DiagnosticIssue]:Source docstring:
Diagnose standard library shadowing, wildcard imports, missing imports, and cycles.
Kind: Method
Source: tzero/tzero_pc_fixer.py:4771-4831
Signature:
def execute_import_heals(cls, issues: List[DiagnosticIssue], dry_run: bool = False) -> List[HealAction]:Source docstring:
Inject missing standard imports at top of source files.
Kind: Class
Source: tzero/tzero_pc_fixer.py:4840-5066
Declaration:
class CodeSmellsHealer:Source docstring:
AST visitor and transformer for eliminating code smells and anti-patterns.
Kind: Method
Source: tzero/tzero_pc_fixer.py:4851-4869
Signature:
def scan_bare_excepts(cls, file_path: str, tree: ast.AST) -> List[DiagnosticIssue]:Source docstring:
Detect bare 'except:' clauses that intercept KeyboardInterrupt and SystemExit.
Kind: Method
Source: tzero/tzero_pc_fixer.py:4872-4892
Signature:
def scan_mutable_defaults(cls, file_path: str, tree: ast.AST) -> List[DiagnosticIssue]:Source docstring:
Detect mutable default arguments in function signatures (def fn(x=[]):).
Kind: Method
Source: tzero/tzero_pc_fixer.py:4895-4920
Signature:
def scan_deprecated_apis(cls, file_path: str, content: str) -> List[DiagnosticIssue]:Source docstring:
Detect usage of removed or deprecated Python standard library functions.
Kind: Method
Source: tzero/tzero_pc_fixer.py:4923-4944
Signature:
def scan_quadratic_string_concat(cls, file_path: str, tree: ast.AST) -> List[DiagnosticIssue]:Source docstring:
Detect quadratic string concatenation (s += ...) inside loops.
Kind: Method
Source: tzero/tzero_pc_fixer.py:4947-4977
Signature:
def heal_code_smells(cls, content: str, filename: str = 'snippet.py') -> Any:Source docstring:
In-memory code smell repair helper.
Kind: Class
Source: tzero/tzero_pc_fixer.py:4950-4954
Declaration:
class StringHealResult:Source docstring: none; consult the linked implementation instead of inferring behavior.
Kind: Method
Source: tzero/tzero_pc_fixer.py:4980-4999
Signature:
def diagnose_file(cls, file_path: str) -> List[DiagnosticIssue]:Source docstring:
Scan file for code smells, anti-patterns, and deprecated APIs.
Kind: Method
Source: tzero/tzero_pc_fixer.py:5002-5066
Signature:
def execute_smell_heals(cls, issues: List[DiagnosticIssue], dry_run: bool = False) -> List[HealAction]:Source docstring:
Execute surgical repairs for bare excepts, mutable defaults, and deprecated APIs.
Kind: Class
Source: tzero/tzero_pc_fixer.py:5075-5330
Declaration:
class ASTTypeModernizer:Source docstring:
AST visitor and transformer for upgrading type hints to modern Python standards.
Kind: Method
Source: tzero/tzero_pc_fixer.py:5088-5117
Signature:
def scan_legacy_typing_generics(cls, file_path: str, content: str) -> List[DiagnosticIssue]:Source docstring:
Detect legacy typing module collections (typing.List, typing.Dict) eligible for PEP 585.
Kind: Method
Source: tzero/tzero_pc_fixer.py:5120-5149
Signature:
def scan_legacy_optional_and_union(cls, file_path: str, content: str) -> List[DiagnosticIssue]:Source docstring:
Detect Optional[T] and Union[A, B] eligible for PEP 604 pipe syntax (A | B).
Kind: Method
Source: tzero/tzero_pc_fixer.py:5152-5196
Signature:
def scan_dataclass_mutable_fields(cls, file_path: str, tree: ast.AST) -> List[DiagnosticIssue]:Source docstring:
Detect mutable defaults directly assigned to fields in @dataclass definitions.
Kind: Method
Source: tzero/tzero_pc_fixer.py:5199-5229
Signature:
def modernize_code(cls, content: str, filename: str = 'snippet.py') -> Any:Source docstring:
In-memory type modernization helper.
Kind: Class
Source: tzero/tzero_pc_fixer.py:5202-5206
Declaration:
class StringHealResult:Source docstring: none; consult the linked implementation instead of inferring behavior.
Kind: Method
Source: tzero/tzero_pc_fixer.py:5232-5254
Signature:
def diagnose_file(cls, file_path: str) -> List[DiagnosticIssue]:Source docstring:
Scan file for all type modernization opportunities and dataclass flaws.
Kind: Method
Source: tzero/tzero_pc_fixer.py:5257-5330
Signature:
def execute_type_heals(cls, issues: List[DiagnosticIssue], dry_run: bool = False) -> List[HealAction]:Source docstring:
Execute surgical regex/AST transforms for PEP 585/604 and dataclass fields.
Kind: Class
Source: tzero/tzero_pc_fixer.py:5341-5349
Declaration:
class PerformanceFinding:Source docstring: none; consult the linked implementation instead of inferring behavior.
Kind: Class
Source: tzero/tzero_pc_fixer.py:5352-5575
Declaration:
class PerformanceProfilerHealer:Source docstring:
Analyzes AST syntax trees for algorithmic complexity degradation and memory bloat.
Provides surgical code repairs for common Python performance pitfalls.
Kind: Method
Source: tzero/tzero_pc_fixer.py:5361-5386
Signature:
def scan_quadratic_string_concat(cls, tree: ast.AST, file_path: str) -> List[DiagnosticIssue]:Source docstring:
Detects string concatenation with '+=' inside loops.
Kind: Method
Source: tzero/tzero_pc_fixer.py:5389-5424
Signature:
def scan_listcomp_reduction_allocations(cls, tree: ast.AST, file_path: str) -> List[DiagnosticIssue]:Source docstring:
Detects list comprehensions passed to reduction functions:
e.g. sum([x * 2 for x in items]) -> allocates intermediate list in memory!
Better: sum(x * 2 for x in items) -> generator expression, O(1) memory!
Kind: Method
Source: tzero/tzero_pc_fixer.py:5427-5456
Signature:
def scan_range_len_antipattern(cls, tree: ast.AST, file_path: str) -> List[DiagnosticIssue]:Source docstring:
Detects 'for i in range(len(items)): ... items[i]' anti-pattern.
Prefer 'for item in items:' or 'for i, item in enumerate(items):'.
Kind: Method
Source: tzero/tzero_pc_fixer.py:5459-5493
Signature:
def scan_unclosed_open_calls(cls, tree: ast.AST, file_path: str) -> List[DiagnosticIssue]:Source docstring:
Detects raw 'open(...)' calls not inside a 'with' context manager or assigned to a variable
without guaranteed try/finally closure.
Kind: Method
Source: tzero/tzero_pc_fixer.py:5496-5514
Signature:
def diagnose_file(cls, file_path: str) -> List[DiagnosticIssue]:Source docstring:
Scans file for all performance anti-patterns and resource leaks.
Kind: Method
Source: tzero/tzero_pc_fixer.py:5517-5575
Signature:
def execute_performance_heals(cls, issues: List[DiagnosticIssue], dry_run: bool = False) -> List[HealAction]:Source docstring:
Applies surgical optimizations such as converting sum([...]) to sum(...).
Kind: Class
Source: tzero/tzero_pc_fixer.py:5585-5859
Declaration:
class ASTStaticAnalyzer:Source docstring:
Deep AST semantic checker and defect auto-remediator.
Kind: Method
Source: tzero/tzero_pc_fixer.py:5594-5604
Signature:
def compute_cyclomatic_complexity(cls, node: ast.AST) -> int:Source docstring:
Calculate McCabe cyclomatic complexity of an AST block.
Kind: Method
Source: tzero/tzero_pc_fixer.py:5607-5625
Signature:
def check_assert_tuples(cls, file_path: str, tree: ast.AST) -> List[DiagnosticIssue]:Source docstring:
Detect 'assert (cond, msg)' bug which always evaluates to True in Python.
Kind: Method
Source: tzero/tzero_pc_fixer.py:5628-5649
Signature:
def check_is_literal_comparisons(cls, file_path: str, tree: ast.AST) -> List[DiagnosticIssue]:Source docstring:
Detect 'is' comparison with integer, string, or float literals.
Kind: Method
Source: tzero/tzero_pc_fixer.py:5652-5678
Signature:
def check_unreachable_code(cls, file_path: str, tree: ast.AST) -> List[DiagnosticIssue]:Source docstring:
Detect statements directly following unconditional return, raise, break, continue.
Kind: Method
Source: tzero/tzero_pc_fixer.py:5681-5704
Signature:
def check_duplicate_dict_keys(cls, file_path: str, tree: ast.AST) -> List[DiagnosticIssue]:Source docstring:
Detect duplicate literal keys in dictionary definitions.
Kind: Method
Source: tzero/tzero_pc_fixer.py:5707-5726
Signature:
def check_high_complexity_functions(cls, file_path: str, tree: ast.AST) -> List[DiagnosticIssue]:Source docstring:
Detect functions with McCabe cyclomatic complexity > 15.
Kind: Method
Source: tzero/tzero_pc_fixer.py:5729-5766
Signature:
def check_redundant_booleans(cls, file_path: str, content: str) -> List[DiagnosticIssue]:Source docstring:
Detect redundant '== True' or '== False' boolean comparisons.
Kind: Method
Source: tzero/tzero_pc_fixer.py:5769-5790
Signature:
def diagnose_file(cls, file_path: str) -> List[DiagnosticIssue]:Source docstring:
Run all AST static analysis checks on a source file.
Kind: Method
Source: tzero/tzero_pc_fixer.py:5793-5859
Signature:
def execute_linter_heals(cls, issues: List[DiagnosticIssue], dry_run: bool = False) -> List[HealAction]:Source docstring:
Execute surgical repairs for assert tuples, 'is' literal comparisons, and redundant booleans.
Kind: Class
Source: tzero/tzero_pc_fixer.py:5868-6180
Declaration:
class SecurityZeroLeakDoctor:Source docstring:
Enterprise 100% Zero-Leak scanner and autonomous secret remediation engine.
Kind: Method
Source: tzero/tzero_pc_fixer.py:5905-5937
Signature:
def sanitize_string(cls, content: str) -> Any:Source docstring:
Sanitizes an in-memory code string by replacing hardcoded secrets with os.environ.get(...).
Kind: Class
Source: tzero/tzero_pc_fixer.py:5908-5912
Declaration:
class StringSanitizeResult:Source docstring: none; consult the linked implementation instead of inferring behavior.
Kind: Method
Source: tzero/tzero_pc_fixer.py:5940-5976
Signature:
def scan_secrets_in_file(cls, file_path: str, content: str) -> List[DiagnosticIssue]:Source docstring:
Scan file content against high-entropy secret regular expressions.
Kind: Method
Source: tzero/tzero_pc_fixer.py:5979-6037
Signature:
def scan_insecure_functions(cls, file_path: str, tree: ast.AST) -> List[DiagnosticIssue]:Source docstring:
Scan AST for insecure eval, exec, and dangerous deserialization calls.
Kind: Method
Source: tzero/tzero_pc_fixer.py:6040-6063
Signature:
def diagnose_file(cls, file_path: str) -> List[DiagnosticIssue]:Source docstring:
Scan file for all security flaws and hardcoded credentials.
Kind: Method
Source: tzero/tzero_pc_fixer.py:6066-6180
Signature:
def execute_security_heals(cls, issues: List[DiagnosticIssue], workspace_dir: str = '.', dry_run: bool = False) -> List[HealAction]:Source docstring:
Execute autonomous remediation: migrate secrets to .env and patch yaml.load.
Kind: Class
Source: tzero/tzero_pc_fixer.py:6189-6476
Declaration:
class PolyglotConfigHealer:Source docstring:
Specialized repair engine for JSON, YAML, Gitignore, and Gitattributes files.
Kind: Method
Source: tzero/tzero_pc_fixer.py:6208-6221
Signature:
def heal_json_string(cls, content: str) -> Any:Source docstring:
Helper to repair trailing commas and single quotes in JSON strings.
Kind: Class
Source: tzero/tzero_pc_fixer.py:6211-6214
Declaration:
class JsonHealResult:Source docstring: none; consult the linked implementation instead of inferring behavior.
Kind: Method
Source: tzero/tzero_pc_fixer.py:6224-6245
Signature:
def repair_json_text(cls, text: str) -> Tuple[bool, str]:Source docstring:
Surgically repair trailing commas, single quotes, and comments in JSON.
Kind: Method
Source: tzero/tzero_pc_fixer.py:6248-6278
Signature:
def check_json_files(cls, workspace_dir: str = '.') -> List[DiagnosticIssue]:Source docstring:
Inspect all JSON files in workspace for syntax errors and trailing commas.
Kind: Method
Source: tzero/tzero_pc_fixer.py:6284-6331
Signature:
def check_gitignore_hygiene(cls, workspace_dir: str = '.') -> List[DiagnosticIssue]:Source docstring:
Verify .gitignore exists and contains critical secret patterns (.env, *.key).
Kind: Method
Source: tzero/tzero_pc_fixer.py:6337-6357
Signature:
def check_gitattributes(cls, workspace_dir: str = '.') -> List[DiagnosticIssue]:Source docstring:
Verify .gitattributes exists to prevent cross-platform CRLF/LF chaos.
Kind: Method
Source: tzero/tzero_pc_fixer.py:6360-6366
Signature:
def diagnose_workspace(cls, workspace_dir: str = '.') -> List[DiagnosticIssue]:Source docstring:
Run all polyglot configuration and git hygiene audits.
Kind: Method
Source: tzero/tzero_pc_fixer.py:6369-6476
Signature:
def execute_config_heals(cls, issues: List[DiagnosticIssue], dry_run: bool = False) -> List[HealAction]:Source docstring:
Execute repairs for JSON files, .gitignore, and .gitattributes.
Kind: Class
Source: tzero/tzero_pc_fixer.py:6487-6492
Declaration:
class LintFixResult:Source docstring: none; consult the linked implementation instead of inferring behavior.
Kind: Class
Source: tzero/tzero_pc_fixer.py:6498-6620
Declaration:
class MarkdownLinterHealer:Source docstring:
Scans and surgically repairs Markdown files without destroying code fences or inline formatting.
Kind: Method
Source: tzero/tzero_pc_fixer.py:6504-6620
Signature:
def lint_and_heal(file_path: str, content: str) -> LintFixResult:Source docstring: none; consult the linked implementation instead of inferring behavior.
Kind: Class
Source: tzero/tzero_pc_fixer.py:6626-6707
Declaration:
class TomlLinterHealer:Source docstring:
Lints and validates pyproject.toml, Cargo.toml, and other TOML files.
Kind: Method
Source: tzero/tzero_pc_fixer.py:6632-6707
Signature:
def lint_and_heal(file_path: str, content: str) -> LintFixResult:Source docstring: none; consult the linked implementation instead of inferring behavior.
Kind: Class
Source: tzero/tzero_pc_fixer.py:6713-6823
Declaration:
class YamlCiCdLinterHealer:Source docstring:
Validates GitHub Actions workflows and YAML deployment specs.
Kind: Method
Source: tzero/tzero_pc_fixer.py:6738-6823
Signature:
def lint_and_heal(cls, file_path: str, content: str) -> LintFixResult:Source docstring: none; consult the linked implementation instead of inferring behavior.
Kind: Class
Source: tzero/tzero_pc_fixer.py:6829-6938
Declaration:
class DockerfileDeepLinterHealer:Source docstring:
Validates Dockerfiles for security, cache optimization, and layer reduction.
Kind: Method
Source: tzero/tzero_pc_fixer.py:6835-6938
Signature:
def lint_and_heal(file_path: str, content: str) -> LintFixResult:Source docstring: none; consult the linked implementation instead of inferring behavior.
Kind: Class
Source: tzero/tzero_pc_fixer.py:6944-7011
Declaration:
class MakefileLinterHealer:Source docstring:
Diagnoses and repairs Makefile tab indentation bugs ('missing separator').
Kind: Method
Source: tzero/tzero_pc_fixer.py:6950-7011
Signature:
def lint_and_heal(file_path: str, content: str) -> LintFixResult:Source docstring: none; consult the linked implementation instead of inferring behavior.
Kind: Class
Source: tzero/tzero_pc_fixer.py:7017-7070
Declaration:
class SqlMigrationLinter:Source docstring:
Static analyzer for database schema scripts, migrations, and SQL queries.
Kind: Method
Source: tzero/tzero_pc_fixer.py:7029-7070
Signature:
def lint_file(cls, file_path: str, content: str) -> List[DiagnosticIssue]:Source docstring: none; consult the linked implementation instead of inferring behavior.
Kind: Class
Source: tzero/tzero_pc_fixer.py:7081-7085
Declaration:
class TokenMatch:Source docstring: none; consult the linked implementation instead of inferring behavior.
Kind: Class
Source: tzero/tzero_pc_fixer.py:7088-7205
Declaration:
class JavaScriptTypeScriptDoctor:Source docstring:
Lexical analyzer and anti-pattern healer for JS and TS codebases.
Kind: Method
Source: tzero/tzero_pc_fixer.py:7098-7159
Signature:
def diagnose_file(cls, file_path: str, content: str) -> List[DiagnosticIssue]:Source docstring: none; consult the linked implementation instead of inferring behavior.
Kind: Method
Source: tzero/tzero_pc_fixer.py:7162-7205
Signature:
def execute_heals(cls, issues: List[DiagnosticIssue], dry_run: bool = False) -> List[HealAction]:Source docstring: none; consult the linked implementation instead of inferring behavior.
Kind: Class
Source: tzero/tzero_pc_fixer.py:7208-7279
Declaration:
class RustToolchainDoctor:Source docstring:
Audits Rust Cargo configurations and source code patterns.
Kind: Method
Source: tzero/tzero_pc_fixer.py:7215-7252
Signature:
def diagnose_cargo_toml(cls, file_path: str, content: str) -> List[DiagnosticIssue]:Source docstring: none; consult the linked implementation instead of inferring behavior.
Kind: Method
Source: tzero/tzero_pc_fixer.py:7255-7279
Signature:
def diagnose_source_file(cls, file_path: str, content: str) -> List[DiagnosticIssue]:Source docstring: none; consult the linked implementation instead of inferring behavior.
Kind: Class
Source: tzero/tzero_pc_fixer.py:7282-7313
Declaration:
class GoToolchainDoctor:Source docstring:
Diagnostics for Go go.mod modules and source code.
Kind: Method
Source: tzero/tzero_pc_fixer.py:7286-7313
Signature:
def diagnose_go_mod(cls, file_path: str, content: str) -> List[DiagnosticIssue]:Source docstring: none; consult the linked implementation instead of inferring behavior.
Kind: Class
Source: tzero/tzero_pc_fixer.py:7316-7359
Declaration:
class ShellScriptDoctor:Source docstring:
Diagnostics for Bash and POSIX shell scripts (.sh).
Kind: Method
Source: tzero/tzero_pc_fixer.py:7320-7359
Signature:
def diagnose_file(cls, file_path: str, content: str) -> List[DiagnosticIssue]:Source docstring: none; consult the linked implementation instead of inferring behavior.
Kind: Class
Source: tzero/tzero_pc_fixer.py:7369-7711
Declaration:
class PolyglotDoctor:Source docstring:
Specialized doctor for polyglot language toolchains and container configurations.
Kind: Method
Source: tzero/tzero_pc_fixer.py:7381-7476
Signature:
def check_nodejs_project(cls, workspace_dir: str = '.') -> List[DiagnosticIssue]:Source docstring:
Inspect package.json, package-lock.json, and tsconfig.json for common defects.
Kind: Method
Source: tzero/tzero_pc_fixer.py:7482-7543
Signature:
def check_rust_project(cls, workspace_dir: str = '.') -> List[DiagnosticIssue]:Source docstring:
Inspect Cargo.toml and target directory for Rust projects.
Kind: Method
Source: tzero/tzero_pc_fixer.py:7549-7590
Signature:
def check_go_project(cls, workspace_dir: str = '.') -> List[DiagnosticIssue]:Source docstring:
Inspect go.mod and go.sum files in Go workspaces.
Kind: Method
Source: tzero/tzero_pc_fixer.py:7596-7647
Signature:
def check_dockerfiles(cls, workspace_dir: str = '.') -> List[DiagnosticIssue]:Source docstring:
Inspect Dockerfile and compose manifests for security and performance smells.
Kind: Method
Source: tzero/tzero_pc_fixer.py:7653-7700
Signature:
def check_ci_workflows(cls, workspace_dir: str = '.') -> List[DiagnosticIssue]:Source docstring:
Inspect .github/workflows YAML manifests for syntax flaws and security issues.
Kind: Method
Source: tzero/tzero_pc_fixer.py:7703-7711
Signature:
def diagnose_workspace(cls, workspace_dir: str = '.') -> List[DiagnosticIssue]:Source docstring:
Run all polyglot ecosystem diagnostic checks.
Kind: Class
Source: tzero/tzero_pc_fixer.py:7722-7728
Declaration:
class CodeCloneBlock:Source docstring: none; consult the linked implementation instead of inferring behavior.
Kind: Class
Source: tzero/tzero_pc_fixer.py:7732-7736
Declaration:
class DuplicateCloneGroup:Source docstring: none; consult the linked implementation instead of inferring behavior.
Kind: Class
Source: tzero/tzero_pc_fixer.py:7739-7838
Declaration:
class ASTDuplicityRefactorer:Source docstring:
Scans workspaces for copy-pasted functions and compound statement blocks (6+ lines).
Uses normalized AST subtree hashing for language-level clone detection.
Kind: Method
Source: tzero/tzero_pc_fixer.py:7748-7753
Signature:
def _normalize_ast_node(cls, node: ast.AST) -> str:Source docstring:
Serializes AST structure discarding line numbers and variable names for Type-2 detection.
Kind: Method
Source: tzero/tzero_pc_fixer.py:7756-7784
Signature:
def scan_file_for_clones(cls, file_path: str, content: str) -> List[CodeCloneBlock]:Source docstring:
Extracts candidate compound statement blocks eligible for clone comparison.
Kind: Method
Source: tzero/tzero_pc_fixer.py:7787-7838
Signature:
def find_duplicate_groups(cls, workspace_dir: str = '.') -> Tuple[List[DuplicateCloneGroup], List[DiagnosticIssue]]:Source docstring:
Scans workspace directory for duplicate clone clusters.
Kind: Class
Source: tzero/tzero_pc_fixer.py:7849-7855
Declaration:
class BenchmarkScenario:Source docstring: none; consult the linked implementation instead of inferring behavior.
Kind: Class
Source: tzero/tzero_pc_fixer.py:7859-7868
Declaration:
class BenchmarkResult:Source docstring: none; consult the linked implementation instead of inferring behavior.
Kind: Class
Source: tzero/tzero_pc_fixer.py:7871-7988
Declaration:
class FixerBenchmarkSuite:Source docstring:
Automated benchmark harness for evaluating T-Zero self-healing capabilities.
Kind: Method
Source: tzero/tzero_pc_fixer.py:7912-7970
Signature:
def run_benchmark(cls) -> BenchmarkResult:Source docstring:
Run all 27 synthetic defect scenarios in an isolated temp sandbox.
Kind: Method
Source: tzero/tzero_pc_fixer.py:7973-7988
Signature:
def render_benchmark_report(cls, res: BenchmarkResult):Source docstring:
Render beautiful ANSI benchmark dashboard.
Kind: Class
Source: tzero/tzero_pc_fixer.py:7999-8006
Declaration:
class RegressionTestCase:Source docstring: none; consult the linked implementation instead of inferring behavior.
Kind: Class
Source: tzero/tzero_pc_fixer.py:8010-8015
Declaration:
class RegressionResult:Source docstring: none; consult the linked implementation instead of inferring behavior.
Kind: Class
Source: tzero/tzero_pc_fixer.py:8018-8547
Declaration:
class AutomatedRegressionSuite:Source docstring:
Exhaustive regression test suite containing 100+ diagnostic & repair scenarios.
Ensures 0 regressions and 100% mathematical fidelity across all T-Zero healers.
Kind: Method
Source: tzero/tzero_pc_fixer.py:8458-8547
Signature:
def run_suite(cls) -> RegressionResult:Source docstring:
Executes all scenarios, runs healers, checks assertions, and verifies AST parses.
Kind: Class
Source: tzero/tzero_pc_fixer.py:8557-8605
Declaration:
class GitHookIntegrator:Source docstring:
Installs and manages git pre-commit and pre-push hooks.
Kind: Method
Source: tzero/tzero_pc_fixer.py:8582-8605
Signature:
def install_hooks(cls, workspace_dir: str = '.') -> Tuple[bool, str]:Source docstring:
Installs pre-commit hook script into .git/hooks/pre-commit.
Kind: Class
Source: tzero/tzero_pc_fixer.py:8608-8658
Declaration:
class CiCdWorkflowGenerator:Source docstring:
Generates CI/CD quality gate workflow configurations.
Kind: Method
Source: tzero/tzero_pc_fixer.py:8612-8658
Signature:
def generate_github_workflow(cls, workspace_dir: str = '.') -> Tuple[bool, str]:Source docstring:
Generates .github/workflows/tzero_gate.yml.
Kind: Class
Source: tzero/tzero_pc_fixer.py:8661-8734
Declaration:
class SarifReportExporter:Source docstring:
Converts T-Zero diagnostic reports into SARIF 2.1.0 standard schema.
Kind: Method
Source: tzero/tzero_pc_fixer.py:8665-8734
Signature:
def export_sarif(cls, issues: List[DiagnosticIssue], workspace_dir: str = '.') -> str:Source docstring:
Serializes issues into official OASIS SARIF v2.1.0 JSON.
Kind: Class
Source: tzero/tzero_pc_fixer.py:8737-8767
Declaration:
class JUnitXmlExporter:Source docstring:
Exports diagnostic issues to JUnit XML for dashboard reporting.
Kind: Method
Source: tzero/tzero_pc_fixer.py:8741-8767
Signature:
def export_junit_xml(cls, issues: List[DiagnosticIssue]) -> str:Source docstring:
Generates standard JUnit XML testsuite element.
Kind: Class
Source: tzero/tzero_pc_fixer.py:8778-8788
Declaration:
class E2EVerificationReport:Source docstring: none; consult the linked implementation instead of inferring behavior.
Kind: Class
Source: tzero/tzero_pc_fixer.py:8791-8963
Declaration:
class SyntheticWorkspaceGenerator:Source docstring:
Constructs high-fidelity synthetic repositories with deliberate defects for automated verification.
Kind: Method
Source: tzero/tzero_pc_fixer.py:8797-8900
Signature:
def create_synthetic_workspace(cls, target_dir: Optional[str] = None) -> str:Source docstring:
Creates a temporary directory populated with realistic project files containing
deliberate defects across syntax, imports, secrets, configs, and environment.
Kind: Method
Source: tzero/tzero_pc_fixer.py:8903-8963
Signature:
def run_e2e_self_healing_verification(cls, workspace_dir: Optional[str] = None) -> E2EVerificationReport:Source docstring:
Executes end-to-end diagnosis, auto-healing, re-diagnosis, and atomic rollback verification.
Kind: Class
Source: tzero/tzero_pc_fixer.py:8975-8983
Declaration:
class VulnerabilityAdvisory:Source docstring: none; consult the linked implementation instead of inferring behavior.
Kind: Class
Source: tzero/tzero_pc_fixer.py:8986-9246
Declaration:
class DependencyVulnerabilityAuditor:Source docstring:
Scans project dependency files offline against known CVE security advisories.
Kind: Method
Source: tzero/tzero_pc_fixer.py:9148-9153
Signature:
def _parse_version_tuple(cls, ver_str: str) -> Tuple[int, ...]:Source docstring: none; consult the linked implementation instead of inferring behavior.
Kind: Method
Source: tzero/tzero_pc_fixer.py:9156-9195
Signature:
def scan_requirements_txt(cls, file_path: str, content: str) -> List[DiagnosticIssue]:Source docstring: none; consult the linked implementation instead of inferring behavior.
Kind: Method
Source: tzero/tzero_pc_fixer.py:9198-9246
Signature:
def execute_upgrades(cls, issues: List[DiagnosticIssue], dry_run: bool = False) -> List[HealAction]:Source docstring: none; consult the linked implementation instead of inferring behavior.
Kind: Class
Source: tzero/tzero_pc_fixer.py:9257-9322
Declaration:
class EditorConfigHealer:Source docstring:
Standardizes project .editorconfig files for uniform line endings and indentations.
Kind: Method
Source: tzero/tzero_pc_fixer.py:9279-9322
Signature:
def diagnose_and_heal(cls, workspace_dir: str = '.', dry_run: bool = False) -> Tuple[List[DiagnosticIssue], List[HealAction]]:Source docstring: none; consult the linked implementation instead of inferring behavior.
Kind: Class
Source: tzero/tzero_pc_fixer.py:9325-9425
Declaration:
class OpenApiSpecLinter:Source docstring:
Validates OpenAPI 3.0 / 3.1 REST API specification definitions.
Kind: Method
Source: tzero/tzero_pc_fixer.py:9329-9425
Signature:
def lint_openapi_dict(cls, spec: Dict[str, Any], file_path: str) -> List[DiagnosticIssue]:Source docstring: none; consult the linked implementation instead of inferring behavior.
Kind: Class
Source: tzero/tzero_pc_fixer.py:9428-9528
Declaration:
class PureJsonSchemaValidator:Source docstring:
Zero-dependency, offline JSON Schema Draft-07 / 2020-12 validator.
Validates types, required fields, numeric bounds, enums, and regular expressions.
Kind: Method
Source: tzero/tzero_pc_fixer.py:9445-9528
Signature:
def validate_instance(cls, instance: Any, schema: Dict[str, Any], path: str = '$') -> List[str]:Source docstring:
Validates a JSON-like object against schema specifications without external libs.
Kind: Class
Source: tzero/tzero_pc_fixer.py:9539-9558
Declaration:
class MicroPatch:Source docstring: none; consult the linked implementation instead of inferring behavior.
Kind: Method
Source: tzero/tzero_pc_fixer.py:9550-9558
Signature:
def to_markdown(self) -> str:Source docstring: none; consult the linked implementation instead of inferring behavior.
Kind: Class
Source: tzero/tzero_pc_fixer.py:9561-9724
Declaration:
class SmartPatchRecommender:Source docstring:
Constructs surgical, atomic patch diffs from DiagnosticIssue instances.
Kind: Method
Source: tzero/tzero_pc_fixer.py:9567-9597
Signature:
def calculate_blast_radius(cls, file_path: str, line_number: Optional[int], issue: DiagnosticIssue) -> int:Source docstring:
Computes blast radius score (0-100) based on issue category and scope:
- Line-level syntax / smell fix: Low blast radius (5 - 15)
- Function signature / mutable default: Moderate blast radius (20 - 40)
- Type annotations: Low blast radius (5 - 10)
- Security secret removal: Moderate blast radius (25 - 45)
- Global environment / config: High blast radius (50 - 80)
Kind: Method
Source: tzero/tzero_pc_fixer.py:9600-9639
Signature:
def generate_patch_from_hunk(cls, file_path: str, original_line: str, repaired_line: str, line_number: int, summary: str, issue: DiagnosticIssue) -> MicroPatch:Source docstring:
Constructs a MicroPatch object with standard unified diff header.
Kind: Method
Source: tzero/tzero_pc_fixer.py:9642-9663
Signature:
def generate_pr_review_comment(cls, patches: List[MicroPatch]) -> str:Source docstring:
Formats a list of micro-patches into a professional GitHub PR review comment.
Kind: Method
Source: tzero/tzero_pc_fixer.py:9666-9710
Signature:
def apply_patch_in_memory(cls, original_content: str, patch: MicroPatch) -> Tuple[bool, str, str]:Source docstring:
Applies unified diff in-memory to verify patch safety and test idempotency.
Returns: (success: bool, patched_content: str, error_message: str)
Kind: Method
Source: tzero/tzero_pc_fixer.py:9713-9724
Signature:
def verify_patch_idempotency(cls, original_content: str, patch: MicroPatch) -> bool:Source docstring:
Verifies that applying the patch once transforms the content,
and applying it a second time is a clean no-op.
Kind: Class
Source: tzero/tzero_pc_fixer.py:9735-9740
Declaration:
class PortConflictInfo:Source docstring: none; consult the linked implementation instead of inferring behavior.
Kind: Class
Source: tzero/tzero_pc_fixer.py:9744-9749
Declaration:
class DiskPartitionHealth:Source docstring: none; consult the linked implementation instead of inferring behavior.
Kind: Class
Source: tzero/tzero_pc_fixer.py:9752-10018
Declaration:
class HardwareAndDiskSurgeon:Source docstring:
Diagnostic and surgical engine for hardware, storage partitions, and developer ports.
Kind: Method
Source: tzero/tzero_pc_fixer.py:9758-9778
Signature:
def check_dev_port_status(cls, ports: Optional[List[int]] = None) -> List[PortConflictInfo]:Source docstring:
Scan common development ports for active listeners and identifying processes.
Kind: Method
Source: tzero/tzero_pc_fixer.py:9781-9839
Signature:
def _identify_process_on_port(cls, port: int) -> Tuple[Optional[int], Optional[str], Optional[str]]:Source docstring:
Identify the PID and process name bound to a specific local TCP port.
Kind: Method
Source: tzero/tzero_pc_fixer.py:9842-9865
Signature:
def diagnose_port_conflicts(cls) -> Tuple[List[DiagnosticIssue], List[HealAction]]:Source docstring:
Detect development port collisions blocking application startup.
Kind: Method
Source: tzero/tzero_pc_fixer.py:9868-9909
Signature:
def kill_process_on_port(cls, port: int, dry_run: bool = False) -> HealAction:Source docstring:
Safely terminate a rogue process occupying a required development port.
Kind: Method
Source: tzero/tzero_pc_fixer.py:9912-9953
Signature:
def check_disk_partitions_health(cls) -> List[DiskPartitionHealth]:Source docstring:
Inspect all available storage volumes for low disk space conditions.
Kind: Method
Source: tzero/tzero_pc_fixer.py:9958-9968
Signature:
def terminate_process(cls, pid: int) -> bool:Source docstring:
Terminate process by PID across platforms.
Kind: Method
Source: tzero/tzero_pc_fixer.py:9971-10018
Signature:
def diagnose_disk_and_memory(cls) -> List[DiagnosticIssue]:Source docstring:
Audit storage and RAM boundaries across host machine.
Kind: Class
Source: tzero/tzero_pc_fixer.py:10029-10033
Declaration:
class DistInfoMetadata:Source docstring: none; consult the linked implementation instead of inferring behavior.
Kind: Class
Source: tzero/tzero_pc_fixer.py:10037-10041
Declaration:
class AbiBinaryIssue:Source docstring: none; consult the linked implementation instead of inferring behavior.
Kind: Class
Source: tzero/tzero_pc_fixer.py:10044-10311
Declaration:
class PackagingAbiSurgeon:Source docstring:
Specialist engine for Python packaging standards, build systems, and binary ABI alignment.
Kind: Method
Source: tzero/tzero_pc_fixer.py:10067-10109
Signature:
def diagnose_workspace(cls, workspace_path: str) -> List[DiagnosticIssue]:Source docstring:
Diagnose packaging and ABI issues across the workspace root and virtual environments.
Kind: Method
Source: tzero/tzero_pc_fixer.py:10112-10158
Signature:
def _audit_pyproject(cls, pyproject_path: Path) -> List[DiagnosticIssue]:Source docstring:
Audit pyproject.toml for missing build-system, invalid backends, or broken syntax.
Kind: Method
Source: tzero/tzero_pc_fixer.py:10161-10190
Signature:
def _audit_pyvenv_cfg(cls, cfg_path: Path) -> List[DiagnosticIssue]:Source docstring:
Audit pyvenv.cfg for broken home directory pointers.
Kind: Method
Source: tzero/tzero_pc_fixer.py:10193-10210
Signature:
def _locate_site_packages(cls, venv_dir: Path) -> List[Path]:Source docstring:
Locate site-packages directories inside a virtual environment across platforms.
Kind: Method
Source: tzero/tzero_pc_fixer.py:10213-10241
Signature:
def _audit_site_packages(cls, sp_dir: Path) -> List[DiagnosticIssue]:Source docstring:
Check for duplicate .dist-info versions and leftover installation locks.
Kind: Method
Source: tzero/tzero_pc_fixer.py:10244-10311
Signature:
def heal_issue(cls, issue: DiagnosticIssue, dry_run: bool = False) -> HealAction:Source docstring:
Autonomously heal packaging and virtual environment ABI issues.
Kind: Class
Source: tzero/tzero_pc_fixer.py:10323-10326
Declaration:
class GitLockInfo:Source docstring: none; consult the linked implementation instead of inferring behavior.
Kind: Class
Source: tzero/tzero_pc_fixer.py:10330-10334
Declaration:
class GitRebaseState:Source docstring: none; consult the linked implementation instead of inferring behavior.
Kind: Class
Source: tzero/tzero_pc_fixer.py:10337-10560
Declaration:
class GitAdvancedSurgeon:Source docstring:
Diagnostic and surgical engine for Git repositories and VCS integrity.
Kind: Method
Source: tzero/tzero_pc_fixer.py:10343-10425
Signature:
def diagnose_workspace(cls, workspace_path: str) -> List[DiagnosticIssue]:Source docstring:
Diagnose all Git VCS issues in the workspace.
Kind: Method
Source: tzero/tzero_pc_fixer.py:10428-10446
Signature:
def _find_git_locks(cls, git_dir: Path) -> List[GitLockInfo]:Source docstring:
Find any lock files in .git directory and compute their age.
Kind: Method
Source: tzero/tzero_pc_fixer.py:10449-10458
Signature:
def _check_rebase_state(cls, git_dir: Path) -> GitRebaseState:Source docstring:
Check if Git is currently in rebase, merge, or cherry-pick states.
Kind: Method
Source: tzero/tzero_pc_fixer.py:10461-10470
Signature:
def _is_detached_head(cls, repo_root: Path) -> bool:Source docstring:
Determine if HEAD is currently detached.
Kind: Method
Source: tzero/tzero_pc_fixer.py:10473-10495
Signature:
def _audit_submodules(cls, repo_root: Path) -> List[DiagnosticIssue]:Source docstring:
Audit submodules listed in .gitmodules.
Kind: Method
Source: tzero/tzero_pc_fixer.py:10498-10560
Signature:
def heal_issue(cls, issue: DiagnosticIssue, dry_run: bool = False) -> HealAction:Source docstring:
Autonomously heal Git repository issues.
Kind: Class
Source: tzero/tzero_pc_fixer.py:10571-10899
Declaration:
class PolyglotBuildHealer:Source docstring:
Surgeon for polyglot build scripts, container files, and infrastructure recipes.
Kind: Method
Source: tzero/tzero_pc_fixer.py:10575-10605
Signature:
def diagnose_workspace(cls, workspace_path: str) -> List[DiagnosticIssue]:Source docstring:
Audit build and container files across the workspace.
Kind: Method
Source: tzero/tzero_pc_fixer.py:10608-10612
Signature:
def _is_ignored(cls, p: Path) -> bool:Source docstring:
Check if path is inside ignored VCS, venv, or build folders.
Kind: Method
Source: tzero/tzero_pc_fixer.py:10615-10675
Signature:
def _audit_dockerfile(cls, dockerfile: Path, root: Path) -> List[DiagnosticIssue]:Source docstring:
Audit Dockerfile for best practices and check for .dockerignore.
Kind: Method
Source: tzero/tzero_pc_fixer.py:10678-10730
Signature:
def _audit_makefile(cls, makefile: Path) -> List[DiagnosticIssue]:Source docstring:
Audit Makefile for space vs tab indentation and missing .PHONY declarations.
Kind: Method
Source: tzero/tzero_pc_fixer.py:10733-10761
Signature:
def _audit_webserver_conf(cls, conf_file: Path) -> List[DiagnosticIssue]:Source docstring:
Audit Nginx / reverse proxy config files for missing semicolons.
Kind: Method
Source: tzero/tzero_pc_fixer.py:10764-10782
Signature:
def _audit_cargo_toml(cls, cargo_file: Path) -> List[DiagnosticIssue]:Source docstring:
Audit Rust Cargo.toml for basic sections.
Kind: Method
Source: tzero/tzero_pc_fixer.py:10785-10803
Signature:
def _audit_go_mod(cls, go_mod_file: Path) -> List[DiagnosticIssue]:Source docstring:
Audit Go go.mod for module declaration.
Kind: Method
Source: tzero/tzero_pc_fixer.py:10806-10899
Signature:
def heal_issue(cls, issue: DiagnosticIssue, dry_run: bool = False) -> HealAction:Source docstring:
Autonomously heal polyglot build and container issues.
Kind: Class
Source: tzero/tzero_pc_fixer.py:10910-11039
Declaration:
class SecurityCweRemediator:Source docstring:
AST surgical patcher for CWE vulnerabilities and OWASP Top 10 weaknesses.
Kind: Method
Source: tzero/tzero_pc_fixer.py:10914-10980
Signature:
def diagnose_file(cls, file_path: str) -> List[DiagnosticIssue]:Source docstring:
Audit Python file for automatable CWE vulnerabilities.
Kind: Method
Source: tzero/tzero_pc_fixer.py:10983-10989
Signature:
def _is_subprocess_call(cls, node: ast.Call) -> bool:Source docstring:
Check if call is subprocess.run, Popen, call, or check_output.
Kind: Method
Source: tzero/tzero_pc_fixer.py:10992-10997
Signature:
def _is_sql_execute(cls, node: ast.Call) -> bool:Source docstring:
Check if call is cursor.execute or conn.execute.
Kind: Method
Source: tzero/tzero_pc_fixer.py:11000-11039
Signature:
def heal_issue(cls, issue: DiagnosticIssue, dry_run: bool = False) -> HealAction:Source docstring:
Autonomously remediate CWE vulnerabilities.
Kind: Class
Source: tzero/tzero_pc_fixer.py:11049-11164
Declaration:
class DeadCodeEliminator:Source docstring:
AST surgical engine for discovering and pruning unreachable or unused code.
Kind: Method
Source: tzero/tzero_pc_fixer.py:11053-11068
Signature:
def diagnose_file(cls, file_path: str) -> List[DiagnosticIssue]:Source docstring:
Audit Python file for dead code, unreferenced private helpers, and unreachable lines.
Kind: Method
Source: tzero/tzero_pc_fixer.py:11071-11101
Signature:
def _find_unreachable_statements(cls, file_path: str, tree: ast.AST) -> List[DiagnosticIssue]:Source docstring:
Find statements following return, raise, break, or continue in the same body block.
Kind: Method
Source: tzero/tzero_pc_fixer.py:11104-11138
Signature:
def _find_unused_private_functions(cls, file_path: str, tree: ast.Module) -> List[DiagnosticIssue]:Source docstring:
Discover module-level private functions (_func) that are never referenced in the module.
Kind: Method
Source: tzero/tzero_pc_fixer.py:11141-11164
Signature:
def heal_issue(cls, issue: DiagnosticIssue, dry_run: bool = False) -> HealAction:Source docstring:
Autonomously comment-out or prune dead unreachable blocks.
Kind: Class
Source: tzero/tzero_pc_fixer.py:11174-11265
Declaration:
class AsyncIoModernizer:Source docstring:
Specialist healer for async/await event loop hygiene and blocking I/O prevention.
Kind: Method
Source: tzero/tzero_pc_fixer.py:11178-11226
Signature:
def diagnose_file(cls, file_path: str) -> List[DiagnosticIssue]:Source docstring:
Audit Python file for blocking calls inside async coroutines.
Kind: Method
Source: tzero/tzero_pc_fixer.py:11229-11265
Signature:
def heal_issue(cls, issue: DiagnosticIssue, dry_run: bool = False) -> HealAction:Source docstring:
Autonomously heal async event loop blocking issues.
Kind: Class
Source: tzero/tzero_pc_fixer.py:11276-11714
Declaration:
class PCFixerMcpServer:Source docstring:
Production-grade MCP stdio server for PC-Fixer & Codebase Doctor.
Kind: Method
Source: tzero/tzero_pc_fixer.py:11465-11466
Signature:
def __init__(self):Source docstring: none; consult the linked implementation instead of inferring behavior.
Kind: Method
Source: tzero/tzero_pc_fixer.py:11468-11503
Signature:
def run(self):Source docstring:
Run the MCP server over stdio reading JSON-RPC 2.0 lines.
Kind: Method
Source: tzero/tzero_pc_fixer.py:11505-11548
Signature:
def handle_request(self, req: Dict[str, Any]) -> Optional[Dict[str, Any]]:Source docstring:
Dispatch JSON-RPC request to appropriate handler.
Kind: Method
Source: tzero/tzero_pc_fixer.py:11550-11699
Signature:
def execute_tool(self, req_id: Any, name: str, args: Dict[str, Any]) -> Dict[str, Any]:Source docstring:
Execute MCP tool by name.
Kind: Method
Source: tzero/tzero_pc_fixer.py:11701-11714
Signature:
def _tool_success(self, req_id: Any, result_data: Dict[str, Any]) -> Dict[str, Any]:Source docstring:
Wrap result in standard MCP tool response.
Kind: Function
Source: tzero/tzero_pc_fixer.py:11717-11720
Signature:
def main():Source docstring:
Main CLI entrypoint for PC-Fixer MCP Server.
Kind: Class
Source: tzero/tzero_pc_fixer.py:11733-12302
Declaration:
class PCFixerDoctor:Source docstring:
Enterprise-grade self-healing PC, runtime environment, and codebase doctor.
Kind: Method
Source: tzero/tzero_pc_fixer.py:11765-11771
Signature:
def check_tools_on_path(cls) -> Dict[str, bool]:Source docstring:
Check availability of essential development CLI tools on system PATH.
Kind: Method
Source: tzero/tzero_pc_fixer.py:11774-11812
Signature:
def inspect_virtualenv(cls, target_dir: str = '.') -> Dict[str, Any]:Source docstring:
Check integrity of local virtual environments (.venv, venv, env).
Kind: Method
Source: tzero/tzero_pc_fixer.py:11815-11945
Signature:
def scan_syntax_and_imports(cls, file_path: str) -> List[DiagnosticIssue]:Source docstring:
Scan a single Python file for syntax flaws, BOM artifacts, and missing imports.
Kind: Method
Source: tzero/tzero_pc_fixer.py:11948-11992
Signature:
def scan_cache_and_bloat(cls, target_dir: str = '.') -> List[DiagnosticIssue]:Source docstring:
Scan for orphaned .pyc files, stale git locks, and bloated caches.
Kind: Method
Source: tzero/tzero_pc_fixer.py:11995-12063
Signature:
def diagnose(cls, target_dir: str = '.') -> DiagnosticReport:Source docstring:
Run comprehensive diagnostic inspection across environment, workspace, and files.
Kind: Method
Source: tzero/tzero_pc_fixer.py:12066-12251
Signature:
def auto_heal(cls, target_dir: str = '.', dry_run: bool = False, fix_syntax: bool = True, add_imports: bool = True, clean_caches: bool = True, repair_venv: bool = True) -> HealReport:Source docstring:
Execute autonomous self-healing for detected codebase and environment issues.
Kind: Method
Source: tzero/tzero_pc_fixer.py:12254-12302
Signature:
def render_cli(cls, report: DiagnosticReport, heal_report: Optional[HealReport] = None):Source docstring:
Render beautiful, ANSI-colored doctor report to terminal.
Kind: Class
Source: tzero/tzero_pc_fixer.py:12321-12630
Declaration:
class FixerOrchestrator:Source docstring:
Master orchestrator for all diagnosis and autonomous self-healing operations.
Kind: Method
Source: tzero/tzero_pc_fixer.py:12327-12350
Signature:
def create_transaction_backup(cls, workspace_dir: str, files_to_backup: Set[str]) -> RollbackManifest:Source docstring:
Create timestamped transactional backup directory for atomic rollback.
Kind: Method
Source: tzero/tzero_pc_fixer.py:12353-12369
Signature:
def rollback_transaction(cls, workspace_dir: str, transaction_id: str) -> bool:Source docstring:
Restore all original files from a previous transactional backup.
Kind: Method
Source: tzero/tzero_pc_fixer.py:12372-12383
Signature:
def calculate_health_score(cls, issues: List[DiagnosticIssue]) -> float:Source docstring:
Compute 0.0-100.0 overall health score based on issue counts and severity weights.
Kind: Method
Source: tzero/tzero_pc_fixer.py:12386-12470
Signature:
def diagnose_workspace(cls, workspace_dir: str = '.') -> DiagnosticReport:Source docstring:
Run complete, multi-category diagnostic sweep across the entire workspace.
Kind: Method
Source: tzero/tzero_pc_fixer.py:12473-12564
Signature:
def auto_heal(cls, workspace_dir: str = '.', dry_run: bool = False, max_iterations: int = 3) -> HealReport:Source docstring:
Execute autonomous self-healing convergence loop across all categories.
Kind: Method
Source: tzero/tzero_pc_fixer.py:12567-12630
Signature:
def render_cli(cls, diag: DiagnosticReport, heal: Optional[HealReport] = None):Source docstring:
Render high-contrast, beautiful ANSI terminal cockpit report.
Kind: Function
Source: tzero/tzero_pc_fixer.py:12632-12713
Signature:
def main():Source docstring:
Command-line interface entrypoint for T-Zero PC-Fixer.
Source: tzero/tzero_promo.py
Source size: 664 lines | 0 classes | 11 functions
Module docstring:
Siber Akademi — T-Zero Zero-Cost Organic Promotion & Launch Generator.
Generates high-signal, authentic, unslop developer launch materials for:
- Hacker News (Show HN)
- Reddit r/LocalLLaMA (strictly following unslop guidelines with affiliation disclosure)
- Twitter / X (Technical launch thread)
- Product Hunt (Listing metadata & Maker comment)
- Discord (MCP Server showcase listing)
Zero paid ads, zero cloud tokens, 100% reproducible developer artifacts.
Kind: Function
Source: tzero/tzero_promo.py:43-50
Signature:
def get_current_version() -> str:Source docstring:
Reads project version from pyproject.toml.
Kind: Function
Source: tzero/tzero_promo.py:53-95
Signature:
def build_show_hn(version: str) -> Dict[str, str]:Source docstring:
Generates authentic, high-signal Show HN submission copy.
Kind: Function
Source: tzero/tzero_promo.py:98-148
Signature:
def build_reddit_localllama(version: str) -> Dict[str, str]:Source docstring:
Generates unslop Reddit r/LocalLLaMA post with clear affiliation disclosure.
Kind: Function
Source: tzero/tzero_promo.py:151-200
Signature:
def build_reddit_cursor(version: str) -> Dict[str, str]:Source docstring:
Generates unslop Reddit r/Cursor post with clear affiliation disclosure.
Kind: Function
Source: tzero/tzero_promo.py:203-261
Signature:
def build_twitter_thread(version: str) -> List[str]:Source docstring:
Generates 7-tweet technical X/Twitter launch thread (each <= 280 chars).
Kind: Function
Source: tzero/tzero_promo.py:264-306
Signature:
def build_product_hunt(version: str) -> Dict[str, str]:Source docstring:
Generates Product Hunt launch listing and maker comment.
Kind: Function
Source: tzero/tzero_promo.py:309-363
Signature:
def build_discord_showcase(version: str) -> Dict[str, str]:Source docstring:
Generates copy-paste ready Discord MCP server showcase entry.
Kind: Function
Source: tzero/tzero_promo.py:366-415
Signature:
def build_readme_index(version: str) -> str:Source docstring:
Generates the master README index for docs/launch/.
Kind: Function
Source: tzero/tzero_promo.py:418-482
Signature:
def generate_all_launch_files(output_dir: pathlib.Path) -> Dict[str, pathlib.Path]:Source docstring:
Generates all launch files in the target directory.
Kind: Function
Source: tzero/tzero_promo.py:485-536
Signature:
def launch_interactive_browser_hub(channel: Optional[str] = None, open_all: bool = False, open_browser: bool = True) -> Dict[str, Any]:Source docstring:
1-Click launch hub that opens pre-filled submission URLs or prints them.
Kind: Function
Source: tzero/tzero_promo.py:539-660
Signature:
def main(argv: Optional[List[str]] = None) -> int:Source docstring: none; consult the linked implementation instead of inferring behavior.
Source: tzero/tzero_proxy.py
Source size: 220 lines | 3 classes | 9 functions
Module docstring:
T-Zero Live Context Proxy (Zero-Config Transparent Token Reducer).
Acts as a local reverse proxy for OpenAI / Anthropic / Gemini compatible APIs.
Intercepts outbound code blocks or context payloads, compresses them via AST,
and transparently forwards to the upstream provider, slashing prompt tokens on the fly.
Kind: Class
Source: tzero/tzero_proxy.py:24-84
Declaration:
class LiveContextPruner:Source docstring:
Detects and prunes source code in message payloads.
Kind: Method
Source: tzero/tzero_proxy.py:28-84
Signature:
def prune_payload(payload: Dict[str, Any], threshold_lines: int = 15) -> Tuple[Dict[str, Any], int]:Source docstring:
Prunes large code blocks in payload messages. Returns (pruned_payload, tokens_saved_estimate).
Kind: Function
Source: tzero/tzero_proxy.py:52-75
Signature:
def _replace_block(match: re.Match) -> str:Source docstring: none; consult the linked implementation instead of inferring behavior.
Kind: Class
Source: tzero/tzero_proxy.py:87-203
Declaration:
class ContextProxyHandler(http.server.BaseHTTPRequestHandler):Source docstring:
HTTP handler that intercepts /v1/chat/completions with strict request bounds.
Kind: Method
Source: tzero/tzero_proxy.py:94-99
Signature:
def setup(self) -> None:Source docstring: none; consult the linked implementation instead of inferring behavior.
Kind: Method
Source: tzero/tzero_proxy.py:101-102
Signature:
def log_message(self, format: str, *args: Any) -> None:Source docstring: none; consult the linked implementation instead of inferring behavior.
Kind: Method
Source: tzero/tzero_proxy.py:104-119
Signature:
def _drain_rejected_body(self, content_length: int) -> None:Source docstring:
Briefly drain bounded unread bytes so TCP close sends FIN instead of RST.
Kind: Method
Source: tzero/tzero_proxy.py:121-132
Signature:
def _send_json_error(self, code: int, msg: str, drain_bytes: int = 0) -> None:Source docstring: none; consult the linked implementation instead of inferring behavior.
Kind: Method
Source: tzero/tzero_proxy.py:134-203
Signature:
def do_POST(self) -> None:Source docstring: none; consult the linked implementation instead of inferring behavior.
Kind: Class
Source: tzero/tzero_proxy.py:206-212
Declaration:
class _BoundedThreadingHTTPServer(socketserver.ThreadingMixIn, http.server.HTTPServer):Source docstring: none; consult the linked implementation instead of inferring behavior.
Kind: Method
Source: tzero/tzero_proxy.py:210-212
Signature:
def __init__(self, server_address: Tuple[str, int], handler_cls: Any, max_concurrent: int = 16):Source docstring: none; consult the linked implementation instead of inferring behavior.
Kind: Function
Source: tzero/tzero_proxy.py:215-220
Signature:
def start_context_proxy(host: str = '127.0.0.1', port: int = 7350, max_concurrent: int = 16) -> socketserver.TCPServer:Source docstring:
Start local transparent context optimizer proxy with timeout and concurrency limits.
Source: tzero/tzero_replay.py
Source size: 141 lines | 3 classes | 2 functions
Module docstring:
Siber Akademi — T-Zero Historical Token ROI & Savings Replay.
Developer: [redacted] (Siber Akademi)
License: AGPL-3.0-only
Replays git commit history to compute cumulative historical token reduction
and dollar savings across Claude 3.5 Sonnet, GPT-4o, and Gemini models.
Kind: Class
Source: tzero/tzero_replay.py:19-28
Declaration:
class CommitReplayPoint:Source docstring: none; consult the linked implementation instead of inferring behavior.
Kind: Class
Source: tzero/tzero_replay.py:32-42
Declaration:
class ReplaySummary:Source docstring: none; consult the linked implementation instead of inferring behavior.
Kind: Class
Source: tzero/tzero_replay.py:45-140
Declaration:
class HistoricalTokenReplay:Source docstring:
Computes historical token reduction and team financial savings from Git history.
Kind: Method
Source: tzero/tzero_replay.py:53-121
Signature:
def replay_history(cls, repo_dir: str = '.', max_commits: int = 15) -> ReplaySummary:Source docstring:
Analyzes recent git commits and computes cumulative token economics.
Kind: Method
Source: tzero/tzero_replay.py:124-140
Signature:
def render_cli(cls, rep: ReplaySummary):Source docstring: none; consult the linked implementation instead of inferring behavior.
Source: tzero/tzero_subagent_engine.py
Source size: 459 lines | 5 classes | 7 functions
Module docstring:
Siber Akademi — T-Zero Autonomous Dynamic Subagent Decomposer & Swarm Orchestrator.
Developer: [redacted] (Siber Akademi)
License: MIT
Dynamically analyzes composite missions and incoming goals.
When multiple simultaneous or dependent tasks are needed:
1. Decomposes the mission into fine-grained atomic subtasks.
2. Dynamically maps subtasks to specialized built-in fleet agents or
synthesizes new ad-hoc subagents on-the-fly via AgentForge.
3. Dispatches independent subagents concurrently across multi-core CPU threads.
4. Enforces conflict-free file locks and PBFT Byzantine consensus.
5. Produces a unified Executive Master Dossier with interactive Mermaid topology.
Kind: Class
Source: tzero/tzero_subagent_engine.py:40-50
Declaration:
class SubtaskSpec:Source docstring: none; consult the linked implementation instead of inferring behavior.
Kind: Class
Source: tzero/tzero_subagent_engine.py:54-64
Declaration:
class DynamicSubagentReport:Source docstring: none; consult the linked implementation instead of inferring behavior.
Kind: Class
Source: tzero/tzero_subagent_engine.py:68-92
Declaration:
class SwarmExecutiveDossier:Source docstring: none; consult the linked implementation instead of inferring behavior.
Kind: Method
Source: tzero/tzero_subagent_engine.py:80-92
Signature:
def to_dict(self) -> Dict[str, Any]:Source docstring: none; consult the linked implementation instead of inferring behavior.
Kind: Class
Source: tzero/tzero_subagent_engine.py:95-254
Declaration:
class DynamicSubagentDecomposer:Source docstring:
Analyzes composite mission prompts and extracts atomic subtasks.
Kind: Method
Source: tzero/tzero_subagent_engine.py:167-254
Signature:
def decompose(self, mission_goal: str, workspace_root: str = '.') -> List[SubtaskSpec]:Source docstring:
Decomposes mission_goal into specific subtasks.
If a requirement matches an existing specialist, assigns it.
If custom requirements are detected, creates ad-hoc dynamic subagents.
Kind: Class
Source: tzero/tzero_subagent_engine.py:257-453
Declaration:
class AutonomousSwarmCoordinator:Source docstring:
Coordinates dynamic multi-agent task execution.
Spawns custom subagents on-demand, dispatches concurrent workers,
and produces an audited Executive Master Dossier.
Kind: Method
Source: tzero/tzero_subagent_engine.py:264-270
Signature:
def __init__(self, workspace_root: str = '.'):Source docstring: none; consult the linked implementation instead of inferring behavior.
Kind: Method
Source: tzero/tzero_subagent_engine.py:272-331
Signature:
def _execute_subtask(self, task: SubtaskSpec, mission_goal: str, workspace_context: str) -> DynamicSubagentReport:Source docstring: none; consult the linked implementation instead of inferring behavior.
Kind: Method
Source: tzero/tzero_subagent_engine.py:333-453
Signature:
def execute_mission(self, mission_goal: str, workspace_context: str = '') -> SwarmExecutiveDossier:Source docstring:
Full autonomous lifecycle:
1. Decomposes composite goal into subtasks.
2. Spawns custom subagents when required.
3. Executes group 1 concurrently across CPU workers.
4. Executes group 2 (consensus / aggregation).
5. Returns structured SwarmExecutiveDossier.
Kind: Function
Source: tzero/tzero_subagent_engine.py:364-365
Signature:
def _run_worker(t: SubtaskSpec) -> DynamicSubagentReport:Source docstring: none; consult the linked implementation instead of inferring behavior.
Kind: Function
Source: tzero/tzero_subagent_engine.py:456-458
Signature:
def get_autonomous_swarm_coordinator(workspace_root: str = '.') -> AutonomousSwarmCoordinator:Source docstring:
Factory helper to obtain an AutonomousSwarmCoordinator instance.
Source: tzero/tzero_superdesign.py
Source size: 774 lines | 0 classes | 7 functions
Module docstring:
Siber Akademi T-Zero — Superdesign MCP Orchestrator Module.
Brings the open-source Superdesign AI design orchestrator capabilities natively to
MCP clients (Claude Code, Cursor, Antigravity IDE, Windsurf).
Operates as a design orchestrator providing structured specifications, design system
extraction, iterative refinement, and interactive HTML galleries without requiring
external API keys or cloud dependencies.
Developer: [redacted] (Siber Akademi)
License: MIT
Kind: Function
Source: tzero/tzero_superdesign.py:107-112
Signature:
def _slugify(text: str) -> str:Source docstring:
Converts a descriptive string to a filesystem-friendly slug.
Kind: Function
Source: tzero/tzero_superdesign.py:115-122
Signature:
def _ensure_superdesign_dirs(workspace_path: str = '.') -> Tuple[str, str]:Source docstring:
Ensures that superdesign/design_iterations and superdesign/design_system exist.
Kind: Function
Source: tzero/tzero_superdesign.py:125-202
Signature:
def superdesign_generate(prompt: str, design_type: str = 'ui', variations: int = 3, framework: str = 'html', workspace_path: str = '.') -> Dict[str, Any]:Source docstring:
Generates structured specifications and guidelines for the LLM to create designs.
Kind: Function
Source: tzero/tzero_superdesign.py:205-265
Signature:
def superdesign_iterate(design_file: str, feedback: str, variations: int = 1, workspace_path: str = '.') -> Dict[str, Any]:Source docstring:
Generates structured iteration instructions to refine an existing design file.
Kind: Function
Source: tzero/tzero_superdesign.py:268-295
Signature:
def superdesign_extract_system(input_path_or_description: str, system_name: str = 'custom', workspace_path: str = '.') -> Dict[str, Any]:Source docstring:
Extracts or initializes a structured JSON design system with modern tokens.
Kind: Function
Source: tzero/tzero_superdesign.py:298-344
Signature:
def superdesign_list(workspace_path: str = '.') -> Dict[str, Any]:Source docstring:
Enumerates all Superdesign creations and extracted design systems.
Kind: Function
Source: tzero/tzero_superdesign.py:347-774
Signature:
def superdesign_gallery(workspace_path: str = '.') -> Dict[str, Any]:Source docstring:
Builds a responsive, interactive HTML gallery previewing all designs in superdesign/.
Source: tzero/tzero_sync.py
Source size: 241 lines | 2 classes | 7 functions
Module docstring:
Siber Akademi — T-Zero Autonomous Multi-IDE Rules & Context Synchronizer.
Developer: [redacted] (Siber Akademi)
License: MIT
Synchronizes current codebase AST topologies, helper catalogs, architecture layers,
and Zero-Leak security rules into:
1. .cursorrules & .cursor/rules/*.mdc (Cursor IDE)
2. CLAUDE.md (Claude Code & Claude Desktop)
3. .windsurfrules (Windsurf Cascade)
4. .agents/rules/tzero-context.md (Antigravity IDE & Autonomous Agents)
5. .git/hooks/pre-commit (Git Zero-Leak Security Guard)
Kind: Class
Source: tzero/tzero_sync.py:28-35
Declaration:
class SyncResult:Source docstring: none; consult the linked implementation instead of inferring behavior.
Kind: Class
Source: tzero/tzero_sync.py:38-231
Declaration:
class WorkspaceSyncManager:Source docstring:
Synchronizes active codebase AST signatures and constraints across all AI environments.
Kind: Method
Source: tzero/tzero_sync.py:47-82
Signature:
def scan_symbols(cls, workspace_dir: str) -> Dict[str, Any]:Source docstring:
Extracts top classes, functions, and architecture layers across workspace.
Kind: Method
Source: tzero/tzero_sync.py:85-106
Signature:
def generate_cursorrules(cls, workspace_name: str, symbols: Dict[str, Any]) -> str:Source docstring:
Generates tailored .cursorrules file.
Kind: Method
Source: tzero/tzero_sync.py:109-139
Signature:
def generate_claudemd(cls, workspace_name: str, symbols: Dict[str, Any]) -> str:Source docstring:
Generates tailored CLAUDE.md file for Claude Code.
Kind: Method
Source: tzero/tzero_sync.py:142-149
Signature:
def generate_windsurfrules(cls, workspace_name: str, symbols: Dict[str, Any]) -> str:Source docstring:
Generates tailored .windsurfrules file for Windsurf Cascade.
Kind: Method
Source: tzero/tzero_sync.py:152-215
Signature:
def sync(cls, workspace_dir: str = '.') -> SyncResult:Source docstring:
Executes full autonomous synchronization across IDEs and Git hooks.
Kind: Method
Source: tzero/tzero_sync.py:218-231
Signature:
def render_cli(cls, result: SyncResult) -> None:Source docstring:
Renders rich ANSI terminal output.
Kind: Function
Source: tzero/tzero_sync.py:234-237
Signature:
def main():Source docstring: none; consult the linked implementation instead of inferring behavior.
Source: tzero/tzero_telemetry.py
Source size: 146 lines | 0 classes | 5 functions
Module docstring:
Local SQLite Token Savings & ROI Telemetry Engine for T-Zero.
100% offline, zero-network telemetry store persisted under `.tzero/telemetry.db`
(or `TZERO_TELEMETRY_DB` env override) so developers can measure cumulative
raw vs. pruned tokens, reduction ratio, and USD savings across local runs.
Kind: Function
Source: tzero/tzero_telemetry.py:20-29
Signature:
def _resolve_db_path(workspace_dir: str = '.') -> str:Source docstring: none; consult the linked implementation instead of inferring behavior.
Kind: Function
Source: tzero/tzero_telemetry.py:32-48
Signature:
def _connect(db_path: str) -> sqlite3.Connection:Source docstring: none; consult the linked implementation instead of inferring behavior.
Kind: Function
Source: tzero/tzero_telemetry.py:51-80
Signature:
def record_event(command: str, raw_tokens: int, pruned_tokens: int, workspace_dir: str = '.', price_per_million: float = DEFAULT_PRICE_PER_M_TOKENS) -> Dict[str, Any]:Source docstring:
Records a local compression/telemetry event into SQLite.
Kind: Function
Source: tzero/tzero_telemetry.py:83-125
Signature:
def get_summary(workspace_dir: str = '.', days: int = 30) -> Dict[str, Any]:Source docstring:
Returns aggregated local telemetry stats over the trailing `days` window.
Kind: Function
Source: tzero/tzero_telemetry.py:128-146
Signature:
def render_report(workspace_dir: str = '.', days: int = 30) -> str:Source docstring:
Formats a human-readable ASCII/Markdown telemetry summary.
Source: tzero/tzero_traffic.py
Source size: 375 lines | 0 classes | 8 functions
Module docstring:
Siber Akademi T-Zero — Traffic, Update & Crypto Support Engine (v12.2.1).
Developer: [redacted] (Siber Akademi)
License: AGPL-3.0-only
Repository: https://github.com/toprakahmetaydogmus/TZeroAlgorithm
Bio: [personal link omitted]
Kind: Function
Source: tzero/tzero_traffic.py:43-52
Signature:
def fetch_latest_pypi_version() -> Optional[str]:Source docstring:
Fetches the latest published release version from PyPI JSON API.
Kind: Function
Source: tzero/tzero_traffic.py:55-65
Signature:
def fetch_latest_github_version() -> Optional[str]:Source docstring:
Fetches the latest release tag from GitHub API.
Kind: Function
Source: tzero/tzero_traffic.py:68-114
Signature:
def check_version_and_updates(open_browser: bool = False) -> Dict[str, Any]:Source docstring:
Checks local version against PyPI and GitHub, returning comparison stats.
Kind: Function
Source: tzero/tzero_traffic.py:117-152
Signature:
def print_crypto_support_card() -> Dict[str, str]:Source docstring:
Displays the official crypto donation and community support card.
Kind: Function
Source: tzero/tzero_traffic.py:155-250
Signature:
def run_live_roi_dashboard(workspace_dir: str = '.') -> Dict[str, Any]:Source docstring:
Computes exact real-time token reduction and financial dollars ($) saved for workspace.
Kind: Function
Source: tzero/tzero_traffic.py:253-315
Signature:
def run_system_disk_doctor(clean: bool = False, workspace_dir: str = '.') -> Dict[str, Any]:Source docstring:
Inspects temporary build artifacts, __pycache__, and cleans safely.
Kind: Function
Source: tzero/tzero_traffic.py:318-334
Signature:
def _resolve_community_stats() -> Dict[str, Any]:Source docstring:
Retrieve live (with fast cache/offline fallback) star and download stats.
Kind: Function
Source: tzero/tzero_traffic.py:337-374
Signature:
def open_github_star_page(open_browser: bool = True) -> Dict[str, Any]:Source docstring:
Displays live star milestone progress and opens GitHub repository in browser.
Source: tzero/tzero_welcome.py
Source size: 230 lines | 0 classes | 9 functions
Module docstring:
T-Zero Community Welcome & GitHub Star Prompt Module.
Developer: [redacted] (Siber Akademi)
License: AGPL-3.0-only
Repository: https://github.com/toprakahmetaydogmus/TZeroAlgorithm
Kind: Function
Source: tzero/tzero_welcome.py:31-32
Signature:
def init_terminal(*args, **kwargs):Source docstring: none; consult the linked implementation instead of inferring behavior.
Kind: Function
Source: tzero/tzero_welcome.py:34-35
Signature:
def sanitize_terminal_text(text, *args, **kwargs):Source docstring: none; consult the linked implementation instead of inferring behavior.
Kind: Function
Source: tzero/tzero_welcome.py:37-38
Signature:
def supports_ansi(*args, **kwargs):Source docstring: none; consult the linked implementation instead of inferring behavior.
Kind: Function
Source: tzero/tzero_welcome.py:45-51
Signature:
def find_git_root(start_dir: Optional[Path] = None) -> Optional[Path]:Source docstring:
Recursively locates .git root directory starting from start_dir or cwd.
Kind: Function
Source: tzero/tzero_welcome.py:54-87
Signature:
def get_welcome_banner(version: str = VERSION) -> str:Source docstring:
Returns the ANSI styled welcome banner asking developers to star the project.
Kind: Function
Source: tzero/tzero_welcome.py:90-123
Signature:
def print_star_banner(force: bool = False) -> None:Source docstring:
Prints the welcome star banner if running interactively in terminal.
Kind: Function
Source: tzero/tzero_welcome.py:126-150
Signature:
def check_first_launch_repo_open(force_open: bool = False, state_path: Optional[Path] = None) -> bool:Source docstring:
On first interactive launch, opens the GitHub repository in browser and prompts to star.
Kind: Function
Source: tzero/tzero_welcome.py:153-207
Signature:
def install_git_star_hooks(repo_dir: Optional[Path] = None) -> bool:Source docstring:
Install reminders only when explicitly called; never change Git configuration.
Refuse configured hook managers and existing active hooks. The default Git
hooks directory also works for linked worktrees; no core.hooksPath is needed.
Kind: Function
Source: tzero/tzero_welcome.py:210-226
Signature:
def main(argv = None) -> int:Source docstring:
CLI entrypoint for scripts/welcome.py.