data-science-mcp 2.3.1__tar.gz → 2.3.3__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {data_science_mcp-2.3.1/data_science_mcp.egg-info → data_science_mcp-2.3.3}/PKG-INFO +7 -7
- {data_science_mcp-2.3.1 → data_science_mcp-2.3.3}/README.md +4 -4
- {data_science_mcp-2.3.1 → data_science_mcp-2.3.3}/data_science_mcp/data_engine.py +18 -17
- {data_science_mcp-2.3.1 → data_science_mcp-2.3.3}/data_science_mcp/mcp_server.py +1 -1
- {data_science_mcp-2.3.1 → data_science_mcp-2.3.3}/data_science_mcp/ml_engine.py +36 -34
- {data_science_mcp-2.3.1 → data_science_mcp-2.3.3/data_science_mcp.egg-info}/PKG-INFO +7 -7
- {data_science_mcp-2.3.1 → data_science_mcp-2.3.3}/data_science_mcp.egg-info/SOURCES.txt +2 -0
- {data_science_mcp-2.3.1 → data_science_mcp-2.3.3}/data_science_mcp.egg-info/requires.txt +2 -2
- {data_science_mcp-2.3.1 → data_science_mcp-2.3.3}/pyproject.toml +6 -3
- {data_science_mcp-2.3.1 → data_science_mcp-2.3.3}/requirements.txt +1 -1
- {data_science_mcp-2.3.1 → data_science_mcp-2.3.3}/tests/conftest.py +4 -6
- data_science_mcp-2.3.3/tests/test_engine_audience.py +20 -0
- data_science_mcp-2.3.3/tests/test_engine_connection.py +51 -0
- {data_science_mcp-2.3.1 → data_science_mcp-2.3.3}/LICENSE +0 -0
- {data_science_mcp-2.3.1 → data_science_mcp-2.3.3}/MANIFEST.in +0 -0
- {data_science_mcp-2.3.1 → data_science_mcp-2.3.3}/data_science_mcp/__init__.py +0 -0
- {data_science_mcp-2.3.1 → data_science_mcp-2.3.3}/data_science_mcp/__main__.py +0 -0
- {data_science_mcp-2.3.1 → data_science_mcp-2.3.3}/data_science_mcp/action_tools.py +0 -0
- {data_science_mcp-2.3.1 → data_science_mcp-2.3.3}/data_science_mcp/adapter_library.py +0 -0
- {data_science_mcp-2.3.1 → data_science_mcp-2.3.3}/data_science_mcp/auth.py +0 -0
- {data_science_mcp-2.3.1 → data_science_mcp-2.3.3}/data_science_mcp/cache_agent_loop.py +0 -0
- {data_science_mcp-2.3.1 → data_science_mcp-2.3.3}/data_science_mcp/chat_template.py +0 -0
- {data_science_mcp-2.3.1 → data_science_mcp-2.3.3}/data_science_mcp/connectors/__init__.py +0 -0
- {data_science_mcp-2.3.1 → data_science_mcp-2.3.3}/data_science_mcp/connectors/mcp_source_presets.json +0 -0
- {data_science_mcp-2.3.1 → data_science_mcp-2.3.3}/data_science_mcp/connectors/tool_schema_fingerprints.json +0 -0
- {data_science_mcp-2.3.1 → data_science_mcp-2.3.3}/data_science_mcp/hf_security.py +0 -0
- {data_science_mcp-2.3.1 → data_science_mcp-2.3.3}/data_science_mcp/inference/__init__.py +0 -0
- {data_science_mcp-2.3.1 → data_science_mcp-2.3.3}/data_science_mcp/inference/base.py +0 -0
- {data_science_mcp-2.3.1 → data_science_mcp-2.3.3}/data_science_mcp/inference/openai_compatible.py +0 -0
- {data_science_mcp-2.3.1 → data_science_mcp-2.3.3}/data_science_mcp/inference/sglang_backend.py +0 -0
- {data_science_mcp-2.3.1 → data_science_mcp-2.3.3}/data_science_mcp/inference/vllm_backend.py +0 -0
- {data_science_mcp-2.3.1 → data_science_mcp-2.3.3}/data_science_mcp/kernels/__init__.py +0 -0
- {data_science_mcp-2.3.1 → data_science_mcp-2.3.3}/data_science_mcp/kernels/_candidate_worker.py +0 -0
- {data_science_mcp-2.3.1 → data_science_mcp-2.3.3}/data_science_mcp/kernels/_protocol.py +0 -0
- {data_science_mcp-2.3.1 → data_science_mcp-2.3.3}/data_science_mcp/kernels/_runner.py +0 -0
- {data_science_mcp-2.3.1 → data_science_mcp-2.3.3}/data_science_mcp/kernels/_worker.py +0 -0
- {data_science_mcp-2.3.1 → data_science_mcp-2.3.3}/data_science_mcp/kernels/kernel_tasks.py +0 -0
- {data_science_mcp-2.3.1 → data_science_mcp-2.3.3}/data_science_mcp/kernels/kernel_verifier.py +0 -0
- {data_science_mcp-2.3.1 → data_science_mcp-2.3.3}/data_science_mcp/kg_log.py +0 -0
- {data_science_mcp-2.3.1 → data_science_mcp-2.3.3}/data_science_mcp/launch/__init__.py +0 -0
- {data_science_mcp-2.3.1 → data_science_mcp-2.3.3}/data_science_mcp/launch/launch.py +0 -0
- {data_science_mcp-2.3.1 → data_science_mcp-2.3.3}/data_science_mcp/mcp/__init__.py +0 -0
- {data_science_mcp-2.3.1 → data_science_mcp-2.3.3}/data_science_mcp/mcp/mcp_data_engine.py +0 -0
- {data_science_mcp-2.3.1 → data_science_mcp-2.3.3}/data_science_mcp/mcp/mcp_deep_delegate.py +0 -0
- {data_science_mcp-2.3.1 → data_science_mcp-2.3.3}/data_science_mcp/mcp/mcp_quant.py +0 -0
- {data_science_mcp-2.3.1 → data_science_mcp-2.3.3}/data_science_mcp/mcp/mcp_trainers.py +0 -0
- {data_science_mcp-2.3.1 → data_science_mcp-2.3.3}/data_science_mcp/mcp/mcp_training_data.py +0 -0
- {data_science_mcp-2.3.1 → data_science_mcp-2.3.3}/data_science_mcp/mcp_config.json +0 -0
- {data_science_mcp-2.3.1 → data_science_mcp-2.3.3}/data_science_mcp/ontology/__init__.py +0 -0
- {data_science_mcp-2.3.1 → data_science_mcp-2.3.3}/data_science_mcp/ontology/certification.json +0 -0
- {data_science_mcp-2.3.1 → data_science_mcp-2.3.3}/data_science_mcp/ontology/datascience.ttl +0 -0
- {data_science_mcp-2.3.1 → data_science_mcp-2.3.3}/data_science_mcp/ontology/fixtures/records.json +0 -0
- {data_science_mcp-2.3.1 → data_science_mcp-2.3.3}/data_science_mcp/ontology/mappings/source.yaml +0 -0
- {data_science_mcp-2.3.1 → data_science_mcp-2.3.3}/data_science_mcp/ontology/migrations/manifest.json +0 -0
- {data_science_mcp-2.3.1 → data_science_mcp-2.3.3}/data_science_mcp/ontology/shapes/connector.shacl.ttl +0 -0
- {data_science_mcp-2.3.1 → data_science_mcp-2.3.3}/data_science_mcp/path_policy.py +0 -0
- {data_science_mcp-2.3.1 → data_science_mcp-2.3.3}/data_science_mcp/peft_manager.py +0 -0
- {data_science_mcp-2.3.1 → data_science_mcp-2.3.3}/data_science_mcp/prompts/__init__.py +0 -0
- {data_science_mcp-2.3.1 → data_science_mcp-2.3.3}/data_science_mcp/prompts/datascience_specialist.json +0 -0
- {data_science_mcp-2.3.1 → data_science_mcp-2.3.3}/data_science_mcp/reward_signals.py +0 -0
- {data_science_mcp-2.3.1 → data_science_mcp-2.3.3}/data_science_mcp/rollout_buffer.py +0 -0
- {data_science_mcp-2.3.1 → data_science_mcp-2.3.3}/data_science_mcp/search_task_corpus.py +0 -0
- {data_science_mcp-2.3.1 → data_science_mcp-2.3.3}/data_science_mcp/skills/__init__.py +0 -0
- {data_science_mcp-2.3.1 → data_science_mcp-2.3.3}/data_science_mcp/skills/data-science-llm-finetuning/SKILL.md +0 -0
- {data_science_mcp-2.3.1 → data_science_mcp-2.3.3}/data_science_mcp/skills/data-science-llm-finetuning/WORKFLOW.md +0 -0
- {data_science_mcp-2.3.1 → data_science_mcp-2.3.3}/data_science_mcp/skills/data-science-mcp-operations/SKILL.md +0 -0
- {data_science_mcp-2.3.1 → data_science_mcp-2.3.3}/data_science_mcp/skills/data-science-mcp-operations/agents/openai.yaml +0 -0
- {data_science_mcp-2.3.1 → data_science_mcp-2.3.3}/data_science_mcp/skills/data-science-mcp-operations/references/catalog.md +0 -0
- {data_science_mcp-2.3.1 → data_science_mcp-2.3.3}/data_science_mcp/skills/data-science-model-reliability/SKILL.md +0 -0
- {data_science_mcp-2.3.1 → data_science_mcp-2.3.3}/data_science_mcp/skills/data-science-model-reliability/WORKFLOW.md +0 -0
- {data_science_mcp-2.3.1 → data_science_mcp-2.3.3}/data_science_mcp/skills/data-science-model-training/SKILL.md +0 -0
- {data_science_mcp-2.3.1 → data_science_mcp-2.3.3}/data_science_mcp/skills/data-science-model-training/WORKFLOW.md +0 -0
- {data_science_mcp-2.3.1 → data_science_mcp-2.3.3}/data_science_mcp/tokenizer_registry.py +0 -0
- {data_science_mcp-2.3.1 → data_science_mcp-2.3.3}/data_science_mcp/tokenizer_trainer.py +0 -0
- {data_science_mcp-2.3.1 → data_science_mcp-2.3.3}/data_science_mcp/tracking.py +0 -0
- {data_science_mcp-2.3.1 → data_science_mcp-2.3.3}/data_science_mcp/trainers/__init__.py +0 -0
- {data_science_mcp-2.3.1 → data_science_mcp-2.3.3}/data_science_mcp/trainers/accelerate_launch.py +0 -0
- {data_science_mcp-2.3.1 → data_science_mcp-2.3.3}/data_science_mcp/trainers/base.py +0 -0
- {data_science_mcp-2.3.1 → data_science_mcp-2.3.3}/data_science_mcp/trainers/dpo_trainer.py +0 -0
- {data_science_mcp-2.3.1 → data_science_mcp-2.3.3}/data_science_mcp/trainers/eval_hooks.py +0 -0
- {data_science_mcp-2.3.1 → data_science_mcp-2.3.3}/data_science_mcp/trainers/grpo_trainer.py +0 -0
- {data_science_mcp-2.3.1 → data_science_mcp-2.3.3}/data_science_mcp/trainers/loop.py +0 -0
- {data_science_mcp-2.3.1 → data_science_mcp-2.3.3}/data_science_mcp/trainers/objectives.py +0 -0
- {data_science_mcp-2.3.1 → data_science_mcp-2.3.3}/data_science_mcp/trainers/ppo_trainer.py +0 -0
- {data_science_mcp-2.3.1 → data_science_mcp-2.3.3}/data_science_mcp/trainers/pretrain_trainer.py +0 -0
- {data_science_mcp-2.3.1 → data_science_mcp-2.3.3}/data_science_mcp/trainers/reward_trainer.py +0 -0
- {data_science_mcp-2.3.1 → data_science_mcp-2.3.3}/data_science_mcp/trainers/sft_trainer.py +0 -0
- {data_science_mcp-2.3.1 → data_science_mcp-2.3.3}/data_science_mcp/trainers/value_head.py +0 -0
- {data_science_mcp-2.3.1 → data_science_mcp-2.3.3}/data_science_mcp/training/__init__.py +0 -0
- {data_science_mcp-2.3.1 → data_science_mcp-2.3.3}/data_science_mcp/training/deep_delegate.py +0 -0
- {data_science_mcp-2.3.1 → data_science_mcp-2.3.3}/data_science_mcp/training/pause_token_trainer.py +0 -0
- {data_science_mcp-2.3.1 → data_science_mcp-2.3.3}/data_science_mcp/training/trading_lstm.py +0 -0
- {data_science_mcp-2.3.1 → data_science_mcp-2.3.3}/data_science_mcp/training_data.py +0 -0
- {data_science_mcp-2.3.1 → data_science_mcp-2.3.3}/data_science_mcp/training_pipeline.py +0 -0
- {data_science_mcp-2.3.1 → data_science_mcp-2.3.3}/data_science_mcp.egg-info/dependency_links.txt +0 -0
- {data_science_mcp-2.3.1 → data_science_mcp-2.3.3}/data_science_mcp.egg-info/entry_points.txt +0 -0
- {data_science_mcp-2.3.1 → data_science_mcp-2.3.3}/data_science_mcp.egg-info/top_level.txt +0 -0
- {data_science_mcp-2.3.1 → data_science_mcp-2.3.3}/scripts/security_contract.py +0 -0
- {data_science_mcp-2.3.1 → data_science_mcp-2.3.3}/scripts/security_sanitizer.py +0 -0
- {data_science_mcp-2.3.1 → data_science_mcp-2.3.3}/setup.cfg +0 -0
- {data_science_mcp-2.3.1 → data_science_mcp-2.3.3}/tests/test_adapter_library.py +0 -0
- {data_science_mcp-2.3.1 → data_science_mcp-2.3.3}/tests/test_auth.py +0 -0
- {data_science_mcp-2.3.1 → data_science_mcp-2.3.3}/tests/test_cache_agent_loop.py +0 -0
- {data_science_mcp-2.3.1 → data_science_mcp-2.3.3}/tests/test_data_engine.py +0 -0
- {data_science_mcp-2.3.1 → data_science_mcp-2.3.3}/tests/test_data_engine_boundaries.py +0 -0
- {data_science_mcp-2.3.1 → data_science_mcp-2.3.3}/tests/test_deep_delegate.py +0 -0
- {data_science_mcp-2.3.1 → data_science_mcp-2.3.3}/tests/test_hf_revision_security.py +0 -0
- {data_science_mcp-2.3.1 → data_science_mcp-2.3.3}/tests/test_inference_backends.py +0 -0
- {data_science_mcp-2.3.1 → data_science_mcp-2.3.3}/tests/test_init_dynamics.py +0 -0
- {data_science_mcp-2.3.1 → data_science_mcp-2.3.3}/tests/test_kernel_sandbox_security.py +0 -0
- {data_science_mcp-2.3.1 → data_science_mcp-2.3.3}/tests/test_kernel_verifier.py +0 -0
- {data_science_mcp-2.3.1 → data_science_mcp-2.3.3}/tests/test_kg_ingest.py +0 -0
- {data_science_mcp-2.3.1 → data_science_mcp-2.3.3}/tests/test_launch.py +0 -0
- {data_science_mcp-2.3.1 → data_science_mcp-2.3.3}/tests/test_lora_hotload.py +0 -0
- {data_science_mcp-2.3.1 → data_science_mcp-2.3.3}/tests/test_mcp_quant.py +0 -0
- {data_science_mcp-2.3.1 → data_science_mcp-2.3.3}/tests/test_mcp_tools.py +0 -0
- {data_science_mcp-2.3.1 → data_science_mcp-2.3.3}/tests/test_path_policy.py +0 -0
- {data_science_mcp-2.3.1 → data_science_mcp-2.3.3}/tests/test_pause_token_trainer.py +0 -0
- {data_science_mcp-2.3.1 → data_science_mcp-2.3.3}/tests/test_ppo_trainer.py +0 -0
- {data_science_mcp-2.3.1 → data_science_mcp-2.3.3}/tests/test_pretrain.py +0 -0
- {data_science_mcp-2.3.1 → data_science_mcp-2.3.3}/tests/test_pretrain_data.py +0 -0
- {data_science_mcp-2.3.1 → data_science_mcp-2.3.3}/tests/test_reward_trainer.py +0 -0
- {data_science_mcp-2.3.1 → data_science_mcp-2.3.3}/tests/test_rust_engine.py +0 -0
- {data_science_mcp-2.3.1 → data_science_mcp-2.3.3}/tests/test_search_task_corpus.py +0 -0
- {data_science_mcp-2.3.1 → data_science_mcp-2.3.3}/tests/test_startup.py +0 -0
- {data_science_mcp-2.3.1 → data_science_mcp-2.3.3}/tests/test_trading_lstm.py +0 -0
- {data_science_mcp-2.3.1 → data_science_mcp-2.3.3}/tests/test_trainer_hardening.py +0 -0
- {data_science_mcp-2.3.1 → data_science_mcp-2.3.3}/tests/test_trainers.py +0 -0
- {data_science_mcp-2.3.1 → data_science_mcp-2.3.3}/tests/test_training_data.py +0 -0
- {data_science_mcp-2.3.1 → data_science_mcp-2.3.3}/tests/test_training_pipeline.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: data-science-mcp
|
|
3
|
-
Version: 2.3.
|
|
3
|
+
Version: 2.3.3
|
|
4
4
|
Summary: Data Science MCP Server — Model training, evaluation, and evolution tools for agentic ML workflows. Exposes training, evaluation and evolution as MCP tools.
|
|
5
5
|
Author-email: Audel Rouhi <knucklessg1@gmail.com>
|
|
6
6
|
License: MIT
|
|
@@ -12,13 +12,13 @@ Classifier: Programming Language :: Python :: 3
|
|
|
12
12
|
Requires-Python: <3.15,>=3.12
|
|
13
13
|
Description-Content-Type: text/markdown
|
|
14
14
|
License-File: LICENSE
|
|
15
|
-
Requires-Dist: agent-connector-sdk[mcp]<1.0.0,>=0.3.
|
|
15
|
+
Requires-Dist: agent-connector-sdk[mcp]<1.0.0,>=0.3.10
|
|
16
16
|
Requires-Dist: requests>=2.34.2
|
|
17
17
|
Requires-Dist: epistemic-graph[full]>=2.27.1
|
|
18
18
|
Requires-Dist: polars>=2.0.0
|
|
19
19
|
Requires-Dist: numpy>=2.5.4
|
|
20
20
|
Provides-Extra: mcp
|
|
21
|
-
Requires-Dist: agent-connector-sdk[mcp]<1.0.0,>=0.3.
|
|
21
|
+
Requires-Dist: agent-connector-sdk[mcp]<1.0.0,>=0.3.10; extra == "mcp"
|
|
22
22
|
Provides-Extra: datasets
|
|
23
23
|
Requires-Dist: scikit-learn>=1.9.1; extra == "datasets"
|
|
24
24
|
Provides-Extra: training
|
|
@@ -65,7 +65,7 @@ Dynamic: license-file
|
|
|
65
65
|

|
|
66
66
|

|
|
67
67
|
|
|
68
|
-
*Version: 2.3.
|
|
68
|
+
*Version: 2.3.3*
|
|
69
69
|
|
|
70
70
|
> **Documentation** — Installation, deployment, usage across the MCP, Python API, and
|
|
71
71
|
> CLI interfaces, and the in-house model-training substrate are maintained in the
|
|
@@ -385,9 +385,9 @@ the detailed transport contract.
|
|
|
385
385
|
| `INFERENCE_BASE_URL` | — | Base URL of the running inference server, e.g. http://host:30000 |
|
|
386
386
|
| `INFERENCE_MODEL` | — | Served model id exposed by the inference server. |
|
|
387
387
|
| `INFERENCE_API_KEY` | secret-injected | Bearer token for the inference server (default "EMPTY" for local servers). |
|
|
388
|
-
| `
|
|
389
|
-
| `
|
|
390
|
-
| `
|
|
388
|
+
| `EPISTEMIC_GRAPH_ENDPOINT` | — | Engine endpoint: `tls://host:port` or `unix:///path`. |
|
|
389
|
+
| `EPISTEMIC_GRAPH_AUTH_SECRET_REF` | — | Secret reference to the engine auth secret (e.g. `env://GRAPH_SERVICE_AUTH_SECRET`). |
|
|
390
|
+
| `EPISTEMIC_GRAPH_TENANT` / `EPISTEMIC_GRAPH_GRAPH` | — | Tenant and graph the compute session signs for. |
|
|
391
391
|
| `DSM_NEAR_PAIRS_LOCAL_MAX` | `20000` | Cap on local O(n^2) near-pair fallback before requiring the Rust path (0 disables the cap). |
|
|
392
392
|
| `MODEL_TRAININGTOOL` | `True` | |
|
|
393
393
|
| `MODEL_EVOLUTIONTOOL` | `True` | |
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|

|
|
21
21
|

|
|
22
22
|
|
|
23
|
-
*Version: 2.3.
|
|
23
|
+
*Version: 2.3.3*
|
|
24
24
|
|
|
25
25
|
> **Documentation** — Installation, deployment, usage across the MCP, Python API, and
|
|
26
26
|
> CLI interfaces, and the in-house model-training substrate are maintained in the
|
|
@@ -340,9 +340,9 @@ the detailed transport contract.
|
|
|
340
340
|
| `INFERENCE_BASE_URL` | — | Base URL of the running inference server, e.g. http://host:30000 |
|
|
341
341
|
| `INFERENCE_MODEL` | — | Served model id exposed by the inference server. |
|
|
342
342
|
| `INFERENCE_API_KEY` | secret-injected | Bearer token for the inference server (default "EMPTY" for local servers). |
|
|
343
|
-
| `
|
|
344
|
-
| `
|
|
345
|
-
| `
|
|
343
|
+
| `EPISTEMIC_GRAPH_ENDPOINT` | — | Engine endpoint: `tls://host:port` or `unix:///path`. |
|
|
344
|
+
| `EPISTEMIC_GRAPH_AUTH_SECRET_REF` | — | Secret reference to the engine auth secret (e.g. `env://GRAPH_SERVICE_AUTH_SECRET`). |
|
|
345
|
+
| `EPISTEMIC_GRAPH_TENANT` / `EPISTEMIC_GRAPH_GRAPH` | — | Tenant and graph the compute session signs for. |
|
|
346
346
|
| `DSM_NEAR_PAIRS_LOCAL_MAX` | `20000` | Cap on local O(n^2) near-pair fallback before requiring the Rust path (0 disables the cap). |
|
|
347
347
|
| `MODEL_TRAININGTOOL` | `True` | |
|
|
348
348
|
| `MODEL_EVOLUTIONTOOL` | `True` | |
|
|
@@ -33,7 +33,8 @@ import json
|
|
|
33
33
|
import logging
|
|
34
34
|
import os
|
|
35
35
|
import re
|
|
36
|
-
from
|
|
36
|
+
from collections.abc import Callable, Iterable, Iterator
|
|
37
|
+
from typing import Any
|
|
37
38
|
|
|
38
39
|
import numpy as np
|
|
39
40
|
|
|
@@ -83,9 +84,9 @@ def _open_text(path: str) -> Any:
|
|
|
83
84
|
"""
|
|
84
85
|
if path.endswith(".zst"):
|
|
85
86
|
try:
|
|
86
|
-
import io
|
|
87
|
+
import io
|
|
87
88
|
|
|
88
|
-
import zstandard
|
|
89
|
+
import zstandard
|
|
89
90
|
except ImportError as e: # pragma: no cover - without the extra
|
|
90
91
|
raise RuntimeError(
|
|
91
92
|
"zstandard is required to stream .zst corpora; install "
|
|
@@ -99,13 +100,13 @@ def _open_text(path: str) -> Any:
|
|
|
99
100
|
|
|
100
101
|
def _stream_hf(spec: dict[str, Any], default_split: str) -> Iterator[dict[str, Any]]:
|
|
101
102
|
try:
|
|
102
|
-
from datasets import load_dataset
|
|
103
|
+
from datasets import load_dataset
|
|
103
104
|
except ImportError as e: # pragma: no cover - without the extra
|
|
104
105
|
raise RuntimeError(
|
|
105
106
|
"huggingface `datasets` is required for hf corpus specs; install "
|
|
106
107
|
"`data-science-mcp[training]`"
|
|
107
108
|
) from e
|
|
108
|
-
from data_science_mcp.hf_security import require_pinned_revision
|
|
109
|
+
from data_science_mcp.hf_security import require_pinned_revision
|
|
109
110
|
|
|
110
111
|
revision = require_pinned_revision(spec["hf"], spec.get("revision"))
|
|
111
112
|
ds = load_dataset(
|
|
@@ -168,7 +169,7 @@ def _near_pairs_engine(
|
|
|
168
169
|
``SyncEpistemicGraphClient.connect()`` here leaked one of each on every dedup.
|
|
169
170
|
"""
|
|
170
171
|
try: # pragma: no cover - requires a live engine + matching client
|
|
171
|
-
from .ml_engine import MLEngine
|
|
172
|
+
from .ml_engine import MLEngine
|
|
172
173
|
|
|
173
174
|
client = MLEngine._rust_client()
|
|
174
175
|
if client is None:
|
|
@@ -222,13 +223,13 @@ def near_duplicate_pairs(
|
|
|
222
223
|
raise RuntimeError(
|
|
223
224
|
f"near_duplicate_pairs: epistemic-graph engine unavailable and "
|
|
224
225
|
f"n={n} exceeds the local O(n^2) cap ({_NEAR_PAIRS_LOCAL_MAX}). "
|
|
225
|
-
f"Start the engine (
|
|
226
|
+
f"Start the engine (EPISTEMIC_GRAPH_ENDPOINT) "
|
|
226
227
|
f"for the Rust LSH/HNSW path, raise DSM_NEAR_PAIRS_LOCAL_MAX, or "
|
|
227
228
|
f"call with use_engine=False to force the local path."
|
|
228
229
|
)
|
|
229
230
|
logger.warning(
|
|
230
231
|
"near_duplicate_pairs: engine unavailable; falling back to local "
|
|
231
|
-
"O(n^2) cosine for n=%d (set
|
|
232
|
+
"O(n^2) cosine for n=%d (set EPISTEMIC_GRAPH_ENDPOINT for the Rust "
|
|
232
233
|
"LSH/HNSW path)",
|
|
233
234
|
n,
|
|
234
235
|
)
|
|
@@ -410,7 +411,7 @@ def prepare_pretrain_data(
|
|
|
410
411
|
try:
|
|
411
412
|
if is_h5:
|
|
412
413
|
try:
|
|
413
|
-
import h5py
|
|
414
|
+
import h5py
|
|
414
415
|
except ImportError as e: # pragma: no cover - without the extra
|
|
415
416
|
raise RuntimeError(
|
|
416
417
|
"h5py is required for HDF5 token output; install "
|
|
@@ -479,7 +480,7 @@ def prepare_pretrain_data(
|
|
|
479
480
|
def load_token_array(path: str) -> np.ndarray:
|
|
480
481
|
"""Load the flat token array written by :func:`prepare_pretrain_data`."""
|
|
481
482
|
if path.endswith((".h5", ".hdf5")):
|
|
482
|
-
import h5py
|
|
483
|
+
import h5py
|
|
483
484
|
|
|
484
485
|
with h5py.File(path, "r") as f:
|
|
485
486
|
return f["tokens"][:]
|
|
@@ -544,21 +545,21 @@ def dataset_provenance(
|
|
|
544
545
|
|
|
545
546
|
|
|
546
547
|
def _kg_write(payload: dict[str, Any]) -> None:
|
|
547
|
-
from data_science_mcp.kg_log import log_provenance
|
|
548
|
+
from data_science_mcp.kg_log import log_provenance
|
|
548
549
|
|
|
549
550
|
log_provenance(payload)
|
|
550
551
|
|
|
551
552
|
|
|
552
553
|
__all__ = [
|
|
553
|
-
"
|
|
554
|
+
"dataset_provenance",
|
|
555
|
+
"decontaminate",
|
|
556
|
+
"dedup",
|
|
554
557
|
"feature_vector",
|
|
558
|
+
"load_token_array",
|
|
555
559
|
"near_duplicate_pairs",
|
|
556
|
-
"dedup",
|
|
557
|
-
"decontaminate",
|
|
558
|
-
"quality_filter",
|
|
559
560
|
"pack_sequences",
|
|
560
561
|
"prepare_pretrain_data",
|
|
561
|
-
"
|
|
562
|
+
"quality_filter",
|
|
562
563
|
"read_token_blocks",
|
|
563
|
-
"
|
|
564
|
+
"stream_corpus",
|
|
564
565
|
]
|
|
@@ -38,7 +38,7 @@ from agent_connector_sdk.mcp.tool_surface import register_tool_surface
|
|
|
38
38
|
from fastmcp import Context, FastMCP
|
|
39
39
|
from pydantic import Field
|
|
40
40
|
|
|
41
|
-
__version__ = "2.3.
|
|
41
|
+
__version__ = "2.3.3"
|
|
42
42
|
|
|
43
43
|
# Redirect logging to stderr to prevent MCP stdout corruption
|
|
44
44
|
logger = logging.getLogger("MCP_Server")
|
|
@@ -17,7 +17,7 @@ from __future__ import annotations
|
|
|
17
17
|
import logging
|
|
18
18
|
import os
|
|
19
19
|
import uuid
|
|
20
|
-
from typing import Any
|
|
20
|
+
from typing import Any, ClassVar, Self
|
|
21
21
|
|
|
22
22
|
logger = logging.getLogger(__name__)
|
|
23
23
|
|
|
@@ -63,10 +63,14 @@ _RUST_PARAM_KEYS = {
|
|
|
63
63
|
}
|
|
64
64
|
|
|
65
65
|
_ENGINE_REQUIRED_ERR = (
|
|
66
|
-
"epistemic-graph engine unavailable. Set
|
|
67
|
-
"
|
|
66
|
+
"epistemic-graph engine unavailable. Set EPISTEMIC_GRAPH_ENDPOINT, "
|
|
67
|
+
"EPISTEMIC_GRAPH_AUTH_SECRET_REF, EPISTEMIC_GRAPH_TENANT and "
|
|
68
|
+
"EPISTEMIC_GRAPH_GRAPH, and ensure the engine is running."
|
|
68
69
|
)
|
|
69
70
|
|
|
71
|
+
#: Engine scopes the compute session signs: data-science and finance compute.
|
|
72
|
+
ENGINE_SCOPES = ("compute:datascience", "compute:finance", "sparql:read")
|
|
73
|
+
|
|
70
74
|
# Sentinel so a cached None ("engine not reachable") is distinct from "unprobed".
|
|
71
75
|
_UNPROBED = object()
|
|
72
76
|
|
|
@@ -79,11 +83,11 @@ class MLEngine:
|
|
|
79
83
|
"""
|
|
80
84
|
|
|
81
85
|
_instance: MLEngine | None = None
|
|
82
|
-
_datasets: dict[str, dict[str, Any]] = {}
|
|
83
|
-
_models: dict[str, dict[str, Any]] = {}
|
|
86
|
+
_datasets: ClassVar[dict[str, dict[str, Any]]] = {}
|
|
87
|
+
_models: ClassVar[dict[str, dict[str, Any]]] = {}
|
|
84
88
|
_rust_client_cache: Any = _UNPROBED
|
|
85
89
|
|
|
86
|
-
def __new__(cls) ->
|
|
90
|
+
def __new__(cls) -> Self:
|
|
87
91
|
"""Singleton pattern for cross-tool state sharing."""
|
|
88
92
|
if cls._instance is None:
|
|
89
93
|
cls._instance = super().__new__(cls)
|
|
@@ -92,34 +96,32 @@ class MLEngine:
|
|
|
92
96
|
# ── Rust epistemic-graph engine integration (CONCEPT:EG-KG.compute.rust-native-training-loss) ──────
|
|
93
97
|
@classmethod
|
|
94
98
|
def _rust_client(cls) -> Any:
|
|
95
|
-
"""Return a cached
|
|
96
|
-
|
|
97
|
-
Connects
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
99
|
+
"""Return a cached connected engine client, or None if unreachable.
|
|
100
|
+
|
|
101
|
+
Connects through the connector SDK's compute adapter from
|
|
102
|
+
``EPISTEMIC_GRAPH_ENDPOINT`` (``tls://host:port`` or ``unix:///path``),
|
|
103
|
+
``EPISTEMIC_GRAPH_AUTH_SECRET_REF``, ``EPISTEMIC_GRAPH_TENANT`` and
|
|
104
|
+
``EPISTEMIC_GRAPH_GRAPH``, signing a verified request context with the
|
|
105
|
+
data-science and finance compute scopes. The result (including a failed
|
|
106
|
+
probe) is cached so a dead endpoint is never re-probed per call. The
|
|
107
|
+
failure cause is logged by type only; it never carries a secret.
|
|
102
108
|
"""
|
|
103
109
|
if cls._rust_client_cache is not _UNPROBED:
|
|
104
110
|
return cls._rust_client_cache
|
|
105
111
|
|
|
106
112
|
client = None
|
|
107
|
-
primary_socket = os.environ.get("EPISTEMIC_GRAPH_SOCKET")
|
|
108
|
-
legacy_socket = os.environ.get("GRAPH_SERVICE_SOCKET")
|
|
109
|
-
socket_path = primary_socket or legacy_socket
|
|
110
|
-
tcp_addr = os.environ.get("EPISTEMIC_GRAPH_TCP")
|
|
111
113
|
try:
|
|
112
|
-
from
|
|
114
|
+
from agent_connector_sdk.compute.engine import connect_compute
|
|
113
115
|
|
|
114
|
-
|
|
115
|
-
client = SyncEpistemicGraphClient.connect(tcp_addr=tcp_addr)
|
|
116
|
-
elif socket_path:
|
|
117
|
-
client = SyncEpistemicGraphClient.connect(socket_path=socket_path)
|
|
118
|
-
else:
|
|
119
|
-
client = SyncEpistemicGraphClient.connect()
|
|
116
|
+
client = connect_compute(scopes=ENGINE_SCOPES).client
|
|
120
117
|
logger.info("epistemic-graph engine connected; Rust compute enabled")
|
|
121
|
-
except Exception as exc:
|
|
122
|
-
|
|
118
|
+
except Exception as exc:
|
|
119
|
+
cause = exc.__cause__ or exc
|
|
120
|
+
logger.warning(
|
|
121
|
+
"epistemic-graph engine unavailable: error_type=%s cause_type=%s",
|
|
122
|
+
type(exc).__name__,
|
|
123
|
+
type(cause).__name__,
|
|
124
|
+
)
|
|
123
125
|
client = None
|
|
124
126
|
cls._rust_client_cache = client
|
|
125
127
|
return client
|
|
@@ -465,7 +467,7 @@ class MLEngine:
|
|
|
465
467
|
"feature_names": data["feature_names"],
|
|
466
468
|
"backend": "rust",
|
|
467
469
|
}
|
|
468
|
-
except Exception as exc:
|
|
470
|
+
except Exception as exc:
|
|
469
471
|
logger.error("Rust OLS fit failed: error_type=%s", type(exc).__name__)
|
|
470
472
|
return None
|
|
471
473
|
|
|
@@ -535,7 +537,7 @@ class MLEngine:
|
|
|
535
537
|
"feature_names": data["feature_names"],
|
|
536
538
|
"backend": "rust_estimator",
|
|
537
539
|
}
|
|
538
|
-
except Exception as exc:
|
|
540
|
+
except Exception as exc:
|
|
539
541
|
logger.error(
|
|
540
542
|
"Rust estimator fit failed: error_type=%s", type(exc).__name__
|
|
541
543
|
)
|
|
@@ -716,7 +718,7 @@ class MLEngine:
|
|
|
716
718
|
current = 0
|
|
717
719
|
for fs in fold_sizes:
|
|
718
720
|
test_idx = list(range(current, current + int(fs)))
|
|
719
|
-
train_idx = list(range(
|
|
721
|
+
train_idx = list(range(current)) + list(range(current + int(fs), n))
|
|
720
722
|
current += int(fs)
|
|
721
723
|
|
|
722
724
|
reg = client.datascience.linear_regression(
|
|
@@ -730,7 +732,7 @@ class MLEngine:
|
|
|
730
732
|
return self._cv_summary(
|
|
731
733
|
model_class, dataset_name, n_folds, rmse_scores, "rust"
|
|
732
734
|
)
|
|
733
|
-
except Exception as exc:
|
|
735
|
+
except Exception as exc:
|
|
734
736
|
logger.error(
|
|
735
737
|
"Rust OLS cross-validation failed: error_type=%s",
|
|
736
738
|
type(exc).__name__,
|
|
@@ -765,7 +767,7 @@ class MLEngine:
|
|
|
765
767
|
current = 0
|
|
766
768
|
for fs in fold_sizes:
|
|
767
769
|
test_idx = list(range(current, current + int(fs)))
|
|
768
|
-
train_idx = list(range(
|
|
770
|
+
train_idx = list(range(current)) + list(range(current + int(fs), n))
|
|
769
771
|
current += int(fs)
|
|
770
772
|
|
|
771
773
|
blob = client.datascience.fit_estimator(
|
|
@@ -779,7 +781,7 @@ class MLEngine:
|
|
|
779
781
|
return self._cv_summary(
|
|
780
782
|
model_class, dataset_name, n_folds, rmse_scores, "rust_estimator"
|
|
781
783
|
)
|
|
782
|
-
except Exception as exc:
|
|
784
|
+
except Exception as exc:
|
|
783
785
|
logger.error(
|
|
784
786
|
"Rust estimator cross-validation failed: error_type=%s",
|
|
785
787
|
type(exc).__name__,
|
|
@@ -884,7 +886,7 @@ class MLEngine:
|
|
|
884
886
|
},
|
|
885
887
|
"backend": "rust",
|
|
886
888
|
}
|
|
887
|
-
except Exception as exc:
|
|
889
|
+
except Exception as exc:
|
|
888
890
|
logger.warning("Operation failed: error_type=%s", type(exc).__name__)
|
|
889
891
|
return None
|
|
890
892
|
|
|
@@ -956,7 +958,7 @@ class MLEngine:
|
|
|
956
958
|
result["total"] = total
|
|
957
959
|
result["backend"] = "rust"
|
|
958
960
|
return result
|
|
959
|
-
except Exception as exc:
|
|
961
|
+
except Exception as exc:
|
|
960
962
|
logger.warning("Operation failed: error_type=%s", type(exc).__name__)
|
|
961
963
|
return None
|
|
962
964
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: data-science-mcp
|
|
3
|
-
Version: 2.3.
|
|
3
|
+
Version: 2.3.3
|
|
4
4
|
Summary: Data Science MCP Server — Model training, evaluation, and evolution tools for agentic ML workflows. Exposes training, evaluation and evolution as MCP tools.
|
|
5
5
|
Author-email: Audel Rouhi <knucklessg1@gmail.com>
|
|
6
6
|
License: MIT
|
|
@@ -12,13 +12,13 @@ Classifier: Programming Language :: Python :: 3
|
|
|
12
12
|
Requires-Python: <3.15,>=3.12
|
|
13
13
|
Description-Content-Type: text/markdown
|
|
14
14
|
License-File: LICENSE
|
|
15
|
-
Requires-Dist: agent-connector-sdk[mcp]<1.0.0,>=0.3.
|
|
15
|
+
Requires-Dist: agent-connector-sdk[mcp]<1.0.0,>=0.3.10
|
|
16
16
|
Requires-Dist: requests>=2.34.2
|
|
17
17
|
Requires-Dist: epistemic-graph[full]>=2.27.1
|
|
18
18
|
Requires-Dist: polars>=2.0.0
|
|
19
19
|
Requires-Dist: numpy>=2.5.4
|
|
20
20
|
Provides-Extra: mcp
|
|
21
|
-
Requires-Dist: agent-connector-sdk[mcp]<1.0.0,>=0.3.
|
|
21
|
+
Requires-Dist: agent-connector-sdk[mcp]<1.0.0,>=0.3.10; extra == "mcp"
|
|
22
22
|
Provides-Extra: datasets
|
|
23
23
|
Requires-Dist: scikit-learn>=1.9.1; extra == "datasets"
|
|
24
24
|
Provides-Extra: training
|
|
@@ -65,7 +65,7 @@ Dynamic: license-file
|
|
|
65
65
|

|
|
66
66
|

|
|
67
67
|
|
|
68
|
-
*Version: 2.3.
|
|
68
|
+
*Version: 2.3.3*
|
|
69
69
|
|
|
70
70
|
> **Documentation** — Installation, deployment, usage across the MCP, Python API, and
|
|
71
71
|
> CLI interfaces, and the in-house model-training substrate are maintained in the
|
|
@@ -385,9 +385,9 @@ the detailed transport contract.
|
|
|
385
385
|
| `INFERENCE_BASE_URL` | — | Base URL of the running inference server, e.g. http://host:30000 |
|
|
386
386
|
| `INFERENCE_MODEL` | — | Served model id exposed by the inference server. |
|
|
387
387
|
| `INFERENCE_API_KEY` | secret-injected | Bearer token for the inference server (default "EMPTY" for local servers). |
|
|
388
|
-
| `
|
|
389
|
-
| `
|
|
390
|
-
| `
|
|
388
|
+
| `EPISTEMIC_GRAPH_ENDPOINT` | — | Engine endpoint: `tls://host:port` or `unix:///path`. |
|
|
389
|
+
| `EPISTEMIC_GRAPH_AUTH_SECRET_REF` | — | Secret reference to the engine auth secret (e.g. `env://GRAPH_SERVICE_AUTH_SECRET`). |
|
|
390
|
+
| `EPISTEMIC_GRAPH_TENANT` / `EPISTEMIC_GRAPH_GRAPH` | — | Tenant and graph the compute session signs for. |
|
|
391
391
|
| `DSM_NEAR_PAIRS_LOCAL_MAX` | `20000` | Cap on local O(n^2) near-pair fallback before requiring the Rust path (0 disables the cap). |
|
|
392
392
|
| `MODEL_TRAININGTOOL` | `True` | |
|
|
393
393
|
| `MODEL_EVOLUTIONTOOL` | `True` | |
|
|
@@ -100,6 +100,8 @@ tests/test_cache_agent_loop.py
|
|
|
100
100
|
tests/test_data_engine.py
|
|
101
101
|
tests/test_data_engine_boundaries.py
|
|
102
102
|
tests/test_deep_delegate.py
|
|
103
|
+
tests/test_engine_audience.py
|
|
104
|
+
tests/test_engine_connection.py
|
|
103
105
|
tests/test_hf_revision_security.py
|
|
104
106
|
tests/test_inference_backends.py
|
|
105
107
|
tests/test_init_dynamics.py
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
agent-connector-sdk[mcp]<1.0.0,>=0.3.
|
|
1
|
+
agent-connector-sdk[mcp]<1.0.0,>=0.3.10
|
|
2
2
|
requests>=2.34.2
|
|
3
3
|
epistemic-graph[full]>=2.27.1
|
|
4
4
|
polars>=2.0.0
|
|
@@ -15,7 +15,7 @@ scikit-learn>=1.9.1
|
|
|
15
15
|
lighteval>=0.13.0
|
|
16
16
|
|
|
17
17
|
[mcp]
|
|
18
|
-
agent-connector-sdk[mcp]<1.0.0,>=0.3.
|
|
18
|
+
agent-connector-sdk[mcp]<1.0.0,>=0.3.10
|
|
19
19
|
|
|
20
20
|
[training]
|
|
21
21
|
torch>=2.14.1
|
|
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "data-science-mcp"
|
|
7
|
-
version = "2.3.
|
|
7
|
+
version = "2.3.3"
|
|
8
8
|
description = "Data Science MCP Server — Model training, evaluation, and evolution tools for agentic ML workflows. Exposes training, evaluation and evolution as MCP tools."
|
|
9
9
|
readme = "README.md"
|
|
10
10
|
authors = [{ name = "Audel Rouhi", email = "knucklessg1@gmail.com" }]
|
|
@@ -17,7 +17,7 @@ classifiers = [
|
|
|
17
17
|
"Programming Language :: Python :: 3"]
|
|
18
18
|
requires-python = ">=3.12,<3.15"
|
|
19
19
|
dependencies = [
|
|
20
|
-
"agent-connector-sdk[mcp]>=0.3.
|
|
20
|
+
"agent-connector-sdk[mcp]>=0.3.10,<1.0.0",
|
|
21
21
|
"requests>=2.34.2",
|
|
22
22
|
"epistemic-graph[full]>=2.27.1",
|
|
23
23
|
"polars>=2.0.0",
|
|
@@ -26,7 +26,7 @@ dependencies = [
|
|
|
26
26
|
|
|
27
27
|
[project.optional-dependencies]
|
|
28
28
|
mcp = [
|
|
29
|
-
"agent-connector-sdk[mcp]>=0.3.
|
|
29
|
+
"agent-connector-sdk[mcp]>=0.3.10,<1.0.0"]
|
|
30
30
|
|
|
31
31
|
|
|
32
32
|
# scikit-learn is no longer used for compute (that runs in the epistemic-graph
|
|
@@ -142,3 +142,6 @@ override-dependencies = [
|
|
|
142
142
|
|
|
143
143
|
[tool.pipelines_hooks.ste]
|
|
144
144
|
exempt = ["specs/*", "specs/**/*"]
|
|
145
|
+
|
|
146
|
+
[tool.pytest.ini_options]
|
|
147
|
+
markers = [ "spec(id): bind a test to its owning specification requirement",]
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Compute runs in the Rust epistemic-graph engine, so the engine-backed tests need
|
|
4
4
|
a live server. The session-scoped `epistemic_graph_engine` fixture best-effort
|
|
5
5
|
launches one (installed `epistemic-graph-server` console script, or a sibling
|
|
6
|
-
source build) and points `
|
|
6
|
+
source build) and points `EPISTEMIC_GRAPH_ENDPOINT` at it. The per-test
|
|
7
7
|
`require_engine` fixture depends on it and skips only if no engine could be
|
|
8
8
|
started/reached — so coverage runs whenever the binary is available, and degrades
|
|
9
9
|
to a clean skip when it is not.
|
|
@@ -64,9 +64,7 @@ def epistemic_graph_engine():
|
|
|
64
64
|
no binary is available — in which case `require_engine` tests skip.
|
|
65
65
|
"""
|
|
66
66
|
# Respect an externally provided engine (e.g. a CI service container).
|
|
67
|
-
if os.environ.get("
|
|
68
|
-
"EPISTEMIC_GRAPH_TCP"
|
|
69
|
-
):
|
|
67
|
+
if os.environ.get("EPISTEMIC_GRAPH_ENDPOINT"):
|
|
70
68
|
yield None
|
|
71
69
|
return
|
|
72
70
|
|
|
@@ -88,7 +86,7 @@ def epistemic_graph_engine():
|
|
|
88
86
|
time.sleep(0.5)
|
|
89
87
|
|
|
90
88
|
if os.path.exists(sock):
|
|
91
|
-
os.environ["
|
|
89
|
+
os.environ["EPISTEMIC_GRAPH_ENDPOINT"] = f"unix://{sock}"
|
|
92
90
|
|
|
93
91
|
try:
|
|
94
92
|
yield proc
|
|
@@ -103,7 +101,7 @@ def epistemic_graph_engine():
|
|
|
103
101
|
os.remove(sock)
|
|
104
102
|
except OSError:
|
|
105
103
|
pass
|
|
106
|
-
os.environ.pop("
|
|
104
|
+
os.environ.pop("EPISTEMIC_GRAPH_ENDPOINT", None)
|
|
107
105
|
|
|
108
106
|
|
|
109
107
|
@pytest.fixture
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"""Engine request audience comes from the deployment (CONN-DATA-SCIENCE-MCP-R002)."""
|
|
2
|
+
|
|
3
|
+
import pytest
|
|
4
|
+
from agent_connector_sdk.ingest.engine import EngineSettings
|
|
5
|
+
|
|
6
|
+
pytestmark = pytest.mark.spec("CONN-DATA-SCIENCE-MCP-R002")
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
def test_signed_context_carries_the_configured_audience(monkeypatch):
|
|
10
|
+
for key, value in {
|
|
11
|
+
"EPISTEMIC_GRAPH_ENDPOINT": "tcp://127.0.0.1:9100",
|
|
12
|
+
"EPISTEMIC_GRAPH_AUTH_SECRET_REF": "env://EG_SECRET",
|
|
13
|
+
"EPISTEMIC_GRAPH_TENANT": "tenant-a",
|
|
14
|
+
"EPISTEMIC_GRAPH_GRAPH": "kg",
|
|
15
|
+
"EPISTEMIC_GRAPH_AUDIENCE": "agent-services",
|
|
16
|
+
}.items():
|
|
17
|
+
monkeypatch.setenv(key, value)
|
|
18
|
+
settings = EngineSettings.from_settings()
|
|
19
|
+
assert settings is not None
|
|
20
|
+
assert settings.verified_context()["audience"] == "agent-services"
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
"""Engine connection through the SDK compute adapter (CONN-DATA-SCIENCE-MCP-R001)."""
|
|
2
|
+
|
|
3
|
+
import pytest
|
|
4
|
+
|
|
5
|
+
from data_science_mcp import ml_engine
|
|
6
|
+
from data_science_mcp.ml_engine import _UNPROBED, ENGINE_SCOPES, MLEngine
|
|
7
|
+
|
|
8
|
+
pytestmark = pytest.mark.spec("CONN-DATA-SCIENCE-MCP-R001")
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
@pytest.fixture(autouse=True)
|
|
12
|
+
def _fresh_probe():
|
|
13
|
+
MLEngine._rust_client_cache = _UNPROBED
|
|
14
|
+
yield
|
|
15
|
+
MLEngine._rust_client_cache = _UNPROBED
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
def test_connects_with_a_signed_compute_context(monkeypatch):
|
|
19
|
+
seen = {}
|
|
20
|
+
|
|
21
|
+
class _Compute:
|
|
22
|
+
client = object()
|
|
23
|
+
|
|
24
|
+
def _connect(*, scopes):
|
|
25
|
+
seen["scopes"] = scopes
|
|
26
|
+
return _Compute()
|
|
27
|
+
|
|
28
|
+
monkeypatch.setattr("agent_connector_sdk.compute.engine.connect_compute", _connect)
|
|
29
|
+
assert MLEngine._rust_client() is _Compute.client
|
|
30
|
+
assert seen["scopes"] == ENGINE_SCOPES
|
|
31
|
+
assert "compute:datascience" in ENGINE_SCOPES
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
def test_unconfigured_engine_is_cached_as_unavailable(monkeypatch, caplog):
|
|
35
|
+
for name in ("EPISTEMIC_GRAPH_ENDPOINT", "EPISTEMIC_GRAPH_AUTH_SECRET_REF"):
|
|
36
|
+
monkeypatch.delenv(name, raising=False)
|
|
37
|
+
calls = []
|
|
38
|
+
|
|
39
|
+
def _connect(*, scopes):
|
|
40
|
+
calls.append(scopes)
|
|
41
|
+
from agent_connector_sdk.compute.engine import ComputeUnavailableError
|
|
42
|
+
|
|
43
|
+
raise ComputeUnavailableError("EPISTEMIC_GRAPH_ENDPOINT is not configured")
|
|
44
|
+
|
|
45
|
+
monkeypatch.setattr("agent_connector_sdk.compute.engine.connect_compute", _connect)
|
|
46
|
+
with caplog.at_level("WARNING", logger=ml_engine.logger.name):
|
|
47
|
+
assert MLEngine._rust_client() is None
|
|
48
|
+
assert MLEngine._rust_client() is None
|
|
49
|
+
assert len(calls) == 1
|
|
50
|
+
assert "ComputeUnavailableError" in caplog.text
|
|
51
|
+
assert "EPISTEMIC_GRAPH_ENDPOINT" in ml_engine._ENGINE_REQUIRED_ERR
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{data_science_mcp-2.3.1 → data_science_mcp-2.3.3}/data_science_mcp/inference/openai_compatible.py
RENAMED
|
File without changes
|
{data_science_mcp-2.3.1 → data_science_mcp-2.3.3}/data_science_mcp/inference/sglang_backend.py
RENAMED
|
File without changes
|
{data_science_mcp-2.3.1 → data_science_mcp-2.3.3}/data_science_mcp/inference/vllm_backend.py
RENAMED
|
File without changes
|
|
File without changes
|
{data_science_mcp-2.3.1 → data_science_mcp-2.3.3}/data_science_mcp/kernels/_candidate_worker.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{data_science_mcp-2.3.1 → data_science_mcp-2.3.3}/data_science_mcp/kernels/kernel_verifier.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{data_science_mcp-2.3.1 → data_science_mcp-2.3.3}/data_science_mcp/ontology/certification.json
RENAMED
|
File without changes
|
|
File without changes
|
{data_science_mcp-2.3.1 → data_science_mcp-2.3.3}/data_science_mcp/ontology/fixtures/records.json
RENAMED
|
File without changes
|
{data_science_mcp-2.3.1 → data_science_mcp-2.3.3}/data_science_mcp/ontology/mappings/source.yaml
RENAMED
|
File without changes
|
{data_science_mcp-2.3.1 → data_science_mcp-2.3.3}/data_science_mcp/ontology/migrations/manifest.json
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{data_science_mcp-2.3.1 → data_science_mcp-2.3.3}/data_science_mcp/trainers/accelerate_launch.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{data_science_mcp-2.3.1 → data_science_mcp-2.3.3}/data_science_mcp/trainers/pretrain_trainer.py
RENAMED
|
File without changes
|
{data_science_mcp-2.3.1 → data_science_mcp-2.3.3}/data_science_mcp/trainers/reward_trainer.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{data_science_mcp-2.3.1 → data_science_mcp-2.3.3}/data_science_mcp/training/deep_delegate.py
RENAMED
|
File without changes
|
{data_science_mcp-2.3.1 → data_science_mcp-2.3.3}/data_science_mcp/training/pause_token_trainer.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{data_science_mcp-2.3.1 → data_science_mcp-2.3.3}/data_science_mcp.egg-info/dependency_links.txt
RENAMED
|
File without changes
|
{data_science_mcp-2.3.1 → data_science_mcp-2.3.3}/data_science_mcp.egg-info/entry_points.txt
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|