Skip to content

Python Fixer Symbol Reference

Toprak Ahmet Aydoğmuş edited this page Nov 30, 2026 · 2 revisions

T-Zero Algorithm Python Fixer Symbol Reference

Coverage: 42 modules, 96 classes, 228 functions, 13940 source lines.

Source-linked AST index for the T-Zero Algorithm Python package.

Scope: Modules under tzero/tzero_fixer/. This package includes workspace repair operations; inspect each implementation and make backups before running modifying modes.

Reading this reference

  • Every declaration is extracted from Python AST and linked to its current source location.
  • Signatures show parsed arguments and annotations; default expressions are included after personal-identifier, contact, and wallet redaction.
  • Source docstrings are quoted, not independently verified claims. Personal identifiers, contact details, and wallet-like values are redacted.
  • Missing docstrings are marked explicitly; behavior is not guessed.
  • This is a symbol map, not a line-by-line explanation of function bodies. Follow the source links for control flow and side effects.
  • Detailed Anti-REA implementation internals are intentionally excluded; see Anti-REA-Safe-Overview.

tzero/tzero_fixer/__init__.py

Source: tzero/tzero_fixer/init.py
Source size: 63 lines | 0 classes | 0 functions

Module docstring:

T-Zero Autonomous PC-Fixer & Codebase Doctor Package.

Author: [redacted] (Siber Akademi)
Version: 10.5.0

tzero/tzero_fixer/amalgamation.py

Source: tzero/tzero_fixer/amalgamation.py
Source size: 334 lines | 0 classes | 1 functions

Module docstring:


T-Zero PC-Fixer Master Amalgamation Compiler
============================================
Compiles the modular tzero_fixer package into an encyclopedic, production-grade,
monolithic single-file executable: `tzero_pc_fixer.py`.

Ensures:
  - Exact 10,000+ line volume requirement is satisfied with functional, non-filler code.
  - Zero duplicate top-level imports and zero circular dependency conflicts.
  - Full backward compatibility with the PCFixerDoctor API used by tests and MCP servers.
  - 100% syntactically valid Python AST verified before writing to disk.

Author: Siber Akademi T-Zero R&D Team
License: MIT (100% Free, Local Offline, Zero-Leak)

compile_amalgamation

Kind: Function
Source: tzero/tzero_fixer/amalgamation.py:72-329

Signature:

def compile_amalgamation(fixer_dir: str, output_file: str) -> Tuple[int, bool]:

Source docstring:

Compiles all modules into a monolithic single-file masterpiece.

tzero/tzero_fixer/ast_syntax_healer.py

Source: tzero/tzero_fixer/ast_syntax_healer.py
Source size: 464 lines | 2 classes | 7 functions

Module docstring:

T-Zero AST Syntax Healer & Polyglot Source Code Doctor.

Performs intelligent, deterministic, and surgical healing for:
- Missing colons on compound statements (def, class, if, elif, else, try, except, finally, for, while, with, match, case).
- Legacy Python 2 idioms (print statements, except Exception, e, xrange, has_key, iteritems, unicode).
- Indentation errors, mixed tabs and spaces, and trailing indentation drift.
- Invisible characters (UTF-8 BOM, zero-width spaces, non-breaking spaces).
- Invalid regex escape sequences (automatic raw string prefixing).
- Unclosed delimiters and unclosed string literals.

Author: [redacted] (Siber Akademi)
Version: 10.4.0

ASTSyntaxHealer

Kind: Class
Source: tzero/tzero_fixer/ast_syntax_healer.py:34-464

Declaration:

class ASTSyntaxHealer:

Source docstring:

Enterprise AST parser and surgical auto-repair engine for source code syntax defects.

ASTSyntaxHealer.scan_encoding_and_invisible_chars

Kind: Method
Source: tzero/tzero_fixer/ast_syntax_healer.py:45-86

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.

ASTSyntaxHealer.detect_mixed_indentation

Kind: Method
Source: tzero/tzero_fixer/ast_syntax_healer.py:89-135

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.

ASTSyntaxHealer.analyze_syntax_error

Kind: Method
Source: tzero/tzero_fixer/ast_syntax_healer.py:138-184

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.

ASTSyntaxHealer.scan_python_idioms_and_regex

Kind: Method
Source: tzero/tzero_fixer/ast_syntax_healer.py:187-241

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.

ASTSyntaxHealer.heal_string

Kind: Method
Source: tzero/tzero_fixer/ast_syntax_healer.py:244-275

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.

ASTSyntaxHealer.heal_string.StringHealResult

Kind: Class
Source: tzero/tzero_fixer/ast_syntax_healer.py:247-251

Declaration:

class StringHealResult:

Source docstring: none; consult the linked implementation rather than inferring behavior.

ASTSyntaxHealer.diagnose_file

Kind: Method
Source: tzero/tzero_fixer/ast_syntax_healer.py:278-321

Signature:

def diagnose_file(cls, file_path: str) -> List[DiagnosticIssue]:

Source docstring:

Scan a single source file for all syntax, encoding, and idiom defects.

ASTSyntaxHealer.execute_syntax_heals

Kind: Method
Source: tzero/tzero_fixer/ast_syntax_healer.py:324-464

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.

tzero/tzero_fixer/ast_type_modernizer.py

Source: tzero/tzero_fixer/ast_type_modernizer.py
Source size: 288 lines | 2 classes | 6 functions

Module docstring:

T-Zero AST Type Hint Modernizer & PEP 585 / PEP 604 Transformer.

Performs static AST transforms to modernize Python type annotations:
- PEP 585 Generics: converts typing.List[T] -> list[T], typing.Dict[K, V] -> dict[K, V], typing.Set[T] -> set[T].
- PEP 604 Unions: converts typing.Optional[T] -> T | None, typing.Union[A, B] -> A | B.
- Dataclass field mutable defaults: converts 'field: list = []' -> 'field: list = field(default_factory=list)'.
- PEP 654 Exception Groups validation and modernization.

Author: [redacted] (Siber Akademi)
Version: 10.4.0

ASTTypeModernizer

Kind: Class
Source: tzero/tzero_fixer/ast_type_modernizer.py:32-288

Declaration:

class ASTTypeModernizer:

Source docstring:

AST visitor and transformer for upgrading type hints to modern Python standards.

ASTTypeModernizer.scan_legacy_typing_generics

Kind: Method
Source: tzero/tzero_fixer/ast_type_modernizer.py:45-74

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.

ASTTypeModernizer.scan_legacy_optional_and_union

Kind: Method
Source: tzero/tzero_fixer/ast_type_modernizer.py:77-106

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).

ASTTypeModernizer.scan_dataclass_mutable_fields

Kind: Method
Source: tzero/tzero_fixer/ast_type_modernizer.py:109-153

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.

ASTTypeModernizer.modernize_code

Kind: Method
Source: tzero/tzero_fixer/ast_type_modernizer.py:156-187

Signature:

def modernize_code(cls, content: str, filename: str = 'snippet.py') -> Any:

Source docstring:

In-memory type modernization helper.

ASTTypeModernizer.modernize_code.StringHealResult

Kind: Class
Source: tzero/tzero_fixer/ast_type_modernizer.py:159-163

Declaration:

class StringHealResult:

Source docstring: none; consult the linked implementation rather than inferring behavior.

ASTTypeModernizer.diagnose_file

Kind: Method
Source: tzero/tzero_fixer/ast_type_modernizer.py:190-212

Signature:

def diagnose_file(cls, file_path: str) -> List[DiagnosticIssue]:

Source docstring:

Scan file for all type modernization opportunities and dataclass flaws.

ASTTypeModernizer.execute_type_heals

Kind: Method
Source: tzero/tzero_fixer/ast_type_modernizer.py:215-288

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.

tzero/tzero_fixer/async_io_modernizer.py

Source: tzero/tzero_fixer/async_io_modernizer.py
Source size: 127 lines | 1 classes | 2 functions

Module docstring:


T-Zero AsyncIO & Event Loop Blocking I/O Healer
==============================================
Static AST analyzer that detects synchronous blocking calls (time.sleep, requests.get,
blocking file operations) inside async coroutines (`async def`), preventing event loop starvation.

Key Capabilities:
  - Detects `time.sleep()` inside `async def` and auto-heals to `await asyncio.sleep()`
  - Auto-injects `import asyncio` if missing when modernizing sleep calls
  - Detects blocking `requests.*` calls inside async coroutines
  - Detects blocking `subprocess.run()` calls without async executors

Author: Siber Akademi T-Zero R&D Team
Version: 10.5.0 | 100% Free & Local Offline | Zero-Leak Certified

AsyncIoModernizer

Kind: Class
Source: tzero/tzero_fixer/async_io_modernizer.py:35-126

Declaration:

class AsyncIoModernizer:

Source docstring:

Specialist healer for async/await event loop hygiene and blocking I/O prevention.

AsyncIoModernizer.diagnose_file

Kind: Method
Source: tzero/tzero_fixer/async_io_modernizer.py:39-87

Signature:

def diagnose_file(cls, file_path: str) -> List[DiagnosticIssue]:

Source docstring:

Audit Python file for blocking calls inside async coroutines.

AsyncIoModernizer.heal_issue

Kind: Method
Source: tzero/tzero_fixer/async_io_modernizer.py:90-126

Signature:

def heal_issue(cls, issue: DiagnosticIssue, dry_run: bool = False) -> HealAction:

Source docstring:

Autonomously heal async event loop blocking issues.

tzero/tzero_fixer/automated_regression_suite.py

Source: tzero/tzero_fixer/automated_regression_suite.py
Source size: 600 lines | 3 classes | 1 functions

Module docstring:


T-Zero PC-Fixer: Automated Regression & Self-Healing Verification Suite
======================================================================
Comprehensive regression suite and scenario matrix for verifying AST healers,
operating system doctors, polyglot linters, and Zero-Leak security engines.
Contains 100+ exhaustive scenario test cases:
  - Python AST syntax errors (missing colons, tab-space mixing, BOM, zero-width chars)
  - Python 2 to 3 backward-compatibility edge cases (print, except, xrange, has_key)
  - Circular import dependency topologies (2-node cycles, 3-node cycles, diamond deps)
  - Type modernizations (PEP 585 generics, PEP 604 union operators)
  - Code smell and anti-pattern transformations (mutable defaults, assert tuples, bare excepts)
  - Zero-Leak security credentials detection (AWS, OpenAI, Anthropic, Gemini, Stripe, SSH)
  - Polyglot configuration repairs (JSON, YAML, Dockerfile, Makefile, TOML, SQL)

Author: Siber Akademi T-Zero R&D Team
License: MIT (100% Free, Local Offline, Zero-Leak)

RegressionTestCase

Kind: Class
Source: tzero/tzero_fixer/automated_regression_suite.py:51-58

Declaration:

class RegressionTestCase:

Source docstring: none; consult the linked implementation rather than inferring behavior.

RegressionResult

Kind: Class
Source: tzero/tzero_fixer/automated_regression_suite.py:62-67

Declaration:

class RegressionResult:

Source docstring: none; consult the linked implementation rather than inferring behavior.

AutomatedRegressionSuite

Kind: Class
Source: tzero/tzero_fixer/automated_regression_suite.py:70-600

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.

AutomatedRegressionSuite.run_suite

Kind: Method
Source: tzero/tzero_fixer/automated_regression_suite.py:510-600

Signature:

def run_suite(cls) -> RegressionResult:

Source docstring:


        Executes all scenarios, runs healers, checks assertions, and verifies AST parses.

tzero/tzero_fixer/benchmarks_and_diagnostics.py

Source: tzero/tzero_fixer/benchmarks_and_diagnostics.py
Source size: 174 lines | 3 classes | 2 functions

Module docstring:

T-Zero Self-Healing Doctor Empirical Benchmark & Scenario Testbed.

Synthesizes 30 diverse defect scenarios in an isolated temporary sandbox:
1. Syntax flaws (missing colons, Python 2 print, legacy except, unclosed brackets)
2. Import omissions (missing sys, os, re, json, typing, dataclasses)
3. Invisible corruptions (UTF-8 BOM, zero-width spaces, mixed tabs/spaces)
4. Code smells (bare except, mutable defaults, deprecated standard library APIs)
5. Security leaks (AWS, OpenAI, GitHub PAT, unsafe yaml.load)
6. Environment & Virtualenv breakages (broken pyvenv.cfg, orphaned bytecode, stale git locks)

Computes detection recall, healing success percentages, latency distributions,
and before-and-after health score transformations.

Author: [redacted] (Siber Akademi)
Version: 10.4.0

BenchmarkScenario

Kind: Class
Source: tzero/tzero_fixer/benchmarks_and_diagnostics.py:35-41

Declaration:

class BenchmarkScenario:

Source docstring: none; consult the linked implementation rather than inferring behavior.

BenchmarkResult

Kind: Class
Source: tzero/tzero_fixer/benchmarks_and_diagnostics.py:45-54

Declaration:

class BenchmarkResult:

Source docstring: none; consult the linked implementation rather than inferring behavior.

FixerBenchmarkSuite

Kind: Class
Source: tzero/tzero_fixer/benchmarks_and_diagnostics.py:57-174

Declaration:

class FixerBenchmarkSuite:

Source docstring:

Automated benchmark harness for evaluating T-Zero self-healing capabilities.

FixerBenchmarkSuite.run_benchmark

Kind: Method
Source: tzero/tzero_fixer/benchmarks_and_diagnostics.py:98-156

Signature:

def run_benchmark(cls) -> BenchmarkResult:

Source docstring:

Run all 27 synthetic defect scenarios in an isolated temp sandbox.

FixerBenchmarkSuite.render_benchmark_report

Kind: Method
Source: tzero/tzero_fixer/benchmarks_and_diagnostics.py:159-174

Signature:

def render_benchmark_report(cls, res: BenchmarkResult):

Source docstring:

Render beautiful ANSI benchmark dashboard.

tzero/tzero_fixer/ci_cd_self_healing_gate.py

Source: tzero/tzero_fixer/ci_cd_self_healing_gate.py
Source size: 246 lines | 4 classes | 4 functions

Module docstring:


T-Zero CI/CD Quality Gate, Hook Integrator, & SARIF/JUnit Exporter
================================================================
Enterprise-grade integration engine for CI/CD continuous inspection pipelines.
Provides:
  - Automated Git Pre-Commit & Pre-Push Hook Installer (.git/hooks/)
  - Native GitHub Actions Quality Gate Generator (.github/workflows/tzero_gate.yml)
  - GitLab CI / Bitbucket Pipelines Configuration Generators
  - Industry-standard SARIF 2.1.0 JSON Report Exporter (for GitHub Code Scanning)
  - JUnit XML Test Result Exporter (for Jenkins, CircleCI, Azure DevOps)

Author: Siber Akademi T-Zero R&D Team
License: MIT (100% Free, Local Offline, Zero-Leak)

GitHookIntegrator

Kind: Class
Source: tzero/tzero_fixer/ci_cd_self_healing_gate.py:36-84

Declaration:

class GitHookIntegrator:

Source docstring:

Installs and manages git pre-commit and pre-push hooks.

GitHookIntegrator.install_hooks

Kind: Method
Source: tzero/tzero_fixer/ci_cd_self_healing_gate.py:61-84

Signature:

def install_hooks(cls, workspace_dir: str = '.') -> Tuple[bool, str]:

Source docstring:

Installs pre-commit hook script into .git/hooks/pre-commit.

CiCdWorkflowGenerator

Kind: Class
Source: tzero/tzero_fixer/ci_cd_self_healing_gate.py:87-137

Declaration:

class CiCdWorkflowGenerator:

Source docstring:

Generates CI/CD quality gate workflow configurations.

CiCdWorkflowGenerator.generate_github_workflow

Kind: Method
Source: tzero/tzero_fixer/ci_cd_self_healing_gate.py:91-137

Signature:

def generate_github_workflow(cls, workspace_dir: str = '.') -> Tuple[bool, str]:

Source docstring:

Generates .github/workflows/tzero_gate.yml.

SarifReportExporter

Kind: Class
Source: tzero/tzero_fixer/ci_cd_self_healing_gate.py:140-213

Declaration:

class SarifReportExporter:

Source docstring:

Converts T-Zero diagnostic reports into SARIF 2.1.0 standard schema.

SarifReportExporter.export_sarif

Kind: Method
Source: tzero/tzero_fixer/ci_cd_self_healing_gate.py:144-213

Signature:

def export_sarif(cls, issues: List[DiagnosticIssue], workspace_dir: str = '.') -> str:

Source docstring:

Serializes issues into official OASIS SARIF v2.1.0 JSON.

JUnitXmlExporter

Kind: Class
Source: tzero/tzero_fixer/ci_cd_self_healing_gate.py:216-246

Declaration:

class JUnitXmlExporter:

Source docstring:

Exports diagnostic issues to JUnit XML for dashboard reporting.

JUnitXmlExporter.export_junit_xml

Kind: Method
Source: tzero/tzero_fixer/ci_cd_self_healing_gate.py:220-246

Signature:

def export_junit_xml(cls, issues: List[DiagnosticIssue]) -> str:

Source docstring:

Generates standard JUnit XML testsuite element.

tzero/tzero_fixer/code_duplicity_and_refactorer.py

Source: tzero/tzero_fixer/code_duplicity_and_refactorer.py
Source size: 151 lines | 3 classes | 3 functions

Module docstring:


T-Zero Code Duplicity Finder & AST Clone Refactorer
==================================================
Zero-dependency static AST clone detector and automated deduplication engine.
Identifies:
  - Type-1 Exact Clones: Identical code fragments with identical tokens
  - Type-2 Renamed Clones: Structurally identical ASTs with renamed identifiers/literals
  - Type-3 Near-Miss Clones: Similar statements with inserted or deleted statements
  - Generates unified helper functions to eliminate copy-pasted blocks

Author: Siber Akademi T-Zero R&D Team
License: MIT (100% Free, Local Offline, Zero-Leak)

CodeCloneBlock

Kind: Class
Source: tzero/tzero_fixer/code_duplicity_and_refactorer.py:34-40

Declaration:

class CodeCloneBlock:

Source docstring: none; consult the linked implementation rather than inferring behavior.

DuplicateCloneGroup

Kind: Class
Source: tzero/tzero_fixer/code_duplicity_and_refactorer.py:44-48

Declaration:

class DuplicateCloneGroup:

Source docstring: none; consult the linked implementation rather than inferring behavior.

ASTDuplicityRefactorer

Kind: Class
Source: tzero/tzero_fixer/code_duplicity_and_refactorer.py:51-150

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.

ASTDuplicityRefactorer._normalize_ast_node

Kind: Method
Source: tzero/tzero_fixer/code_duplicity_and_refactorer.py:60-65

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.

ASTDuplicityRefactorer.scan_file_for_clones

Kind: Method
Source: tzero/tzero_fixer/code_duplicity_and_refactorer.py:68-96

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.

ASTDuplicityRefactorer.find_duplicate_groups

Kind: Method
Source: tzero/tzero_fixer/code_duplicity_and_refactorer.py:99-150

Signature:

def find_duplicate_groups(cls, workspace_dir: str = '.') -> Tuple[List[DuplicateCloneGroup], List[DiagnosticIssue]]:

Source docstring:

Scans workspace directory for duplicate clone clusters.

tzero/tzero_fixer/code_smells_healer.py

Source: tzero/tzero_fixer/code_smells_healer.py
Source size: 260 lines | 2 classes | 7 functions

Module docstring:

T-Zero Code Smells, Anti-Patterns, and Modernization Healer.

Detects and surgically heals Python anti-patterns and code smells:
- Mutable default arguments (def foo(x=[]) -> def foo(x=None) + sentinel guard).
- Bare except clauses (except: -> except Exception:).
- Deprecated standard library APIs (cgi.escape, pipes.quote, datetime.utcnow).
- PEP 585 / 604 modern type annotations (List[int] -> list[int], Optional[str] -> str | None).
- Quadratic string concatenations inside loops.
- Resource leaks: unclosed file handles without 'with' statement.

Author: [redacted] (Siber Akademi)
Version: 10.4.0

CodeSmellsHealer

Kind: Class
Source: tzero/tzero_fixer/code_smells_healer.py:33-260

Declaration:

class CodeSmellsHealer:

Source docstring:

AST visitor and transformer for eliminating code smells and anti-patterns.

CodeSmellsHealer.scan_bare_excepts

Kind: Method
Source: tzero/tzero_fixer/code_smells_healer.py:44-62

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.

CodeSmellsHealer.scan_mutable_defaults

Kind: Method
Source: tzero/tzero_fixer/code_smells_healer.py:65-85

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=[]):).

CodeSmellsHealer.scan_deprecated_apis

Kind: Method
Source: tzero/tzero_fixer/code_smells_healer.py:88-113

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.

CodeSmellsHealer.scan_quadratic_string_concat

Kind: Method
Source: tzero/tzero_fixer/code_smells_healer.py:116-137

Signature:

def scan_quadratic_string_concat(cls, file_path: str, tree: ast.AST) -> List[DiagnosticIssue]:

Source docstring:

Detect quadratic string concatenation (s += ...) inside loops.

CodeSmellsHealer.heal_code_smells

Kind: Method
Source: tzero/tzero_fixer/code_smells_healer.py:140-171

Signature:

def heal_code_smells(cls, content: str, filename: str = 'snippet.py') -> Any:

Source docstring:

In-memory code smell repair helper.

CodeSmellsHealer.heal_code_smells.StringHealResult

Kind: Class
Source: tzero/tzero_fixer/code_smells_healer.py:143-147

Declaration:

class StringHealResult:

Source docstring: none; consult the linked implementation rather than inferring behavior.

CodeSmellsHealer.diagnose_file

Kind: Method
Source: tzero/tzero_fixer/code_smells_healer.py:174-193

Signature:

def diagnose_file(cls, file_path: str) -> List[DiagnosticIssue]:

Source docstring:

Scan file for code smells, anti-patterns, and deprecated APIs.

CodeSmellsHealer.execute_smell_heals

Kind: Method
Source: tzero/tzero_fixer/code_smells_healer.py:196-260

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.

tzero/tzero_fixer/cwe_remediator.py

Source: tzero/tzero_fixer/cwe_remediator.py
Source size: 171 lines | 1 classes | 4 functions

Module docstring:


T-Zero CWE & OWASP Autonomous Security Remediator
================================================
Static AST security vulnerability detector and automated surgical code patcher.
Transforms dangerous, injectable patterns into secure, parameterized, sandboxed code.

CWE Remediations Supported:
  - CWE-78 (OS Command Injection):
      Replaces shell=True string interpolations with parameterized argument lists.
  - CWE-89 (SQL Injection):
      Converts raw f-string and % formatted SQL queries into parameterized query tuples.
  - CWE-22 (Improper Limitation of a Pathname / Path Traversal):
      Injects resolve() validation to enforce path sandboxing within root directory.
  - CWE-502 (Deserialization of Untrusted Data):
      Replaces unsafe pickle.loads / yaml.load with safe deserialization equivalents.
  - CWE-327 (Use of a Broken or Risky Cryptographic Algorithm):
      Replaces md5 / sha1 for security hashing with sha256 / hashlib.blake2b.

Author: Siber Akademi T-Zero R&D Team
Version: 10.5.0 | 100% Free & Local Offline | Zero-Leak Certified

SecurityCweRemediator

Kind: Class
Source: tzero/tzero_fixer/cwe_remediator.py:41-170

Declaration:

class SecurityCweRemediator:

Source docstring:

AST surgical patcher for CWE vulnerabilities and OWASP Top 10 weaknesses.

SecurityCweRemediator.diagnose_file

Kind: Method
Source: tzero/tzero_fixer/cwe_remediator.py:45-111

Signature:

def diagnose_file(cls, file_path: str) -> List[DiagnosticIssue]:

Source docstring:

Audit Python file for automatable CWE vulnerabilities.

SecurityCweRemediator._is_subprocess_call

Kind: Method
Source: tzero/tzero_fixer/cwe_remediator.py:114-120

Signature:

def _is_subprocess_call(cls, node: ast.Call) -> bool:

Source docstring:

Check if call is subprocess.run, Popen, call, or check_output.

SecurityCweRemediator._is_sql_execute

Kind: Method
Source: tzero/tzero_fixer/cwe_remediator.py:123-128

Signature:

def _is_sql_execute(cls, node: ast.Call) -> bool:

Source docstring:

Check if call is cursor.execute or conn.execute.

SecurityCweRemediator.heal_issue

Kind: Method
Source: tzero/tzero_fixer/cwe_remediator.py:131-170

Signature:

def heal_issue(cls, issue: DiagnosticIssue, dry_run: bool = False) -> HealAction:

Source docstring:

Autonomously remediate CWE vulnerabilities.

tzero/tzero_fixer/dead_code_eliminator.py

Source: tzero/tzero_fixer/dead_code_eliminator.py
Source size: 150 lines | 1 classes | 4 functions

Module docstring:


T-Zero Dead Code, Orphaned Symbol, & Unreachable Branch Eliminator
================================================================
Static AST analyzer that detects dead code smells, unreferenced private symbols,
unused local variables, and statements after terminating branches (return / raise).

Key Capabilities:
  - Detection of unreferenced private functions (_helper()) within module scope
  - Detection of unreachable statements immediately following return, raise, or break
  - Detection of unused local assignments
  - Autonomous surgical removal or comment-out of dead branches

Author: Siber Akademi T-Zero R&D Team
Version: 10.5.0 | 100% Free & Local Offline | Zero-Leak Certified

DeadCodeEliminator

Kind: Class
Source: tzero/tzero_fixer/dead_code_eliminator.py:34-149

Declaration:

class DeadCodeEliminator:

Source docstring:

AST surgical engine for discovering and pruning unreachable or unused code.

DeadCodeEliminator.diagnose_file

Kind: Method
Source: tzero/tzero_fixer/dead_code_eliminator.py:38-53

Signature:

def diagnose_file(cls, file_path: str) -> List[DiagnosticIssue]:

Source docstring:

Audit Python file for dead code, unreferenced private helpers, and unreachable lines.

DeadCodeEliminator._find_unreachable_statements

Kind: Method
Source: tzero/tzero_fixer/dead_code_eliminator.py:56-86

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.

DeadCodeEliminator._find_unused_private_functions

Kind: Method
Source: tzero/tzero_fixer/dead_code_eliminator.py:89-123

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.

DeadCodeEliminator.heal_issue

Kind: Method
Source: tzero/tzero_fixer/dead_code_eliminator.py:126-149

Signature:

def heal_issue(cls, issue: DiagnosticIssue, dry_run: bool = False) -> HealAction:

Source docstring:

Autonomously comment-out or prune dead unreachable blocks.

tzero/tzero_fixer/dependency_vulnerability_auditor.py

Source: tzero/tzero_fixer/dependency_vulnerability_auditor.py
Source size: 309 lines | 2 classes | 3 functions

Module docstring:


T-Zero Offline Dependency Vulnerability & Advisory Auditor
==========================================================
Zero-dependency, 100% offline vulnerability auditing engine for software dependencies.
Inspects package manifests (requirements.txt, pyproject.toml, package.json, Cargo.toml)
against an embedded database of known Critical and High severity CVE advisories.

Provides:
  - Python vulnerability scanner (requests, urllib3, jinja2, flask, django, cryptography, etc.)
  - Node.js vulnerability scanner (lodash, axios, tar, jsonwebtoken, express, etc.)
  - Rust & Cargo advisory scanner
  - Minimum safe version upgrade recommendations
  - 100% offline, local-only analysis with zero network requests or telemetry

Author: Siber Akademi T-Zero R&D Team
License: MIT (100% Free, Local Offline, Zero-Leak)

VulnerabilityAdvisory

Kind: Class
Source: tzero/tzero_fixer/dependency_vulnerability_auditor.py:37-45

Declaration:

class VulnerabilityAdvisory:

Source docstring: none; consult the linked implementation rather than inferring behavior.

DependencyVulnerabilityAuditor

Kind: Class
Source: tzero/tzero_fixer/dependency_vulnerability_auditor.py:48-308

Declaration:

class DependencyVulnerabilityAuditor:

Source docstring:


    Scans project dependency files offline against known CVE security advisories.

DependencyVulnerabilityAuditor._parse_version_tuple

Kind: Method
Source: tzero/tzero_fixer/dependency_vulnerability_auditor.py:210-215

Signature:

def _parse_version_tuple(cls, ver_str: str) -> Tuple[int, ...]:

Source docstring: none; consult the linked implementation rather than inferring behavior.

DependencyVulnerabilityAuditor.scan_requirements_txt

Kind: Method
Source: tzero/tzero_fixer/dependency_vulnerability_auditor.py:218-257

Signature:

def scan_requirements_txt(cls, file_path: str, content: str) -> List[DiagnosticIssue]:

Source docstring: none; consult the linked implementation rather than inferring behavior.

DependencyVulnerabilityAuditor.execute_upgrades

Kind: Method
Source: tzero/tzero_fixer/dependency_vulnerability_auditor.py:260-308

Signature:

def execute_upgrades(cls, issues: List[DiagnosticIssue], dry_run: bool = False) -> List[HealAction]:

Source docstring: none; consult the linked implementation rather than inferring behavior.

tzero/tzero_fixer/git_advanced_surgeon.py

Source: tzero/tzero_fixer/git_advanced_surgeon.py
Source size: 280 lines | 3 classes | 6 functions

Module docstring:


T-Zero Git Advanced Surgeon & VCS Integrity Healer
=================================================
Deep surgical recovery and diagnostics for Git version control repositories,
stale lockfiles, detached HEAD states, stalled rebase/merge operations,
uninitialized submodules, and cross-platform line ending conflicts.

Key Capabilities:
  - Stale lock detection & surgical removal (.git/index.lock, refs/heads/*.lock, HEAD.lock)
  - Stalled rebase/merge state diagnostic (.git/rebase-merge, .git/MERGE_HEAD, CHERRY_PICK_HEAD)
  - Detached HEAD state detection and branch rescue
  - Submodule alignment & uninitialized repository recovery
  - Cross-platform line-ending (.gitattributes) standardizer
  - Large binary file commit warning (>50MB) to prevent repo bloat

Author: Siber Akademi T-Zero R&D Team
Version: 10.5.0 | 100% Free & Local Offline | Zero-Leak Certified

GitLockInfo

Kind: Class
Source: tzero/tzero_fixer/git_advanced_surgeon.py:42-45

Declaration:

class GitLockInfo:

Source docstring: none; consult the linked implementation rather than inferring behavior.

GitRebaseState

Kind: Class
Source: tzero/tzero_fixer/git_advanced_surgeon.py:49-53

Declaration:

class GitRebaseState:

Source docstring: none; consult the linked implementation rather than inferring behavior.

GitAdvancedSurgeon

Kind: Class
Source: tzero/tzero_fixer/git_advanced_surgeon.py:56-279

Declaration:

class GitAdvancedSurgeon:

Source docstring:

Diagnostic and surgical engine for Git repositories and VCS integrity.

GitAdvancedSurgeon.diagnose_workspace

Kind: Method
Source: tzero/tzero_fixer/git_advanced_surgeon.py:62-144

Signature:

def diagnose_workspace(cls, workspace_path: str) -> List[DiagnosticIssue]:

Source docstring:

Diagnose all Git VCS issues in the workspace.

GitAdvancedSurgeon._find_git_locks

Kind: Method
Source: tzero/tzero_fixer/git_advanced_surgeon.py:147-165

Signature:

def _find_git_locks(cls, git_dir: Path) -> List[GitLockInfo]:

Source docstring:

Find any lock files in .git directory and compute their age.

GitAdvancedSurgeon._check_rebase_state

Kind: Method
Source: tzero/tzero_fixer/git_advanced_surgeon.py:168-177

Signature:

def _check_rebase_state(cls, git_dir: Path) -> GitRebaseState:

Source docstring:

Check if Git is currently in rebase, merge, or cherry-pick states.

GitAdvancedSurgeon._is_detached_head

Kind: Method
Source: tzero/tzero_fixer/git_advanced_surgeon.py:180-189

Signature:

def _is_detached_head(cls, repo_root: Path) -> bool:

Source docstring:

Determine if HEAD is currently detached.

GitAdvancedSurgeon._audit_submodules

Kind: Method
Source: tzero/tzero_fixer/git_advanced_surgeon.py:192-214

Signature:

def _audit_submodules(cls, repo_root: Path) -> List[DiagnosticIssue]:

Source docstring:

Audit submodules listed in .gitmodules.

GitAdvancedSurgeon.heal_issue

Kind: Method
Source: tzero/tzero_fixer/git_advanced_surgeon.py:217-279

Signature:

def heal_issue(cls, issue: DiagnosticIssue, dry_run: bool = False) -> HealAction:

Source docstring:

Autonomously heal Git repository issues.

tzero/tzero_fixer/hardware_and_disk_doctor.py

Source: tzero/tzero_fixer/hardware_and_disk_doctor.py
Source size: 325 lines | 3 classes | 7 functions

Module docstring:


T-Zero Hardware, Memory, & Dev Port Surgeon
===========================================
Deep diagnostics for physical hardware, disk partitions, dev port conflicts,
and zombie process termination.

Features:
  - Dev port collision detection & process identification (ports 3000, 5000, 8000, 8080, 5432, 27017, etc.)
  - S.M.A.R.T. physical disk health and storage capacity monitoring
  - WSL2 virtual disk (.vhdx) compaction recommendations
  - High-memory consumer and zombie process detection (>1.5 GB RAM)
  - Cross-platform support (Windows, Linux, macOS)

Author: Siber Akademi T-Zero R&D Team
Version: 10.5.0 | 100% Free & Local Offline | Zero-Leak Certified

PortConflictInfo

Kind: Class
Source: tzero/tzero_fixer/hardware_and_disk_doctor.py:42-47

Declaration:

class PortConflictInfo:

Source docstring: none; consult the linked implementation rather than inferring behavior.

DiskPartitionHealth

Kind: Class
Source: tzero/tzero_fixer/hardware_and_disk_doctor.py:51-56

Declaration:

class DiskPartitionHealth:

Source docstring: none; consult the linked implementation rather than inferring behavior.

HardwareAndDiskSurgeon

Kind: Class
Source: tzero/tzero_fixer/hardware_and_disk_doctor.py:59-325

Declaration:

class HardwareAndDiskSurgeon:

Source docstring:

Diagnostic and surgical engine for hardware, storage partitions, and developer ports.

HardwareAndDiskSurgeon.check_dev_port_status

Kind: Method
Source: tzero/tzero_fixer/hardware_and_disk_doctor.py:65-85

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.

HardwareAndDiskSurgeon._identify_process_on_port

Kind: Method
Source: tzero/tzero_fixer/hardware_and_disk_doctor.py:88-146

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.

HardwareAndDiskSurgeon.diagnose_port_conflicts

Kind: Method
Source: tzero/tzero_fixer/hardware_and_disk_doctor.py:149-172

Signature:

def diagnose_port_conflicts(cls) -> Tuple[List[DiagnosticIssue], List[HealAction]]:

Source docstring:

Detect development port collisions blocking application startup.

HardwareAndDiskSurgeon.kill_process_on_port

Kind: Method
Source: tzero/tzero_fixer/hardware_and_disk_doctor.py:175-216

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.

HardwareAndDiskSurgeon.check_disk_partitions_health

Kind: Method
Source: tzero/tzero_fixer/hardware_and_disk_doctor.py:219-260

Signature:

def check_disk_partitions_health(cls) -> List[DiskPartitionHealth]:

Source docstring:

Inspect all available storage volumes for low disk space conditions.

HardwareAndDiskSurgeon.terminate_process

Kind: Method
Source: tzero/tzero_fixer/hardware_and_disk_doctor.py:265-275

Signature:

def terminate_process(cls, pid: int) -> bool:

Source docstring:

Terminate process by PID across platforms.

HardwareAndDiskSurgeon.diagnose_disk_and_memory

Kind: Method
Source: tzero/tzero_fixer/hardware_and_disk_doctor.py:278-325

Signature:

def diagnose_disk_and_memory(cls) -> List[DiagnosticIssue]:

Source docstring:

Audit storage and RAM boundaries across host machine.

tzero/tzero_fixer/import_graph_healer.py

Source: tzero/tzero_fixer/import_graph_healer.py
Source size: 412 lines | 1 classes | 9 functions

Module docstring:

T-Zero Import Graph & Dependency Cycle Healer.

Performs deep static graph analysis on module imports:
- Tarjan's Strongly Connected Components (SCC) algorithm for circular import cycles.
- Missing Standard Library and Typing symbol auto-injection (80+ symbols).
- Dead / unused import detection and pruning with zero blast radius.
- Wildcard import expansion (from module import * -> explicit symbols).
- Standard library module shadowing detection (e.g. workspace email.py or random.py).

Author: [redacted] (Siber Akademi)
Version: 10.4.0

ImportGraphHealer

Kind: Class
Source: tzero/tzero_fixer/import_graph_healer.py:30-412

Declaration:

class ImportGraphHealer:

Source docstring:

Graph-theoretic dependency analyzer and surgical import injector.

ImportGraphHealer.check_stdlib_shadowing

Kind: Method
Source: tzero/tzero_fixer/import_graph_healer.py:127-149

Signature:

def check_stdlib_shadowing(cls, workspace_dir: str = '.') -> List[DiagnosticIssue]:

Source docstring:

Detect workspace files that dangerously shadow Python standard library modules.

ImportGraphHealer.scan_file_imports_and_references

Kind: Method
Source: tzero/tzero_fixer/import_graph_healer.py:152-172

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.

ImportGraphHealer.detect_missing_stdlib_imports

Kind: Method
Source: tzero/tzero_fixer/import_graph_healer.py:175-197

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.

ImportGraphHealer.detect_wildcard_imports

Kind: Method
Source: tzero/tzero_fixer/import_graph_healer.py:200-219

Signature:

def detect_wildcard_imports(cls, file_path: str, tree: ast.AST) -> List[DiagnosticIssue]:

Source docstring:

Detect wildcard 'from module import *' anti-patterns.

ImportGraphHealer.build_workspace_import_graph

Kind: Method
Source: tzero/tzero_fixer/import_graph_healer.py:222-261

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).

ImportGraphHealer.find_circular_import_cycles

Kind: Method
Source: tzero/tzero_fixer/import_graph_healer.py:264-303

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.

ImportGraphHealer.find_circular_import_cycles.strongconnect

Kind: Nested function
Source: tzero/tzero_fixer/import_graph_healer.py:273-297

Signature:

def strongconnect(node: str):

Source docstring: none; consult the linked implementation rather than inferring behavior.

ImportGraphHealer.diagnose_workspace

Kind: Method
Source: tzero/tzero_fixer/import_graph_healer.py:306-349

Signature:

def diagnose_workspace(cls, workspace_dir: str = '.') -> List[DiagnosticIssue]:

Source docstring:

Diagnose standard library shadowing, wildcard imports, missing imports, and cycles.

ImportGraphHealer.execute_import_heals

Kind: Method
Source: tzero/tzero_fixer/import_graph_healer.py:352-412

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.

tzero/tzero_fixer/interactive_tui.py

Source: tzero/tzero_fixer/interactive_tui.py
Source size: 91 lines | 1 classes | 3 functions

Module docstring:

T-Zero Autonomous Doctor Interactive Terminal Cockpit & TUI.

Provides high-impact ANSI terminal visualization:
- Visual health score gauges and dial meters.
- Multi-column toolchain status matrices.
- Colored syntax-highlighted diff hunk renderers.
- Interactive category filtering and self-healing menus.

Author: [redacted] (Siber Akademi)
Version: 10.4.0

InteractiveFixerTUI

Kind: Class
Source: tzero/tzero_fixer/interactive_tui.py:27-91

Declaration:

class InteractiveFixerTUI:

Source docstring:

Terminal UI renderer for T-Zero Autonomous Doctor.

InteractiveFixerTUI.render_gauge

Kind: Method
Source: tzero/tzero_fixer/interactive_tui.py:31-43

Signature:

def render_gauge(percentage: int, width: int = 30) -> str:

Source docstring:

Render a colored ASCII health progress bar gauge.

InteractiveFixerTUI.render_cockpit

Kind: Method
Source: tzero/tzero_fixer/interactive_tui.py:46-78

Signature:

def render_cockpit(cls, diag: DiagnosticReport, heal: Optional[HealReport] = None):

Source docstring:

Render full interactive cockpit view.

InteractiveFixerTUI.render_diff

Kind: Method
Source: tzero/tzero_fixer/interactive_tui.py:81-91

Signature:

def render_diff(cls, diff_text: str):

Source docstring:

Render a unified diff with ANSI syntax colors.

tzero/tzero_fixer/knowledge_base.py

Source: tzero/tzero_fixer/knowledge_base.py
Source size: 295 lines | 2 classes | 2 functions

Module docstring:

T-Zero Autonomous Doctor Encyclopedic Diagnostic Knowledge Base.

Contains 100+ formal diagnostic error codes with comprehensive technical explanations,
root-cause analyses, CWE / OWASP security references, and surgical remediation guides:
- Syntax and grammar defects (TZ-SYN-001 to TZ-SYN-025)
- Import topology and circular cycles (TZ-IMP-001 to TZ-IMP-025)
- Environment and virtualenv corruptions (TZ-ENV-001 to TZ-ENV-025)
- Zero-Leak security credentials and secret leaks (TZ-SEC-001 to TZ-SEC-040)
- Code smells, anti-patterns, and memory leaks (TZ-SML-001 to TZ-SML-025)
- Polyglot Node, Rust, Go, and Container defects (TZ-PLG-001 to TZ-PLG-025)

Author: [redacted] (Siber Akademi)
Version: 10.4.0

ErrorSpecification

Kind: Class
Source: tzero/tzero_fixer/knowledge_base.py:20-29

Declaration:

class ErrorSpecification(NamedTuple):

Source docstring: none; consult the linked implementation rather than inferring behavior.

KnowledgeBaseManager

Kind: Class
Source: tzero/tzero_fixer/knowledge_base.py:286-295

Declaration:

class KnowledgeBaseManager:

Source docstring:

Provides query access and lookup for the diagnostic knowledge base.

KnowledgeBaseManager.get_spec

Kind: Method
Source: tzero/tzero_fixer/knowledge_base.py:290-291

Signature:

def get_spec(cls, error_code: str) -> Optional[ErrorSpecification]:

Source docstring: none; consult the linked implementation rather than inferring behavior.

KnowledgeBaseManager.get_all_codes

Kind: Method
Source: tzero/tzero_fixer/knowledge_base.py:294-295

Signature:

def get_all_codes(cls) -> List[str]:

Source docstring: none; consult the linked implementation rather than inferring behavior.

tzero/tzero_fixer/knowledge_base_extended.py

Source: tzero/tzero_fixer/knowledge_base_extended.py
Source size: 940 lines | 2 classes | 8 functions

Module docstring:


T-Zero PC-Fixer: Extended Diagnostic Knowledge Base & Remediation Encyclopedia
=============================================================================
Comprehensive, structured encyclopedia of software engineering defects,
architectural anti-patterns, runtime environment faults, and automated remediation recipes.
Provides:
  - 120+ granular defect specifications across 6 primary engineering domains
  - Technical root cause explanations
  - Before/after code snippets for surgical AST healing
  - Multi-language coverage (Python, Node/TS, Rust, Go, Docker, YAML, Make, SQL)
  - Common Weakness Enumeration (CWE) and ISO-25010 code quality mappings
  - Algorithmic remediation workflows and confidence scoring metrics

Author: Siber Akademi T-Zero R&D Team
License: MIT (100% Free, Local Offline, Zero-Leak)

ExtendedKnowledgeEntry

Kind: Class
Source: tzero/tzero_fixer/knowledge_base_extended.py:27-73

Declaration:

class ExtendedKnowledgeEntry:

Source docstring:

Detailed encyclopedia entry for a specific diagnostic defect.

ExtendedKnowledgeEntry.to_dict

Kind: Method
Source: tzero/tzero_fixer/knowledge_base_extended.py:42-43

Signature:

def to_dict(self) -> Dict[str, Any]:

Source docstring: none; consult the linked implementation rather than inferring behavior.

ExtendedKnowledgeEntry.to_markdown

Kind: Method
Source: tzero/tzero_fixer/knowledge_base_extended.py:45-73

Signature:

def to_markdown(self) -> str:

Source docstring: none; consult the linked implementation rather than inferring behavior.

ExtendedKnowledgeBase

Kind: Class
Source: tzero/tzero_fixer/knowledge_base_extended.py:76-940

Declaration:

class ExtendedKnowledgeBase:

Source docstring:

Master repository and index for software defects and automated repair knowledge.

ExtendedKnowledgeBase.get_entry

Kind: Method
Source: tzero/tzero_fixer/knowledge_base_extended.py:906-907

Signature:

def get_entry(cls, code: str) -> Optional[ExtendedKnowledgeEntry]:

Source docstring: none; consult the linked implementation rather than inferring behavior.

ExtendedKnowledgeBase.list_by_category

Kind: Method
Source: tzero/tzero_fixer/knowledge_base_extended.py:910-912

Signature:

def list_by_category(cls, category: str) -> List[ExtendedKnowledgeEntry]:

Source docstring: none; consult the linked implementation rather than inferring behavior.

ExtendedKnowledgeBase.list_by_severity

Kind: Method
Source: tzero/tzero_fixer/knowledge_base_extended.py:915-917

Signature:

def list_by_severity(cls, severity: str) -> List[ExtendedKnowledgeEntry]:

Source docstring: none; consult the linked implementation rather than inferring behavior.

ExtendedKnowledgeBase.search_by_keyword

Kind: Method
Source: tzero/tzero_fixer/knowledge_base_extended.py:920-929

Signature:

def search_by_keyword(cls, query: str) -> List[ExtendedKnowledgeEntry]:

Source docstring: none; consult the linked implementation rather than inferring behavior.

ExtendedKnowledgeBase.export_all_markdown

Kind: Method
Source: tzero/tzero_fixer/knowledge_base_extended.py:932-936

Signature:

def export_all_markdown(cls) -> str:

Source docstring: none; consult the linked implementation rather than inferring behavior.

ExtendedKnowledgeBase.export_all_json

Kind: Method
Source: tzero/tzero_fixer/knowledge_base_extended.py:939-940

Signature:

def export_all_json(cls) -> str:

Source docstring: none; consult the linked implementation rather than inferring behavior.

tzero/tzero_fixer/linters_and_static_analyzer.py

Source: tzero/tzero_fixer/linters_and_static_analyzer.py
Source size: 307 lines | 1 classes | 9 functions

Module docstring:

T-Zero AST Static Code Linter & Deep Semantic Analyzer.

Performs static code analysis across Python AST structures:
- Identity comparison with literals (x is 5 -> x == 5).
- Assert statements with 2-tuples (assert (cond, msg) always evaluates to True).
- Unreachable code statements following return, raise, break, or continue.
- Redundant boolean comparisons (if x == True: -> if x:).
- Duplicate dictionary literal keys.
- Variable assignments shadowing Python built-in names (list, dict, id, str).
- Silent exception swallowing (except Exception: pass).
- High cyclomatic complexity calculations (McCabe complexity > 15).

Author: [redacted] (Siber Akademi)
Version: 10.4.0

ASTStaticAnalyzer

Kind: Class
Source: tzero/tzero_fixer/linters_and_static_analyzer.py:33-307

Declaration:

class ASTStaticAnalyzer:

Source docstring:

Deep AST semantic checker and defect auto-remediator.

ASTStaticAnalyzer.compute_cyclomatic_complexity

Kind: Method
Source: tzero/tzero_fixer/linters_and_static_analyzer.py:42-52

Signature:

def compute_cyclomatic_complexity(cls, node: ast.AST) -> int:

Source docstring:

Calculate McCabe cyclomatic complexity of an AST block.

ASTStaticAnalyzer.check_assert_tuples

Kind: Method
Source: tzero/tzero_fixer/linters_and_static_analyzer.py:55-73

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.

ASTStaticAnalyzer.check_is_literal_comparisons

Kind: Method
Source: tzero/tzero_fixer/linters_and_static_analyzer.py:76-97

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.

ASTStaticAnalyzer.check_unreachable_code

Kind: Method
Source: tzero/tzero_fixer/linters_and_static_analyzer.py:100-126

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.

ASTStaticAnalyzer.check_duplicate_dict_keys

Kind: Method
Source: tzero/tzero_fixer/linters_and_static_analyzer.py:129-152

Signature:

def check_duplicate_dict_keys(cls, file_path: str, tree: ast.AST) -> List[DiagnosticIssue]:

Source docstring:

Detect duplicate literal keys in dictionary definitions.

ASTStaticAnalyzer.check_high_complexity_functions

Kind: Method
Source: tzero/tzero_fixer/linters_and_static_analyzer.py:155-174

Signature:

def check_high_complexity_functions(cls, file_path: str, tree: ast.AST) -> List[DiagnosticIssue]:

Source docstring:

Detect functions with McCabe cyclomatic complexity > 15.

ASTStaticAnalyzer.check_redundant_booleans

Kind: Method
Source: tzero/tzero_fixer/linters_and_static_analyzer.py:177-214

Signature:

def check_redundant_booleans(cls, file_path: str, content: str) -> List[DiagnosticIssue]:

Source docstring:

Detect redundant '== True' or '== False' boolean comparisons.

ASTStaticAnalyzer.diagnose_file

Kind: Method
Source: tzero/tzero_fixer/linters_and_static_analyzer.py:217-238

Signature:

def diagnose_file(cls, file_path: str) -> List[DiagnosticIssue]:

Source docstring:

Run all AST static analysis checks on a source file.

ASTStaticAnalyzer.execute_linter_heals

Kind: Method
Source: tzero/tzero_fixer/linters_and_static_analyzer.py:241-307

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.

tzero/tzero_fixer/mcp_server.py

Source: tzero/tzero_fixer/mcp_server.py
Source size: 499 lines | 1 classes | 6 functions

Module docstring:


T-Zero PC-Fixer Standalone MCP Server
====================================
Model Context Protocol (MCP) JSON-RPC 2.0 Server for PC-Fixer & Codebase Doctor.
Integrates with Cursor, Windsurf, Claude Desktop, Antigravity IDE, and Zed.

TDQS 5.0 Grade A Certified:
  - 100% typed JSON-RPC 2.0 stdio transport
  - Strict input schema validation with required/optional parameter constraints
  - Zero cloud dependencies ($0.00 spend, local offline AST analysis)
  - Full transactional rollback safety & audit logging

Author: Siber Akademi T-Zero R&D Team
Version: 10.4.0 | 100% Free & Local Offline | Zero-Leak Certified

PCFixerMcpServer

Kind: Class
Source: tzero/tzero_fixer/mcp_server.py:41-479

Declaration:

class PCFixerMcpServer:

Source docstring:

Production-grade MCP stdio server for PC-Fixer & Codebase Doctor.

PCFixerMcpServer.__init__

Kind: Method
Source: tzero/tzero_fixer/mcp_server.py:230-231

Signature:

def __init__(self):

Source docstring: none; consult the linked implementation rather than inferring behavior.

PCFixerMcpServer.run

Kind: Method
Source: tzero/tzero_fixer/mcp_server.py:233-268

Signature:

def run(self):

Source docstring:

Run the MCP server over stdio reading JSON-RPC 2.0 lines.

PCFixerMcpServer.handle_request

Kind: Method
Source: tzero/tzero_fixer/mcp_server.py:270-313

Signature:

def handle_request(self, req: Dict[str, Any]) -> Optional[Dict[str, Any]]:

Source docstring:

Dispatch JSON-RPC request to appropriate handler.

PCFixerMcpServer.execute_tool

Kind: Method
Source: tzero/tzero_fixer/mcp_server.py:315-464

Signature:

def execute_tool(self, req_id: Any, name: str, args: Dict[str, Any]) -> Dict[str, Any]:

Source docstring:

Execute MCP tool by name.

PCFixerMcpServer._tool_success

Kind: Method
Source: tzero/tzero_fixer/mcp_server.py:466-479

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.

main

Kind: Function
Source: tzero/tzero_fixer/mcp_server.py:482-495

Signature:

def main():

Source docstring:

Main CLI entrypoint for PC-Fixer MCP Server.

tzero/tzero_fixer/models.py

Source: tzero/tzero_fixer/models.py
Source size: 385 lines | 11 classes | 19 functions

Module docstring:

T-Zero Autonomous PC-Fixer & Codebase Doctor: Core Models and Enums.

Defines all diagnostic entities, severity tiers, platform descriptors,
diff structures, transactional rollback manifests, and reporting schemas.

Author: [redacted] (Siber Akademi)
Version: 10.5.0
Master Edition / Security Certified Zero-Leak

SeverityLevel

Kind: Class
Source: tzero/tzero_fixer/models.py:22-52

Declaration:

class SeverityLevel(enum.Enum):

Source docstring:

Severity classification for diagnostic issues.

SeverityLevel.ansi_color

Kind: Method
Source: tzero/tzero_fixer/models.py:31-40

Signature:

def ansi_color(self) -> str:

Source docstring: none; consult the linked implementation rather than inferring behavior.

SeverityLevel.badge

Kind: Method
Source: tzero/tzero_fixer/models.py:43-52

Signature:

def badge(self) -> str:

Source docstring: none; consult the linked implementation rather than inferring behavior.

DiagnosticCategory

Kind: Class
Source: tzero/tzero_fixer/models.py:55-68

Declaration:

class DiagnosticCategory(enum.Enum):

Source docstring:

Category classification for doctor checks.

SystemPlatform

Kind: Class
Source: tzero/tzero_fixer/models.py:79-94

Declaration:

class SystemPlatform(enum.Enum):

Source docstring:

Host operating system platform.

SystemPlatform.current

Kind: Method
Source: tzero/tzero_fixer/models.py:87-94

Signature:

def current(cls) -> 'SystemPlatform':

Source docstring: none; consult the linked implementation rather than inferring behavior.

DiffHunk

Kind: Class
Source: tzero/tzero_fixer/models.py:98-111

Declaration:

class DiffHunk:

Source docstring:

Represents a unified diff modification hunk.

DiffHunk.to_unified_string

Kind: Method
Source: tzero/tzero_fixer/models.py:108-111

Signature:

def to_unified_string(self) -> str:

Source docstring: none; consult the linked implementation rather than inferring behavior.

DiagnosticIssue

Kind: Class
Source: tzero/tzero_fixer/models.py:115-189

Declaration:

class DiagnosticIssue:

Source docstring:

Represents a single detected diagnostic defect in codebase or environment.

DiagnosticIssue.__init__

Kind: Method
Source: tzero/tzero_fixer/models.py:129-163

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 rather than inferring behavior.

DiagnosticIssue.code

Kind: Method
Source: tzero/tzero_fixer/models.py:166-167

Signature:

def code(self) -> str:

Source docstring: none; consult the linked implementation rather than inferring behavior.

DiagnosticIssue.remediation

Kind: Method
Source: tzero/tzero_fixer/models.py:170-171

Signature:

def remediation(self) -> str:

Source docstring: none; consult the linked implementation rather than inferring behavior.

DiagnosticIssue.line_number

Kind: Method
Source: tzero/tzero_fixer/models.py:174-175

Signature:

def line_number(self) -> Optional[int]:

Source docstring: none; consult the linked implementation rather than inferring behavior.

DiagnosticIssue.to_dict

Kind: Method
Source: tzero/tzero_fixer/models.py:177-178

Signature:

def to_dict(self) -> Dict[str, Any]:

Source docstring: none; consult the linked implementation rather than inferring behavior.

DiagnosticIssue.formatted_location

Kind: Method
Source: tzero/tzero_fixer/models.py:181-189

Signature:

def formatted_location(self) -> str:

Source docstring: none; consult the linked implementation rather than inferring behavior.

HealAction

Kind: Class
Source: tzero/tzero_fixer/models.py:193-245

Declaration:

class HealAction:

Source docstring:

Record of a surgical repair action executed on disk or in memory.

HealAction.__init__

Kind: Method
Source: tzero/tzero_fixer/models.py:205-238

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 rather than inferring behavior.

HealAction.details

Kind: Method
Source: tzero/tzero_fixer/models.py:241-242

Signature:

def details(self) -> str:

Source docstring: none; consult the linked implementation rather than inferring behavior.

HealAction.to_dict

Kind: Method
Source: tzero/tzero_fixer/models.py:244-245

Signature:

def to_dict(self) -> Dict[str, Any]:

Source docstring: none; consult the linked implementation rather than inferring behavior.

ToolStatus

Kind: Class
Source: tzero/tzero_fixer/models.py:249-256

Declaration:

class ToolStatus:

Source docstring:

Status of an external development tool on system PATH.

EnvironmentSnapshot

Kind: Class
Source: tzero/tzero_fixer/models.py:260-276

Declaration:

class EnvironmentSnapshot:

Source docstring:

Detailed health matrix of the host operating system and execution runtime.

DiagnosticReport

Kind: Class
Source: tzero/tzero_fixer/models.py:280-342

Declaration:

class DiagnosticReport:

Source docstring:

Complete diagnostic audit result across all categories.

DiagnosticReport.to_dict

Kind: Method
Source: tzero/tzero_fixer/models.py:304-305

Signature:

def to_dict(self) -> Dict[str, Any]:

Source docstring: none; consult the linked implementation rather than inferring behavior.

DiagnosticReport.to_sarif

Kind: Method
Source: tzero/tzero_fixer/models.py:307-342

Signature:

def to_sarif(self) -> Dict[str, Any]:

Source docstring:

Convert diagnostic issues to standard OASIS SARIF v2.1.0 format.

RollbackManifest

Kind: Class
Source: tzero/tzero_fixer/models.py:346-362

Declaration:

class RollbackManifest:

Source docstring:

Manifest of files backed up before autonomous healing for atomic rollback.

RollbackManifest.save

Kind: Method
Source: tzero/tzero_fixer/models.py:354-356

Signature:

def save(self, manifest_file: str):

Source docstring: none; consult the linked implementation rather than inferring behavior.

RollbackManifest.load

Kind: Method
Source: tzero/tzero_fixer/models.py:359-362

Signature:

def load(cls, manifest_file: str) -> 'RollbackManifest':

Source docstring: none; consult the linked implementation rather than inferring behavior.

HealReport

Kind: Class
Source: tzero/tzero_fixer/models.py:366-385

Declaration:

class HealReport:

Source docstring:

Comprehensive outcome report of autonomous self-healing execution.

HealReport.to_dict

Kind: Method
Source: tzero/tzero_fixer/models.py:380-381

Signature:

def to_dict(self) -> Dict[str, Any]:

Source docstring: none; consult the linked implementation rather than inferring behavior.

HealReport.is_fully_healthy

Kind: Method
Source: tzero/tzero_fixer/models.py:384-385

Signature:

def is_fully_healthy(self) -> bool:

Source docstring: none; consult the linked implementation rather than inferring behavior.

tzero/tzero_fixer/orchestrator.py

Source: tzero/tzero_fixer/orchestrator.py
Source size: 375 lines | 1 classes | 6 functions

Module docstring:

T-Zero Master Autonomous Orchestrator & Transactional Rollback Engine.

Coordinates all specialized doctor engines:
- OS & Hardware Doctor (OSDoctor)
- Virtualenv & Dependency Drift Doctor (VenvDoctor)
- AST Syntax Healer (ASTSyntaxHealer)
- Import Graph & Cycle Healer (ImportGraphHealer)
- Code Smells & Modernizer (CodeSmellsHealer)
- 100% Zero-Leak Security Guard (SecurityZeroLeakDoctor)

Features:
- Transactional file backups with atomic rollback (.tzero/fixer_backups/).
- Multi-pass convergence loop (diagnose -> heal -> verify AST -> converge).
- Unified ANSI terminal rendering and JSON / SARIF v2.1.0 report generation.

Author: [redacted] (Siber Akademi)
Version: 10.5.0

FixerOrchestrator

Kind: Class
Source: tzero/tzero_fixer/orchestrator.py:66-375

Declaration:

class FixerOrchestrator:

Source docstring:

Master orchestrator for all diagnosis and autonomous self-healing operations.

FixerOrchestrator.create_transaction_backup

Kind: Method
Source: tzero/tzero_fixer/orchestrator.py:72-95

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.

FixerOrchestrator.rollback_transaction

Kind: Method
Source: tzero/tzero_fixer/orchestrator.py:98-114

Signature:

def rollback_transaction(cls, workspace_dir: str, transaction_id: str) -> bool:

Source docstring:

Restore all original files from a previous transactional backup.

FixerOrchestrator.calculate_health_score

Kind: Method
Source: tzero/tzero_fixer/orchestrator.py:117-128

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.

FixerOrchestrator.diagnose_workspace

Kind: Method
Source: tzero/tzero_fixer/orchestrator.py:131-215

Signature:

def diagnose_workspace(cls, workspace_dir: str = '.') -> DiagnosticReport:

Source docstring:

Run complete, multi-category diagnostic sweep across the entire workspace.

FixerOrchestrator.auto_heal

Kind: Method
Source: tzero/tzero_fixer/orchestrator.py:218-309

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.

FixerOrchestrator.render_cli

Kind: Method
Source: tzero/tzero_fixer/orchestrator.py:312-375

Signature:

def render_cli(cls, diag: DiagnosticReport, heal: Optional[HealReport] = None):

Source docstring:

Render high-contrast, beautiful ANSI terminal cockpit report.

tzero/tzero_fixer/os_doctor.py

Source: tzero/tzero_fixer/os_doctor.py
Source size: 502 lines | 2 classes | 10 functions

Module docstring:

T-Zero Operating System, Toolchain, & Hardware Environment Doctor.

Performs deep hardware, runtime environment, CLI toolchain, and OS-level diagnostics:
- Tool probing with version parsing (git, python, pip, npm, npx, pnpm, yarn, bun, rustc, cargo, go, docker, code, cursor).
- Windows Registry inspection (LongPathsEnabled, PythonCore registration, dead PATH entries).
- POSIX permissions, ulimits, and file handle exhaustion checks.
- File lock detection and exclusive access verification.
- Stale lockfiles (.git/index.lock, .cargo/.package-cache) and orphaned bytecode sweeper.
- Hardware metrics: RAM availability, disk space, and temp bloat inspection.

Author: [redacted] (Siber Akademi)
Version: 10.4.0

OSDoctor

Kind: Class
Source: tzero/tzero_fixer/os_doctor.py:38-502

Declaration:

class OSDoctor:

Source docstring:

Enterprise-grade diagnostic engine for OS, hardware, filesystem, and CLI tools.

OSDoctor.get_system_platform

Kind: Method
Source: tzero/tzero_fixer/os_doctor.py:67-68

Signature:

def get_system_platform(cls) -> SystemPlatform:

Source docstring: none; consult the linked implementation rather than inferring behavior.

OSDoctor.get_hardware_metrics

Kind: Method
Source: tzero/tzero_fixer/os_doctor.py:71-124

Signature:

def get_hardware_metrics(cls) -> Tuple[float, float, int]:

Source docstring:

Returns (total_ram_gb, available_ram_gb, cpu_cores).

OSDoctor.get_hardware_metrics.MEMORYSTATUSEX

Kind: Class
Source: tzero/tzero_fixer/os_doctor.py:92-103

Declaration:

class MEMORYSTATUSEX(ctypes.Structure):

Source docstring: none; consult the linked implementation rather than inferring behavior.

OSDoctor.probe_tool

Kind: Method
Source: tzero/tzero_fixer/os_doctor.py:127-172

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.

OSDoctor.probe_all_tools

Kind: Method
Source: tzero/tzero_fixer/os_doctor.py:177-187

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.

OSDoctor.check_windows_registry_settings

Kind: Method
Source: tzero/tzero_fixer/os_doctor.py:190-226

Signature:

def check_windows_registry_settings(cls) -> List[DiagnosticIssue]:

Source docstring:

Inspect critical Windows registry settings (LongPathsEnabled, Python shims).

OSDoctor.check_path_environment

Kind: Method
Source: tzero/tzero_fixer/os_doctor.py:229-275

Signature:

def check_path_environment(cls) -> List[DiagnosticIssue]:

Source docstring:

Check system PATH for invalid directories, dead shims, and redundant entries.

OSDoctor.check_file_locks_and_permissions

Kind: Method
Source: tzero/tzero_fixer/os_doctor.py:278-329

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.

OSDoctor.check_bytecode_and_temp_bloat

Kind: Method
Source: tzero/tzero_fixer/os_doctor.py:332-380

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.

OSDoctor.capture_snapshot

Kind: Method
Source: tzero/tzero_fixer/os_doctor.py:383-412

Signature:

def capture_snapshot(cls, workspace_dir: str = '.') -> EnvironmentSnapshot:

Source docstring:

Capture comprehensive state snapshot of the active host environment.

OSDoctor.execute_os_heals

Kind: Method
Source: tzero/tzero_fixer/os_doctor.py:415-502

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.

tzero/tzero_fixer/packaging_abi_surgeon.py

Source: tzero/tzero_fixer/packaging_abi_surgeon.py
Source size: 323 lines | 3 classes | 6 functions

Module docstring:


T-Zero Packaging, PEP 517, & ABI Compatibility Surgeon
======================================================
Deep surgical diagnosis and self-healing for Python packaging, virtual environment
ABI alignment, duplicate .dist-info metadata, and PEP 517/621 configuration integrity.

Key Capabilities:
  - PEP 517 / PEP 621 pyproject.toml build-system validation & auto-healing
  - pyvenv.cfg corruption repair (home directory realignment & version pointers)
  - Duplicate / conflicting .dist-info resolution in site-packages
  - CPython ABI & native binary extension (.pyd / .so) mismatch detection
  - Stale .egg-info and legacy setup.py modernization
  - Pip wheel cache lock & index corruption clearing

Author: Siber Akademi T-Zero R&D Team
Version: 10.5.0 | 100% Free & Local Offline | Zero-Leak Certified

DistInfoMetadata

Kind: Class
Source: tzero/tzero_fixer/packaging_abi_surgeon.py:40-44

Declaration:

class DistInfoMetadata:

Source docstring: none; consult the linked implementation rather than inferring behavior.

AbiBinaryIssue

Kind: Class
Source: tzero/tzero_fixer/packaging_abi_surgeon.py:48-52

Declaration:

class AbiBinaryIssue:

Source docstring: none; consult the linked implementation rather than inferring behavior.

PackagingAbiSurgeon

Kind: Class
Source: tzero/tzero_fixer/packaging_abi_surgeon.py:55-322

Declaration:

class PackagingAbiSurgeon:

Source docstring:

Specialist engine for Python packaging standards, build systems, and binary ABI alignment.

PackagingAbiSurgeon.diagnose_workspace

Kind: Method
Source: tzero/tzero_fixer/packaging_abi_surgeon.py:78-120

Signature:

def diagnose_workspace(cls, workspace_path: str) -> List[DiagnosticIssue]:

Source docstring:

Diagnose packaging and ABI issues across the workspace root and virtual environments.

PackagingAbiSurgeon._audit_pyproject

Kind: Method
Source: tzero/tzero_fixer/packaging_abi_surgeon.py:123-169

Signature:

def _audit_pyproject(cls, pyproject_path: Path) -> List[DiagnosticIssue]:

Source docstring:

Audit pyproject.toml for missing build-system, invalid backends, or broken syntax.

PackagingAbiSurgeon._audit_pyvenv_cfg

Kind: Method
Source: tzero/tzero_fixer/packaging_abi_surgeon.py:172-201

Signature:

def _audit_pyvenv_cfg(cls, cfg_path: Path) -> List[DiagnosticIssue]:

Source docstring:

Audit pyvenv.cfg for broken home directory pointers.

PackagingAbiSurgeon._locate_site_packages

Kind: Method
Source: tzero/tzero_fixer/packaging_abi_surgeon.py:204-221

Signature:

def _locate_site_packages(cls, venv_dir: Path) -> List[Path]:

Source docstring:

Locate site-packages directories inside a virtual environment across platforms.

PackagingAbiSurgeon._audit_site_packages

Kind: Method
Source: tzero/tzero_fixer/packaging_abi_surgeon.py:224-252

Signature:

def _audit_site_packages(cls, sp_dir: Path) -> List[DiagnosticIssue]:

Source docstring:

Check for duplicate .dist-info versions and leftover installation locks.

PackagingAbiSurgeon.heal_issue

Kind: Method
Source: tzero/tzero_fixer/packaging_abi_surgeon.py:255-322

Signature:

def heal_issue(cls, issue: DiagnosticIssue, dry_run: bool = False) -> HealAction:

Source docstring:

Autonomously heal packaging and virtual environment ABI issues.

tzero/tzero_fixer/pc_fixer_doctor.py

Source: tzero/tzero_fixer/pc_fixer_doctor.py
Source size: 600 lines | 1 classes | 7 functions

Module docstring:


T-Zero PC Fixer Doctor Classic Facade and Compatibility Layer
============================================================
Provides backward-compatible PCFixerDoctor class for legacy test suites and APIs.

PCFixerDoctor

Kind: Class
Source: tzero/tzero_fixer/pc_fixer_doctor.py:31-600

Declaration:

class PCFixerDoctor:

Source docstring:

Enterprise-grade self-healing PC, runtime environment, and codebase doctor.

PCFixerDoctor.check_tools_on_path

Kind: Method
Source: tzero/tzero_fixer/pc_fixer_doctor.py:63-69

Signature:

def check_tools_on_path(cls) -> Dict[str, bool]:

Source docstring:

Check availability of essential development CLI tools on system PATH.

PCFixerDoctor.inspect_virtualenv

Kind: Method
Source: tzero/tzero_fixer/pc_fixer_doctor.py:72-110

Signature:

def inspect_virtualenv(cls, target_dir: str = '.') -> Dict[str, Any]:

Source docstring:

Check integrity of local virtual environments (.venv, venv, env).

PCFixerDoctor.scan_syntax_and_imports

Kind: Method
Source: tzero/tzero_fixer/pc_fixer_doctor.py:113-243

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.

PCFixerDoctor.scan_cache_and_bloat

Kind: Method
Source: tzero/tzero_fixer/pc_fixer_doctor.py:246-290

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.

PCFixerDoctor.diagnose

Kind: Method
Source: tzero/tzero_fixer/pc_fixer_doctor.py:293-361

Signature:

def diagnose(cls, target_dir: str = '.') -> DiagnosticReport:

Source docstring:

Run comprehensive diagnostic inspection across environment, workspace, and files.

PCFixerDoctor.auto_heal

Kind: Method
Source: tzero/tzero_fixer/pc_fixer_doctor.py:364-549

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.

PCFixerDoctor.render_cli

Kind: Method
Source: tzero/tzero_fixer/pc_fixer_doctor.py:552-600

Signature:

def render_cli(cls, report: DiagnosticReport, heal_report: Optional[HealReport] = None):

Source docstring:

Render beautiful, ANSI-colored doctor report to terminal.

tzero/tzero_fixer/performance_and_memory_profiler.py

Source: tzero/tzero_fixer/performance_and_memory_profiler.py
Source size: 274 lines | 2 classes | 6 functions

Module docstring:


T-Zero Performance & Memory Anti-Pattern Profiler
=================================================
Zero-overhead static AST profiler and automatic optimizer.
Diagnoses and surgically repairs:
  - Quadratic string accumulation in loops (O(N^2) memory reallocation)
  - Linear membership tests on lists inside loop bodies (O(N*M) algorithmic bottleneck)
  - List comprehension allocations passed directly to reduction functions (sum, any, all, min, max)
  - Unclosed file descriptors and network sockets missing context manager guards
  - Redundant range(len(collection)) iteration patterns

Author: Siber Akademi T-Zero R&D Team
License: MIT (100% Free, Local Offline, Zero-Leak)

PerformanceFinding

Kind: Class
Source: tzero/tzero_fixer/performance_and_memory_profiler.py:39-47

Declaration:

class PerformanceFinding:

Source docstring: none; consult the linked implementation rather than inferring behavior.

PerformanceProfilerHealer

Kind: Class
Source: tzero/tzero_fixer/performance_and_memory_profiler.py:50-273

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.

PerformanceProfilerHealer.scan_quadratic_string_concat

Kind: Method
Source: tzero/tzero_fixer/performance_and_memory_profiler.py:59-84

Signature:

def scan_quadratic_string_concat(cls, tree: ast.AST, file_path: str) -> List[DiagnosticIssue]:

Source docstring:

Detects string concatenation with '+=' inside loops.

PerformanceProfilerHealer.scan_listcomp_reduction_allocations

Kind: Method
Source: tzero/tzero_fixer/performance_and_memory_profiler.py:87-122

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!

PerformanceProfilerHealer.scan_range_len_antipattern

Kind: Method
Source: tzero/tzero_fixer/performance_and_memory_profiler.py:125-154

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):'.

PerformanceProfilerHealer.scan_unclosed_open_calls

Kind: Method
Source: tzero/tzero_fixer/performance_and_memory_profiler.py:157-191

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.

PerformanceProfilerHealer.diagnose_file

Kind: Method
Source: tzero/tzero_fixer/performance_and_memory_profiler.py:194-212

Signature:

def diagnose_file(cls, file_path: str) -> List[DiagnosticIssue]:

Source docstring:

Scans file for all performance anti-patterns and resource leaks.

PerformanceProfilerHealer.execute_performance_heals

Kind: Method
Source: tzero/tzero_fixer/performance_and_memory_profiler.py:215-273

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(...).

tzero/tzero_fixer/polyglot_ast_parsers.py

Source: tzero/tzero_fixer/polyglot_ast_parsers.py
Source size: 313 lines | 5 classes | 6 functions

Module docstring:


T-Zero Polyglot Tokenizers, AST Parsers, & Syntax Diagnostics
=============================================================
Zero-dependency, multi-language lexical analysis and AST inspection engine.
Provides syntax parsers and anti-pattern detectors for:
  - JavaScript / TypeScript (ES6+): Unclosed delimiters, var declarations, unhandled Promise rejections
  - Rust (Cargo & Source): Edition modernizations, unpinned dependencies, unsafe block audits
  - Go (go.mod & Source): Deprecated go directives, unhandled error variables, goroutine leak checks
  - Shell Scripts (Bash / POSIX sh): Missing shebang, unquoted variables, pipefail safety flags

Author: Siber Akademi T-Zero R&D Team
License: MIT (100% Free, Local Offline, Zero-Leak)

TokenMatch

Kind: Class
Source: tzero/tzero_fixer/polyglot_ast_parsers.py:34-38

Declaration:

class TokenMatch:

Source docstring: none; consult the linked implementation rather than inferring behavior.

JavaScriptTypeScriptDoctor

Kind: Class
Source: tzero/tzero_fixer/polyglot_ast_parsers.py:41-158

Declaration:

class JavaScriptTypeScriptDoctor:

Source docstring:

Lexical analyzer and anti-pattern healer for JS and TS codebases.

JavaScriptTypeScriptDoctor.diagnose_file

Kind: Method
Source: tzero/tzero_fixer/polyglot_ast_parsers.py:51-112

Signature:

def diagnose_file(cls, file_path: str, content: str) -> List[DiagnosticIssue]:

Source docstring: none; consult the linked implementation rather than inferring behavior.

JavaScriptTypeScriptDoctor.execute_heals

Kind: Method
Source: tzero/tzero_fixer/polyglot_ast_parsers.py:115-158

Signature:

def execute_heals(cls, issues: List[DiagnosticIssue], dry_run: bool = False) -> List[HealAction]:

Source docstring: none; consult the linked implementation rather than inferring behavior.

RustToolchainDoctor

Kind: Class
Source: tzero/tzero_fixer/polyglot_ast_parsers.py:161-232

Declaration:

class RustToolchainDoctor:

Source docstring:

Audits Rust Cargo configurations and source code patterns.

RustToolchainDoctor.diagnose_cargo_toml

Kind: Method
Source: tzero/tzero_fixer/polyglot_ast_parsers.py:168-205

Signature:

def diagnose_cargo_toml(cls, file_path: str, content: str) -> List[DiagnosticIssue]:

Source docstring: none; consult the linked implementation rather than inferring behavior.

RustToolchainDoctor.diagnose_source_file

Kind: Method
Source: tzero/tzero_fixer/polyglot_ast_parsers.py:208-232

Signature:

def diagnose_source_file(cls, file_path: str, content: str) -> List[DiagnosticIssue]:

Source docstring: none; consult the linked implementation rather than inferring behavior.

GoToolchainDoctor

Kind: Class
Source: tzero/tzero_fixer/polyglot_ast_parsers.py:235-266

Declaration:

class GoToolchainDoctor:

Source docstring:

Diagnostics for Go go.mod modules and source code.

GoToolchainDoctor.diagnose_go_mod

Kind: Method
Source: tzero/tzero_fixer/polyglot_ast_parsers.py:239-266

Signature:

def diagnose_go_mod(cls, file_path: str, content: str) -> List[DiagnosticIssue]:

Source docstring: none; consult the linked implementation rather than inferring behavior.

ShellScriptDoctor

Kind: Class
Source: tzero/tzero_fixer/polyglot_ast_parsers.py:269-312

Declaration:

class ShellScriptDoctor:

Source docstring:

Diagnostics for Bash and POSIX shell scripts (.sh).

ShellScriptDoctor.diagnose_file

Kind: Method
Source: tzero/tzero_fixer/polyglot_ast_parsers.py:273-312

Signature:

def diagnose_file(cls, file_path: str, content: str) -> List[DiagnosticIssue]:

Source docstring: none; consult the linked implementation rather than inferring behavior.

tzero/tzero_fixer/polyglot_build_healer.py

Source: tzero/tzero_fixer/polyglot_build_healer.py
Source size: 364 lines | 1 classes | 8 functions

Module docstring:


T-Zero Polyglot Build, Container, & Infrastructure Healer
========================================================
Specialized AST & syntax healer for cross-language build tools, Dockerfiles,
Makefiles, container configurations, web server rules, and multi-ecosystem manifests.

Key Capabilities:
  - Dockerfile best-practice auditor & .dockerignore generator
  - Makefile tab-vs-space indentation healer (eliminates 'missing separator' errors)
  - Makefile .PHONY target generator
  - Nginx / Caddy reverse proxy syntax and semicolon validator
  - Rust Cargo.toml & Go go.mod basic syntax integrity checkers

Author: Siber Akademi T-Zero R&D Team
Version: 10.5.0 | 100% Free & Local Offline | Zero-Leak Certified

PolyglotBuildHealer

Kind: Class
Source: tzero/tzero_fixer/polyglot_build_healer.py:35-363

Declaration:

class PolyglotBuildHealer:

Source docstring:

Surgeon for polyglot build scripts, container files, and infrastructure recipes.

PolyglotBuildHealer.diagnose_workspace

Kind: Method
Source: tzero/tzero_fixer/polyglot_build_healer.py:39-69

Signature:

def diagnose_workspace(cls, workspace_path: str) -> List[DiagnosticIssue]:

Source docstring:

Audit build and container files across the workspace.

PolyglotBuildHealer._is_ignored

Kind: Method
Source: tzero/tzero_fixer/polyglot_build_healer.py:72-76

Signature:

def _is_ignored(cls, p: Path) -> bool:

Source docstring:

Check if path is inside ignored VCS, venv, or build folders.

PolyglotBuildHealer._audit_dockerfile

Kind: Method
Source: tzero/tzero_fixer/polyglot_build_healer.py:79-139

Signature:

def _audit_dockerfile(cls, dockerfile: Path, root: Path) -> List[DiagnosticIssue]:

Source docstring:

Audit Dockerfile for best practices and check for .dockerignore.

PolyglotBuildHealer._audit_makefile

Kind: Method
Source: tzero/tzero_fixer/polyglot_build_healer.py:142-194

Signature:

def _audit_makefile(cls, makefile: Path) -> List[DiagnosticIssue]:

Source docstring:

Audit Makefile for space vs tab indentation and missing .PHONY declarations.

PolyglotBuildHealer._audit_webserver_conf

Kind: Method
Source: tzero/tzero_fixer/polyglot_build_healer.py:197-225

Signature:

def _audit_webserver_conf(cls, conf_file: Path) -> List[DiagnosticIssue]:

Source docstring:

Audit Nginx / reverse proxy config files for missing semicolons.

PolyglotBuildHealer._audit_cargo_toml

Kind: Method
Source: tzero/tzero_fixer/polyglot_build_healer.py:228-246

Signature:

def _audit_cargo_toml(cls, cargo_file: Path) -> List[DiagnosticIssue]:

Source docstring:

Audit Rust Cargo.toml for basic sections.

PolyglotBuildHealer._audit_go_mod

Kind: Method
Source: tzero/tzero_fixer/polyglot_build_healer.py:249-267

Signature:

def _audit_go_mod(cls, go_mod_file: Path) -> List[DiagnosticIssue]:

Source docstring:

Audit Go go.mod for module declaration.

PolyglotBuildHealer.heal_issue

Kind: Method
Source: tzero/tzero_fixer/polyglot_build_healer.py:270-363

Signature:

def heal_issue(cls, issue: DiagnosticIssue, dry_run: bool = False) -> HealAction:

Source docstring:

Autonomously heal polyglot build and container issues.

tzero/tzero_fixer/polyglot_config_healer.py

Source: tzero/tzero_fixer/polyglot_config_healer.py
Source size: 318 lines | 2 classes | 7 functions

Module docstring:

T-Zero Polyglot Configuration & Environment Files Healer.

Performs forensic repair and hygiene checks on configuration files:
- JSON repair engine (strips trailing commas, single quotes, unquoted keys, and JS comments).
- Gitignore & Security hygiene (verifies .env, *.pem, *.key are in .gitignore).
- Gitattributes LF/CRLF normalizer (* text=auto eol=lf).
- EditorConfig generator and validator.

Author: [redacted] (Siber Akademi)
Version: 10.4.0

PolyglotConfigHealer

Kind: Class
Source: tzero/tzero_fixer/polyglot_config_healer.py:31-318

Declaration:

class PolyglotConfigHealer:

Source docstring:

Specialized repair engine for JSON, YAML, Gitignore, and Gitattributes files.

PolyglotConfigHealer.heal_json_string

Kind: Method
Source: tzero/tzero_fixer/polyglot_config_healer.py:50-63

Signature:

def heal_json_string(cls, content: str) -> Any:

Source docstring:

Helper to repair trailing commas and single quotes in JSON strings.

PolyglotConfigHealer.heal_json_string.JsonHealResult

Kind: Class
Source: tzero/tzero_fixer/polyglot_config_healer.py:53-56

Declaration:

class JsonHealResult:

Source docstring: none; consult the linked implementation rather than inferring behavior.

PolyglotConfigHealer.repair_json_text

Kind: Method
Source: tzero/tzero_fixer/polyglot_config_healer.py:66-87

Signature:

def repair_json_text(cls, text: str) -> Tuple[bool, str]:

Source docstring:

Surgically repair trailing commas, single quotes, and comments in JSON.

PolyglotConfigHealer.check_json_files

Kind: Method
Source: tzero/tzero_fixer/polyglot_config_healer.py:90-120

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.

PolyglotConfigHealer.check_gitignore_hygiene

Kind: Method
Source: tzero/tzero_fixer/polyglot_config_healer.py:126-173

Signature:

def check_gitignore_hygiene(cls, workspace_dir: str = '.') -> List[DiagnosticIssue]:

Source docstring:

Verify .gitignore exists and contains critical secret patterns (.env, *.key).

PolyglotConfigHealer.check_gitattributes

Kind: Method
Source: tzero/tzero_fixer/polyglot_config_healer.py:179-199

Signature:

def check_gitattributes(cls, workspace_dir: str = '.') -> List[DiagnosticIssue]:

Source docstring:

Verify .gitattributes exists to prevent cross-platform CRLF/LF chaos.

PolyglotConfigHealer.diagnose_workspace

Kind: Method
Source: tzero/tzero_fixer/polyglot_config_healer.py:202-208

Signature:

def diagnose_workspace(cls, workspace_dir: str = '.') -> List[DiagnosticIssue]:

Source docstring:

Run all polyglot configuration and git hygiene audits.

PolyglotConfigHealer.execute_config_heals

Kind: Method
Source: tzero/tzero_fixer/polyglot_config_healer.py:211-318

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.

tzero/tzero_fixer/polyglot_doctor.py

Source: tzero/tzero_fixer/polyglot_doctor.py
Source size: 372 lines | 1 classes | 6 functions

Module docstring:

T-Zero Polyglot Ecosystem Doctor: Node, Rust, Go, Docker, & CI Workflows.

Performs forensic diagnostics across polyglot project architectures:
- Node.js / TypeScript: package.json validation, tsconfig.json integrity, lockfile conflicts, node_modules bloat.
- Rust / Cargo: Cargo.toml linting, target/ directory bloat, missing edition flags, cargo lock sync.
- Go Toolchain: go.mod & go.sum validation, GOPATH resolution, dangling vendor folders.
- Docker & Containers: Dockerfile linting (unpinned base images, root user execution, dangling cache).
- GitHub Actions CI/CD: .github/workflows YAML syntax, unpinned actions SHA, hardcoded secret leaks in workflows.

Author: [redacted] (Siber Akademi)
Version: 10.4.0

PolyglotDoctor

Kind: Class
Source: tzero/tzero_fixer/polyglot_doctor.py:30-372

Declaration:

class PolyglotDoctor:

Source docstring:

Specialized doctor for polyglot language toolchains and container configurations.

PolyglotDoctor.check_nodejs_project

Kind: Method
Source: tzero/tzero_fixer/polyglot_doctor.py:42-137

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.

PolyglotDoctor.check_rust_project

Kind: Method
Source: tzero/tzero_fixer/polyglot_doctor.py:143-204

Signature:

def check_rust_project(cls, workspace_dir: str = '.') -> List[DiagnosticIssue]:

Source docstring:

Inspect Cargo.toml and target directory for Rust projects.

PolyglotDoctor.check_go_project

Kind: Method
Source: tzero/tzero_fixer/polyglot_doctor.py:210-251

Signature:

def check_go_project(cls, workspace_dir: str = '.') -> List[DiagnosticIssue]:

Source docstring:

Inspect go.mod and go.sum files in Go workspaces.

PolyglotDoctor.check_dockerfiles

Kind: Method
Source: tzero/tzero_fixer/polyglot_doctor.py:257-308

Signature:

def check_dockerfiles(cls, workspace_dir: str = '.') -> List[DiagnosticIssue]:

Source docstring:

Inspect Dockerfile and compose manifests for security and performance smells.

PolyglotDoctor.check_ci_workflows

Kind: Method
Source: tzero/tzero_fixer/polyglot_doctor.py:314-361

Signature:

def check_ci_workflows(cls, workspace_dir: str = '.') -> List[DiagnosticIssue]:

Source docstring:

Inspect .github/workflows YAML manifests for syntax flaws and security issues.

PolyglotDoctor.diagnose_workspace

Kind: Method
Source: tzero/tzero_fixer/polyglot_doctor.py:364-372

Signature:

def diagnose_workspace(cls, workspace_dir: str = '.') -> List[DiagnosticIssue]:

Source docstring:

Run all polyglot ecosystem diagnostic checks.

tzero/tzero_fixer/polyglot_linters.py

Source: tzero/tzero_fixer/polyglot_linters.py
Source size: 619 lines | 7 classes | 6 functions

Module docstring:


T-Zero Polyglot Linters & Infrastructure Healer
==============================================
Zero-dependency, multi-language static analysis and configuration repair engine.
Covers:
  - Markdown / README: Unclosed code blocks, broken header hierarchy, trailing whitespace, table formatting
  - TOML: pyproject.toml / Cargo.toml syntax, build-system validation, unquoted dotted keys
  - YAML & CI/CD: GitHub Actions workflow validation, unpinned actions, YAML 1.1 boolean pitfalls
  - Dockerfile: Multi-stage optimizations, root user warnings, unpinned tags, cache clearing
  - Makefile: Recipe indentation repair (space-to-tab), missing .PHONY targets
  - SQL / Schema: Reserved keywords, missing primary keys, unindexed foreign key warnings

Author: Siber Akademi T-Zero R&D Team
License: MIT (100% Free, Local Offline, Zero-Leak)

LintFixResult

Kind: Class
Source: tzero/tzero_fixer/polyglot_linters.py:36-41

Declaration:

class LintFixResult:

Source docstring: none; consult the linked implementation rather than inferring behavior.

MarkdownLinterHealer

Kind: Class
Source: tzero/tzero_fixer/polyglot_linters.py:47-169

Declaration:

class MarkdownLinterHealer:

Source docstring:


    Scans and surgically repairs Markdown files without destroying code fences or inline formatting.

MarkdownLinterHealer.lint_and_heal

Kind: Method
Source: tzero/tzero_fixer/polyglot_linters.py:53-169

Signature:

def lint_and_heal(file_path: str, content: str) -> LintFixResult:

Source docstring: none; consult the linked implementation rather than inferring behavior.

TomlLinterHealer

Kind: Class
Source: tzero/tzero_fixer/polyglot_linters.py:175-256

Declaration:

class TomlLinterHealer:

Source docstring:


    Lints and validates pyproject.toml, Cargo.toml, and other TOML files.

TomlLinterHealer.lint_and_heal

Kind: Method
Source: tzero/tzero_fixer/polyglot_linters.py:181-256

Signature:

def lint_and_heal(file_path: str, content: str) -> LintFixResult:

Source docstring: none; consult the linked implementation rather than inferring behavior.

YamlCiCdLinterHealer

Kind: Class
Source: tzero/tzero_fixer/polyglot_linters.py:262-372

Declaration:

class YamlCiCdLinterHealer:

Source docstring:


    Validates GitHub Actions workflows and YAML deployment specs.

YamlCiCdLinterHealer.lint_and_heal

Kind: Method
Source: tzero/tzero_fixer/polyglot_linters.py:287-372

Signature:

def lint_and_heal(cls, file_path: str, content: str) -> LintFixResult:

Source docstring: none; consult the linked implementation rather than inferring behavior.

DockerfileDeepLinterHealer

Kind: Class
Source: tzero/tzero_fixer/polyglot_linters.py:378-487

Declaration:

class DockerfileDeepLinterHealer:

Source docstring:


    Validates Dockerfiles for security, cache optimization, and layer reduction.

DockerfileDeepLinterHealer.lint_and_heal

Kind: Method
Source: tzero/tzero_fixer/polyglot_linters.py:384-487

Signature:

def lint_and_heal(file_path: str, content: str) -> LintFixResult:

Source docstring: none; consult the linked implementation rather than inferring behavior.

MakefileLinterHealer

Kind: Class
Source: tzero/tzero_fixer/polyglot_linters.py:493-560

Declaration:

class MakefileLinterHealer:

Source docstring:


    Diagnoses and repairs Makefile tab indentation bugs ('missing separator').

MakefileLinterHealer.lint_and_heal

Kind: Method
Source: tzero/tzero_fixer/polyglot_linters.py:499-560

Signature:

def lint_and_heal(file_path: str, content: str) -> LintFixResult:

Source docstring: none; consult the linked implementation rather than inferring behavior.

SqlMigrationLinter

Kind: Class
Source: tzero/tzero_fixer/polyglot_linters.py:566-619

Declaration:

class SqlMigrationLinter:

Source docstring:


    Static analyzer for database schema scripts, migrations, and SQL queries.

SqlMigrationLinter.lint_file

Kind: Method
Source: tzero/tzero_fixer/polyglot_linters.py:578-619

Signature:

def lint_file(cls, file_path: str, content: str) -> List[DiagnosticIssue]:

Source docstring: none; consult the linked implementation rather than inferring behavior.

tzero/tzero_fixer/polyglot_schema_validator.py

Source: tzero/tzero_fixer/polyglot_schema_validator.py
Source size: 305 lines | 3 classes | 3 functions

Module docstring:


T-Zero Polyglot Schema Validator, OpenAPI Linter, & EditorConfig Healer
======================================================================
Zero-dependency schema validation and developer environment standardization engine.
Provides:
  - JSON Schema Draft-07 / 2020-12 validation (types, required, enum, pattern, bounds)
  - OpenAPI 3.0 / 3.1 REST API specification linter (missing paths, non-unique operationIds)
  - GraphQL SDL (Schema Definition Language) parser & syntax auditor
  - .editorconfig specification generator & line-ending LF normalizer

Author: Siber Akademi T-Zero R&D Team
License: MIT (100% Free, Local Offline, Zero-Leak)

EditorConfigHealer

Kind: Class
Source: tzero/tzero_fixer/polyglot_schema_validator.py:34-99

Declaration:

class EditorConfigHealer:

Source docstring:

Standardizes project .editorconfig files for uniform line endings and indentations.

EditorConfigHealer.diagnose_and_heal

Kind: Method
Source: tzero/tzero_fixer/polyglot_schema_validator.py:56-99

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 rather than inferring behavior.

OpenApiSpecLinter

Kind: Class
Source: tzero/tzero_fixer/polyglot_schema_validator.py:102-202

Declaration:

class OpenApiSpecLinter:

Source docstring:

Validates OpenAPI 3.0 / 3.1 REST API specification definitions.

OpenApiSpecLinter.lint_openapi_dict

Kind: Method
Source: tzero/tzero_fixer/polyglot_schema_validator.py:106-202

Signature:

def lint_openapi_dict(cls, spec: Dict[str, Any], file_path: str) -> List[DiagnosticIssue]:

Source docstring: none; consult the linked implementation rather than inferring behavior.

PureJsonSchemaValidator

Kind: Class
Source: tzero/tzero_fixer/polyglot_schema_validator.py:205-305

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.

PureJsonSchemaValidator.validate_instance

Kind: Method
Source: tzero/tzero_fixer/polyglot_schema_validator.py:222-305

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.

tzero/tzero_fixer/security_cwe_database.py

Source: tzero/tzero_fixer/security_cwe_database.py
Source size: 444 lines | 2 classes | 5 functions

Module docstring:


T-Zero Security CWE & OWASP Vulnerability Taxonomy
=================================================
Exhaustive vulnerability mapping, remediation encyclopedia, and AST rule engine.
Maps Common Weakness Enumerations (CWE), OWASP Top 10, and CIS Critical Security Controls
to specific static analysis patterns and surgical remediation recipes.

Covers:
  - Injection Flaws (CWE-89 SQL Injection, CWE-78 OS Command Injection, CWE-79 XSS)
  - Broken Access Control & Path Traversal (CWE-22 Path Traversal, CWE-284 Improper Access)
  - Cryptographic Failures & Hardcoded Credentials (CWE-798, CWE-259, CWE-327 Broken Crypto)
  - Insecure Deserialization (CWE-502 Untrusted Deserialization in Python/Java/Node)
  - Security Misconfiguration (CWE-16, CWE-1004 Missing Cookie HttpOnly, CWE-942 CORS)
  - Software & Data Integrity Failures (CWE-494 Missing Integrity Check, CWE-829 Unpinned Deps)

Author: Siber Akademi T-Zero R&D Team
License: MIT (100% Free, Local Offline, Zero-Leak)

CWERuleDefinition

Kind: Class
Source: tzero/tzero_fixer/security_cwe_database.py:29-44

Declaration:

class CWERuleDefinition:

Source docstring:

Taxonomy definition for a specific Common Weakness Enumeration.

CWERuleDefinition.to_dict

Kind: Method
Source: tzero/tzero_fixer/security_cwe_database.py:43-44

Signature:

def to_dict(self) -> Dict[str, Any]:

Source docstring: none; consult the linked implementation rather than inferring behavior.

CWESecurityDatabase

Kind: Class
Source: tzero/tzero_fixer/security_cwe_database.py:47-444

Declaration:

class CWESecurityDatabase:

Source docstring:

Master registry of security weaknesses and automated patch strategies.

CWESecurityDatabase.get_by_cwe

Kind: Method
Source: tzero/tzero_fixer/security_cwe_database.py:426-427

Signature:

def get_by_cwe(cls, cwe_id: str) -> Optional[CWERuleDefinition]:

Source docstring: none; consult the linked implementation rather than inferring behavior.

CWESecurityDatabase.list_by_owasp

Kind: Method
Source: tzero/tzero_fixer/security_cwe_database.py:430-432

Signature:

def list_by_owasp(cls, owasp_cat: str) -> List[CWERuleDefinition]:

Source docstring: none; consult the linked implementation rather than inferring behavior.

CWESecurityDatabase.search_rules

Kind: Method
Source: tzero/tzero_fixer/security_cwe_database.py:435-440

Signature:

def search_rules(cls, query: str) -> List[CWERuleDefinition]:

Source docstring: none; consult the linked implementation rather than inferring behavior.

CWESecurityDatabase.export_catalog_json

Kind: Method
Source: tzero/tzero_fixer/security_cwe_database.py:443-444

Signature:

def export_catalog_json(cls) -> str:

Source docstring: none; consult the linked implementation rather than inferring behavior.

tzero/tzero_fixer/security_deep_rules.py

Source: tzero/tzero_fixer/security_deep_rules.py
Source size: 114 lines | 2 classes | 2 functions

Module docstring:

T-Zero Deep Security Rules & Secret Signatures Database.

Provides an extensive registry of 150+ granular security detection rules
covering cloud infrastructure, databases, AI/ML APIs, payment processors,
and cryptographic tokens.

Author: [redacted] (Siber Akademi)
Version: 10.4.0

DetailedSecurityRule

Kind: Class
Source: tzero/tzero_fixer/security_deep_rules.py:15-23

Declaration:

class DetailedSecurityRule(NamedTuple):

Source docstring: none; consult the linked implementation rather than inferring behavior.

DeepSecurityCatalog

Kind: Class
Source: tzero/tzero_fixer/security_deep_rules.py:105-114

Declaration:

class DeepSecurityCatalog:

Source docstring:

Registry engine providing fast rule matching and compliance checks.

DeepSecurityCatalog.get_rules

Kind: Method
Source: tzero/tzero_fixer/security_deep_rules.py:109-110

Signature:

def get_rules(cls) -> List[DetailedSecurityRule]:

Source docstring: none; consult the linked implementation rather than inferring behavior.

DeepSecurityCatalog.get_count

Kind: Method
Source: tzero/tzero_fixer/security_deep_rules.py:113-114

Signature:

def get_count(cls) -> int:

Source docstring: none; consult the linked implementation rather than inferring behavior.

tzero/tzero_fixer/security_rules_catalog.py

Source: tzero/tzero_fixer/security_rules_catalog.py
Source size: 110 lines | 2 classes | 3 functions

Module docstring:

T-Zero Security Rules & Secret Signatures Encyclopedic Catalog.

Provides 200+ battle-tested secret detection regular expressions and security rules
spanning all major cloud providers, AI/LLM vendors, payment gateways, databases,
CI/CD platforms, communication tools, and cryptographic key formats.

Author: [redacted] (Siber Akademi)
Version: 10.4.0

SecurityRule

Kind: Class
Source: tzero/tzero_fixer/security_rules_catalog.py:15-22

Declaration:

class SecurityRule(NamedTuple):

Source docstring: none; consult the linked implementation rather than inferring behavior.

SecurityRulesCatalog

Kind: Class
Source: tzero/tzero_fixer/security_rules_catalog.py:94-110

Declaration:

class SecurityRulesCatalog:

Source docstring:

Catalog manager providing indexed lookups and rule evaluation.

SecurityRulesCatalog.get_all_rules

Kind: Method
Source: tzero/tzero_fixer/security_rules_catalog.py:98-99

Signature:

def get_all_rules(cls) -> List[SecurityRule]:

Source docstring: none; consult the linked implementation rather than inferring behavior.

SecurityRulesCatalog.get_rules_by_vendor

Kind: Method
Source: tzero/tzero_fixer/security_rules_catalog.py:102-103

Signature:

def get_rules_by_vendor(cls, vendor: str) -> List[SecurityRule]:

Source docstring: none; consult the linked implementation rather than inferring behavior.

SecurityRulesCatalog.get_rule_by_id

Kind: Method
Source: tzero/tzero_fixer/security_rules_catalog.py:106-110

Signature:

def get_rule_by_id(cls, rule_id: str) -> SecurityRule:

Source docstring: none; consult the linked implementation rather than inferring behavior.

tzero/tzero_fixer/security_zero_leak.py

Source: tzero/tzero_fixer/security_zero_leak.py
Source size: 344 lines | 2 classes | 5 functions

Module docstring:

T-Zero 100% Zero-Leak Security & Secret Guard Doctor.

Forensic secret scanner, dangerous deserialization detector, and autonomous .env migrator:
- 60+ High-entropy secret patterns (AWS, GitHub, OpenAI, Anthropic, Gemini, Slack, Stripe, JWT, DB URLs).
- Autonomous secret extraction: migrates hardcoded secrets to '.env' and patches code with os.getenv().
- Insecure deserialization checks (pickle.loads, yaml.load without SafeLoader).
- Dynamic execution guards (eval, exec with dynamic variables).
- SQL injection string concatenation heuristics.

Author: [redacted] (Siber Akademi)
Version: 10.4.0

SecurityZeroLeakDoctor

Kind: Class
Source: tzero/tzero_fixer/security_zero_leak.py:32-344

Declaration:

class SecurityZeroLeakDoctor:

Source docstring:

Enterprise 100% Zero-Leak scanner and autonomous secret remediation engine.

SecurityZeroLeakDoctor.sanitize_string

Kind: Method
Source: tzero/tzero_fixer/security_zero_leak.py:69-101

Signature:

def sanitize_string(cls, content: str) -> Any:

Source docstring:

Sanitizes an in-memory code string by replacing hardcoded secrets with os.environ.get(...).

SecurityZeroLeakDoctor.sanitize_string.StringSanitizeResult

Kind: Class
Source: tzero/tzero_fixer/security_zero_leak.py:72-76

Declaration:

class StringSanitizeResult:

Source docstring: none; consult the linked implementation rather than inferring behavior.

SecurityZeroLeakDoctor.scan_secrets_in_file

Kind: Method
Source: tzero/tzero_fixer/security_zero_leak.py:104-140

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.

SecurityZeroLeakDoctor.scan_insecure_functions

Kind: Method
Source: tzero/tzero_fixer/security_zero_leak.py:143-201

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.

SecurityZeroLeakDoctor.diagnose_file

Kind: Method
Source: tzero/tzero_fixer/security_zero_leak.py:204-227

Signature:

def diagnose_file(cls, file_path: str) -> List[DiagnosticIssue]:

Source docstring:

Scan file for all security flaws and hardcoded credentials.

SecurityZeroLeakDoctor.execute_security_heals

Kind: Method
Source: tzero/tzero_fixer/security_zero_leak.py:230-344

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.

tzero/tzero_fixer/smart_patch_recommender.py

Source: tzero/tzero_fixer/smart_patch_recommender.py
Source size: 223 lines | 2 classes | 6 functions

Module docstring:


T-Zero Smart Micro-Patch Recommender & Semantic Diff Engine
===========================================================
Generates unified, atomic, and idempotent GNU diff micro-patches
for code issues diagnosed across software repositories.

Features:
  - Idempotency verification: guarantees repeated patch applications are safe no-ops
  - Blast radius scoring (0-100): measures downstream impact on dependent modules
  - Pull Request markdown comment generation for automated code review bots
  - Reversible transactional patch formatting compatible with git apply

Author: Siber Akademi T-Zero R&D Team
License: MIT (100% Free, Local Offline, Zero-Leak)

MicroPatch

Kind: Class
Source: tzero/tzero_fixer/smart_patch_recommender.py:38-57

Declaration:

class MicroPatch:

Source docstring: none; consult the linked implementation rather than inferring behavior.

MicroPatch.to_markdown

Kind: Method
Source: tzero/tzero_fixer/smart_patch_recommender.py:49-57

Signature:

def to_markdown(self) -> str:

Source docstring: none; consult the linked implementation rather than inferring behavior.

SmartPatchRecommender

Kind: Class
Source: tzero/tzero_fixer/smart_patch_recommender.py:60-223

Declaration:

class SmartPatchRecommender:

Source docstring:


    Constructs surgical, atomic patch diffs from DiagnosticIssue instances.

SmartPatchRecommender.calculate_blast_radius

Kind: Method
Source: tzero/tzero_fixer/smart_patch_recommender.py:66-96

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)

SmartPatchRecommender.generate_patch_from_hunk

Kind: Method
Source: tzero/tzero_fixer/smart_patch_recommender.py:99-138

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.

SmartPatchRecommender.generate_pr_review_comment

Kind: Method
Source: tzero/tzero_fixer/smart_patch_recommender.py:141-162

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.

SmartPatchRecommender.apply_patch_in_memory

Kind: Method
Source: tzero/tzero_fixer/smart_patch_recommender.py:165-209

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)

SmartPatchRecommender.verify_patch_idempotency

Kind: Method
Source: tzero/tzero_fixer/smart_patch_recommender.py:212-223

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.

tzero/tzero_fixer/synthetic_workspace_generator.py

Source: tzero/tzero_fixer/synthetic_workspace_generator.py
Source size: 220 lines | 2 classes | 2 functions

Module docstring:


T-Zero Synthetic Workspace Generator & End-to-End Stress Testbed
===============================================================
Generates fully functional, realistic multi-tier workspaces with deliberate
synthetic defects across all 6 diagnostic categories to verify self-healing,
zero-regression stability, transactional rollback, and performance under load.

Author: Siber Akademi T-Zero R&D Team
License: MIT (100% Free, Local Offline, Zero-Leak)

E2EVerificationReport

Kind: Class
Source: tzero/tzero_fixer/synthetic_workspace_generator.py:34-44

Declaration:

class E2EVerificationReport:

Source docstring: none; consult the linked implementation rather than inferring behavior.

SyntheticWorkspaceGenerator

Kind: Class
Source: tzero/tzero_fixer/synthetic_workspace_generator.py:47-219

Declaration:

class SyntheticWorkspaceGenerator:

Source docstring:


    Constructs high-fidelity synthetic repositories with deliberate defects for automated verification.

SyntheticWorkspaceGenerator.create_synthetic_workspace

Kind: Method
Source: tzero/tzero_fixer/synthetic_workspace_generator.py:53-156

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.

SyntheticWorkspaceGenerator.run_e2e_self_healing_verification

Kind: Method
Source: tzero/tzero_fixer/synthetic_workspace_generator.py:159-219

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.

tzero/tzero_fixer/system_diagnostics_extended.py

Source: tzero/tzero_fixer/system_diagnostics_extended.py
Source size: 493 lines | 4 classes | 9 functions

Module docstring:


T-Zero PC-Fixer: Extended System Diagnostics & Deep OS Inspection
================================================================
Enterprise-grade, zero-dependency operating system diagnostics engine.
Provides deep cross-platform diagnostics for:
  - Disk storage health, mount partition thresholds, inode pressure, temp exhaustion
  - Network port conflicts, listening dev servers, socket accumulation
  - Memory pressure, swap/pagefile sizing, cache allocation
  - Zombie processes, orphaned compiler/toolchain locks, runaway dev servers
  - Platform-specific registry policies (Windows LongPaths, DeveloperMode, ExecutionPolicy)
  - POSIX filesystem permissions (SSH keys, sticky bits, executable bits)
  - Package manager locks and stale build artifact accumulation

Author: Siber Akademi T-Zero R&D Team
License: MIT (100% Free, Local Offline, Zero-Leak)

DiskPartitionHealth

Kind: Class
Source: tzero/tzero_fixer/system_diagnostics_extended.py:44-51

Declaration:

class DiskPartitionHealth:

Source docstring: none; consult the linked implementation rather than inferring behavior.

NetworkPortStatus

Kind: Class
Source: tzero/tzero_fixer/system_diagnostics_extended.py:55-60

Declaration:

class NetworkPortStatus:

Source docstring: none; consult the linked implementation rather than inferring behavior.

ExtendedDiagnosticSummary

Kind: Class
Source: tzero/tzero_fixer/system_diagnostics_extended.py:64-74

Declaration:

class ExtendedDiagnosticSummary:

Source docstring: none; consult the linked implementation rather than inferring behavior.

ExtendedSystemDiagnostics

Kind: Class
Source: tzero/tzero_fixer/system_diagnostics_extended.py:77-493

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.

ExtendedSystemDiagnostics.__init__

Kind: Method
Source: tzero/tzero_fixer/system_diagnostics_extended.py:102-104

Signature:

def __init__(self, workspace_path: Optional[str] = None):

Source docstring: none; consult the linked implementation rather than inferring behavior.

ExtendedSystemDiagnostics._detect_platform

Kind: Method
Source: tzero/tzero_fixer/system_diagnostics_extended.py:106-114

Signature:

def _detect_platform(self) -> SystemPlatform:

Source docstring: none; consult the linked implementation rather than inferring behavior.

ExtendedSystemDiagnostics.inspect_disk_health

Kind: Method
Source: tzero/tzero_fixer/system_diagnostics_extended.py:119-198

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.

ExtendedSystemDiagnostics.inspect_temp_directory_exhaustion

Kind: Method
Source: tzero/tzero_fixer/system_diagnostics_extended.py:200-229

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.

ExtendedSystemDiagnostics.inspect_dev_ports

Kind: Method
Source: tzero/tzero_fixer/system_diagnostics_extended.py:234-272

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.

ExtendedSystemDiagnostics.inspect_windows_registry_policies

Kind: Method
Source: tzero/tzero_fixer/system_diagnostics_extended.py:277-348

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)

ExtendedSystemDiagnostics.inspect_posix_permissions

Kind: Method
Source: tzero/tzero_fixer/system_diagnostics_extended.py:353-401

Signature:

def inspect_posix_permissions(self) -> List[DiagnosticIssue]:

Source docstring:


        Verifies correct permissions on user SSH keys, git credentials, and tmp directory.

ExtendedSystemDiagnostics.inspect_stale_build_artifacts

Kind: Method
Source: tzero/tzero_fixer/system_diagnostics_extended.py:406-453

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/`).

ExtendedSystemDiagnostics.run_all_extended_diagnostics

Kind: Method
Source: tzero/tzero_fixer/system_diagnostics_extended.py:458-493

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.

tzero/tzero_fixer/system_repair_recipes.py

Source: tzero/tzero_fixer/system_repair_recipes.py
Source size: 447 lines | 2 classes | 4 functions

Module docstring:


T-Zero System Repair Playbooks & Operating System Healer Recipes
===============================================================
Production-grade system repair recipes for engineering workstations.
Provides automated playbooks and verified remediation commands for:
  - Windows 10/11 & Server: LongPaths, DeveloperMode, UTF-8 console, Symlinks, ExecutionPolicy
  - Linux (Ubuntu/Debian, Fedora/RHEL, Arch): inotify watchers, file descriptors, tmp permissions, SSH keys
  - macOS (Apple Silicon & Intel): Gatekeeper quarantine, Homebrew permissions, Xcode CLI tools
  - Language Runtimes: Python (pip/pyenv/poetry/pdm), Node.js (npm/yarn/pnpm), Rust (cargo), Go
  - Version Control & Storage: Stale git locks, detached HEADs, Git LFS pointer corruptions, disk caches

Author: Siber Akademi T-Zero R&D Team
License: MIT (100% Free, Local Offline, Zero-Leak)

SystemRepairRecipe

Kind: Class
Source: tzero/tzero_fixer/system_repair_recipes.py:37-49

Declaration:

class SystemRepairRecipe:

Source docstring:

Executable repair recipe for a specific operating system or toolchain defect.

SystemRepairPlaybooks

Kind: Class
Source: tzero/tzero_fixer/system_repair_recipes.py:52-447

Declaration:

class SystemRepairPlaybooks:

Source docstring:


    Exhaustive catalog and execution engine for cross-platform system repair recipes.

SystemRepairPlaybooks.get_recipe

Kind: Method
Source: tzero/tzero_fixer/system_repair_recipes.py:410-411

Signature:

def get_recipe(cls, recipe_id: str) -> Optional[SystemRepairRecipe]:

Source docstring: none; consult the linked implementation rather than inferring behavior.

SystemRepairPlaybooks.find_recipe_for_issue

Kind: Method
Source: tzero/tzero_fixer/system_repair_recipes.py:414-415

Signature:

def find_recipe_for_issue(cls, diagnostic_code: str) -> Optional[SystemRepairRecipe]:

Source docstring: none; consult the linked implementation rather than inferring behavior.

SystemRepairPlaybooks.list_recipes_for_platform

Kind: Method
Source: tzero/tzero_fixer/system_repair_recipes.py:418-422

Signature:

def list_recipes_for_platform(cls, target_platform: SystemPlatform) -> List[SystemRepairRecipe]:

Source docstring: none; consult the linked implementation rather than inferring behavior.

SystemRepairPlaybooks.execute_recipe_command

Kind: Method
Source: tzero/tzero_fixer/system_repair_recipes.py:425-447

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.

tzero/tzero_fixer/venv_doctor.py

Source: tzero/tzero_fixer/venv_doctor.py
Source size: 309 lines | 1 classes | 8 functions

Module docstring:

T-Zero Virtualenv, Python Runtime, and Dependency Drift Doctor.

Performs forensic diagnosis and autonomous healing on:
- Virtual environment structures (.venv, venv, env, poetry, conda, pipenv).
- pyvenv.cfg integrity, broken base python home paths, and invalid symlinks.
- Missing packages defined in requirements.txt / pyproject.toml.
- Corrupted site-packages, dangling .dist-info / .egg-info directories.
- Package version conflicts and Python minor version drift.

Author: [redacted] (Siber Akademi)
Version: 10.4.0

VenvDoctor

Kind: Class
Source: tzero/tzero_fixer/venv_doctor.py:32-309

Declaration:

class VenvDoctor:

Source docstring:

Specialized doctor for Python virtual environments and dependency topologies.

VenvDoctor.detect_workspace_venvs

Kind: Method
Source: tzero/tzero_fixer/venv_doctor.py:38-46

Signature:

def detect_workspace_venvs(cls, workspace_dir: str = '.') -> List[Path]:

Source docstring:

Locate all local virtualenv directories in workspace root.

VenvDoctor.parse_pyvenv_cfg

Kind: Method
Source: tzero/tzero_fixer/venv_doctor.py:49-63

Signature:

def parse_pyvenv_cfg(cls, cfg_path: Path) -> Dict[str, str]:

Source docstring:

Parse key-value pairs from a pyvenv.cfg file.

VenvDoctor.inspect_virtualenv

Kind: Method
Source: tzero/tzero_fixer/venv_doctor.py:66-92

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.

VenvDoctor.parse_requirements_file

Kind: Method
Source: tzero/tzero_fixer/venv_doctor.py:95-115

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.

VenvDoctor.check_dependency_drift

Kind: Method
Source: tzero/tzero_fixer/venv_doctor.py:118-150

Signature:

def check_dependency_drift(cls, workspace_dir: str = '.') -> List[DiagnosticIssue]:

Source docstring:

Cross-reference requirements against currently installed packages.

VenvDoctor.check_corrupted_site_packages

Kind: Method
Source: tzero/tzero_fixer/venv_doctor.py:153-190

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.

VenvDoctor.diagnose

Kind: Method
Source: tzero/tzero_fixer/venv_doctor.py:193-236

Signature:

def diagnose(cls, workspace_dir: str = '.') -> List[DiagnosticIssue]:

Source docstring:

Run complete virtualenv diagnostic suite.

VenvDoctor.execute_venv_heals

Kind: Method
Source: tzero/tzero_fixer/venv_doctor.py:239-309

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.

Clone this wiki locally