Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,24 @@ on:
branches: [main]

jobs:
lint:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v5

- uses: actions/setup-python@v6
with:
python-version: "3.11"

- name: Install lint dependencies
run: |
python -m pip install --upgrade pip
python -m pip install -e ".[dev]"

- name: Run Ruff
run: ruff check wavemind tests benchmarks examples

pytest:
runs-on: ubuntu-latest
strategy:
Expand Down
2 changes: 1 addition & 1 deletion benchmarks/agent_memory_benchmark.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
sys.path.insert(0, str(PROJECT_ROOT))

from wavemind import WaveMind
from wavemind.encoders import HashingTextEncoder, create_text_encoder
from wavemind.encoders import create_text_encoder


@dataclass(frozen=True)
Expand Down
15 changes: 0 additions & 15 deletions benchmarks/benchmark_registry.py
Original file line number Diff line number Diff line change
Expand Up @@ -653,8 +653,6 @@ def _implemented_entries(root: Path) -> list[dict[str, Any]]:
postgres_pitr_payload = _load_json(root / "benchmarks" / "postgres_pitr_plan.json")
memory_competitor_payload = _load_json(root / "benchmarks" / "memory_competitor_results.json")
answer_payload = _load_json(root / "benchmarks" / "longmemeval_answer_extractive_20_results.json")
vectordbbench_payload = _load_json(root / "benchmarks" / "vectordbbench_dataset_manifest.json")

