Merged
Conversation
AlexanderSmil
pushed a commit
to AlexanderSmil/awesome-python
that referenced
this pull request
Apr 12, 2026
…metrics Closes all remaining architectural audit recommendations. 1. ai/embedding_synthesizer.py (NEW — v2.0 audit item vinta#6) - Dynamic polarity detection via cosine similarity between concept embeddings - Replaces static POLARITY_MAP with semantic distance (threshold 0.55) - Intensity labels: profound/strong/noticeable/subtle based on distance - Concept embedding cache to avoid re-embedding within a session - Works with any school — no manual polarity pairs needed 2. agents/devops/health_agent.py (NEW) - HealthAgent: synchronous self-diagnostic of security/storage/ai/synthesis - Thread-isolated asyncio.run() to avoid event loop conflicts - Returns {"status": "healthy"|"degraded", "checks": {...}, "version": "1.2.0"} - Implements async execute() for orchestrator compatibility 3. monitoring/metrics_collector.py (NEW) - Thread-safe rolling-window MetricsCollector - timer() context manager, record_ms(), increment() counter - snapshot() with avg/min/max/p95 per metric name - Module-level singleton: from monitoring.metrics_collector import metrics 4. game/leela_psychological.py - Instrument analyze_turn: records total latency, per-school call counts, consent_granted/consent_denied counters 5. web/feedback_api.py - GET /api/health — liveness/readiness probe (200 healthy, 503 degraded) - GET /api/metrics — performance metrics snapshot 6. tests/test_embedding_synthesizer.py (NEW — 17 tests) - 6 EmbeddingSynthesizer tests (polarity detection, cache, alignment) - 6 MetricsCollector tests (counters, timers, rolling window, p95, reset) - 5 HealthAgent tests (all-ok, latency, async execute, unknown action) Test results: 53/53 passed https://claude.ai/code/session_01Nmtk7oaHGcmm56rjXeMa3Z
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.