Skip to content

fix: enforce strict mypy on core ops, harden twin API and SQL queries - #12

Merged
josaum merged 2 commits into
mainfrom
fix/strict-types-twin-and-tests
Nov 3, 2026
Merged

josaum merged 2 commits into
mainfrom
fix/strict-types-twin-and-tests

Conversation

@josaum

@josaum josaum commented Nov 3, 2026

Copy link
Copy Markdown
Owner

Summary

  • Strict Mypy Coverage: Fixed type annotations across event_jepa_cube/numpy_ops.py, event_jepa_cube/predictors.py, and event_jepa_cube/regularizers.py, removing the ignore_errors = true override block in pyproject.toml.
  • Digital Twin API Hardening (event_jepa_cube/twin_api.py):
    • Fixed variable shadowing of state in _load_embeddings that raised AttributeError when storing loaded weights into state.emb_data.
    • Pushed entity_ids=[entity_id] down to Materializer.materialize() in GET /twin/entity/{entity_type}/{entity_id} to avoid full-database scans.
    • Enabled :path route parameters on /twin/similar/{node_id:path}, /twin/embedding/similar/{node_id:path}, and /twin/embedding/vector/{node_id:path} so V4 slash-delimited node IDs (e.g. GHO-BRADESCO/ID_CD_INTERNACAO_123) route properly.
    • Guarded np.argpartition and .reshape(-1) in find_similar, find_anomalies, and search_by_vector against k >= N and single-candidate 0-D array edge cases.
  • SQL Parameterization & Escaping (duckdb_connector.py, triggers.py, materializer.py):
    • Added optional params support to DuckDBConnector.load_sequences() and load_entities().
    • Parameterized TriggerEngine sequence history and alert queries and escaped string filters in Materializer.materialize().
  • Test Coverage (434 passed, 0 skipped):
    • Enabled tests/test_scale_pipeline_v6.py in Modal-free environments via _install_modal_stub().
    • Added unit tests in tests/test_twin_api.py and tests/test_triggers.py covering all fixed edge cases.

@josaum
josaum merged commit 22708fb into main Nov 3, 2026
4 checks passed
@josaum
josaum deleted the fix/strict-types-twin-and-tests branch November 3, 2026 13:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant