From 3180231545188966ffa92b297bad762ad744d39a Mon Sep 17 00:00:00 2001 From: "google-labs-jules[bot]" <161369871+google-labs-jules[bot]@users.noreply.github.com> Date: Tue, 28 Jul 2026 04:15:03 +0000 Subject: [PATCH 1/3] chore(ci): nightly bridge validation and formatting Co-authored-by: d-oit <6849456+d-oit@users.noreply.github.com> --- .agents/metrics.jsonl | 1 + tests/test_routing_foundation.py | 12 ++++++------ 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/.agents/metrics.jsonl b/.agents/metrics.jsonl index 302f97a5..99eb409a 100644 --- a/.agents/metrics.jsonl +++ b/.agents/metrics.jsonl @@ -1 +1,2 @@ {"timestamp": "2026-06-26T11:18:30Z", "agent": "jules", "task": "optimize content compaction and quality scoring", "skill_used": "do-web-doc-resolver", "status": "completed", "tokens_used": 0, "duration_seconds": 0, "notes": "Optimized compaction (~6%) and quality scoring (~2.5%) while maintaining UTF-8 safety and logic correctness."} +{"timestamp": "2026-07-28T04:15:00Z", "agent": "jules", "task": "nightly bridge validation and formatting", "skill_used": "do-web-doc-resolver", "status": "completed", "tokens_used": 0, "duration_seconds": 0, "notes": "Re-built Rust CLI, validated Python environment, ran full integration test suite, verified markdown standards on JS-heavy site, and successfully auto-formatted the codebase."} diff --git a/tests/test_routing_foundation.py b/tests/test_routing_foundation.py index bd872ba6..4487c23a 100644 --- a/tests/test_routing_foundation.py +++ b/tests/test_routing_foundation.py @@ -1015,15 +1015,15 @@ def record_batch(thread_id: int): stats = rm.get_domain_stats("shared-provider", "shared.com") assert stats is not None total_expected = num_threads * records_per_thread - assert ( - stats["attempts"] == total_expected - ), f"Expected {total_expected} attempts, got {stats['attempts']}" + assert stats["attempts"] == total_expected, ( + f"Expected {total_expected} attempts, got {stats['attempts']}" + ) # avg_latency_ms should be reasonable (not NaN, not corrupted) assert 100 <= stats["avg_latency_ms"] <= 200 # ~66.7% success rate expected (i % 3 != 0 → fails every 3rd record) - assert ( - 0.6 < stats["success_rate"] < 0.75 - ), f"Expected ~0.667 success rate, got {stats['success_rate']}" + assert 0.6 < stats["success_rate"] < 0.75, ( + f"Expected ~0.667 success rate, got {stats['success_rate']}" + ) # quality scores range from 0.7 to 0.88 assert stats["avg_quality"] > 0.7, f"Expected avg_quality > 0.7, got {stats['avg_quality']}" From 55e61b8e6ec815058bcf64aa15c7565bb40b0c6d Mon Sep 17 00:00:00 2001 From: "google-labs-jules[bot]" <161369871+google-labs-jules[bot]@users.noreply.github.com> Date: Tue, 28 Jul 2026 04:27:24 +0000 Subject: [PATCH 2/3] chore(ci): nightly bridge validation and formatting Co-authored-by: d-oit <6849456+d-oit@users.noreply.github.com> --- tests/test_routing_foundation.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/tests/test_routing_foundation.py b/tests/test_routing_foundation.py index 4487c23a..bd872ba6 100644 --- a/tests/test_routing_foundation.py +++ b/tests/test_routing_foundation.py @@ -1015,15 +1015,15 @@ def record_batch(thread_id: int): stats = rm.get_domain_stats("shared-provider", "shared.com") assert stats is not None total_expected = num_threads * records_per_thread - assert stats["attempts"] == total_expected, ( - f"Expected {total_expected} attempts, got {stats['attempts']}" - ) + assert ( + stats["attempts"] == total_expected + ), f"Expected {total_expected} attempts, got {stats['attempts']}" # avg_latency_ms should be reasonable (not NaN, not corrupted) assert 100 <= stats["avg_latency_ms"] <= 200 # ~66.7% success rate expected (i % 3 != 0 → fails every 3rd record) - assert 0.6 < stats["success_rate"] < 0.75, ( - f"Expected ~0.667 success rate, got {stats['success_rate']}" - ) + assert ( + 0.6 < stats["success_rate"] < 0.75 + ), f"Expected ~0.667 success rate, got {stats['success_rate']}" # quality scores range from 0.7 to 0.88 assert stats["avg_quality"] > 0.7, f"Expected avg_quality > 0.7, got {stats['avg_quality']}" From 63b6f4538a76d93406e3690a3956370bd40f21f2 Mon Sep 17 00:00:00 2001 From: "google-labs-jules[bot]" <161369871+google-labs-jules[bot]@users.noreply.github.com> Date: Tue, 28 Jul 2026 08:38:00 +0000 Subject: [PATCH 3/3] chore(ci): nightly bridge validation and offline semantic cache mocking Co-authored-by: d-oit <6849456+d-oit@users.noreply.github.com> --- tests/conftest.py | 72 ++++++++++++++++++++++++++++++++++++++++------- 1 file changed, 62 insertions(+), 10 deletions(-) diff --git a/tests/conftest.py b/tests/conftest.py index a3bafa12..928fed64 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -1,16 +1,68 @@ -from unittest.mock import patch +import sys +from unittest.mock import MagicMock, patch +import numpy as np import pytest -import scripts.providers_impl -import scripts.quality -import scripts.resolve -import scripts.routing -import scripts.routing_memory -import scripts.state -import scripts.synthesis -import scripts.utils -import scripts.utils.cache + +class MockSentenceTransformer: + def __init__(self, model_name=None): + self.model_name = model_name + + def get_embedding_dimension(self): + return 384 + + def encode(self, sentences, convert_to_numpy=True, normalize_embeddings=True, **kwargs): + if isinstance(sentences, str): + single = True + sentences_list = [sentences] + elif isinstance(sentences, (list, tuple)): + single = False + sentences_list = list(sentences) + else: + single = True + sentences_list = [str(sentences)] + + embeddings = [] + for text in sentences_list: + vec = np.zeros(384, dtype=np.float32) + words = text.lower().split() + stop = {"how", "to", "do", "i", "a", "in", "the", "an", "and", "of", "for", "is", "are"} + words = [w for w in words if w not in stop] + for word in words: + stem = word[:4] + h1 = hash(stem) % 384 + h2 = hash(word) % 384 + vec[h1] += 1.0 + vec[(h1 + 1) % 384] += 0.5 + vec[(h1 - 1) % 384] += 0.5 + vec[h2] += 0.5 + vec[(h2 + 1) % 384] += 0.25 + vec[(h2 - 1) % 384] += 0.25 + norm = np.linalg.norm(vec) + if norm > 0: + vec = vec / norm + embeddings.append(vec) + + if single: + return embeddings[0] + return np.array(embeddings) + + +# Mock sentence_transformers module to avoid HuggingFace model downloads during tests +mock_st_module = MagicMock() +mock_st_module.SentenceTransformer = MockSentenceTransformer +sys.modules["sentence_transformers"] = mock_st_module + +import scripts.providers_impl # noqa: E402 +import scripts.quality # noqa: E402 +import scripts.resolve # noqa: E402 +import scripts.routing # noqa: E402 +import scripts.routing_memory # noqa: E402 +import scripts.state # noqa: E402 +import scripts.synthesis # noqa: E402 +import scripts.utils # noqa: E402 +import scripts.utils.cache # noqa: E402 class MemoryCache: