Repository navigation
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.
- 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.
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
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)
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.
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
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.
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.
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.
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.
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.
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.
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.
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.
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.
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
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.
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.
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).
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.
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.
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.
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.
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.
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
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.
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.
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.
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)
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.
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.
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.
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.
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
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.
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.
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.
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.
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.
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)
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.
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.
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.
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.
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.
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.
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.
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.
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)
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.
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.
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.
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.
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.
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.
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
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.
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.
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=[]):).
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.
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.
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.
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.
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.
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.
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
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.
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.
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.
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.
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.
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
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.
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.
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.
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.
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.
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)
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.
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.
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.
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.
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.
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
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.
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.
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.
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.
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.
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.
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.
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.
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.
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
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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
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.
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.
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.
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.
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.
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).
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.
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.
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.
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.
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
Kind: Class
Source: tzero/tzero_fixer/interactive_tui.py:27-91
Declaration:
class InteractiveFixerTUI:Source docstring:
Terminal UI renderer for T-Zero Autonomous Doctor.
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.
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.
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.
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
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.
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.
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.
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.
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)
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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
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.
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.
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.
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.
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.
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.
Kind: Function
Source: tzero/tzero_fixer/mcp_server.py:482-495
Signature:
def main():Source docstring:
Main CLI entrypoint for PC-Fixer MCP Server.
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
Kind: Class
Source: tzero/tzero_fixer/models.py:22-52
Declaration:
class SeverityLevel(enum.Enum):Source docstring:
Severity classification for diagnostic issues.
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.
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.
Kind: Class
Source: tzero/tzero_fixer/models.py:55-68
Declaration:
class DiagnosticCategory(enum.Enum):Source docstring:
Category classification for doctor checks.
Kind: Class
Source: tzero/tzero_fixer/models.py:79-94
Declaration:
class SystemPlatform(enum.Enum):Source docstring:
Host operating system platform.
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.
Kind: Class
Source: tzero/tzero_fixer/models.py:98-111
Declaration:
class DiffHunk:Source docstring:
Represents a unified diff modification hunk.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
Kind: Class
Source: tzero/tzero_fixer/models.py:249-256
Declaration:
class ToolStatus:Source docstring:
Status of an external development tool on system PATH.
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.
Kind: Class
Source: tzero/tzero_fixer/models.py:280-342
Declaration:
class DiagnosticReport:Source docstring:
Complete diagnostic audit result across all categories.
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.
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.
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.
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.
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.
Kind: Class
Source: tzero/tzero_fixer/models.py:366-385
Declaration:
class HealReport:Source docstring:
Comprehensive outcome report of autonomous self-healing execution.
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.
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.
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
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.
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.
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.
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.
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.
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.
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.
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
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.
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.
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).
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.
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.
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.
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).
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.
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.
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.
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.
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.
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
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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).
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.
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.
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.
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.
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.
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)
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.
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.
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.
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!
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):'.
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.
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.
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(...).
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)
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.
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.
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.
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.
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.
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.
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.
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.
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.
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).
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.
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
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.
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.
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.
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.
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.
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.
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.
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.
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.
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
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.
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.
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.
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.
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.
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).
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.
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.
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.
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
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.
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.
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.
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.
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.
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.
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.
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)
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.
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.
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.
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.
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.
Kind: Class
Source: tzero/tzero_fixer/polyglot_linters.py:262-372
Declaration:
class YamlCiCdLinterHealer:Source docstring:
Validates GitHub Actions workflows and YAML deployment specs.
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.
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.
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.
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').
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.
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.
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.
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)
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.
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.
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.
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.
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.
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.
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)
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.
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.
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.
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.
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.
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.
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.
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
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.
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.
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.
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.
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
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.
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.
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.
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.
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.
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
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.
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(...).
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.
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.
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.
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.
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.
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)
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.
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.
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.
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)
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.
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.
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)
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.
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)
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.
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.
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.
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.
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)
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.
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.
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.
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.
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.
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.
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.
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.
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.
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)
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.
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/`).
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.
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)
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.
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.
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.
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.
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.
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.
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
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.
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.
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.
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.
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.
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.
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.
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.
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.