agent_results = _engine_results(agent_payload)
agent_coherence_results = _engine_results(agent_coherence_payload)
dynamic_results = _engine_results(dynamic_payload)
Expand Down Expand Up @@ -722,19 +720,6 @@ def _implemented_entries(root: Path) -> list[dict[str, Any]]:
)
postgres_pitr_validation = postgres_pitr_profile.get("validation", {})
memory_competitor_results = _engine_results(memory_competitor_payload)
vectordbbench_summary = (
{
"WaveMind custom dataset export": {
"status": vectordbbench_payload.get("status"),
"vectors": vectordbbench_payload.get("dataset", {}).get("vectors"),
"queries": vectordbbench_payload.get("dataset", {}).get("queries"),
"dim": vectordbbench_payload.get("dataset", {}).get("dim"),
"top_k": vectordbbench_payload.get("dataset", {}).get("top_k"),
}
}
if vectordbbench_payload
else {}
)
answer_qwen05_payload = _load_json(root / "benchmarks" / "longmemeval_answer_qwen25_0_5b_50_results.json")
answer_qwen15_payload = _load_json(root / "benchmarks" / "longmemeval_answer_qwen25_1_5b_50_results.json")
answer_results = {
Expand Down
1 change: 0 additions & 1 deletion benchmarks/kubernetes_serverless_lifecycle_smoke.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
import json
import math
import os
import statistics
import subprocess
import tempfile
import time
Expand Down
17 changes: 13 additions & 4 deletions benchmarks/memory_competitor_benchmark.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
import time
import uuid
from collections import defaultdict
from dataclasses import asdict, dataclass
from dataclasses import dataclass
from datetime import datetime, timedelta, timezone
from pathlib import Path
from typing import Any, Callable, Iterable
Expand Down Expand Up @@ -446,23 +446,32 @@ def run_zep(
from zep_cloud import Message
except Exception as exc:
return skipped_result("Zep", f"Import zep-cloud failed: {exc}")
client_factory = lambda: Zep(base_url=api_url, api_key=api_key, timeout=timeout)
def create_zep_cloud_client() -> Any:
return Zep(base_url=api_url, api_key=api_key, timeout=timeout)

client_factory = create_zep_cloud_client
message_factory = Message
elif _module_available("zep_python"):
try:
from zep_python.client import Zep
from zep_python.types.message import Message
except Exception as exc:
return skipped_result("Zep", f"Import zep-python failed: {exc}")
client_factory = lambda: Zep(base_url=api_url, api_key=api_key, timeout=timeout)
def create_zep_python_client() -> Any:
return Zep(base_url=api_url, api_key=api_key, timeout=timeout)

client_factory = create_zep_python_client
message_factory = Message
else:
return skipped_result(
"Zep",
'Install a Zep SDK to run this adapter profile: pip install "zep-cloud" or pip install "zep-python"',
)
if message_factory is None:
message_factory = lambda **kwargs: kwargs
def create_message(**kwargs: Any) -> dict[str, Any]:
return kwargs

message_factory = create_message

client = client_factory()
if hasattr(client, "memory"):
Expand Down
3 changes: 0 additions & 3 deletions benchmarks/scale_readiness_benchmark.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@
operator_status,
query_with_cache,
query_with_vector_cache,
remember_payload,
run_control_plane_consensus_profile,
serverless_sample_bundle,
sync_namespace_delta,
Expand Down Expand Up @@ -1798,8 +1797,6 @@ def run_api_cache_mutation_profile() -> dict[str, object]:
second_query.raise_for_status()
latencies.append((time.perf_counter() - started) * 1000.0)
second_results = second_query.json()["results"]
cache_keys_after_second_query = len(client.items)

feedback_response = api.post(
"/feedback",
json={
Expand Down
1 change: 0 additions & 1 deletion examples/agent_with_memory.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
import argparse
import json
import os
import re
import sys
import urllib.request
from pathlib import Path
Expand Down
9 changes: 9 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,9 @@ production = [
dev = [
"pytest>=8",
"httpx>=0.27",
"httpx2>=2",
"langchain-classic>=1.0",
"ruff>=0.12",
]

[project.scripts]
Expand All @@ -85,3 +87,10 @@ Repository = "https://github.com/CaspianG/wavemind"
[tool.setuptools.packages.find]
where = ["."]
include = ["wavemind*"]

[tool.ruff]
target-version = "py310"

[tool.ruff.lint.per-file-ignores]
"benchmarks/*.py" = ["E402"]
"examples/*.py" = ["E402"]
2 changes: 1 addition & 1 deletion wavemind/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -431,7 +431,6 @@
"render_active_active_admission_markdown",
"render_scale_gap_markdown",
"render_serverless_admission_markdown",
"render_active_active_admission_markdown",
"render_production_admission_markdown",
"render_memory_os_canary_markdown",
"render_memory_os_policy_evolution_markdown",
Expand All @@ -454,6 +453,7 @@
"validate_precomputed_cross_modal_contract",
"validate_external_multimodal_evidence",
"validate_postgres_pitr_commands",
"video_payload",
"write_memory_os_policy_evolution_artifacts",
"write_production_evidence_env_artifacts",
]
2 changes: 0 additions & 2 deletions wavemind/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@
run_memory_os_canary,
)
from .memory_os_evolution import (
render_memory_os_policy_evolution_markdown,
run_memory_os_policy_evolution,
write_memory_os_policy_evolution_artifacts,
)
Expand Down Expand Up @@ -102,7 +101,6 @@
)
from .production_evidence_env import (
build_production_evidence_env_contract,
render_production_evidence_env_markdown,
write_production_evidence_env_artifacts,
)
from .production_evidence_ingest import (
Expand Down
6 changes: 3 additions & 3 deletions wavemind/cloud_run_evidence.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,11 +75,11 @@ def _annotation(service: Mapping[str, Any], *names: str) -> str | None:
service.get("spec", {}).get("template", {}).get("metadata", {}).get("annotations", {}),
service.get("template", {}).get("annotations", {}),
]
for annotations in candidates:
if not isinstance(annotations, Mapping):
for metadata_annotations in candidates:
if not isinstance(metadata_annotations, Mapping):
continue
for name in names:
value = annotations.get(name)
value = metadata_annotations.get(name)
if value is not None and str(value).strip():
return str(value).strip()
return None
Expand Down
1 change: 0 additions & 1 deletion wavemind/cluster.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,6 @@ def quorum_report(self) -> dict[str, object]:

def placement_health_report(self) -> dict[str, object]:
namespace_count = len(self.placements)
zone_by_node = {node.id: node.zone for node in self.nodes}
failure_domain_by_node = {
node.id: node.zone or node.id
for node in self.nodes
Expand Down
5 changes: 0 additions & 5 deletions wavemind/production_evidence.py
Original file line number Diff line number Diff line change
Expand Up @@ -1925,11 +1925,6 @@ def build_production_evidence_dispatch_plan(
root = Path(root)
strict = evaluate_production_evidence(root)
preflight = evaluate_production_evidence_preflight(root, env=env)
strict_by_id = {
str(row.get("id")): row
for row in strict.get("requirements", [])
if isinstance(row, dict)
}
preflight_by_id = {
str(row.get("id")): row
for row in preflight.get("checks", [])
Expand Down
3 changes: 1 addition & 2 deletions wavemind/remote_lab.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
import hashlib
import ipaddress
import json
import os
import re
import socket
import subprocess
Expand All @@ -12,7 +11,7 @@
import urllib.request
from dataclasses import dataclass
from pathlib import Path
from typing import Any, Callable, Mapping, Sequence
from typing import Any, Callable, Mapping
from urllib.parse import quote, urlparse

from .active_active_drill import run_active_active_drill
Expand Down
Loading