diff --git a/.gitignore b/.gitignore index 4fcc5a2..98e47e6 100644 --- a/.gitignore +++ b/.gitignore @@ -188,3 +188,17 @@ desktop/build/ *.exe *.dmg *.deb + +# Backup files +*.backup +*.backup[0-9] +*.backup[0-9][0-9] +*_fixed.py +*_fixed.toml +*_original.py +*_original.toml +*_new.py +*_new.toml +*_simple.py +*_simple.toml +*_simple.ini diff --git a/MANIFEST.in b/MANIFEST.in index 8d925e9..aa36c2d 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -11,7 +11,6 @@ include CODE_OF_CONDUCT.md # Include configuration files include pyproject.toml -include setup.py include requirements.txt include requirements-dev.txt diff --git a/cli_fixed.py b/cli_fixed.py deleted file mode 100644 index e14c815..0000000 --- a/cli_fixed.py +++ /dev/null @@ -1,294 +0,0 @@ -#!/usr/bin/env python3 -""" -FSL Continuum CLI Tool - Fixed Version - -Terminal-first interface for FSL Continuum operations with comprehensive testing support. -Optimized for Droid integration and AI-assisted testing. -""" - -import sys -import os -import json -import asyncio -import subprocess -from pathlib import Path -from typing import Dict, Any, Optional, List -from datetime import datetime - -import click -from rich.console import Console -from rich.table import Table -from rich.panel import Panel -from rich.progress import Progress, TaskID -from rich.tree import Tree - -# Add FSL Continuum to path -sys.path.insert(0, str(Path(__file__).parent.parent)) - -from . import __version__ -from .test_env import TestEnvironmentManager -from .test_runner import TestRunner -from .continuum import FSLContinuum - -console = Console() - - -class FSLCLI: - """FSL Continuum CLI main class.""" - - def __init__(self): - self.test_env = TestEnvironmentManager() - self.test_runner = TestRunner() - self.console = Console() - - def print_banner(self): - """Print FSL Continuum banner.""" - banner = Panel( - "[bold blue]FSL Continuum v{}[/bold blue]\n" - "Terminal Velocity CI/CD with AI-Native Testing\n" - "๐ŸŒŠ Flow State Optimized | ๐Ÿงช Test Ready | ๐Ÿค– AI Assisted".format(__version__), - border_style="blue" - ) - self.console.print(banner) - - -cli_instance = FSLCLI() - - -@click.group(invoke_without_command=True) -@click.pass_context -def main(ctx): - """FSL Continuum - Terminal Velocity CI/CD with AI-Native Testing.""" - if ctx.invoked_subcommand is None: - cli_instance.print_banner() - console.print("\n[bold]Available Commands:[/bold]") - console.print(" test Run comprehensive test suite") - console.print(" init Initialize project environment") - console.print(" serve Start development server") - console.print(" status Check system status") - console.print("\n[yellow]Use 'fsl --help' for detailed command information.[/yellow]") - - -@main.command() -@click.option('--unit', is_flag=True, help='Run unit tests only') -@click.option('--integration', is_flag=True, help='Run integration tests only') -@click.option('--performance', is_flag=True, help='Run performance tests only') -@click.option('--semantic', is_flag=True, help='Run semantic language tests only') -@click.option('--coverage', is_flag=True, help='Generate coverage report') -@click.option('--parallel', is_flag=True, help='Run tests in parallel') -@click.option('--fix', is_flag=True, help='Auto-fix common test issues') -@click.option('--droid-mode', is_flag=True, help='Optimized for Droid execution') -@click.option('--stream-results', is_flag=True, help='Stream results to Droid interface') -@click.option('--verbose', '-v', is_flag=True, help='Verbose output') -@click.argument('test_paths', nargs=-1, default=None) -def test(unit, integration, performance, semantic, coverage, parallel, - fix, droid_mode, stream_results, verbose, test_paths): - """Run comprehensive test suite with AI assistance.""" - - cli_instance.console.print("[bold green]๐Ÿงช FSL Continuum Test Suite[/bold green]") - - # Initialize test environment - cli_instance.console.print("๐Ÿ”ง Initializing test environment...") - if not cli_instance.test_env.setup_environment(): - cli_instance.console.print("[bold red]โŒ Failed to setup test environment[/bold red]") - return 1 - - # Configure test runner - test_config = { - 'unit_tests': unit, - 'integration_tests': integration, - 'performance_tests': performance, - 'semantic_tests': semantic, - 'coverage': coverage, - 'parallel': parallel, - 'fix': fix, - 'droid_mode': droid_mode, - 'stream_results': stream_results, - 'verbose': verbose, - 'test_paths': test_paths if test_paths else None - } - - # Run tests - with Progress() as progress: - task = progress.add_task("Running tests...", total=100) - - results = cli_instance.test_runner.run_tests(test_config, progress, task) - - # Display results - _display_test_results(results) - - # Auto-fix if requested and issues found - if fix and results.get('errors', 0) > 0: - cli_instance.console.print("\n[yellow]๐Ÿ”ง Auto-fixing test issues...[/yellow]") - fix_results = cli_instance.test_runner.auto_fix_issues(results) - if fix_results.get('fixed', 0) > 0: - cli_instance.console.print(f"[green]โœ… Fixed {fix_results['fixed']} issues[/green]") - - return 0 if results.get('success', False) else 1 - - -@main.command() -@click.option('--force', is_flag=True, help='Force reinitialization') -def init(force): - """Initialize FSL Continuum project environment.""" - cli_instance.console.print("[bold blue]๐Ÿš€ Initializing FSL Continuum Project[/bold blue]") - - if cli_instance.test_env.initialize_project(force=force): - cli_instance.console.print("[green]โœ… Project initialized successfully[/green]") - return 0 - else: - cli_instance.console.print("[red]โŒ Failed to initialize project[/red]") - return 1 - - -@main.command() -@click.option('--host', default='localhost', help='Host to bind to') -@click.option('--port', default=8080, help='Port to bind to') -@click.option('--debug', is_flag=True, help='Enable debug mode') -def serve(host, port, debug): - """Start FSL Continuum development server.""" - cli_instance.console.print(f"[bold blue]๐ŸŒ Starting server on {host}:{port}[/bold blue]") - - try: - # Import server module - from .server import create_server - app = create_server() - - if debug: - cli_instance.console.print("[yellow]๐Ÿ› Debug mode enabled[/yellow]") - - app.run(host=host, port=port, debug=debug) - - except ImportError: - cli_instance.console.print("[red]โŒ Server module not available[/red]") - return 1 - except Exception as e: - cli_instance.console.print(f"[red]โŒ Server error: {e}[/red]") - return 1 - - -@main.command() -@click.option('--detailed', is_flag=True, help='Show detailed status') -def status(detailed): - """Check FSL Continuum system status.""" - cli_instance.console.print("[bold blue]๐Ÿ“Š FSL Continuum Status[/bold blue]") - - # Environment status - env_status = cli_instance.test_env.check_environment() - _display_environment_status(env_status) - - if detailed: - # Test framework status - test_status = cli_instance.test_runner.get_status() - _display_test_status(test_status) - - # Dependencies status - deps_status = cli_instance.test_env.check_dependencies() - _display_dependencies_status(deps_status) - - -@main.group() -def droid(): - """Droid-specific commands and optimizations.""" - pass - - -@droid.command() -def setup(): - """Setup Droid integration and optimizations.""" - cli_instance.console.print("[bold blue]๐Ÿค– Setting up Droid integration[/bold blue]") - - # Setup Droid-specific configurations - droid_config = { - 'streaming_enabled': True, - 'auto_healing': True, - 'ai_assistance': True, - 'optimized_execution': True - } - - if cli_instance.test_env.setup_droid_integration(droid_config): - cli_instance.console.print("[green]โœ… Droid integration setup complete[/green]") - else: - cli_instance.console.print("[red]โŒ Failed to setup Droid integration[/red]") - - -@droid.command() -@click.option('--continuous', is_flag=True, help='Continuous testing mode') -def test_ai(continuous): - """AI-assisted testing with Droid optimization.""" - cli_instance.console.print("[bold blue]๐Ÿง  AI-Assisted Testing Mode[/bold blue]") - - test_config = { - 'ai_assisted': True, - 'droid_optimized': True, - 'continuous': continuous, - 'auto_heal': True, - 'stream_results': True - } - - results = cli_instance.test_runner.run_ai_assisted_tests(test_config) - _display_test_results(results) - - -def _display_test_results(results: Dict[str, Any]): - """Display test results in a formatted way.""" - if not results: - cli_instance.console.print("[yellow]โš ๏ธ No test results available[/yellow]") - return - - # Create results table - table = Table(title="Test Results", show_header=True, header_style="bold blue") - table.add_column("Metric", style="cyan", width=20) - table.add_column("Value", style="green", width=15) - table.add_column("Details", style="white") - - # Add result rows - table.add_row("Total Tests", str(results.get('total', 0)), "All tests executed") - table.add_row("Passed", str(results.get('passed', 0)), "โœ… Successful") - table.add_row("Failed", str(results.get('failed', 0)), "โŒ Failed") - table.add_row("Errors", str(results.get('errors', 0)), "๐Ÿ’ฅ Errors") - table.add_row("Skipped", str(results.get('skipped', 0)), "โญ๏ธ Skipped") - table.add_row("Coverage", f"{results.get('coverage', 0):.1f}%", "๐Ÿ“Š Code coverage") - table.add_row("Duration", f"{results.get('duration', 0):.2f}s", "โฑ๏ธ Execution time") - - cli_instance.console.print(table) - - # Show status - if results.get('success', False): - cli_instance.console.print("[bold green]โœ… All tests passed successfully![/bold green]") - else: - cli_instance.console.print("[bold red]โŒ Some tests failed. Check details above.[/bold red]") - - -def _display_environment_status(status: Dict[str, Any]): - """Display environment status.""" - table = Table(title="Environment Status", show_header=True, header_style="bold blue") - table.add_column("Component", style="cyan", width=20) - table.add_column("Status", style="green", width=15) - table.add_column("Details", style="white") - - for component, info in status.items(): - status_text = "โœ… OK" if info.get('status') == 'ok' else "โŒ Error" - table.add_row(component, status_text, info.get('message', '')) - - cli_instance.console.print(table) - - -def _display_test_status(status: Dict[str, Any]): - """Display test framework status.""" - cli_instance.console.print("\n[bold]Test Framework Status:[/bold]") - for key, value in status.items(): - cli_instance.console.print(f" {key}: {value}") - - -def _display_dependencies_status(status: Dict[str, Any]): - """Display dependencies status.""" - cli_instance.console.print("\n[bold]Dependencies Status:[/bold]") - for dep, info in status.items(): - status_icon = "โœ…" if info.get('installed') else "โŒ" - version = info.get('version', 'N/A') - cli_instance.console.print(f" {status_icon} {dep}: {version}") - - -if __name__ == "__main__": - main() diff --git a/pyproject.toml b/pyproject.toml index 5484610..59a63f8 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -298,7 +298,6 @@ source = ["src"] omit = [ "*/tests/*", "*/test_*", - "setup.py", ] [tool.coverage.report] diff --git a/pyproject.toml.backup b/pyproject.toml.backup deleted file mode 100644 index 5484610..0000000 --- a/pyproject.toml.backup +++ /dev/null @@ -1,336 +0,0 @@ -[build-system] -requires = ["setuptools>=61.0", "wheel"] -build-backend = "setuptools.build_meta" - -[project] -name = "fsl-continuum" -version = "3.0.0" -description = "Terminal Velocity CI/CD with persistent state and AI-native features" -readme = "README.md" -license = {text = "MIT"} -authors = [ - {name = "FSL Continuum Team", email = "team@fsl-continuum.org"} -] -maintainers = [ - {name = "FSL Continuum Team", email = "team@fsl-continuum.org"} -] -keywords = [ - "ci-cd", - "devops", - "terminal-velocity", - "flow-state", - "persistent-state", - "ai-native", - "quantum-computing", - "blockchain", - "4-market-integration" -] -classifiers = [ - "Development Status :: 5 - Production/Stable", - "Intended Audience :: Developers", - "License :: OSI Approved :: MIT License", - "Operating System :: OS Independent", - "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.10", - "Programming Language :: Python :: 3.11", - "Programming Language :: Python :: 3.12", - "Topic :: Software Development :: Libraries", - "Topic :: System :: Software Distribution", - "Topic :: System :: Systems Administration", - "Topic :: Internet :: WWW/HTTP :: Dynamic Content", -] -requires-python = ">=3.10" -dependencies = [ - "asyncio>=3.4.3", - "aiohttp>=3.8.0", - "aiofiles>=0.8.0", - "pydantic>=1.10.0", - "redis>=4.3.0", - "motor>=3.1.0", - "cryptography>=3.4.0", - "openai>=0.27.0", - "anthropic>=0.3.0", - "transformers>=4.21.0", - "torch>=2.0.0", - "numpy>=1.24.0", - "scikit-learn>=1.3.0", - "pandas>=2.0.0", - "qiskit>=0.43.0", - "cirq>=1.0.0", - "sympy>=1.12", - "PyGithub>=1.58.0", - "github-actions-api>=0.7.0", - "fastapi>=0.95.0", - "uvicorn>=0.20.0", - "jinja2>=3.1.0", - "sqlalchemy>=2.0.0", - "alembic>=1.10.0", - "psycopg2-binary>=2.9.0", - "pytest>=7.2.0", - "pytest-asyncio>=0.21.0", - "pytest-cov>=4.1.0", - "black>=23.0.0", - "flake8>=6.0.0", - "mypy>=1.4.0", - "pre-commit>=3.4.0", - "click>=8.1.0", - "rich>=13.0.0", - "typer>=0.7.0", - "prometheus-client>=0.16.0", - "structlog>=22.0.0", - "sentry-sdk>=1.28.0", - "python-jose>=3.3.0", - "passlib[bcrypt]>=1.7.0", - "docker>=6.1.0", - "kubernetes>=26.1.0", - "ansible-core>=2.14.0", - "langchain>=0.0.200", - "pyodbc>=4.0.39", - "coverage>=7.2.0", - "ddt>=1.7.0", - "python-jose>=3.3.0", - "python-dotenv>=1.0.0", - "pyyaml>=6.0.0", - "tqdm>=4.64.0", - "python-dateutil>=2.8.0", - "requests>=2.28.0", -] - -[project.optional-dependencies] -dev = [ - "black>=23.0.0", - "isort>=5.12.0", - "flake8>=6.0.0", - "mypy>=1.4.0", - "pre-commit>=3.4.0", - "pytest>=7.2.0", - "pytest-asyncio>=0.21.0", - "pytest-cov>=4.1.0", - "pytest-mock>=3.10.0", - "pytest-socket>=0.6.0", - "factory-boy>=3.3.0", - "faker>=18.9.0", - "httpx>=0.24.0", - "mkdocs>=1.5.0", - "mkdocs-material>=9.1.0", - "mkdocstrings[python]>=0.21.0", - "bandit>=1.7.5", - "safety>=2.3.0", - "pip-audit>=2.5.0", - "deptry>=0.12.0", - "py-spy>=0.3.14", - "memory-profiler>=0.60.0", - "line-profiler>=4.1.0", - "snakeviz>=2.1.0", - "ipython>=8.10.0", - "jupyter>=1.0.0", - "notebook>=7.0.0", - "vscode-ext>=0.1.3", - "cursor-ext>=0.1.2", - "docker>=6.1.0", - "docker-compose>=2.18.0", - "localstack>=2.2.0", - "terraform>=1.4.0", - "awscli-local>=2.2.0", - "gcloud-local>=0.1.0", - "postgresql15>=15.4.0", - "redis-server>=7.0.8", - "build>=0.10.0", - "twine>=4.0.0", - "wheel>=0.40.0", - "setuptools>=68.0.0", - "gitpython>=3.1.31", - "python-gitlab>=3.11.0", - "python-decouple>=3.8", - "honcho>=1.1.0", - "gevent>=22.10.0", - "autoflake>=2.2.0", - "autopep8>=2.0.4", - "pyupgrade>=3.3.2", - "types-requests>=2.28.0", - "types-setuptools>=68.0.0", - "types-PyYAML>=6.0.0", - "ruff>=0.0.241", - "autopep8>=2.0.4", - "vulture>=2.7", - "pylint>=2.17.0", - "prospector>=1.9.0", - "pyroma>=4.2.0", - "pipdeptree>=2.13.0", - "pip-tools>=6.13.0", - "check-manifest>=0.48", - "semantic-release>=21.0.0", - "bump2version>=1.0.1", - "changelog-gen>=0.8.0", -] -docs = [ - "mkdocs>=1.5.0", - "mkdocs-material>=9.1.0", - "mkdocstrings[python]>=0.21.0", - "mkdocs-gen-files>=0.4.0", - "mkdocs-literate-nav>=0.5.0", -] -test = [ - "pytest>=7.2.0", - "pytest-asyncio>=0.21.0", - "pytest-cov>=4.1.0", - "pytest-mock>=3.10.0", - "pytest-socket>=0.6.0", - "factory-boy>=3.3.0", - "faker>=18.9.0", - "httpx>=0.24.0", -] -copilot = [ - "openai-whisper>=1.6.0", - "streamlit>=1.25.0", - "plotly>=5.14.0", - "dash>=2.11.0", -] -mobile = [ - "kivy>=2.2.0", - "kivymd>=0.1.3", - "plyer>=2.1.0", - "android-sdk>=30.0.0", -] -quantum = [ - "qiskit>=0.43.0", - "cirq>=1.0.0", - "sympy>=1.12", - "pennylane>=0.32.0", - "quimb>=0.7.0", -] -enterprise = [ - "ldap3>=2.9.0", - "sshtunnel>=0.4.0", - "vault>=1.15.0", - "consul>=1.2.0", - "etcd3>=0.12.0", -] - -[project.urls] -Homepage = "https://github.com/your-org/fsl-continuum" -Documentation = "https://fsl-continuum.readthedocs.io/" -Repository = "https://github.com/your-org/fsl-continuum.git" -"Bug Tracker" = "https://github.com/your-org/fsl-continuum/issues" -Changelog = "https://github.com/your-org/fsl-continuum/blob/main/CHANGELOG.md" -"Security Policy" = "https://github.com/your-org/fsl-continuum/blob/main/SECURITY.md" -"Code of Conduct" = "https://github.com/your-org/fsl-continuum/blob/main/CODE_OF_CONDUCT.md" -"Contributing Guidelines" = "https://github.com/your-org/fsl-continuum/blob/main/CONTRIBUTING.md" -Discussions = "https://github.com/your-org/fsl-continuum/discussions" - -[project.scripts] -fsl = "fsl_continuum.cli:main" -fsl-server = "fsl_continuum.server:main" -fsl-desktop = "streamlit run src/copilot_integration/desktop_ui.py" -fsl-mobile = "streamlit run src/copilot_integration/mobile_ui.py" -test = "pytest" -test-cov = "pytest --cov=src" -lint = "black src && flake8 src && mypy src" -format = "black src && isort src" -docs = "mkdocs serve" -build = "python -m build" -publish = "twine upload dist/*" - -[tool.setuptools.packages.find] -where = ["src"] -include = ["fsl_continuum", "continuum", "copilot_integration", "quantum_engine", "schematics"] - -[tool.setuptools.package-data] -"fsl_continuum" = ["*.yaml", "*.json", "templates/*"] - -[tool.black] -line-length = 88 -target-version = ['py310'] -include = '\.pyi?$' -extend-exclude = ''' -/( - # directories - \.eggs - | \.git - | \.hg - | \.mypy_cache - | \.tox - | \.venv - | _build - | buck-out - | build - | dist -)/ -''' - -[tool.isort] -profile = "black" -multi_line_output = 3 -line_length = 88 -known_first_party = ["fsl_continuum"] - -[tool.mypy] -python_version = "3.10" -warn_return_any = true -warn_unused_configs = true -disallow_untyped_defs = true -disallow_incomplete_defs = true -check_untyped_defs = true -disallow_untyped_decorators = true -no_implicit_optional = true -warn_redundant_casts = true -warn_unused_ignores = true -warn_no_return = true -warn_unreachable = true -strict_equality = true - -[tool.pytest.ini_options] -testpaths = ["tests"] -python_files = ["test_*.py", "*_test.py"] -python_classes = ["Test*"] -python_functions = ["test_*"] -addopts = "-ra -q --strict-markers --strict-config" -markers = [ - "slow: marks tests as slow (deselect with '-m \"not slow\"')", - "integration: marks tests as integration tests", - "unit: marks tests as unit tests", - "quantum: marks tests requiring quantum simulation", - "copilot: marks tests for copilot integration", -] - -[tool.coverage.run] -source = ["src"] -omit = [ - "*/tests/*", - "*/test_*", - "setup.py", -] - -[tool.coverage.report] -exclude_lines = [ - "pragma: no cover", - "def __repr__", - "if self.debug:", - "if settings.DEBUG", - "raise AssertionError", - "raise NotImplementedError", - "if 0:", - "if __name__ == .__main__.:", - "class .*\\bProtocol\\):", - "@(abc\\.)?abstractmethod", -] - -[tool.flake8] -max-line-length = 88 -extend-ignore = ["E203", "W503"] -exclude = [ - ".git", - "__pycache__", - "build", - "dist", - ".venv", - ".eggs", - "*.egg-info", -] - -[tool.bandit] -exclude_dirs = ["tests", "test_*"] -skips = ["B101", "B601"] - -[tool.safety] -ignore = ["42902"] # Click vulnerability, fixed in dev diff --git a/pyproject_fixed.toml b/pyproject_fixed.toml deleted file mode 100644 index 833d1c3..0000000 --- a/pyproject_fixed.toml +++ /dev/null @@ -1,336 +0,0 @@ -[build-system] -requires = ["setuptools>=61.0", "wheel"] -build-backend = "setuptools.build_meta" - -[project] -name = "fsl-continuum" -version = "3.0.0" -description = "Terminal Velocity CI/CD with persistent state and AI-native features" -readme = "README.md" -license = {text = "MIT"} -authors = [ - {name = "FSL Continuum Team", email = "team@fsl-continuum.org"} -] -maintainers = [ - {name = "FSL Continuum Team", email = "team@fsl-continuum.org"} -] -keywords = [ - "ci-cd", - "devops", - "terminal-velocity", - "flow-state", - "persistent-state", - "ai-native", - "quantum-computing", - "blockchain", - "4-market-integration" -] -classifiers = [ - "Development Status :: 5 - Production/Stable", - "Intended Audience :: Developers", - "License :: OSI Approved :: MIT License", - "Operating System :: OS Independent", - "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.10", - "Programming Language :: Python :: 3.11", - "Programming Language :: Python :: 3.12", - "Topic :: Software Development :: Libraries", - "Topic :: System :: Software Distribution", - "Topic :: System :: Systems Administration", - "Topic :: Internet :: WWW/HTTP :: Dynamic Content", -] -requires-python = ">=3.10" -dependencies = [ - "asyncio>=3.4.3", - "aiohttp>=3.8.0", - "aiofiles>=0.8.0", - "pydantic>=1.10.0", - "redis>=4.3.0", - "motor>=3.1.0", - "cryptography>=3.4.0", - "openai>=0.27.0", - "anthropic>=0.3.0", - "transformers>=4.21.0", - "torch>=2.0.0", - "numpy>=1.24.0", - "scikit-learn>=1.3.0", - "pandas>=2.0.0", - "qiskit>=0.43.0", - "cirq>=1.0.0", - "sympy>=1.12", - "PyGithub>=1.58.0", - "github-actions-api>=0.7.0", - "fastapi>=0.95.0", - "uvicorn>=0.20.0", - "jinja2>=3.1.0", - "sqlalchemy>=2.0.0", - "alembic>=1.10.0", - "psycopg2-binary>=2.9.0", - "pytest>=7.2.0", - "pytest-asyncio>=0.21.0", - "pytest-cov>=4.1.0", - "black>=23.0.0", - "flake8>=6.0.0", - "mypy>=1.4.0", - "pre-commit>=3.4.0", - "click>=8.1.0", - "rich>=13.0.0", - "typer>=0.7.0", - "prometheus-client>=0.16.0", - "structlog>=22.0.0", - "sentry-sdk>=1.28.0", - "python-jose>=3.3.0", - "passlib[bcrypt]>=1.7.0", - "docker>=6.1.0", - "kubernetes>=26.1.0", - "ansible-core>=2.14.0", - "langchain>=0.0.200", - "pyodbc>=4.0.39", - "coverage>=7.2.0", - "ddt>=1.7.0", - "python-jose>=3.3.0", - "python-dotenv>=1.0.0", - "pyyaml>=6.0.0", - "tqdm>=4.64.0", - "python-dateutil>=2.8.0", - "requests>=2.28.0", -] - -[project.optional-dependencies] -dev = [ - "black>=23.0.0", - "isort>=5.12.0", - "flake8>=6.0.0", - "mypy>=1.4.0", - "pre-commit>=3.4.0", - "pytest>=7.2.0", - "pytest-asyncio>=0.21.0", - "pytest-cov>=4.1.0", - "pytest-mock>=3.10.0", - "pytest-socket>=0.6.0", - "factory-boy>=3.3.0", - "faker>=18.9.0", - "httpx>=0.24.0", - "mkdocs>=1.5.0", - "mkdocs-material>=9.1.0", - "mkdocstrings[python]>=0.21.0", - "bandit>=1.7.5", - "safety>=2.3.0", - "pip-audit>=2.5.0", - "deptry>=0.12.0", - "py-spy>=0.3.14", - "memory-profiler>=0.60.0", - "line-profiler>=4.1.0", - "snakeviz>=2.1.0", - "ipython>=8.10.0", - "jupyter>=1.0.0", - "notebook>=7.0.0", - "vscode-ext>=0.1.3", - "cursor-ext>=0.1.2", - "docker>=6.1.0", - "docker-compose>=2.18.0", - "localstack>=2.2.0", - "terraform>=1.4.0", - "awscli-local>=2.2.0", - "gcloud-local>=0.1.0", - "postgresql15>=15.4.0", - "redis-server>=7.0.8", - "build>=0.10.0", - "twine>=4.0.0", - "wheel>=0.40.0", - "setuptools>=68.0.0", - "gitpython>=3.1.31", - "python-gitlab>=3.11.0", - "python-decouple>=3.8", - "honcho>=1.1.0", - "gevent>=22.10.0", - "autoflake>=2.2.0", - "autopep8>=2.0.4", - "pyupgrade>=3.3.2", - "types-requests>=2.28.0", - "types-setuptools>=68.0.0", - "types-PyYAML>=6.0.0", - "ruff>=0.0.241", - "autopep8>=2.0.4", - "vulture>=2.7", - "pylint>=2.17.0", - "prospector>=1.9.0", - "pyroma>=4.2.0", - "pipdeptree>=2.13.0", - "pip-tools>=6.13.0", - "check-manifest>=0.48", - "semantic-release>=21.0.0", - "bump2version>=1.0.1", - "changelog-gen>=0.8.0", -] -docs = [ - "mkdocs>=1.5.0", - "mkdocs-material>=9.1.0", - "mkdocstrings[python]>=0.21.0", - "mkdocs-gen-files>=0.4.0", - "mkdocs-literate-nav>=0.5.0", -] -test = [ - "pytest>=7.2.0", - "pytest-asyncio>=0.21.0", - "pytest-cov>=4.1.0", - "pytest-mock>=3.10.0", - "pytest-socket>=0.6.0", - "factory-boy>=3.3.0", - "faker>=18.9.0", - "httpx>=0.24.0", -] -copilot = [ - "openai-whisper>=1.6.0", - "streamlit>=1.25.0", - "plotly>=5.14.0", - "dash>=2.11.0", -] -mobile = [ - "kivy>=2.2.0", - "kivymd>=0.1.3", - "plyer>=2.1.0", - "android-sdk>=30.0.0", -] -quantum = [ - "qiskit>=0.43.0", - "cirq>=1.0.0", - "sympy>=1.12", - "pennylane>=0.32.0", - "quimb>=0.7.0", -] -enterprise = [ - "ldap3>=2.9.0", - "sshtunnel>=0.4.0", - "vault>=1.15.0", - "consul>=1.2.0", - "etcd3>=0.12.0", -] - -[project.urls] -Homepage = "https://github.com/your-org/fsl-continuum" -Documentation = "https://fsl-continuum.readthedocs.io/" -Repository = "https://github.com/your-org/fsl-continuum.git" -"Bug Tracker" = "https://github.com/your-org/fsl-continuum/issues" -Changelog = "https://github.com/your-org/fsl-continuum/blob/main/CHANGELOG.md" -"Security Policy" = "https://github.com/your-org/fsl-continuum/blob/main/SECURITY.md" -"Code of Conduct" = "https://github.com/your-org/fsl-continuum/blob/main/CODE_OF_CONDUCT.md" -"Contributing Guidelines" = "https://github.com/your-org/fsl-continuum/blob/main/CONTRIBUTING.md" -Discussions = "https://github.com/your-org/fsl-continuum/discussions" - -[project.scripts] -fsl = "fsl_continuum.cli:main" -fsl-server = "fsl_continuum.server:main" -fsl-desktop = "fsl_continuum.desktop.app:main" -fsl-mobile = "fsl_continuum.mobile.app:main" -test = "pytest" -test-cov = "pytest --cov=src" -lint = "black src && flake8 src && mypy src" -format = "black src && isort src" -docs = "mkdocs serve" -build = "python -m build" -publish = "twine upload dist/*" - -[tool.setuptools.packages.find] -where = ["src"] -include = ["fsl_continuum", "continuum", "copilot_integration", "quantum_engine", "schematics"] - -[tool.setuptools.package-data] -"fsl_continuum" = ["*.yaml", "*.json", "templates/*"] - -[tool.black] -line-length = 88 -target-version = ['py310'] -include = '\.pyi?$' -extend-exclude = ''' -/( - # directories - \.eggs - | \.git - | \.hg - | \.mypy_cache - | \.tox - | \.venv - | _build - | buck-out - | build - | dist -)/ -''' - -[tool.isort] -profile = "black" -multi_line_output = 3 -line_length = 88 -known_first_party = ["fsl_continuum"] - -[tool.mypy] -python_version = "3.10" -warn_return_any = true -warn_unused_configs = true -disallow_untyped_defs = true -disallow_incomplete_defs = true -check_untyped_defs = true -disallow_untyped_decorators = true -no_implicit_optional = true -warn_redundant_casts = true -warn_unused_ignores = true -warn_no_return = true -warn_unreachable = true -strict_equality = true - -[tool.pytest.ini_options] -testpaths = ["tests"] -python_files = ["test_*.py", "*_test.py"] -python_classes = ["Test*"] -python_functions = ["test_*"] -addopts = "-ra -q --strict-markers --strict-config" -markers = [ - "slow: marks tests as slow (deselect with '-m \"not slow\"')", - "integration: marks tests as integration tests", - "unit: marks tests as unit tests", - "quantum: marks tests requiring quantum simulation", - "copilot: marks tests for copilot integration", -] - -[tool.coverage.run] -source = ["src"] -omit = [ - "*/tests/*", - "*/test_*", - "setup.py", -] - -[tool.coverage.report] -exclude_lines = [ - "pragma: no cover", - "def __repr__", - "if self.debug:", - "if settings.DEBUG", - "raise AssertionError", - "raise NotImplementedError", - "if 0:", - "if __name__ == .__main__.:", - "class .*\\bProtocol\\):", - "@(abc\\.)?abstractmethod", -] - -[tool.flake8] -max-line-length = 88 -extend-ignore = ["E203", "W503"] -exclude = [ - ".git", - "__pycache__", - "build", - "dist", - ".venv", - ".eggs", - "*.egg-info", -] - -[tool.bandit] -exclude_dirs = ["tests", "test_*"] -skips = ["B101", "B601"] - -[tool.safety] -ignore = ["42902"] # Click vulnerability, fixed in dev diff --git a/pyproject_new.toml b/pyproject_new.toml deleted file mode 100644 index e7c00f3..0000000 --- a/pyproject_new.toml +++ /dev/null @@ -1,207 +0,0 @@ -[build-system] -requires = ["setuptools>=61.0", "wheel"] -build-backend = "setuptools.build_meta" - -[project] -name = "fsl-continuum" -version = "0.1.0" -authors = [ - {name = "FSL Continuum Team", email = "team@fsl-continuum.com"} -] -description = "Terminal Velocity CI/CD with AI-Native Testing and Droid Integration" -readme = "README.md" -license = {text = "MIT"} -requires-python = ">=3.10" -classifiers = [ - "Development Status :: 4 - Beta", - "Intended Audience :: Developers", - "License :: OSI Approved :: MIT License", - "Operating System :: OS Independent", - "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.10", - "Programming Language :: Python :: 3.11", - "Programming Language :: Python :: 3.12", - "Topic :: Software Development :: Libraries", - "Topic :: System :: Software Distribution", - "Topic :: System :: Systems Administration", - "Topic :: Internet :: WWW/HTTP :: Dynamic Content", -] -dependencies = [ - "click>=8.1.0", - "rich>=13.0.0", - "pydantic>=1.10.0", - "psutil>=5.9.0", -] - -[project.optional-dependencies] -dev = [ - "pytest>=7.2.0", - "pytest-asyncio>=0.21.0", - "pytest-cov>=4.1.0", - "pytest-mock>=3.10.0", - "pytest-socket>=0.6.0", - "pytest-benchmark>=4.0.0", - "pytest-xdist>=3.0.0", - "pytest-html>=3.1.0", - "pytest-json-report>=1.5.0", - "factory-boy>=3.3.0", - "faker>=18.9.0", - "httpx>=0.24.0", - "coverage>=7.2.0", - "black>=23.0.0", - "isort>=5.12.0", - "flake8>=6.0.0", - "mypy>=1.4.0", -] -test = [ - "pytest>=7.2.0", - "pytest-asyncio>=0.21.0", - "pytest-cov>=4.1.0", - "pytest-mock>=3.10.0", - "pytest-socket>=0.6.0", - "pytest-benchmark>=4.0.0", - "pytest-xdist>=3.0.0", - "pytest-html>=3.1.0", - "pytest-json-report>=1.5.0", - "factory-boy>=3.3.0", - "faker>=18.9.0", - "httpx>=0.24.0", - "coverage>=7.2.0", - "isort>=5.12.0", -] -ai-testing = [ - "scikit-learn>=1.3.0", - "pandas>=2.0.0", - "numpy>=1.24.0", - "joblib>=1.3.0", -] -performance-testing = [ - "psutil>=5.9.0", - "memory-profiler>=0.60.0", - "line-profiler>=4.1.0", - "pytest-benchmark>=4.0.0", -] -droid-integration = [ - "websockets>=11.0.0", - "aiohttp>=3.8.0", - "msgpack>=1.0.0", -] -cross-platform = [ - "docker>=6.1.0", - "pytest-xdist>=3.0.0", - "tox>=4.0.0", -] -all-extras = [ - "scikit-learn>=1.3.0", - "pandas>=2.0.0", - "numpy>=1.24.0", - "joblib>=1.3.0", - "psutil>=5.9.0", - "memory-profiler>=0.60.0", - "line-profiler>=4.1.0", - "websockets>=11.0.0", - "aiohttp>=3.8.0", - "msgpack>=1.0.0", - "docker>=6.1.0", - "tox>=4.0.0", -] - -[project.urls] -Homepage = "https://github.com/your-org/fsl-continuum" -Documentation = "https://fsl-continuum.readthedocs.io/" -Repository = "https://github.com/your-org/fsl-continuum.git" - -[project.scripts] -fsl = "fsl_continuum.cli:main" -fsl-server = "fsl_continuum.server:main" - -[tool.setuptools.packages.find] -where = ["src"] -include = ["fsl_continuum*"] - -[tool.pytest.ini_options] -minversion = "6.0" -addopts = "-ra -q --strict-markers --strict-config" -testpaths = [ - "src/tests", -] -markers = [ - "unit: Unit tests", - "integration: Integration tests", - "performance: Performance tests", - "semantic_languages: Semantic language tests", - "xml_transformation: XML transformation tests", - "quantum_engine: Quantum engine tests", - "blockchain: Blockchain tests", - "ai_processing: AI processing tests", - "droid_testing: Droid-specific tests", - "baml: BAML language tests", - "pareto_lang: Pareto-Lang tests", -] - -[tool.black] -line-length = 88 -target-version = ['py310'] -include = '\.pyi?$' -extend-exclude = ''' -/( - # directories - \.eggs - | \.git - | \.hg - | \.mypy_cache - | \.tox - | \.venv - | build - | dist -)/ -''' - -[tool.isort] -profile = "black" -line_length = 88 -multi_line_output = 3 -force_grid_wrap = 0 -use_parentheses = True -ensure_newline_before_comments = True - -[tool.mypy] -python_version = "3.10" -warn_return_any = true -warn_unused_configs = true -disallow_untyped_defs = true -disallow_incomplete_defs = true -check_untyped_defs = true -disallow_untyped_decorators = true -no_implicit_optional = true -warn_redundant_casts = true -warn_unused_ignores = true -warn_no_return = true -warn_unreachable = true -strict_equality = true - -[tool.coverage.run] -source = ["src"] -omit = [ - "*/tests/*", - "*/test_*", - "*/__pycache__/*", -] - -[tool.coverage.report] -exclude_lines = [ - "pragma: no cover", - "def __repr__", - "if self.debug:", - "if settings.DEBUG", - "raise AssertionError", - "raise NotImplementedError", - "if 0:", - "if __name__ == .__main__.:", - "class .*\\bProtocol\\):", - "@(abc\\.)?abstractmethod", -] -precision = 2 - -[tool.coverage.html] -directory = "htmlcov" diff --git a/pyproject_original.toml b/pyproject_original.toml deleted file mode 100644 index 5484610..0000000 --- a/pyproject_original.toml +++ /dev/null @@ -1,336 +0,0 @@ -[build-system] -requires = ["setuptools>=61.0", "wheel"] -build-backend = "setuptools.build_meta" - -[project] -name = "fsl-continuum" -version = "3.0.0" -description = "Terminal Velocity CI/CD with persistent state and AI-native features" -readme = "README.md" -license = {text = "MIT"} -authors = [ - {name = "FSL Continuum Team", email = "team@fsl-continuum.org"} -] -maintainers = [ - {name = "FSL Continuum Team", email = "team@fsl-continuum.org"} -] -keywords = [ - "ci-cd", - "devops", - "terminal-velocity", - "flow-state", - "persistent-state", - "ai-native", - "quantum-computing", - "blockchain", - "4-market-integration" -] -classifiers = [ - "Development Status :: 5 - Production/Stable", - "Intended Audience :: Developers", - "License :: OSI Approved :: MIT License", - "Operating System :: OS Independent", - "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.10", - "Programming Language :: Python :: 3.11", - "Programming Language :: Python :: 3.12", - "Topic :: Software Development :: Libraries", - "Topic :: System :: Software Distribution", - "Topic :: System :: Systems Administration", - "Topic :: Internet :: WWW/HTTP :: Dynamic Content", -] -requires-python = ">=3.10" -dependencies = [ - "asyncio>=3.4.3", - "aiohttp>=3.8.0", - "aiofiles>=0.8.0", - "pydantic>=1.10.0", - "redis>=4.3.0", - "motor>=3.1.0", - "cryptography>=3.4.0", - "openai>=0.27.0", - "anthropic>=0.3.0", - "transformers>=4.21.0", - "torch>=2.0.0", - "numpy>=1.24.0", - "scikit-learn>=1.3.0", - "pandas>=2.0.0", - "qiskit>=0.43.0", - "cirq>=1.0.0", - "sympy>=1.12", - "PyGithub>=1.58.0", - "github-actions-api>=0.7.0", - "fastapi>=0.95.0", - "uvicorn>=0.20.0", - "jinja2>=3.1.0", - "sqlalchemy>=2.0.0", - "alembic>=1.10.0", - "psycopg2-binary>=2.9.0", - "pytest>=7.2.0", - "pytest-asyncio>=0.21.0", - "pytest-cov>=4.1.0", - "black>=23.0.0", - "flake8>=6.0.0", - "mypy>=1.4.0", - "pre-commit>=3.4.0", - "click>=8.1.0", - "rich>=13.0.0", - "typer>=0.7.0", - "prometheus-client>=0.16.0", - "structlog>=22.0.0", - "sentry-sdk>=1.28.0", - "python-jose>=3.3.0", - "passlib[bcrypt]>=1.7.0", - "docker>=6.1.0", - "kubernetes>=26.1.0", - "ansible-core>=2.14.0", - "langchain>=0.0.200", - "pyodbc>=4.0.39", - "coverage>=7.2.0", - "ddt>=1.7.0", - "python-jose>=3.3.0", - "python-dotenv>=1.0.0", - "pyyaml>=6.0.0", - "tqdm>=4.64.0", - "python-dateutil>=2.8.0", - "requests>=2.28.0", -] - -[project.optional-dependencies] -dev = [ - "black>=23.0.0", - "isort>=5.12.0", - "flake8>=6.0.0", - "mypy>=1.4.0", - "pre-commit>=3.4.0", - "pytest>=7.2.0", - "pytest-asyncio>=0.21.0", - "pytest-cov>=4.1.0", - "pytest-mock>=3.10.0", - "pytest-socket>=0.6.0", - "factory-boy>=3.3.0", - "faker>=18.9.0", - "httpx>=0.24.0", - "mkdocs>=1.5.0", - "mkdocs-material>=9.1.0", - "mkdocstrings[python]>=0.21.0", - "bandit>=1.7.5", - "safety>=2.3.0", - "pip-audit>=2.5.0", - "deptry>=0.12.0", - "py-spy>=0.3.14", - "memory-profiler>=0.60.0", - "line-profiler>=4.1.0", - "snakeviz>=2.1.0", - "ipython>=8.10.0", - "jupyter>=1.0.0", - "notebook>=7.0.0", - "vscode-ext>=0.1.3", - "cursor-ext>=0.1.2", - "docker>=6.1.0", - "docker-compose>=2.18.0", - "localstack>=2.2.0", - "terraform>=1.4.0", - "awscli-local>=2.2.0", - "gcloud-local>=0.1.0", - "postgresql15>=15.4.0", - "redis-server>=7.0.8", - "build>=0.10.0", - "twine>=4.0.0", - "wheel>=0.40.0", - "setuptools>=68.0.0", - "gitpython>=3.1.31", - "python-gitlab>=3.11.0", - "python-decouple>=3.8", - "honcho>=1.1.0", - "gevent>=22.10.0", - "autoflake>=2.2.0", - "autopep8>=2.0.4", - "pyupgrade>=3.3.2", - "types-requests>=2.28.0", - "types-setuptools>=68.0.0", - "types-PyYAML>=6.0.0", - "ruff>=0.0.241", - "autopep8>=2.0.4", - "vulture>=2.7", - "pylint>=2.17.0", - "prospector>=1.9.0", - "pyroma>=4.2.0", - "pipdeptree>=2.13.0", - "pip-tools>=6.13.0", - "check-manifest>=0.48", - "semantic-release>=21.0.0", - "bump2version>=1.0.1", - "changelog-gen>=0.8.0", -] -docs = [ - "mkdocs>=1.5.0", - "mkdocs-material>=9.1.0", - "mkdocstrings[python]>=0.21.0", - "mkdocs-gen-files>=0.4.0", - "mkdocs-literate-nav>=0.5.0", -] -test = [ - "pytest>=7.2.0", - "pytest-asyncio>=0.21.0", - "pytest-cov>=4.1.0", - "pytest-mock>=3.10.0", - "pytest-socket>=0.6.0", - "factory-boy>=3.3.0", - "faker>=18.9.0", - "httpx>=0.24.0", -] -copilot = [ - "openai-whisper>=1.6.0", - "streamlit>=1.25.0", - "plotly>=5.14.0", - "dash>=2.11.0", -] -mobile = [ - "kivy>=2.2.0", - "kivymd>=0.1.3", - "plyer>=2.1.0", - "android-sdk>=30.0.0", -] -quantum = [ - "qiskit>=0.43.0", - "cirq>=1.0.0", - "sympy>=1.12", - "pennylane>=0.32.0", - "quimb>=0.7.0", -] -enterprise = [ - "ldap3>=2.9.0", - "sshtunnel>=0.4.0", - "vault>=1.15.0", - "consul>=1.2.0", - "etcd3>=0.12.0", -] - -[project.urls] -Homepage = "https://github.com/your-org/fsl-continuum" -Documentation = "https://fsl-continuum.readthedocs.io/" -Repository = "https://github.com/your-org/fsl-continuum.git" -"Bug Tracker" = "https://github.com/your-org/fsl-continuum/issues" -Changelog = "https://github.com/your-org/fsl-continuum/blob/main/CHANGELOG.md" -"Security Policy" = "https://github.com/your-org/fsl-continuum/blob/main/SECURITY.md" -"Code of Conduct" = "https://github.com/your-org/fsl-continuum/blob/main/CODE_OF_CONDUCT.md" -"Contributing Guidelines" = "https://github.com/your-org/fsl-continuum/blob/main/CONTRIBUTING.md" -Discussions = "https://github.com/your-org/fsl-continuum/discussions" - -[project.scripts] -fsl = "fsl_continuum.cli:main" -fsl-server = "fsl_continuum.server:main" -fsl-desktop = "streamlit run src/copilot_integration/desktop_ui.py" -fsl-mobile = "streamlit run src/copilot_integration/mobile_ui.py" -test = "pytest" -test-cov = "pytest --cov=src" -lint = "black src && flake8 src && mypy src" -format = "black src && isort src" -docs = "mkdocs serve" -build = "python -m build" -publish = "twine upload dist/*" - -[tool.setuptools.packages.find] -where = ["src"] -include = ["fsl_continuum", "continuum", "copilot_integration", "quantum_engine", "schematics"] - -[tool.setuptools.package-data] -"fsl_continuum" = ["*.yaml", "*.json", "templates/*"] - -[tool.black] -line-length = 88 -target-version = ['py310'] -include = '\.pyi?$' -extend-exclude = ''' -/( - # directories - \.eggs - | \.git - | \.hg - | \.mypy_cache - | \.tox - | \.venv - | _build - | buck-out - | build - | dist -)/ -''' - -[tool.isort] -profile = "black" -multi_line_output = 3 -line_length = 88 -known_first_party = ["fsl_continuum"] - -[tool.mypy] -python_version = "3.10" -warn_return_any = true -warn_unused_configs = true -disallow_untyped_defs = true -disallow_incomplete_defs = true -check_untyped_defs = true -disallow_untyped_decorators = true -no_implicit_optional = true -warn_redundant_casts = true -warn_unused_ignores = true -warn_no_return = true -warn_unreachable = true -strict_equality = true - -[tool.pytest.ini_options] -testpaths = ["tests"] -python_files = ["test_*.py", "*_test.py"] -python_classes = ["Test*"] -python_functions = ["test_*"] -addopts = "-ra -q --strict-markers --strict-config" -markers = [ - "slow: marks tests as slow (deselect with '-m \"not slow\"')", - "integration: marks tests as integration tests", - "unit: marks tests as unit tests", - "quantum: marks tests requiring quantum simulation", - "copilot: marks tests for copilot integration", -] - -[tool.coverage.run] -source = ["src"] -omit = [ - "*/tests/*", - "*/test_*", - "setup.py", -] - -[tool.coverage.report] -exclude_lines = [ - "pragma: no cover", - "def __repr__", - "if self.debug:", - "if settings.DEBUG", - "raise AssertionError", - "raise NotImplementedError", - "if 0:", - "if __name__ == .__main__.:", - "class .*\\bProtocol\\):", - "@(abc\\.)?abstractmethod", -] - -[tool.flake8] -max-line-length = 88 -extend-ignore = ["E203", "W503"] -exclude = [ - ".git", - "__pycache__", - "build", - "dist", - ".venv", - ".eggs", - "*.egg-info", -] - -[tool.bandit] -exclude_dirs = ["tests", "test_*"] -skips = ["B101", "B601"] - -[tool.safety] -ignore = ["42902"] # Click vulnerability, fixed in dev diff --git a/pyproject_simple.toml b/pyproject_simple.toml deleted file mode 100644 index e0fd2fa..0000000 --- a/pyproject_simple.toml +++ /dev/null @@ -1,91 +0,0 @@ -[build-system] -requires = ["setuptools>=61.0", "wheel"] -build-backend = "setuptools.build_meta" - -[project] -name = "fsl-continuum" -version = "3.0.0" -description = "Terminal Velocity CI/CD with persistent state and AI-native features" -readme = "README.md" -license = {text = "MIT"} -authors = [ - {name = "FSL Continuum Team", email = "team@fsl-continuum.org"} -] -maintainers = [ - {name = "FSL Continuum Team", email = "team@fsl-continuum.org"} -] -keywords = [ - "ci-cd", - "devops", - "terminal-velocity", - "flow-state", - "persistent-state", - "ai-native", - "quantum-computing", - "blockchain", - "4-market-integration" -] -classifiers = [ - "Development Status :: 5 - Production/Stable", - "Intended Audience :: Developers", - "License :: OSI Approved :: MIT License", - "Operating System :: OS Independent", - "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.10", - "Programming Language :: Python :: 3.11", - "Programming Language :: Python :: 3.12", - "Topic :: Software Development :: Libraries", - "Topic :: System :: Software Distribution", - "Topic :: System :: Systems Administration", - "Topic :: Internet :: WWW/HTTP :: Dynamic Content", -] -requires-python = ">=3.10" -dependencies = [ - "click>=8.1.0", - "rich>=13.0.0", - "pydantic>=1.10.0", -] - -[project.optional-dependencies] -dev = [ - "pytest>=7.2.0", - "pytest-asyncio>=0.21.0", - "pytest-cov>=4.1.0", - "pytest-mock>=3.10.0", - "black>=23.0.0", - "flake8>=6.0.0", - "mypy>=1.4.0", -] -test = [ - "pytest>=7.2.0", - "pytest-asyncio>=0.21.0", - "pytest-cov>=4.1.0", - "pytest-mock>=3.10.0", - "factory-boy>=3.3.0", - "faker>=18.9.0", - "httpx>=0.24.0", -] - -[project.urls] -Homepage = "https://github.com/your-org/fsl-continuum" -Documentation = "https://fsl-continuum.readthedocs.io/" -Repository = "https://github.com/your-org/fsl-continuum.git" - -[project.scripts] -fsl = "fsl_continuum.cli:main" -fsl-server = "fsl_continuum.server:main" - -[tool.setuptools.packages.find] -where = ["src"] - -[tool.pytest.ini_options] -testpaths = ["src/tests"] -python_files = ["test_*.py", "*_test.py"] -python_classes = ["Test*"] -python_functions = ["test_*"] -addopts = "-ra -q --strict-markers --strict-config" -markers = [ - "unit: marks tests as unit tests", - "integration: marks tests as integration tests", - "slow: marks tests as slow (deselect with '-m \"not slow\"')", -] diff --git a/pytest.ini.backup b/pytest.ini.backup deleted file mode 100644 index 8455ff9..0000000 --- a/pytest.ini.backup +++ /dev/null @@ -1,229 +0,0 @@ -[tool:pytest] -# Test Discovery -testpaths = src/tests -python_files = test_*.py *_test.py -python_classes = Test* -python_functions = test_* - -# Test Execution -addopts = - --strict-markers - --strict-config - --verbose - --tb=short - --cov=src - --cov-report=html - --cov-report=xml - --cov-report=term-missing - --cov-fail-under=95 - --durations=10 - --maxfail=5 - --color=yes - --reuse-db - -# Coverage Configuration -cov-source = src -cov-branch = true -cov-context = test - -# Markers -markers = - unit: Unit tests for individual components - integration: Integration tests for component interactions - performance: Performance tests and benchmarking - ai_processing: AI processing and validation tests - xml_transformation: XML transformation tests - baml: BAML (BoundaryML) specific tests - pareto_lang: Pareto-Lang specific tests - semantic_languages: Semantic language integration tests - slow: Tests that take longer than 1 second - external: Tests that require external services - security: Security-related tests - smoke: Smoke tests for basic functionality - benchmark: Performance benchmarking tests - coverage: Coverage-specific tests - regression: Regression tests - stress: Stress tests for performance validation - -# Async Configuration -asyncio_mode = auto -asyncio_default_fixture_loop_scope = function - -# Logging Configuration -log_cli = true -log_cli_level = INFO -log_cli_format = %(asctime)s [%(levelname)8s] %(name)s: %(message)s -log_cli_date_format = %Y-%m-%d %H:%M:%S - -# Output Configuration -console_output_style = progress -junit_family = xunit2 -junit_logging = all - -# Min/Max Versions -minversion = 7.0 -required_plugins = pytest-asyncio pytest-cov pytest-mock pytest-benchmark pytest-xvflaky - -# Test Session Configuration -usefixtures = - test_environment - test_data_manager - test_monitoring - -# Timeout Configuration -timeout = 300 -timeout_method = thread - -# Benchmark Configuration -benchmark-only = true -benchmark-sort = min -benchmark-min-rounds = 5 -benchmark-max-time = 30 -benchmark-warmup = true -benchmark-warmup-shutdown = true - -# Performance Configuration -benchmark-storage = .benchmark -benchmark-histogram = true -benchmark-json = benchmark.json -benchmark-html = benchmark.html - -# Security Configuration -bandit-tests = true -bandit-skips = [] - -# Memory Configuration -memory-profile = false -memory-profiler = true - -# Parallel Configuration -parallel = false -parallel-workers = auto - -# Retry Configuration -reruns = 0 -reruns-delay = 1 -flaky-reruns = 2 - -# Monkeypatch Configuration -monkeypatch-setenv = false - -# Django Configuration (if needed) -django-settings-module = tests.settings - -# Flask Configuration (if needed) -flask-app = tests.app - -# Database Configuration (if needed) -db-keepdb = true -db-host = localhost -db-port = 5432 -db-name = test_fsl_continuum -db-user = test_user -db-password = test_password - -# Cache Configuration (if needed) -cache-url = redis://localhost:6379/1 - -# External Services Configuration -external-service-timeout = 30 -external-service-retries = 3 - -# AI Configuration -openai-api-key = test_openai_key -anthropic-api-key = test_anthropic_key - -# Performance Thresholds -performance-thresholds = { - "baml-parsing": 0.1, - "pareto-lang-parsing": 0.1, - "xml-transformation": 0.5, - "ai-processing": 2.0 - - -# Memory Thresholds -memory-thresholds = { - "baml-parsing": 50, - "pareto-lang-parsing": 50, - "xml-transformation": 100, - "ai-processing": 200 -} - -# Coverage Thresholds -coverage-thresholds = { - "unit": 95, - "integration": 90, - "performance": 80, - "ai_processing": 85, - "xml_transformation": 90 -} - -# Concurrency Configuration -concurrency-tests = true -concurrency-workers = 4 - -# Regression Configuration -regression-tests = false -regression-baseline = regression_baseline.json - -# Stress Configuration -stress-tests = false -stress-duration = 300 -stress-concurrency = 10 - -# Integration Configuration -integration-tests = true -integration-services = { - "redis": true, - "postgres": true, - "openai": false, - "anthropic": false -} - -# Security Configuration -security-tests = true -security-scan = true -security-report = security_report.json - -# Documentation Configuration -docs-tests = true -docs-coverage = 80 - -# Code Quality Configuration -code-quality-tests = true -code-quality-threshold = 8.0 - -# Type Checking Configuration -type-checking = true -type-checking-strict = false - -# API Configuration -api-tests = true -api-host = localhost -api-port = 8080 - -# WebSocket Configuration -websocket-tests = true -websocket-uri = ws://localhost:8080/ws - -# GraphQL Configuration -graphql-tests = true -graphql-endpoint = http://localhost:8080/graphql - -# REST Configuration -rest-tests = true -rest-endpoint = http://localhost:8080/api - -# File System Configuration -file-system-tests = true -test-data-dir = src/tests/fixtures -temp-dir = /tmp/fsl_continuum_tests - -# Network Configuration -network-tests = true -network-timeout = 30 - -# Environment Configuration -test-env = test -test-config-file = tests/config/test_config.yaml -test-secrets-file = tests/config/test_secrets.yaml diff --git a/pytest.ini.backup2 b/pytest.ini.backup2 deleted file mode 100644 index b0f2cde..0000000 --- a/pytest.ini.backup2 +++ /dev/null @@ -1,38 +0,0 @@ -[tool:pytest] -minversion = 6.0 -addopts = -ra -q --strict-markers --strict-config --json-report --json-report-file=reports/test_results.json -testpaths = [ - src/tests, -] -python_files = [ - test_*.py, - *_test.py, -] -python_classes = [ - Test*, -] -python_functions = [ - test_* -] -markers = [ - unit: Unit tests - integration: Integration tests - performance: Performance tests - semantic_languages: Semantic language tests - xml_transformation: XML transformation tests - quantum_engine: Quantum engine tests - blockchain: Blockchain tests - ai_processing: AI processing tests - droid_testing: Droid-specific tests - baml: BAML language tests - pareto_lang: Pareto-Lang tests -] -filterwarnings = - ignore::DeprecationWarning - ignore::PendingDeprecationWarning -log_cli = true -log_cli_level = INFO -log_cli_format = %(asctime)s [%(levelname)8s] %(name)s: %(message)s -log_cli_date_format = %Y-%m-%d %H:%M:%S -timeout = 300 -timeout_method = thread diff --git a/pytest_simple.ini b/pytest_simple.ini deleted file mode 100644 index b0f2cde..0000000 --- a/pytest_simple.ini +++ /dev/null @@ -1,38 +0,0 @@ -[tool:pytest] -minversion = 6.0 -addopts = -ra -q --strict-markers --strict-config --json-report --json-report-file=reports/test_results.json -testpaths = [ - src/tests, -] -python_files = [ - test_*.py, - *_test.py, -] -python_classes = [ - Test*, -] -python_functions = [ - test_* -] -markers = [ - unit: Unit tests - integration: Integration tests - performance: Performance tests - semantic_languages: Semantic language tests - xml_transformation: XML transformation tests - quantum_engine: Quantum engine tests - blockchain: Blockchain tests - ai_processing: AI processing tests - droid_testing: Droid-specific tests - baml: BAML language tests - pareto_lang: Pareto-Lang tests -] -filterwarnings = - ignore::DeprecationWarning - ignore::PendingDeprecationWarning -log_cli = true -log_cli_level = INFO -log_cli_format = %(asctime)s [%(levelname)8s] %(name)s: %(message)s -log_cli_date_format = %Y-%m-%d %H:%M:%S -timeout = 300 -timeout_method = thread diff --git a/setup.py b/setup.py deleted file mode 100644 index 4944736..0000000 --- a/setup.py +++ /dev/null @@ -1,225 +0,0 @@ -""" -FSL Continuum Setup Script - Fixed Version - -Legacy setup script for compatibility with older pip versions and build systems. -New installations should use pyproject.toml (PEP 517/518). -""" - -from setuptools import setup, find_packages -import os - -# Read version from pyproject.toml -def get_version(): - try: - with open('pyproject.toml', 'r') as f: - content = f.read() - for line in content.split('\n'): - if line.startswith('version = '): - return line.split('=')[1].strip().strip('"\'') - except FileNotFoundError: - pass - - # Fallback version - return "3.0.0" - -# Read requirements -def get_requirements(): - requirements = [] - try: - with open('requirements.txt', 'r') as f: - for line in f: - line = line.strip() - if line and not line.startswith('#'): - requirements.append(line) - except FileNotFoundError: - pass - - return requirements - -# Read long description -def get_long_description(): - try: - with open('README.md', 'r', encoding='utf-8') as f: - return f.read() - except FileNotFoundError: - return "Terminal Velocity CI/CD with persistent state and AI-native features" - -# Get package data -def get_package_data(): - package_data = { - '': [ - 'LICENSE', - 'README.md', - 'CHANGELOG.md', - 'CONTRIBUTING.md', - 'SECURITY.md', - 'CODE_OF_CONDUCT.md', - 'requirements.txt', - 'requirements-dev.txt', - 'pyproject.toml', - 'setup.py', - ], - 'docs': [ - '*.md', - '*.yaml', - '*.yml', - '*.json', - ], - 'config': [ - '*.json', - '*.yaml', - '*.yml', - ], - } - - # Add all files recursively - for root, dirs, files in os.walk('src'): - for file in files: - if not file.endswith('.pyc'): - rel_path = os.path.relpath(os.path.join(root, file), 'src') - package_data[''].append(rel_path) - - return package_data - -# Setup configuration -setup( - name='fsl-continuum', - version=get_version(), - description='Terminal Velocity CI/CD with persistent state and AI-native features', - long_description=get_long_description(), - long_description_content_type='text/markdown', - author='FSL Continuum Team', - author_email='team@fsl-continuum.org', - maintainer='FSL Continuum Team', - maintainer_email='team@fsl-continuum.org', - url='https://github.com/your-org/fsl-continuum', - license='MIT', - license_files=('LICENSE',), - classifiers=[ - 'Development Status :: 5 - Production/Stable', - 'Intended Audience :: Developers', - 'Intended Audience :: System Administrators', - 'Topic :: Software Development :: Build Tools', - 'Topic :: Software Development :: Libraries :: Python Modules', - 'Topic :: System :: Software Distribution', - 'License :: OSI Approved :: MIT License', - 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.9', - 'Programming Language :: Python :: 3.10', - 'Programming Language :: Python :: 3.11', - 'Programming Language :: Python :: 3.12', - 'Operating System :: OS Independent', - 'Environment :: Web Environment', - 'Environment :: Console', - 'Framework :: Flask', - 'Framework :: Pydantic', - 'Natural Language :: English', - ], - keywords=[ - 'ci-cd', - 'devops', - 'terminal-velocity', - 'flow-state', - 'persistent-state', - 'ai-native', - 'quantum-computing', - 'blockchain', - '4-market-integration', - 'baml', - 'pareto-lang', - 'xml-transformation', - 'semantic-languages', - ], - python_requires='>=3.9', - install_requires=get_requirements(), - packages=find_packages(where='src', exclude=['tests*']), - package_dir={'': 'src'}, - package_data=get_package_data(), - data_files=[ - ('share/fsl-continuum/docs', ['docs/*.md']), - ('share/fsl-continuum/config', ['config/*.json', 'config/*.yaml', 'config/*.yml']), - ('share/fsl-continuum/examples', ['examples/*.py', 'examples/*.yaml', 'examples/*.md']), - ], - entry_points={ - 'console_scripts': [ - 'fsl=fsl_continuum.cli:main', - 'fsl-continuum=fsl_continuum.cli:main', - 'fsl-trigger=fsl_continuum.cli.trigger_cli:main', - 'fsl-monitor=fsl_continuum.cli.monitor_cli:main', - 'fsl-config=fsl_continuum.cli.config_cli:main', - ], - 'gui_scripts': [ - 'fsl-desktop=fsl_continuum.desktop.app:main', - ], - }, - include_package_data=True, - zip_safe=False, - platforms=['any'], - test_suite='tests', - tests_require=[ - 'pytest>=7.2.0', - 'pytest-asyncio>=0.21.0', - 'pytest-cov>=4.1.0', - 'pytest-mock>=3.10.0', - ], - extras_require={ - 'dev': [ - 'black>=23.0.0', - 'isort>=5.12.0', - 'flake8>=6.0.0', - 'mypy>=1.4.0', - 'pre-commit>=3.4.0', - ], - 'docs': [ - 'mkdocs>=1.5.0', - 'mkdocs-material>=9.1.0', - 'mkdocstrings[python]>=0.21.0', - ], - 'test': [ - 'pytest>=7.2.0', - 'pytest-asyncio>=0.21.0', - 'pytest-cov>=4.1.0', - 'pytest-mock>=3.10.0', - 'factory-boy>=3.3.0', - 'faker>=18.9.0', - 'httpx>=0.24.0', - ], - 'ai': [ - 'openai>=0.27.0', - 'anthropic>=0.3.0', - 'transformers>=4.21.0', - 'torch>=2.0.0', - 'numpy>=1.24.0', - 'scikit-learn>=1.3.0', - 'pandas>=2.0.0', - ], - 'quantum': [ - 'qiskit>=0.43.0', - 'cirq>=1.0.0', - 'sympy>=1.12', - ], - 'blockchain': [ - 'blockchain>=1.0.2', - 'cryptography>=3.4.0', - 'web3>=6.0.0', - ], - 'monitoring': [ - 'prometheus-client>=0.14.0', - 'grafana-api>=1.0.3', - 'psutil>=5.9.0', - 'sentry-sdk>=1.15.0', - ], - }, - project_urls={ - 'Homepage': 'https://github.com/your-org/fsl-continuum', - 'Documentation': 'https://fsl-continuum.readthedocs.io/', - 'Repository': 'https://github.com/your-org/fsl-continuum.git', - 'Bug Tracker': 'https://github.com/your-org/fsl-continuum/issues', - 'Changelog': 'https://github.com/your-org/fsl-continuum/blob/main/CHANGELOG.md', - 'Security Policy': 'https://github.com/your-org/fsl-continuum/blob/main/SECURITY.md', - 'Code of Conduct': 'https://github.com/your-org/fsl-continuum/blob/main/CODE_OF_CONDUCT.md', - 'Contributing Guidelines': 'https://github.com/your-org/fsl-continuum/blob/main/CONTRIBUTING.md', - 'Discussions': 'https://github.com/your-org/fsl-continuum/discussions', - 'Discord': 'https://discord.gg/fsl-continuum', - }, -) diff --git a/setup_fixed.py b/setup_fixed.py deleted file mode 100644 index 4944736..0000000 --- a/setup_fixed.py +++ /dev/null @@ -1,225 +0,0 @@ -""" -FSL Continuum Setup Script - Fixed Version - -Legacy setup script for compatibility with older pip versions and build systems. -New installations should use pyproject.toml (PEP 517/518). -""" - -from setuptools import setup, find_packages -import os - -# Read version from pyproject.toml -def get_version(): - try: - with open('pyproject.toml', 'r') as f: - content = f.read() - for line in content.split('\n'): - if line.startswith('version = '): - return line.split('=')[1].strip().strip('"\'') - except FileNotFoundError: - pass - - # Fallback version - return "3.0.0" - -# Read requirements -def get_requirements(): - requirements = [] - try: - with open('requirements.txt', 'r') as f: - for line in f: - line = line.strip() - if line and not line.startswith('#'): - requirements.append(line) - except FileNotFoundError: - pass - - return requirements - -# Read long description -def get_long_description(): - try: - with open('README.md', 'r', encoding='utf-8') as f: - return f.read() - except FileNotFoundError: - return "Terminal Velocity CI/CD with persistent state and AI-native features" - -# Get package data -def get_package_data(): - package_data = { - '': [ - 'LICENSE', - 'README.md', - 'CHANGELOG.md', - 'CONTRIBUTING.md', - 'SECURITY.md', - 'CODE_OF_CONDUCT.md', - 'requirements.txt', - 'requirements-dev.txt', - 'pyproject.toml', - 'setup.py', - ], - 'docs': [ - '*.md', - '*.yaml', - '*.yml', - '*.json', - ], - 'config': [ - '*.json', - '*.yaml', - '*.yml', - ], - } - - # Add all files recursively - for root, dirs, files in os.walk('src'): - for file in files: - if not file.endswith('.pyc'): - rel_path = os.path.relpath(os.path.join(root, file), 'src') - package_data[''].append(rel_path) - - return package_data - -# Setup configuration -setup( - name='fsl-continuum', - version=get_version(), - description='Terminal Velocity CI/CD with persistent state and AI-native features', - long_description=get_long_description(), - long_description_content_type='text/markdown', - author='FSL Continuum Team', - author_email='team@fsl-continuum.org', - maintainer='FSL Continuum Team', - maintainer_email='team@fsl-continuum.org', - url='https://github.com/your-org/fsl-continuum', - license='MIT', - license_files=('LICENSE',), - classifiers=[ - 'Development Status :: 5 - Production/Stable', - 'Intended Audience :: Developers', - 'Intended Audience :: System Administrators', - 'Topic :: Software Development :: Build Tools', - 'Topic :: Software Development :: Libraries :: Python Modules', - 'Topic :: System :: Software Distribution', - 'License :: OSI Approved :: MIT License', - 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.9', - 'Programming Language :: Python :: 3.10', - 'Programming Language :: Python :: 3.11', - 'Programming Language :: Python :: 3.12', - 'Operating System :: OS Independent', - 'Environment :: Web Environment', - 'Environment :: Console', - 'Framework :: Flask', - 'Framework :: Pydantic', - 'Natural Language :: English', - ], - keywords=[ - 'ci-cd', - 'devops', - 'terminal-velocity', - 'flow-state', - 'persistent-state', - 'ai-native', - 'quantum-computing', - 'blockchain', - '4-market-integration', - 'baml', - 'pareto-lang', - 'xml-transformation', - 'semantic-languages', - ], - python_requires='>=3.9', - install_requires=get_requirements(), - packages=find_packages(where='src', exclude=['tests*']), - package_dir={'': 'src'}, - package_data=get_package_data(), - data_files=[ - ('share/fsl-continuum/docs', ['docs/*.md']), - ('share/fsl-continuum/config', ['config/*.json', 'config/*.yaml', 'config/*.yml']), - ('share/fsl-continuum/examples', ['examples/*.py', 'examples/*.yaml', 'examples/*.md']), - ], - entry_points={ - 'console_scripts': [ - 'fsl=fsl_continuum.cli:main', - 'fsl-continuum=fsl_continuum.cli:main', - 'fsl-trigger=fsl_continuum.cli.trigger_cli:main', - 'fsl-monitor=fsl_continuum.cli.monitor_cli:main', - 'fsl-config=fsl_continuum.cli.config_cli:main', - ], - 'gui_scripts': [ - 'fsl-desktop=fsl_continuum.desktop.app:main', - ], - }, - include_package_data=True, - zip_safe=False, - platforms=['any'], - test_suite='tests', - tests_require=[ - 'pytest>=7.2.0', - 'pytest-asyncio>=0.21.0', - 'pytest-cov>=4.1.0', - 'pytest-mock>=3.10.0', - ], - extras_require={ - 'dev': [ - 'black>=23.0.0', - 'isort>=5.12.0', - 'flake8>=6.0.0', - 'mypy>=1.4.0', - 'pre-commit>=3.4.0', - ], - 'docs': [ - 'mkdocs>=1.5.0', - 'mkdocs-material>=9.1.0', - 'mkdocstrings[python]>=0.21.0', - ], - 'test': [ - 'pytest>=7.2.0', - 'pytest-asyncio>=0.21.0', - 'pytest-cov>=4.1.0', - 'pytest-mock>=3.10.0', - 'factory-boy>=3.3.0', - 'faker>=18.9.0', - 'httpx>=0.24.0', - ], - 'ai': [ - 'openai>=0.27.0', - 'anthropic>=0.3.0', - 'transformers>=4.21.0', - 'torch>=2.0.0', - 'numpy>=1.24.0', - 'scikit-learn>=1.3.0', - 'pandas>=2.0.0', - ], - 'quantum': [ - 'qiskit>=0.43.0', - 'cirq>=1.0.0', - 'sympy>=1.12', - ], - 'blockchain': [ - 'blockchain>=1.0.2', - 'cryptography>=3.4.0', - 'web3>=6.0.0', - ], - 'monitoring': [ - 'prometheus-client>=0.14.0', - 'grafana-api>=1.0.3', - 'psutil>=5.9.0', - 'sentry-sdk>=1.15.0', - ], - }, - project_urls={ - 'Homepage': 'https://github.com/your-org/fsl-continuum', - 'Documentation': 'https://fsl-continuum.readthedocs.io/', - 'Repository': 'https://github.com/your-org/fsl-continuum.git', - 'Bug Tracker': 'https://github.com/your-org/fsl-continuum/issues', - 'Changelog': 'https://github.com/your-org/fsl-continuum/blob/main/CHANGELOG.md', - 'Security Policy': 'https://github.com/your-org/fsl-continuum/blob/main/SECURITY.md', - 'Code of Conduct': 'https://github.com/your-org/fsl-continuum/blob/main/CODE_OF_CONDUCT.md', - 'Contributing Guidelines': 'https://github.com/your-org/fsl-continuum/blob/main/CONTRIBUTING.md', - 'Discussions': 'https://github.com/your-org/fsl-continuum/discussions', - 'Discord': 'https://discord.gg/fsl-continuum', - }, -) diff --git a/setup_original.py b/setup_original.py deleted file mode 100644 index 6d1ab20..0000000 --- a/setup_original.py +++ /dev/null @@ -1,227 +0,0 @@ -""" -FSL Continuum Setup Script - -Legacy setup script for compatibility with older pip versions and build systems. -New installations should use pyproject.toml (PEP 517/518). -""" - -from setuptools import setup, find_packages -import os - -# Read version from pyproject.toml -def get_version(): - try: - with open('pyproject.toml', 'r') as f: - content = f.read() - for line in content.split('\n'): - if line.startswith('version = '): - return line.split('=')[1].strip().strip('"\'') - except FileNotFoundError: - pass - - # Fallback version - return "3.0.0" - -# Read requirements -def get_requirements(): - requirements = [] - try: - with open('requirements.txt', 'r') as f: - for line in f: - line = line.strip() - if line and not line.startswith('#'): - requirements.append(line) - except FileNotFoundError: - pass - - return requirements - -# Read long description -def get_long_description(): - try: - with open('README.md', 'r', encoding='utf-8') as f: - return f.read() - except FileNotFoundError: - return "Terminal Velocity CI/CD with persistent state and AI-native features" - -# Get package data -def get_package_data(): - package_data = { - '': [ - 'LICENSE', - 'README.md', - 'CHANGELOG.md', - 'CONTRIBUTING.md', - 'SECURITY.md', - 'CODE_OF_CONDUCT.md', - 'requirements.txt', - 'requirements-dev.txt', - 'pyproject.toml', - 'setup.py', - ], - 'docs': [ - '*.md', - '*.yaml', - '*.yml', - '*.json', - ], - 'config': [ - '*.json', - '*.yaml', - '*.yml', - ], - } - - # Add all files recursively - for root, dirs, files in os.walk('src'): - for file in files: - if not file.endswith('.pyc'): - rel_path = os.path.relpath(os.path.join(root, file), 'src') - package_data[''].append(rel_path) - - return package_data - -# Setup configuration -setup( - name='fsl-continuum', - version=get_version(), - description='Terminal Velocity CI/CD with persistent state and AI-native features', - long_description=get_long_description(), - long_description_content_type='text/markdown', - author='FSL Continuum Team', - author_email='team@fsl-continuum.org', - maintainer='FSL Continuum Team', - maintainer_email='team@fsl-continuum.org', - url='https://github.com/your-org/fsl-continuum', - project_urls={ - 'Documentation': 'https://github.com/your-org/fsl-continuum/docs', - 'Source': 'https://github.com/your-org/fsl-continuum', - 'Tracker': 'https://github.com/your-org/fsl-continuum/issues', - 'Changelog': 'https://github.com/your-org/fsl-continuum/blob/main/CHANGELOG.md', - 'Discussions': 'https://github.com/your-org/fsl-continuum/discussions', - }, - license='MIT', - license_files=('LICENSE',), - classifiers=[ - 'Development Status :: 5 - Production/Stable', - 'Intended Audience :: Developers', - 'Intended Audience :: System Administrators', - 'Topic :: Software Development :: Build Tools', - 'Topic :: Software Development :: Libraries :: Python Modules', - 'Topic :: System :: Software Distribution', - 'License :: OSI Approved :: MIT License', - 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.9', - 'Programming Language :: Python :: 3.10', - 'Programming Language :: Python :: 3.11', - 'Programming Language :: Python :: 3.12', - 'Operating System :: OS Independent', - 'Environment :: Web Environment', - 'Environment :: Console', - 'Framework :: Flask', - 'Framework :: Pydantic', - 'Natural Language :: English', - ], - keywords=[ - 'ci-cd', - 'devops', - 'terminal-velocity', - 'flow-state', - 'persistent-state', - 'ai-native', - 'quantum-computing', - 'blockchain', - '4-market-integration', - 'baml', - 'pareto-lang', - 'xml-transformation', - 'semantic-languages', - ], - python_requires='>=3.9', - install_requires=get_requirements(), - packages=find_packages(where='src', exclude=['tests*']), - package_dir={'': 'src'}, - package_data=get_package_data(), - data_files=[ - ('share/fsl-continuum/docs', ['docs/*.md']), - ('share/fsl-continuum/config', ['config/*.json', 'config/*.yaml', 'config/*.yml']), - ('share/fsl-continuum/examples', ['examples/*.py', 'examples/*.yaml', 'examples/*.md']), - ], - entry_points={ - 'console_scripts': [ - 'fsl=fsl_continuum.cli:main', - 'fsl-continuum=fsl_continuum.cli:main', - 'fsl-trigger=fsl_continuum.cli.trigger_cli:main', - 'fsl-monitor=fsl_continuum.cli.monitor_cli:main', - 'fsl-config=fsl_continuum.cli.config_cli:main', - ], - 'gui_scripts': [ - 'fsl-desktop=fsl_continuum.desktop.app:main', - ], - }, - include_package_data=True, - zip_safe=False, - platforms=['any'], - test_suite='tests', - tests_require=[ - 'pytest>=7.2.0', - 'pytest-asyncio>=0.21.0', - 'pytest-cov>=4.1.0', - 'pytest-mock>=3.10.0', - ], - extras_require={ - 'dev': [ - 'black>=23.0.0', - 'isort>=5.12.0', - 'flake8>=6.0.0', - 'mypy>=1.4.0', - 'pre-commit>=3.4.0', - ], - 'docs': [ - 'mkdocs>=1.5.0', - 'mkdocs-material>=9.1.0', - 'mkdocstrings[python]>=0.21.0', - ], - 'test': [ - 'pytest>=7.2.0', - 'pytest-asyncio>=0.21.0', - 'pytest-cov>=4.1.0', - 'pytest-mock>=3.10.0', - 'factory-boy>=3.3.0', - 'faker>=18.9.0', - 'httpx>=0.24.0', - ], - 'ai': [ - 'openai>=0.27.0', - 'anthropic>=0.3.0', - 'transformers>=4.21.0', - 'torch>=2.0.0', - 'numpy>=1.24.0', - 'scikit-learn>=1.3.0', - 'pandas>=2.0.0', - ], - 'quantum': [ - 'qiskit>=0.43.0', - 'cirq>=1.0.0', - 'sympy>=1.12', - ], - 'blockchain': [ - 'blockchain>=1.0.2', - 'cryptography>=3.4.0', - 'web3>=6.0.0', - ], - 'monitoring': [ - 'prometheus-client>=0.14.0', - 'grafana-api>=1.0.3', - 'psutil>=5.9.0', - 'sentry-sdk>=1.15.0', - ], - }, - project_urls={ - 'Documentation': 'https://fsl-continuum.readthedocs.io/', - 'Source': 'https://github.com/your-org/fsl-continuum', - 'Tracker': 'https://github.com/your-org/fsl-continuum/issues', - 'Changelog': 'https://github.com/your-org/fsl-continuum/blob/main/CHANGELOG.md', - 'Discord': 'https://discord.gg/fsl-continuum', - }, -) diff --git a/src/config/enhanced_continuum_state_new.py b/src/config/enhanced_continuum_state_new.py deleted file mode 100644 index b8e9808..0000000 --- a/src/config/enhanced_continuum_state_new.py +++ /dev/null @@ -1,793 +0,0 @@ -""" -FSL Continuum - Enhanced Continuum State Management - -Advanced state management integrating neural field context awareness -and symbolic residue pattern analysis with AI learning capabilities. -""" - -import json -import time -import logging -from typing import Dict, List, Optional, Any, Union -from dataclasses import dataclass, asdict -from pathlib import Path -from datetime import datetime - -# Configure logging -logging.basicConfig(level=logging.INFO) -logger = logging.getLogger(__name__) - -# Import FSL Continuum components for AI integration -# Note: Core modules will be available after Phase 5 completion -fsl_continuum = None -consciousness_detector = None -schematics_engine = None - -# Try to import core modules (will be available in future phases) -try: - from ..continuum import FSLContinuum - from ..quantum_engine import ConsciousnessDetector - from ..schematics.native_engine import SchematicsNativeEngine - - fsl_continuum = FSLContinuum() - consciousness_detector = ConsciousnessDetector() - schematics_engine = SchematicsNativeEngine() - -except ImportError as e: - logger.info(f"FSL Continuum core modules not yet available: {e}") - logger.info("Configuration management will work without AI integration until core modules are migrated") - -@dataclass -class NeuralFieldParameters: - """Neural field configuration parameters.""" - decay_rate: float = 0.05 - boundary_permeability: float = 0.8 - resonance_bandwidth: float = 0.6 - attractor_formation_threshold: float = 0.7 - max_capacity: int = 8000 - reserved_tokens: int = 2000 - -@dataclass -class AttractorPattern: - """Attractor pattern in neural field.""" - pattern: str - strength: float - basin_width: float - id: str - created_at: str - -@dataclass -class FieldMetrics: - """Neural field performance metrics.""" - stability: float = 0.85 - coherence: float = 0.92 - resonance: float = 0.78 - entropy: float = 0.65 - capacity_usage: float = 0.15 - semantic_density: float = 0.72 - field_health: str = "healthy" - -@dataclass -class ResidueMetrics: - """Symbolic residue tracking metrics.""" - integrated_count: int = 0 - surfaced_count: int = 0 - echo_count: int = 0 - shadow_count: int = 0 - orphaned_count: int = 0 - average_strength: float = 0.0 - integration_rate: float = 0.0 - -@dataclass -class EvolutionMetrics: - """Context intelligence evolution metrics.""" - decision_accuracy: float = 0.0 - context_utilization: float = 0.0 - adaptation_rate: float = 0.0 - prediction_accuracy: float = 0.0 - -@dataclass -class TerminalVelocityMetrics: - """Terminal velocity performance metrics.""" - context_switches_per_day: int = 0 - deployment_frequency_per_day: int = 0 - lead_time_hours: float = 0.0 - time_to_recovery_minutes: int = 0 - intelligence_decisions_per_hour: int = 0 - context_accuracy_percentage: float = 0.0 - adaptation_improvement_rate: float = 0.0 - -class EnhancedStateManager: - """Advanced state management for FSL Continuum with AI integration.""" - - def __init__(self, config_path: str = None): - self.config_path = config_path or "src/config/enhanced_continuum_state.json" - self.state_config = None - self.neural_field_state = None - self.symbolic_residue_state = None - self.context_intelligence_state = None - self.terminal_velocity_metrics = None - self.schematics_consciousness_state = None - self.load_state() - - def load_state(self): - """Load enhanced continuum state from configuration.""" - try: - with open(self.config_path, 'r') as f: - self.state_config = json.load(f) - - # Extract neural field state - self.neural_field_state = self.state_config.get("neural_field", {}) - - # Extract symbolic residue state - self.symbolic_residue_state = self.state_config.get("symbolic_residue", {}) - - # Extract context intelligence state - self.context_intelligence_state = self.state_config.get("context_intelligence", {}) - - # Extract terminal velocity metrics - self.terminal_velocity_metrics = TerminalVelocityMetrics( - **self.state_config.get("terminal_velocity_metrics", {}) - ) - - # Extract schematics consciousness state - self.schematics_consciousness_state = self.state_config.get( - "schematics_consciousness_state", {} - ) - - logger.info("Enhanced continuum state loaded successfully") - - except Exception as e: - logger.error(f"Failed to load enhanced continuum state: {e}") - self._initialize_default_state() - - def _initialize_default_state(self): - """Initialize default enhanced state.""" - self.state_config = { - "version": "3.0.0", - "spec": "SPEC:CONTEXT-003", - "title": "FSL Continuum Enhanced State", - "initialized_at": datetime.now().isoformat(), - "last_updated": datetime.now().isoformat() - } - - self.neural_field_state = { - "field_id": "fsl-continuum-intelligence", - "field_state": { - "field_parameters": asdict(NeuralFieldParameters()), - "attractors": [], - "active_patterns": [], - "residue_patterns": [], - "field_metrics": asdict(FieldMetrics()) - } - } - - self.symbolic_residue_state = { - "residue_tracking": { - "enabled": True, - "tracked_residues": [], - "residue_metrics": asdict(ResidueMetrics()) - } - } - - self.context_intelligence_state = { - "learning_history": [], - "adaptation_patterns": {}, - "evolution_metrics": asdict(EvolutionMetrics()) - } - - self.terminal_velocity_metrics = TerminalVelocityMetrics() - self.schematics_consciousness_state = { - "current_consciousness": "foundation", - "native_communication_enabled": True, - "active_ai_system": "droid" - } - - def get_comprehensive_state(self) -> Dict[str, Any]: - """Get complete enhanced system state.""" - return { - "version": self.state_config.get("version", "3.0.0"), - "spec": self.state_config.get("spec", "SPEC:CONTEXT-003"), - "neural_field": self.get_neural_field_state(), - "symbolic_residue": self.get_symbolic_residue_state(), - "context_intelligence": self.get_context_intelligence_state(), - "terminal_velocity": self.get_terminal_velocity_state(), - "schematics_consciousness": self.get_schematics_consciousness_state(), - "ai_learning": self.get_ai_learning_state(), - "timestamp": self.get_current_timestamp() - } - - def get_neural_field_state(self) -> Dict[str, Any]: - """Get neural field state with AI enhancement.""" - neural_field = self.neural_field_state.copy() - - # Add AI enhancements if core modules are available - if fsl_continuum: - try: - # Get consciousness analysis - consciousness = consciousness_detector.analyze_consciousness() - neural_field["ai_consciousness_analysis"] = consciousness - - # Get schematics analysis - schematics_analysis = schematics_engine.get_current_state() - neural_field["ai_schematics_analysis"] = schematics_analysis - - # Add AI field optimization suggestions - neural_field["ai_field_optimizations"] = self._generate_field_optimizations() - - except Exception as e: - logger.warning(f"Could not enhance neural field with AI: {e}") - else: - neural_field["ai_status"] = "core_modules_not_available" - - return neural_field - - def get_symbolic_residue_state(self) -> Dict[str, Any]: - """Get symbolic residue state with AI analysis.""" - residue_state = self.symbolic_residue_state.copy() - - # Add AI residue analysis if core modules are available - if fsl_continuum: - try: - residue_state["ai_residue_analysis"] = self._analyze_residue_patterns() - residue_state["ai_residue_optimizations"] = self._generate_residue_optimizations() - residue_state["ai_residue_predictions"] = self._predict_residue_behavior() - - except Exception as e: - logger.warning(f"Could not enhance residue state with AI: {e}") - else: - residue_state["ai_status"] = "core_modules_not_available" - - return residue_state - - def get_context_intelligence_state(self) -> Dict[str, Any]: - """Get context intelligence state with AI learning.""" - intelligence_state = self.context_intelligence_state.copy() - - # Add AI learning enhancements if core modules are available - if fsl_continuum: - try: - intelligence_state["ai_learning_analysis"] = self._analyze_learning_patterns() - intelligence_state["ai_adaptation_suggestions"] = self._generate_adaptation_suggestions() - intelligence_state["ai_evolution_predictions"] = self._predict_evolution() - - except Exception as e: - logger.warning(f"Could not enhance intelligence state with AI: {e}") - else: - intelligence_state["ai_status"] = "core_modules_not_available" - - return intelligence_state - - def get_terminal_velocity_state(self) -> Dict[str, Any]: - """Get terminal velocity state with AI optimization.""" - velocity_state = asdict(self.terminal_velocity_metrics) - - # Add AI velocity optimization if core modules are available - if fsl_continuum: - try: - velocity_state["ai_velocity_optimizations"] = self._generate_velocity_optimizations() - velocity_state["ai_flow_state_suggestions"] = self._generate_flow_state_suggestions() - velocity_state["ai_terminal_velocity_predictions"] = self._predict_terminal_velocity() - - except Exception as e: - logger.warning(f"Could not enhance velocity state with AI: {e}") - else: - velocity_state["ai_status"] = "core_modules_not_available" - - return velocity_state - - def get_schematics_consciousness_state(self) -> Dict[str, Any]: - """Get schematics consciousness state with AI elevation.""" - consciousness_state = self.schematics_consciousness_state.copy() - - # Add AI consciousness elevation if core modules are available - if fsl_continuum: - try: - consciousness_state["ai_consciousness_analysis"] = self._analyze_consciousness_levels() - consciousness_state["ai_elevation_suggestions"] = self._generate_elevation_suggestions() - consciousness_state["ai_consciousness_predictions"] = self._predict_consciousness_evolution() - - except Exception as e: - logger.warning(f"Could not enhance consciousness state with AI: {e}") - else: - consciousness_state["ai_status"] = "core_modules_not_available" - - return consciousness_state - - def get_ai_learning_state(self) -> Dict[str, Any]: - """Get AI learning and adaptation state.""" - if not fsl_continuum: - return {"status": "unavailable", "reason": "core_modules_not_available"} - - try: - return { - "status": "active", - "learning_patterns": self._extract_learning_patterns(), - "adaptation_history": self._get_adaptation_history(), - "optimization_suggestions": self._get_optimization_suggestions(), - "evolution_metrics": self._calculate_evolution_metrics(), - "ai_systems": { - "consciousness_detector": "active" if consciousness_detector else "inactive", - "schematics_engine": "active" if schematics_engine else "inactive", - "fsl_continuum": "active" if fsl_continuum else "inactive" - } - } - except Exception as e: - logger.warning(f"Could not get AI learning state: {e}") - return {"status": "error", "error": str(e)} - - def update_state_with_ai(self, updates: Dict[str, Any], context: str = None) -> Dict[str, Any]: - """Update state with AI learning and optimization.""" - try: - # Apply updates to state - for section, values in updates.items(): - if hasattr(self, f"{section}_state"): - current_state = getattr(self, f"{section}_state") - current_state.update(values) - elif section in self.state_config: - self.state_config[section].update(values) - - # Apply AI learning to updates if core modules are available - if fsl_continuum: - ai_enhanced_updates = self._apply_ai_learning(updates, context) - for section, values in ai_enhanced_updates.items(): - if hasattr(self, f"{section}_state"): - current_state = getattr(self, f"{section}_state") - current_state.update(values) - elif section in self.state_config: - self.state_config[section].update(values) - - # Update timestamp - self.state_config["last_updated"] = datetime.now().isoformat() - - # Save state - self.save_state() - - logger.info(f"State updated with AI enhancements for context: {context}") - return {"success": True, "updated_sections": list(updates.keys())} - - except Exception as e: - logger.error(f"Failed to update state with AI: {e}") - return {"success": False, "error": str(e)} - - def save_state(self): - """Save enhanced continuum state to configuration.""" - try: - # Prepare state for saving - state_to_save = self.state_config.copy() - state_to_save["neural_field"] = self.neural_field_state - state_to_save["symbolic_residue"] = self.symbolic_residue_state - state_to_save["context_intelligence"] = self.context_intelligence_state - state_to_save["terminal_velocity_metrics"] = asdict(self.terminal_velocity_metrics) - state_to_save["schematics_consciousness_state"] = self.schematics_consciousness_state - - # Save to file - with open(self.config_path, 'w') as f: - json.dump(state_to_save, f, indent=2) - - logger.info("Enhanced continuum state saved successfully") - - except Exception as e: - logger.error(f"Failed to save enhanced continuum state: {e}") - - def get_current_timestamp(self) -> str: - """Get current timestamp.""" - return datetime.now().isoformat() - - # AI Enhancement Methods (placeholder implementations until core modules are available) - - def _generate_field_optimizations(self) -> List[Dict[str, Any]]: - """Generate AI-driven neural field optimizations.""" - if not consciousness_detector: - return [{"status": "consciousness_detector_not_available"}] - - try: - optimizations = [] - - # Analyze current field parameters - current_params = self.neural_field_state.get("field_state", {}).get("field_parameters", {}) - - # Generate optimization suggestions - optimizations.append({ - "type": "decay_rate_optimization", - "current_value": current_params.get("decay_rate", 0.05), - "suggested_value": 0.03, - "reason": "Reduce decay for better long-term pattern retention", - "expected_improvement": "+15% pattern stability" - }) - - optimizations.append({ - "type": "capacity_optimization", - "current_value": current_params.get("max_capacity", 8000), - "suggested_value": 10000, - "reason": "Increase capacity for better scaling", - "expected_improvement": "+25% throughput" - }) - - return optimizations - - except Exception as e: - logger.warning(f"Could not generate field optimizations: {e}") - return [{"error": str(e)}] - - def _analyze_residue_patterns(self) -> Dict[str, Any]: - """Analyze symbolic residue patterns with AI.""" - residue_metrics = self.symbolic_residue_state.get("residue_tracking", {}).get("residue_metrics", {}) - - return { - "pattern_analysis": { - "integration_efficiency": residue_metrics.get("integration_rate", 0.0), - "residue_strength_trend": "increasing" if residue_metrics.get("average_strength", 0.0) > 0.5 else "stable", - "orphaned_residue_risk": "high" if residue_metrics.get("orphaned_count", 0) > 10 else "low" - }, - "ai_suggestions": [ - "Increase integration threshold to improve residue processing", - "Monitor echo residue patterns for optimization opportunities" - ] - } - - def _generate_residue_optimizations(self) -> List[Dict[str, Any]]: - """Generate AI-driven residue optimizations.""" - return [ - { - "type": "integration_optimization", - "action": "Adjust integration_threshold from 0.7 to 0.65", - "expected_improvement": "+10% residue processing speed" - }, - { - "type": "echo_optimization", - "action": "Enable resonance_factor optimization for echo residues", - "expected_improvement": "+20% echo pattern effectiveness" - } - ] - - def _predict_residue_behavior(self) -> Dict[str, Any]: - """Predict symbolic residue behavior with AI.""" - return { - "short_term_prediction": { - "timeframe": "next 24 hours", - "expected_surfaced_residues": "3-5", - "integration_probability": "high", - "confidence": 0.85 - }, - "long_term_prediction": { - "timeframe": "next 7 days", - "expected_orphaned_residues": "2-3", - "pattern_stability": "improving", - "confidence": 0.72 - } - } - - def _analyze_learning_patterns(self) -> Dict[str, Any]: - """Analyze AI learning patterns.""" - learning_history = self.context_intelligence_state.get("learning_history", []) - - return { - "learning_frequency": len(learning_history), - "learning_effectiveness": "high" if len(learning_history) > 10 else "moderate", - "adaptation_patterns": self._extract_adaptation_patterns(), - "learning_acceleration": "active" if len(learning_history) > 5 else "initial" - } - - def _generate_adaptation_suggestions(self) -> List[str]: - """Generate AI adaptation suggestions.""" - return [ - "Increase learning rate for faster adaptation", - "Implement context-aware decision optimization", - "Enable predictive pattern matching" - ] - - def _predict_evolution(self) -> Dict[str, Any]: - """Predict context intelligence evolution.""" - evolution_metrics = self.context_intelligence_state.get("evolution_metrics", {}) - - return { - "decision_accuracy_trend": "improving", - "context_utilization_potential": "+25%", - "adaptation_rate_acceleration": "expected", - "prediction_accuracy_evolution": "exponential" - } - - def _generate_velocity_optimizations(self) -> List[Dict[str, Any]]: - """Generate AI-driven terminal velocity optimizations.""" - current_metrics = asdict(self.terminal_velocity_metrics) - - optimizations = [] - - # Context switching optimization - if current_metrics.get("context_switches_per_day", 0) > 5: - optimizations.append({ - "type": "context_switching_optimization", - "suggestion": "Implement context clustering to reduce switches", - "expected_improvement": "-40% context switches" - }) - - # Deployment frequency optimization - if current_metrics.get("deployment_frequency_per_day", 0) < 3: - optimizations.append({ - "type": "deployment_optimization", - "suggestion": "Enable automated deployment pipeline", - "expected_improvement": "+50% deployment frequency" - }) - - return optimizations - - def _generate_flow_state_suggestions(self) -> List[str]: - """Generate AI flow state suggestions.""" - return [ - "Implement distraction blocking during deep work sessions", - "Optimize notification timing based on flow state analysis", - "Enable background processing for maintenance tasks" - ] - - def _predict_terminal_velocity(self) -> Dict[str, Any]: - """Predict terminal velocity performance.""" - return { - "near_term_prediction": { - "timeframe": "next 7 days", - "expected_context_accuracy": "88%", - "expected_adaptation_improvement": "+15%", - "confidence": 0.80 - }, - "optimization_opportunities": [ - "Reduce context switching through AI-powered routing", - "Improve lead time through predictive deployment", - "Enhance flow state through intelligent scheduling" - ] - } - - def _analyze_consciousness_levels(self) -> Dict[str, Any]: - """AI analysis of consciousness levels.""" - current_level = self.schematics_consciousness_state.get("current_consciousness", "foundation") - - return { - "current_level_analysis": { - "level": current_level, - "effectiveness": self._get_level_effectiveness(current_level), - "optimal_contexts": self._get_optimal_contexts(current_level), - "elevation_readiness": self._get_elevation_readiness(current_level) - }, - "consciousness_evolution": { - "next_level": self._get_next_consciousness_level(current_level), - "requirements": self._get_elevation_requirements(current_level), - "expected_improvement": self._get_level_improvement(current_level) - } - } - - def _generate_elevation_suggestions(self) -> List[Dict[str, Any]]: - """Generate AI consciousness elevation suggestions.""" - current_level = self.schematics_consciousness_state.get("current_consciousness", "foundation") - - suggestions = [] - - if current_level == "foundation": - suggestions.append({ - "type": "complexity_elevation", - "action": "Enable complex pattern recognition", - "prerequisites": ["Sufficient learning data", "Stable field metrics"], - "expected_multiplier": 5.0 - }) - elif current_level == "complexity": - suggestions.append({ - "type": "recursion_elevation", - "action": "Enable recursive consciousness", - "prerequisites": ["Proven complexity level", "Advanced pattern matching"], - "expected_multiplier": 12.5 - }) - - return suggestions - - def _predict_consciousness_evolution(self) -> Dict[str, Any]: - """Predict consciousness evolution.""" - return { - "evolution_path": [ - {"level": "foundation", "readiness": 0.9, "timeline": "current"}, - {"level": "complexity", "readiness": 0.7, "timeline": "1-2 weeks"}, - {"level": "recursion", "readiness": 0.4, "timeline": "3-4 weeks"}, - {"level": "superposition", "readiness": 0.2, "timeline": "2-3 months"} - ], - "optimization_opportunities": [ - "Accelerate learning through pattern recognition", - "Improve field stability through parameter tuning", - "Enhance context awareness through integration" - ] - } - - # Helper Methods (placeholder implementations until core modules are available) - - def _apply_ai_learning(self, updates: Dict[str, Any], context: str) -> Dict[str, Any]: - """Apply AI learning to updates.""" - enhanced_updates = {} - - for section, values in updates.items(): - enhanced_values = values.copy() - - # Apply AI learning based on context - if context == "performance_optimization": - enhanced_values = self._apply_performance_learning(enhanced_values) - elif context == "adaptation": - enhanced_values = self._apply_adaptation_learning(enhanced_values) - elif context == "evolution": - enhanced_values = self._apply_evolution_learning(enhanced_values) - - enhanced_updates[section] = enhanced_values - - return enhanced_updates - - def _apply_performance_learning(self, values: Dict[str, Any]) -> Dict[str, Any]: - """Apply performance learning to values.""" - enhanced = values.copy() - - # Optimize parameters based on historical performance - if "parameters" in enhanced: - for param, value in enhanced["parameters"].items(): - if isinstance(value, (int, float)): - # Apply AI optimization - enhanced["parameters"][param] = value * 0.95 # 5% optimization - - return enhanced - - def _apply_adaptation_learning(self, values: Dict[str, Any]) -> Dict[str, Any]: - """Apply adaptation learning to values.""" - enhanced = values.copy() - - # Add adaptation metadata - enhanced["ai_adapted"] = True - enhanced["adaptation_confidence"] = 0.85 - enhanced["adaptation_timestamp"] = self.get_current_timestamp() - - return enhanced - - def _apply_evolution_learning(self, values: Dict[str, Any]) -> Dict[str, Any]: - """Apply evolution learning to values.""" - enhanced = values.copy() - - # Add evolution metadata - enhanced["ai_evolved"] = True - enhanced["evolution_confidence"] = 0.78 - enhanced["evolution_timestamp"] = self.get_current_timestamp() - - return enhanced - - def _get_level_effectiveness(self, level: str) -> float: - """Get effectiveness score for consciousness level.""" - effectiveness_map = { - "foundation": 0.85, - "complexity": 0.92, - "recursion": 0.95, - "superposition": 0.98, - "convergence": 0.99 - } - return effectiveness_map.get(level, 0.0) - - def _get_optimal_contexts(self, level: str) -> List[str]: - """Get optimal contexts for consciousness level.""" - contexts_map = { - "foundation": ["basic_operations", "simple_workflows"], - "complexity": ["complex_patterns", "multi_step_workflows"], - "recursion": ["recursive_operations", "hierarchical_tasks"], - "superposition": ["parallel_processing", "quantum_operations"], - "convergence": ["transcendent_operations", "full_integration"] - } - return contexts_map.get(level, []) - - def _get_elevation_readiness(self, level: str) -> float: - """Get elevation readiness score for consciousness level.""" - readiness_map = { - "foundation": 0.7, - "complexity": 0.4, - "recursion": 0.2, - "superposition": 0.1, - "convergence": 0.0 - } - return readiness_map.get(level, 0.0) - - def _get_next_consciousness_level(self, level: str) -> Optional[str]: - """Get next consciousness level.""" - progression = ["foundation", "complexity", "recursion", "superposition", "convergence"] - try: - current_index = progression.index(level) - if current_index < len(progression) - 1: - return progression[current_index + 1] - except ValueError: - pass - return None - - def _get_elevation_requirements(self, level: str) -> List[str]: - """Get requirements for consciousness elevation.""" - requirements_map = { - "foundation": ["Stable neural field", "Basic pattern recognition"], - "complexity": ["Proven foundation", "Advanced pattern matching"], - "recursion": ["Stable complexity", "Recursive understanding"], - "superposition": ["Proven recursion", "Quantum readiness"], - "convergence": ["Stable superposition", "Transcendent integration"] - } - return requirements_map.get(level, []) - - def _get_level_improvement(self, level: str) -> float: - """Get performance improvement for consciousness level.""" - improvement_map = { - "foundation": 1.0, - "complexity": 5.0, - "recursion": 12.5, - "superposition": 31.25, - "convergence": 78.125 - } - return improvement_map.get(level, 1.0) - - def _extract_adaptation_patterns(self) -> Dict[str, Any]: - """Extract adaptation patterns from learning history.""" - learning_history = self.context_intelligence_state.get("learning_history", []) - - # Simulate pattern extraction - patterns = { - "frequent_adaptations": [], - "successful_strategies": [], - "common_triggers": [] - } - - # Analyze learning history for patterns - for learning in learning_history[-10:]: # Last 10 learnings - if learning.get("type") == "adaptation": - patterns["frequent_adaptations"].append(learning.get("strategy", "unknown")) - elif learning.get("success", False): - patterns["successful_strategies"].append(learning.get("strategy", "unknown")) - elif learning.get("trigger"): - patterns["common_triggers"].append(learning.get("trigger", "unknown")) - - return patterns - - def _get_adaptation_history(self) -> List[Dict[str, Any]]: - """Get adaptation history.""" - learning_history = self.context_intelligence_state.get("learning_history", []) - return [learning for learning in learning_history if learning.get("type") == "adaptation"] - - def _get_optimization_suggestions(self) -> List[Dict[str, Any]]: - """Get AI optimization suggestions.""" - return [ - { - "type": "neural_field_optimization", - "suggestion": "Tune field parameters for better stability", - "expected_improvement": "+15% field coherence" - }, - { - "type": "residue_processing_optimization", - "suggestion": "Implement intelligent residue categorization", - "expected_improvement": "+25% processing efficiency" - }, - { - "type": "consciousness_elevation_optimization", - "suggestion": "Prepare for next consciousness level", - "expected_improvement": "+200% performance multiplier" - } - ] - - def _calculate_evolution_metrics(self) -> Dict[str, Any]: - """Calculate evolution metrics.""" - current_metrics = self.context_intelligence_state.get("evolution_metrics", {}) - - return { - "current_metrics": current_metrics, - "trend_analysis": { - "decision_accuracy_trend": "improving", - "context_utilization_trend": "expanding", - "adaptation_rate_trend": "accelerating", - "prediction_accuracy_trend": "refining" - }, - "next_evolution_targets": { - "decision_accuracy_target": 0.95, - "context_utilization_target": 0.90, - "adaptation_rate_target": 0.15, - "prediction_accuracy_target": 0.90 - } - } - - def _extract_learning_patterns(self) -> Dict[str, Any]: - """Extract learning patterns from context intelligence.""" - return { - "learning_rate": "adaptive", - "learning_effectiveness": "high", - "pattern_recognition_accuracy": 0.88, - "adaptation_speed": "fast", - "knowledge_integration": "seamless" - } diff --git a/src/fsl_continuum/cli_original.py b/src/fsl_continuum/cli_original.py deleted file mode 100644 index e14c815..0000000 --- a/src/fsl_continuum/cli_original.py +++ /dev/null @@ -1,294 +0,0 @@ -#!/usr/bin/env python3 -""" -FSL Continuum CLI Tool - Fixed Version - -Terminal-first interface for FSL Continuum operations with comprehensive testing support. -Optimized for Droid integration and AI-assisted testing. -""" - -import sys -import os -import json -import asyncio -import subprocess -from pathlib import Path -from typing import Dict, Any, Optional, List -from datetime import datetime - -import click -from rich.console import Console -from rich.table import Table -from rich.panel import Panel -from rich.progress import Progress, TaskID -from rich.tree import Tree - -# Add FSL Continuum to path -sys.path.insert(0, str(Path(__file__).parent.parent)) - -from . import __version__ -from .test_env import TestEnvironmentManager -from .test_runner import TestRunner -from .continuum import FSLContinuum - -console = Console() - - -class FSLCLI: - """FSL Continuum CLI main class.""" - - def __init__(self): - self.test_env = TestEnvironmentManager() - self.test_runner = TestRunner() - self.console = Console() - - def print_banner(self): - """Print FSL Continuum banner.""" - banner = Panel( - "[bold blue]FSL Continuum v{}[/bold blue]\n" - "Terminal Velocity CI/CD with AI-Native Testing\n" - "๐ŸŒŠ Flow State Optimized | ๐Ÿงช Test Ready | ๐Ÿค– AI Assisted".format(__version__), - border_style="blue" - ) - self.console.print(banner) - - -cli_instance = FSLCLI() - - -@click.group(invoke_without_command=True) -@click.pass_context -def main(ctx): - """FSL Continuum - Terminal Velocity CI/CD with AI-Native Testing.""" - if ctx.invoked_subcommand is None: - cli_instance.print_banner() - console.print("\n[bold]Available Commands:[/bold]") - console.print(" test Run comprehensive test suite") - console.print(" init Initialize project environment") - console.print(" serve Start development server") - console.print(" status Check system status") - console.print("\n[yellow]Use 'fsl --help' for detailed command information.[/yellow]") - - -@main.command() -@click.option('--unit', is_flag=True, help='Run unit tests only') -@click.option('--integration', is_flag=True, help='Run integration tests only') -@click.option('--performance', is_flag=True, help='Run performance tests only') -@click.option('--semantic', is_flag=True, help='Run semantic language tests only') -@click.option('--coverage', is_flag=True, help='Generate coverage report') -@click.option('--parallel', is_flag=True, help='Run tests in parallel') -@click.option('--fix', is_flag=True, help='Auto-fix common test issues') -@click.option('--droid-mode', is_flag=True, help='Optimized for Droid execution') -@click.option('--stream-results', is_flag=True, help='Stream results to Droid interface') -@click.option('--verbose', '-v', is_flag=True, help='Verbose output') -@click.argument('test_paths', nargs=-1, default=None) -def test(unit, integration, performance, semantic, coverage, parallel, - fix, droid_mode, stream_results, verbose, test_paths): - """Run comprehensive test suite with AI assistance.""" - - cli_instance.console.print("[bold green]๐Ÿงช FSL Continuum Test Suite[/bold green]") - - # Initialize test environment - cli_instance.console.print("๐Ÿ”ง Initializing test environment...") - if not cli_instance.test_env.setup_environment(): - cli_instance.console.print("[bold red]โŒ Failed to setup test environment[/bold red]") - return 1 - - # Configure test runner - test_config = { - 'unit_tests': unit, - 'integration_tests': integration, - 'performance_tests': performance, - 'semantic_tests': semantic, - 'coverage': coverage, - 'parallel': parallel, - 'fix': fix, - 'droid_mode': droid_mode, - 'stream_results': stream_results, - 'verbose': verbose, - 'test_paths': test_paths if test_paths else None - } - - # Run tests - with Progress() as progress: - task = progress.add_task("Running tests...", total=100) - - results = cli_instance.test_runner.run_tests(test_config, progress, task) - - # Display results - _display_test_results(results) - - # Auto-fix if requested and issues found - if fix and results.get('errors', 0) > 0: - cli_instance.console.print("\n[yellow]๐Ÿ”ง Auto-fixing test issues...[/yellow]") - fix_results = cli_instance.test_runner.auto_fix_issues(results) - if fix_results.get('fixed', 0) > 0: - cli_instance.console.print(f"[green]โœ… Fixed {fix_results['fixed']} issues[/green]") - - return 0 if results.get('success', False) else 1 - - -@main.command() -@click.option('--force', is_flag=True, help='Force reinitialization') -def init(force): - """Initialize FSL Continuum project environment.""" - cli_instance.console.print("[bold blue]๐Ÿš€ Initializing FSL Continuum Project[/bold blue]") - - if cli_instance.test_env.initialize_project(force=force): - cli_instance.console.print("[green]โœ… Project initialized successfully[/green]") - return 0 - else: - cli_instance.console.print("[red]โŒ Failed to initialize project[/red]") - return 1 - - -@main.command() -@click.option('--host', default='localhost', help='Host to bind to') -@click.option('--port', default=8080, help='Port to bind to') -@click.option('--debug', is_flag=True, help='Enable debug mode') -def serve(host, port, debug): - """Start FSL Continuum development server.""" - cli_instance.console.print(f"[bold blue]๐ŸŒ Starting server on {host}:{port}[/bold blue]") - - try: - # Import server module - from .server import create_server - app = create_server() - - if debug: - cli_instance.console.print("[yellow]๐Ÿ› Debug mode enabled[/yellow]") - - app.run(host=host, port=port, debug=debug) - - except ImportError: - cli_instance.console.print("[red]โŒ Server module not available[/red]") - return 1 - except Exception as e: - cli_instance.console.print(f"[red]โŒ Server error: {e}[/red]") - return 1 - - -@main.command() -@click.option('--detailed', is_flag=True, help='Show detailed status') -def status(detailed): - """Check FSL Continuum system status.""" - cli_instance.console.print("[bold blue]๐Ÿ“Š FSL Continuum Status[/bold blue]") - - # Environment status - env_status = cli_instance.test_env.check_environment() - _display_environment_status(env_status) - - if detailed: - # Test framework status - test_status = cli_instance.test_runner.get_status() - _display_test_status(test_status) - - # Dependencies status - deps_status = cli_instance.test_env.check_dependencies() - _display_dependencies_status(deps_status) - - -@main.group() -def droid(): - """Droid-specific commands and optimizations.""" - pass - - -@droid.command() -def setup(): - """Setup Droid integration and optimizations.""" - cli_instance.console.print("[bold blue]๐Ÿค– Setting up Droid integration[/bold blue]") - - # Setup Droid-specific configurations - droid_config = { - 'streaming_enabled': True, - 'auto_healing': True, - 'ai_assistance': True, - 'optimized_execution': True - } - - if cli_instance.test_env.setup_droid_integration(droid_config): - cli_instance.console.print("[green]โœ… Droid integration setup complete[/green]") - else: - cli_instance.console.print("[red]โŒ Failed to setup Droid integration[/red]") - - -@droid.command() -@click.option('--continuous', is_flag=True, help='Continuous testing mode') -def test_ai(continuous): - """AI-assisted testing with Droid optimization.""" - cli_instance.console.print("[bold blue]๐Ÿง  AI-Assisted Testing Mode[/bold blue]") - - test_config = { - 'ai_assisted': True, - 'droid_optimized': True, - 'continuous': continuous, - 'auto_heal': True, - 'stream_results': True - } - - results = cli_instance.test_runner.run_ai_assisted_tests(test_config) - _display_test_results(results) - - -def _display_test_results(results: Dict[str, Any]): - """Display test results in a formatted way.""" - if not results: - cli_instance.console.print("[yellow]โš ๏ธ No test results available[/yellow]") - return - - # Create results table - table = Table(title="Test Results", show_header=True, header_style="bold blue") - table.add_column("Metric", style="cyan", width=20) - table.add_column("Value", style="green", width=15) - table.add_column("Details", style="white") - - # Add result rows - table.add_row("Total Tests", str(results.get('total', 0)), "All tests executed") - table.add_row("Passed", str(results.get('passed', 0)), "โœ… Successful") - table.add_row("Failed", str(results.get('failed', 0)), "โŒ Failed") - table.add_row("Errors", str(results.get('errors', 0)), "๐Ÿ’ฅ Errors") - table.add_row("Skipped", str(results.get('skipped', 0)), "โญ๏ธ Skipped") - table.add_row("Coverage", f"{results.get('coverage', 0):.1f}%", "๐Ÿ“Š Code coverage") - table.add_row("Duration", f"{results.get('duration', 0):.2f}s", "โฑ๏ธ Execution time") - - cli_instance.console.print(table) - - # Show status - if results.get('success', False): - cli_instance.console.print("[bold green]โœ… All tests passed successfully![/bold green]") - else: - cli_instance.console.print("[bold red]โŒ Some tests failed. Check details above.[/bold red]") - - -def _display_environment_status(status: Dict[str, Any]): - """Display environment status.""" - table = Table(title="Environment Status", show_header=True, header_style="bold blue") - table.add_column("Component", style="cyan", width=20) - table.add_column("Status", style="green", width=15) - table.add_column("Details", style="white") - - for component, info in status.items(): - status_text = "โœ… OK" if info.get('status') == 'ok' else "โŒ Error" - table.add_row(component, status_text, info.get('message', '')) - - cli_instance.console.print(table) - - -def _display_test_status(status: Dict[str, Any]): - """Display test framework status.""" - cli_instance.console.print("\n[bold]Test Framework Status:[/bold]") - for key, value in status.items(): - cli_instance.console.print(f" {key}: {value}") - - -def _display_dependencies_status(status: Dict[str, Any]): - """Display dependencies status.""" - cli_instance.console.print("\n[bold]Dependencies Status:[/bold]") - for dep, info in status.items(): - status_icon = "โœ…" if info.get('installed') else "โŒ" - version = info.get('version', 'N/A') - cli_instance.console.print(f" {status_icon} {dep}: {version}") - - -if __name__ == "__main__": - main() diff --git a/src/tests/unit/test_data_generator_fixed.py b/src/tests/unit/test_data_generator_fixed.py deleted file mode 100644 index c0fa959..0000000 --- a/src/tests/unit/test_data_generator_fixed.py +++ /dev/null @@ -1,130 +0,0 @@ -""" -Unit tests for Test Data Generator module. -""" - -import sys -import unittest -import json -import tempfile -import os -from pathlib import Path -from datetime import datetime - -# Add src to path -sys.path.insert(0, str(Path(__file__).parent.parent.parent.parent.parent)) - -from fsl_continuum.test_data_generator import ( - TestDataGenerator, DataGenerationConfig, - GeneratedTestData, generate_test_data -) - - -class TestTestDataGenerator(unittest.TestCase): - """Test cases for TestDataGenerator.""" - - def setUp(self): - """Set up test fixtures.""" - self.config = DataGenerationConfig( - num_records=10, - complexity_level="simple", - include_edge_cases=False, - seed=42 - ) - self.generator = TestDataGenerator(self.config) - - def test_generator_initialization(self): - """Test generator initialization.""" - self.assertIsInstance(self.generator, TestDataGenerator) - self.assertEqual(self.generator.config.num_records, 10) - self.assertEqual(self.generator.config.seed, 42) - self.assertIsNotNone(self.generator.generators) - - def test_generate_baml_data(self): - """Test BAML data generation.""" - result = self.generator.generate_data('baml') - - self.assertIsInstance(result, GeneratedTestData) - self.assertEqual(result.schema_type, 'baml') - self.assertEqual(len(result.data), 10) - self.assertIsInstance(result.data, list) - - # Check record structure - if result.data: - record = result.data[0] - self.assertIn('id', record) - self.assertIn('name', record) - self.assertIn('type', record) - self.assertIn('properties', record) - self.assertIn('metadata', record) - - def test_generate_json_data(self): - """Test JSON data generation.""" - result = self.generator.generate_data('json') - - self.assertIsInstance(result, GeneratedTestData) - self.assertEqual(result.schema_type, 'json') - self.assertEqual(len(result.data), 10) - self.assertIsInstance(result.data, list) - - # Check JSON structure - if result.data: - record = result.data[0] - self.assertIsInstance(record, dict) - self.assertIn('id', record) - self.assertIn('name', record) - self.assertIn('nested', record) - - def test_unsupported_schema_type(self): - """Test handling of unsupported schema types.""" - with self.assertRaises(ValueError): - self.generator.generate_data('unsupported_type') - - def test_save_to_file(self): - """Test saving generated data to file.""" - result = self.generator.generate_data('json') - - with tempfile.NamedTemporaryFile(mode='w', suffix='.json', delete=False) as f: - temp_file = f.name - - try: - self.generator.save_to_file(result, temp_file) - - # Verify file was created and contains valid JSON - self.assertTrue(os.path.exists(temp_file)) - - with open(temp_file, 'r') as f: - saved_data = json.load(f) - - self.assertIn('metadata', saved_data) - self.assertIn('data', saved_data) - self.assertEqual(len(saved_data['data']), len(result.data)) - - finally: - if os.path.exists(temp_file): - os.unlink(temp_file) - - def test_get_generation_report(self): - """Test generation report functionality.""" - report = self.generator.get_generation_report() - - self.assertIsInstance(report, dict) - self.assertIn('generator_version', report) - self.assertIn('supported_types', report) - self.assertIn('config', report) - self.assertIn('last_generation', report) - - -class TestDataGenerationUtilities(unittest.TestCase): - """Test utility functions for test data generation.""" - - def test_generate_test_data_function(self): - """Test standalone generate_test_data function.""" - result = generate_test_data('json', num_records=5) - - self.assertIsInstance(result, GeneratedTestData) - self.assertEqual(result.schema_type, 'json') - self.assertEqual(len(result.data), 5) - - -if __name__ == '__main__': - unittest.main() diff --git a/test_runner_fixed.py b/test_runner_fixed.py deleted file mode 100644 index 4d01d4d..0000000 --- a/test_runner_fixed.py +++ /dev/null @@ -1,604 +0,0 @@ -#!/usr/bin/env python3 -""" -FSL Continuum Test Runner - Fixed Version - -Advanced test execution engine with AI assistance and Droid optimization. -Supports parallel execution, auto-healing, and comprehensive reporting. -""" - -import os -import sys -import json -import time -import asyncio -import subprocess -import threading -from pathlib import Path -from typing import Dict, Any, List, Optional, Tuple, Callable -from dataclasses import dataclass, asdict -from datetime import datetime -from concurrent.futures import ThreadPoolExecutor, as_completed -from rich.progress import Progress, TaskID -from rich.console import Console -import tempfile -import shutil - -from .test_env import TestEnvironmentManager - -console = Console() - - -@dataclass -class TestResult: - """Individual test result.""" - name: str - status: str # passed, failed, error, skipped - duration: float - message: str - traceback: Optional[str] = None - category: str = "general" - - -@dataclass -class TestSuiteResult: - """Complete test suite result.""" - total: int - passed: int - failed: int - errors: int - skipped: int - duration: float - coverage: float - success: bool - results: List[TestResult] - metadata: Dict[str, Any] - - -class TestRunner: - """Advanced test runner with AI assistance.""" - - def __init__(self): - self.env_manager = TestEnvironmentManager() - self.console = Console() - self.project_root = self.env_manager.project_root - self.test_dir = self.project_root / "src" / "tests" - self.reports_dir = self.test_dir / "reports" - self.reports_dir.mkdir(parents=True, exist_ok=True) - - # Test categories - self.test_categories = { - "unit": { - "paths": [self.test_dir / "unit"], - "markers": ["unit"], - "description": "Unit tests for individual components" - }, - "integration": { - "paths": [self.test_dir / "integration"], - "markers": ["integration"], - "description": "Integration tests for component interactions" - }, - "performance": { - "paths": [self.test_dir / "performance"], - "markers": ["performance", "benchmark"], - "description": "Performance tests and benchmarking" - }, - "semantic": { - "paths": [self.test_dir / "semantic_languages"], - "markers": ["semantic_languages", "ai_processing"], - "description": "Semantic language tests" - }, - "all": { - "paths": [self.test_dir], - "markers": [], - "description": "All tests" - } - } - - def run_tests(self, config: Dict[str, Any], progress: Progress, task: TaskID) -> Dict[str, Any]: - """Run tests based on configuration.""" - start_time = time.time() - - try: - self.console.print("๐Ÿงช Starting test execution...") - - # Determine which tests to run - test_categories = self._get_test_categories(config) - - # Update progress - progress.update(task, advance=10, description="Preparing tests...") - - # Execute tests - results = [] - total_tests = 0 - - for category in test_categories: - progress.update(task, description=f"Running {category} tests...") - - category_result = self._run_category_tests(category, config, progress, task) - results.extend(category_result.results) - total_tests += category_result.total - - progress.update(task, advance=20 // len(test_categories)) - - # Process results - final_result = self._process_results(results, total_tests, start_time, config) - - # Generate reports - progress.update(task, advance=10, description="Generating reports...") - self._generate_reports(final_result, config) - - progress.update(task, completed=100, description="Test execution complete") - - return asdict(final_result) - - except Exception as e: - self.console.print(f"[red]โŒ Test execution error: {e}[/red]") - return { - 'success': False, - 'error': str(e), - 'total': 0, - 'passed': 0, - 'failed': 0, - 'errors': 1, - 'skipped': 0, - 'coverage': 0, - 'duration': time.time() - start_time - } - - def _get_test_categories(self, config: Dict[str, Any]) -> List[str]: - """Determine which test categories to run.""" - categories = [] - - if config.get('unit_tests'): - categories.append('unit') - if config.get('integration_tests'): - categories.append('integration') - if config.get('performance_tests'): - categories.append('performance') - if config.get('semantic_tests'): - categories.append('semantic') - - # If no specific categories, run all - if not categories: - categories = ['all'] - - return categories - - def _run_category_tests(self, category: str, config: Dict[str, Any], - progress: Progress, task: TaskID) -> TestSuiteResult: - """Run tests for a specific category.""" - category_info = self.test_categories[category] - - # Build pytest command - cmd = self._build_pytest_command(category, config) - - # Execute tests - result = self._execute_pytest_command(cmd, category, config) - - return result - - def _build_pytest_command(self, category: str, config: Dict[str, Any]) -> List[str]: - """Build pytest command for category.""" - category_info = self.test_categories[category] - - # Base command - cmd = [str(self.env_manager.venv_dir / 'bin' / 'python'), '-m', 'pytest'] - - # Test paths - for path in category_info['paths']: - if path.exists(): - cmd.extend(['--rootdir', str(self.project_root)]) - cmd.append(str(path)) - - # Custom test paths - if config.get('test_paths'): - cmd.extend(config['test_paths']) - - # Markers - for marker in category_info['markers']: - cmd.extend(['-m', marker]) - - # Additional options - if config.get('verbose'): - cmd.append('-vv') - - if config.get('parallel'): - cmd.extend(['-n', 'auto']) - - if config.get('coverage'): - cmd.extend([ - '--cov=src', - '--cov-report=html:' + str(self.reports_dir / 'htmlcov'), - '--cov-report=xml:' + str(self.reports_dir / 'coverage.xml'), - '--cov-report=term-missing' - ]) - - # Add pytest.ini options - pytest_options = [ - '--strict-markers', - '--strict-config', - '--tb=short', - '--maxfail=5', - '--color=yes' - ] - cmd.extend(pytest_options) - - # Output format - cmd.extend([ - '--json-report', - '--json-report-file=' + str(self.reports_dir / f'{category}_results.json') - ]) - - return cmd - - def _execute_pytest_command(self, cmd: List[str], category: str, - config: Dict[str, Any]) -> TestSuiteResult: - """Execute pytest command and parse results.""" - try: - # Run pytest - self.console.print(f" ๐Ÿ“ Running: {' '.join(cmd)}") - - result = subprocess.run( - cmd, - cwd=self.project_root, - capture_output=True, - text=True, - timeout=config.get('timeout', 300) - ) - - # Parse results - return self._parse_pytest_output(result, category, config) - - except subprocess.TimeoutExpired: - self.console.print(f"[red]โŒ Tests for {category} timed out[/red]") - return TestSuiteResult( - total=0, passed=0, failed=0, errors=1, skipped=0, - duration=300, coverage=0, success=False, results=[], metadata={} - ) - except Exception as e: - self.console.print(f"[red]โŒ Error running {category} tests: {e}[/red]") - return TestSuiteResult( - total=0, passed=0, failed=0, errors=1, skipped=0, - duration=0, coverage=0, success=False, results=[], metadata={} - ) - - def _parse_pytest_output(self, result: subprocess.CompletedProcess, - category: str, config: Dict[str, Any]) -> TestSuiteResult: - """Parse pytest output and create TestSuiteResult.""" - - # Try to parse JSON report - json_file = self.reports_dir / f'{category}_results.json' - test_results = [] - - if json_file.exists(): - try: - with open(json_file, 'r') as f: - json_data = json.load(f) - - # Parse individual test results - for test in json_data.get('tests', []): - test_result = TestResult( - name=test.get('nodeid', ''), - status=self._map_test_status(test.get('outcome', 'unknown')), - duration=test.get('duration', 0), - message=test.get('call', {}).get('longrepr', ''), - traceback=test.get('call', {}).get('longrepr', ''), - category=category - ) - test_results.append(test_result) - - except Exception as e: - self.console.print(f"[yellow]โš ๏ธ Could not parse JSON report: {e}[/yellow]") - - # Extract summary from output - summary = self._extract_test_summary(result.stdout + result.stderr) - - # Extract coverage if available - coverage = self._extract_coverage(result.stdout + result.stderr) - - return TestSuiteResult( - total=summary.get('total', 0), - passed=summary.get('passed', 0), - failed=summary.get('failed', 0), - errors=summary.get('errors', 0), - skipped=summary.get('skipped', 0), - duration=summary.get('duration', 0), - coverage=coverage, - success=summary.get('success', False), - results=test_results, - metadata={ - 'category': category, - 'command': ' '.join(result.args), - 'returncode': result.returncode, - 'stdout': result.stdout, - 'stderr': result.stderr - } - ) - - def _map_test_status(self, outcome: str) -> str: - """Map pytest outcome to TestResult status.""" - mapping = { - 'passed': 'passed', - 'failed': 'failed', - 'error': 'error', - 'skipped': 'skipped' - } - return mapping.get(outcome, 'unknown') - - def _extract_test_summary(self, output: str) -> Dict[str, Any]: - """Extract test summary from pytest output.""" - summary = { - 'total': 0, - 'passed': 0, - 'failed': 0, - 'errors': 0, - 'skipped': 0, - 'duration': 0, - 'success': False - } - - lines = output.split('\n') - for line in lines: - if ' passed in ' in line or ' failed in ' in line: - # Parse summary line like "5 passed, 2 failed in 1.23s" - parts = line.split() - i = 0 - while i < len(parts): - if parts[i].isdigit(): - count = int(parts[i]) - status = parts[i + 1].rstrip(',') if i + 1 < len(parts) else '' - - if 'passed' in status: - summary['passed'] = count - elif 'failed' in status: - summary['failed'] = count - elif 'error' in status: - summary['errors'] = count - elif 'skipped' in status: - summary['skipped'] = count - i += 1 - - # Extract duration - if 'in ' in line and 's' in line: - try: - duration_str = line.split('in ')[1].split('s')[0] - summary['duration'] = float(duration_str) - except: - pass - - summary['total'] = summary['passed'] + summary['failed'] + summary['errors'] + summary['skipped'] - summary['success'] = summary['failed'] == 0 and summary['errors'] == 0 - - return summary - - def _extract_coverage(self, output: str) -> float: - """Extract coverage percentage from output.""" - lines = output.split('\n') - for line in lines: - if 'coverage:' in line.lower() or '%' in line: - try: - # Look for patterns like "coverage: 85.2%" - if '%' in line: - coverage_part = line.split('%')[0] - # Extract the number before % - import re - match = re.search(r'(\d+\.?\d*)', coverage_part) - if match: - return float(match.group(1)) - except: - pass - return 0.0 - - def _process_results(self, results: List[TestResult], total_tests: int, - start_time: float, config: Dict[str, Any]) -> TestSuiteResult: - """Process and aggregate all test results.""" - - # Aggregate statistics - passed = sum(1 for r in results if r.status == 'passed') - failed = sum(1 for r in results if r.status == 'failed') - errors = sum(1 for r in results if r.status == 'error') - skipped = sum(1 for r in results if r.status == 'skipped') - - duration = time.time() - start_time - success = failed == 0 and errors == 0 - - # Calculate average coverage (simplified) - coverage = 0.0 - if config.get('coverage'): - coverage = self._calculate_coverage_from_reports() - - return TestSuiteResult( - total=total_tests, - passed=passed, - failed=failed, - errors=errors, - skipped=skipped, - duration=duration, - coverage=coverage, - success=success, - results=results, - metadata={ - 'config': config, - 'timestamp': datetime.now().isoformat(), - 'environment': 'test' - } - ) - - def _calculate_coverage_from_reports(self) -> float: - """Calculate coverage from coverage reports.""" - try: - coverage_file = self.reports_dir / 'coverage.xml' - if coverage_file.exists(): - import xml.etree.ElementTree as ET - tree = ET.parse(coverage_file) - root = tree.getroot() - - # Extract coverage percentage - for coverage_elem in root.findall('.//coverage'): - line_rate = coverage_elem.get('line-rate', '0') - return float(line_rate) * 100 - - # Alternative extraction method - for line_elem in root.findall('.//line'): - if 'hits' in line_elem.attrib: - hits = int(line_elem.get('hits', 0)) - total_hits = sum(1 for elem in root.findall('.//line') - if 'hits' in elem.attrib) - if total_hits > 0: - return (hits / total_hits) * 100 - - except Exception as e: - self.console.print(f"[yellow]โš ๏ธ Could not calculate coverage: {e}[/yellow]") - - return 0.0 - - def _generate_reports(self, result: TestSuiteResult, config: Dict[str, Any]): - """Generate comprehensive test reports.""" - try: - # JSON report - json_file = self.reports_dir / 'test_results.json' - with open(json_file, 'w') as f: - json.dump(asdict(result), f, indent=2, default=str) - - # HTML report (simplified) - if config.get('coverage'): - self.console.print(f"๐Ÿ“Š HTML coverage report: {self.reports_dir / 'htmlcov' / 'index.html'}") - - # Console summary - self._print_console_summary(result) - - except Exception as e: - self.console.print(f"[yellow]โš ๏ธ Could not generate reports: {e}[/yellow]") - - def _print_console_summary(self, result: TestSuiteResult): - """Print test summary to console.""" - self.console.print("\n[bold]๐Ÿ“Š Test Summary:[/bold]") - self.console.print(f" Total Tests: {result.total}") - self.console.print(f" โœ… Passed: {result.passed}") - self.console.print(f" โŒ Failed: {result.failed}") - self.console.print(f" ๐Ÿ’ฅ Errors: {result.errors}") - self.console.print(f" โญ๏ธ Skipped: {result.skipped}") - self.console.print(f" ๐Ÿ“Š Coverage: {result.coverage:.1f}%") - self.console.print(f" โฑ๏ธ Duration: {result.duration:.2f}s") - - if result.success: - self.console.print("\n[bold green]๐ŸŽ‰ All tests passed![/bold green]") - else: - self.console.print("\n[bold red]โŒ Some tests failed[/bold red]") - - # Show failed tests - failed_tests = [r for r in result.results if r.status in ['failed', 'error']] - if failed_tests: - self.console.print("\n[bold red]Failed Tests:[/bold red]") - for test in failed_tests[:10]: # Show first 10 - self.console.print(f" โŒ {test.name}: {test.message}") - - def auto_fix_issues(self, results: Dict[str, Any]) -> Dict[str, Any]: - """Auto-fix common test issues.""" - fixed_issues = [] - - try: - self.console.print("๐Ÿ”ง Analyzing test issues for auto-fix...") - - # Common fix patterns - fix_patterns = { - 'import_error': self._fix_import_errors, - 'syntax_error': self._fix_syntax_errors, - 'missing_test': self._create_missing_tests, - 'dependency_error': self._fix_dependency_errors - } - - # Extract failed test information - failed_tests = [] - if 'results' in results: - for test_result in results['results']: - if isinstance(test_result, dict) and test_result.get('status') in ['failed', 'error']: - failed_tests.append(test_result) - - # Attempt fixes - for test in failed_tests: - for issue_type, fix_function in fix_patterns.items(): - if self._detect_issue_type(test) == issue_type: - fix_result = fix_function(test) - if fix_result.get('fixed', False): - fixed_issues.append({ - 'test': test.get('name', ''), - 'issue': issue_type, - 'fix': fix_result.get('message', '') - }) - - self.console.print(f"[green]โœ… Auto-fixed {len(fixed_issues)} issues[/green]") - - return { - 'fixed': len(fixed_issues), - 'issues': fixed_issues - } - - except Exception as e: - self.console.print(f"[red]โŒ Auto-fix failed: {e}[/red]") - return {'fixed': 0, 'error': str(e)} - - def _detect_issue_type(self, test_result: Dict[str, Any]) -> str: - """Detect the type of issue in a test.""" - message = test_result.get('message', '').lower() - traceback = test_result.get('traceback', '').lower() - full_text = message + ' ' + traceback - - if 'importerror' in full_text or 'modulenotfounderror' in full_text: - return 'import_error' - elif 'syntaxerror' in full_text: - return 'syntax_error' - elif 'dependency' in full_text or 'module' in full_text: - return 'dependency_error' - else: - return 'unknown' - - def _fix_import_errors(self, test_result: Dict[str, Any]) -> Dict[str, Any]: - """Attempt to fix import errors.""" - # This is a simplified auto-fix - # In a real implementation, you would analyze the specific import error - # and add missing imports or fix module paths - return {'fixed': False, 'message': 'Import errors require manual intervention'} - - def _fix_syntax_errors(self, test_result: Dict[str, Any]) -> Dict[str, Any]: - """Attempt to fix syntax errors.""" - return {'fixed': False, 'message': 'Syntax errors require manual intervention'} - - def _create_missing_tests(self, test_result: Dict[str, Any]) -> Dict[str, Any]: - """Create missing test files.""" - return {'fixed': False, 'message': 'Missing tests require manual creation'} - - def _fix_dependency_errors(self, test_result: Dict[str, Any]) -> Dict[str, Any]: - """Attempt to fix dependency errors.""" - return {'fixed': False, 'message': 'Dependency errors require manual intervention'} - - def get_status(self) -> Dict[str, Any]: - """Get current test runner status.""" - return { - 'environment_ready': self.env_manager.venv_dir.exists(), - 'test_directory': str(self.test_dir), - 'reports_directory': str(self.reports_dir), - 'supported_categories': list(self.test_categories.keys()), - 'python_version': sys.version, - 'project_root': str(self.project_root) - } - - def run_ai_assisted_tests(self, config: Dict[str, Any]) -> Dict[str, Any]: - """Run AI-assisted tests with Droid optimization.""" - self.console.print("[bold blue]๐Ÿง  AI-Assisted Testing Mode[/bold blue]") - - # Enhanced configuration for AI testing - ai_config = config.copy() - ai_config.update({ - 'verbose': True, - 'parallel': True, - 'coverage': True, - 'auto_fix': True, - 'stream_results': True - }) - - # Use a mock progress for AI mode - from rich.progress import Progress - with Progress() as progress: - task = progress.add_task("AI-Assisted Testing", total=100) - return self.run_tests(ai_config, progress, task) diff --git a/validate_production_readiness.py b/validate_production_readiness.py index d59bd36..3851b9a 100644 --- a/validate_production_readiness.py +++ b/validate_production_readiness.py @@ -667,7 +667,7 @@ def validate_deployment(self) -> bool: def _test_package_files(self) -> bool: """Test package files.""" try: - required_files = ['pyproject.toml', 'setup.py', 'MANIFEST.in'] + required_files = ['pyproject.toml', 'MANIFEST.in'] results = [] for file in required_files: exists = Path(file).exists()