12baf2d792
The SDK ships its own tracing pipeline (``agents.tracing``) plus ``SQLiteSession`` for native conversation persistence. Strix's custom OTEL bootstrap + Traceloop integration was dead weight — the SDK does not bridge to OpenTelemetry, so all of our adapter code was solving a problem we didn't actually need solved. Telemetry purge: - Drop the ``traceloop-sdk`` and ``opentelemetry-exporter-otlp-proto-http`` runtime deps. ``uv sync`` uninstalls ~30 transitive packages (the OTEL family, ``traceloop-sdk``, ``protobuf``, ``opentelemetry-exporter-otlp-*``, ``deprecated``, ``wrapt``, ``backoff``, etc.) — about 1000 lines off ``uv.lock``. - Delete ``bootstrap_otel`` and ``JsonlSpanExporter`` from ``telemetry/utils.py``; strip the OTEL pruning helpers, ``parse_traceloop_headers``, ``default_resource_attributes``, ``format_trace_id`` / ``format_span_id`` / ``iso_from_unix_ns``. Keep only the sanitizer + JSONL writer + write-lock registry. - Strip ``Tracer._setup_telemetry``, ``_otel_tracer``, ``_remote_export_enabled``, ``_active_events_file_path``, ``_active_run_metadata``, ``_get_events_write_lock``, ``_set_association_properties``. ``_emit_event`` now generates trace/span ids from ``uuid4`` directly. - Drop the ``traceloop_base_url`` / ``traceloop_api_key`` / ``traceloop_headers`` / ``strix_otel_telemetry`` config knobs. - Rename ``is_otel_enabled`` → ``is_telemetry_enabled`` (the gate now controls JSONL emission only). Native session resume: - ``entry.py`` now constructs an ``agents.memory.SQLiteSession`` keyed by ``scan_id`` and persists conversation history at ``strix_runs/<scan_id>/session.db``. A second call to ``run_strix_scan`` with the same ``scan_id`` resumes from where the prior run left off — no manual state plumbing needed. Tracer.agents fix (TUI agent tree was silently empty): - ``StrixOrchestrationHooks.on_agent_start`` now mirrors bus state into ``tracer.agents`` (id / name / parent_id / status), and ``on_agent_end`` flips the entry to ``completed`` / ``crashed``. The TUI now actually shows the agent tree during scans. Tooling: - Drop ``pylint`` from dev deps; ``ruff`` covers everything we used it for. Strip the ``make lint`` pylint step. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
71 lines
2.2 KiB
Makefile
71 lines
2.2 KiB
Makefile
.PHONY: help install dev-install format lint type-check security check-all clean pre-commit setup-dev dev
|
|
|
|
help:
|
|
@echo "Available commands:"
|
|
@echo " setup-dev - Install all development dependencies and setup pre-commit"
|
|
@echo " install - Install production dependencies"
|
|
@echo " dev-install - Install development dependencies"
|
|
@echo ""
|
|
@echo "Code Quality:"
|
|
@echo " format - Format code with ruff"
|
|
@echo " lint - Lint code with ruff"
|
|
@echo " type-check - Run type checking with mypy and pyright"
|
|
@echo " security - Run security checks with bandit"
|
|
@echo " check-all - Run all code quality checks"
|
|
@echo ""
|
|
@echo "Development:"
|
|
@echo " pre-commit - Run pre-commit hooks on all files"
|
|
@echo " clean - Clean up cache files and artifacts"
|
|
|
|
install:
|
|
uv sync --no-dev
|
|
|
|
dev-install:
|
|
uv sync
|
|
|
|
setup-dev: dev-install
|
|
uv run pre-commit install
|
|
@echo "✅ Development environment setup complete!"
|
|
@echo "Run 'make check-all' to verify everything works correctly."
|
|
|
|
format:
|
|
@echo "🎨 Formatting code with ruff..."
|
|
uv run ruff format .
|
|
@echo "✅ Code formatting complete!"
|
|
|
|
lint:
|
|
@echo "🔍 Linting code with ruff..."
|
|
uv run ruff check . --fix
|
|
@echo "✅ Linting complete!"
|
|
|
|
type-check:
|
|
@echo "🔍 Type checking with mypy..."
|
|
uv run mypy strix/
|
|
@echo "🔍 Type checking with pyright..."
|
|
uv run pyright strix/
|
|
@echo "✅ Type checking complete!"
|
|
|
|
security:
|
|
@echo "🔒 Running security checks with bandit..."
|
|
uv run bandit -r strix/ -c pyproject.toml
|
|
@echo "✅ Security checks complete!"
|
|
|
|
check-all: format lint type-check security
|
|
@echo "✅ All code quality checks passed!"
|
|
|
|
pre-commit:
|
|
@echo "🔧 Running pre-commit hooks..."
|
|
uv run pre-commit run --all-files
|
|
@echo "✅ Pre-commit hooks complete!"
|
|
|
|
clean:
|
|
@echo "🧹 Cleaning up cache files..."
|
|
find . -type d -name "__pycache__" -exec rm -rf {} + 2>/dev/null || true
|
|
find . -type d -name ".mypy_cache" -exec rm -rf {} + 2>/dev/null || true
|
|
find . -type d -name ".ruff_cache" -exec rm -rf {} + 2>/dev/null || true
|
|
find . -name "*.pyc" -delete 2>/dev/null || true
|
|
@echo "✅ Cleanup complete!"
|
|
|
|
dev: format lint type-check
|
|
@echo "✅ Development cycle complete!"
|