scholarx 2.3.4__tar.gz → 2.3.6__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.
- {scholarx-2.3.4/scholarx.egg-info → scholarx-2.3.6}/PKG-INFO +4 -5
- {scholarx-2.3.4 → scholarx-2.3.6}/README.md +0 -1
- {scholarx-2.3.4 → scholarx-2.3.6}/pyproject.toml +7 -7
- {scholarx-2.3.4 → scholarx-2.3.6}/scholarx/api_client.py +1 -1
- scholarx-2.3.6/scholarx/connector_sources.py +101 -0
- {scholarx-2.3.4 → scholarx-2.3.6}/scholarx/mcp_server.py +2 -1
- {scholarx-2.3.4 → scholarx-2.3.6}/scholarx/ontology/certification.json +4 -7
- {scholarx-2.3.4 → scholarx-2.3.6}/scholarx/ontology/scholarx.ttl +4 -2
- scholarx-2.3.6/scholarx/skills/scholarx-development/SKILL.md +84 -0
- {scholarx-2.3.4 → scholarx-2.3.6/scholarx.egg-info}/PKG-INFO +4 -5
- {scholarx-2.3.4 → scholarx-2.3.6}/scholarx.egg-info/SOURCES.txt +2 -2
- {scholarx-2.3.4 → scholarx-2.3.6}/scholarx.egg-info/entry_points.txt +0 -3
- {scholarx-2.3.4 → scholarx-2.3.6}/scholarx.egg-info/requires.txt +2 -2
- {scholarx-2.3.4 → scholarx-2.3.6}/tests/test_cli_extended.py +4 -2
- {scholarx-2.3.4 → scholarx-2.3.6}/tests/test_kg_ingest.py +1 -1
- {scholarx-2.3.4 → scholarx-2.3.6}/tests/test_mcp_server.py +2 -6
- {scholarx-2.3.4 → scholarx-2.3.6}/tests/test_operation_tools.py +1 -27
- {scholarx-2.3.4 → scholarx-2.3.6}/tests/test_parallel_download.py +2 -6
- {scholarx-2.3.4 → scholarx-2.3.6}/tests/test_queue.py +7 -7
- scholarx-2.3.4/scholarx/connectors/mcp_source_presets.json +0 -14
- scholarx-2.3.4/scholarx/connectors/tool_schema_fingerprints.json +0 -8
- {scholarx-2.3.4 → scholarx-2.3.6}/LICENSE +0 -0
- {scholarx-2.3.4 → scholarx-2.3.6}/scholarx/__init__.py +0 -0
- {scholarx-2.3.4 → scholarx-2.3.6}/scholarx/__main__.py +0 -0
- {scholarx-2.3.4 → scholarx-2.3.6}/scholarx/cli.py +0 -0
- {scholarx-2.3.4 → scholarx-2.3.6}/scholarx/connectors/__init__.py +0 -0
- {scholarx-2.3.4 → scholarx-2.3.6}/scholarx/deduplication.py +0 -0
- {scholarx-2.3.4 → scholarx-2.3.6}/scholarx/kg_ingest.py +0 -0
- {scholarx-2.3.4 → scholarx-2.3.6}/scholarx/kg_media.py +0 -0
- {scholarx-2.3.4 → scholarx-2.3.6}/scholarx/mcp_config.json +0 -0
- {scholarx-2.3.4 → scholarx-2.3.6}/scholarx/models.py +0 -0
- {scholarx-2.3.4 → scholarx-2.3.6}/scholarx/ontology/__init__.py +0 -0
- {scholarx-2.3.4 → scholarx-2.3.6}/scholarx/ontology/fixtures/records.json +0 -0
- {scholarx-2.3.4 → scholarx-2.3.6}/scholarx/ontology/mappings/source.yaml +0 -0
- {scholarx-2.3.4 → scholarx-2.3.6}/scholarx/ontology/migrations/manifest.json +0 -0
- {scholarx-2.3.4 → scholarx-2.3.6}/scholarx/ontology/shapes/connector.shacl.ttl +0 -0
- {scholarx-2.3.4 → scholarx-2.3.6}/scholarx/paper_storage.py +0 -0
- {scholarx-2.3.4 → scholarx-2.3.6}/scholarx/prompts/__init__.py +0 -0
- {scholarx-2.3.4 → scholarx-2.3.6}/scholarx/providers/__init__.py +0 -0
- {scholarx-2.3.4 → scholarx-2.3.6}/scholarx/providers/arxiv.py +0 -0
- {scholarx-2.3.4 → scholarx-2.3.6}/scholarx/providers/base.py +0 -0
- {scholarx-2.3.4 → scholarx-2.3.6}/scholarx/providers/biorxiv.py +0 -0
- {scholarx-2.3.4 → scholarx-2.3.6}/scholarx/providers/osf.py +0 -0
- {scholarx-2.3.4 → scholarx-2.3.6}/scholarx/providers/pmc.py +0 -0
- {scholarx-2.3.4 → scholarx-2.3.6}/scholarx/providers/rss.py +0 -0
- {scholarx-2.3.4 → scholarx-2.3.6}/scholarx/providers/semantic_scholar.py +0 -0
- {scholarx-2.3.4 → scholarx-2.3.6}/scholarx/queue.py +0 -0
- {scholarx-2.3.4 → scholarx-2.3.6}/scholarx/skills/__init__.py +0 -0
- {scholarx-2.3.4 → scholarx-2.3.6}/scholarx/skills/scholarx-kg-ingestion/SKILL.md +0 -0
- {scholarx-2.3.4 → scholarx-2.3.6}/scholarx/skills/scholarx-kg-ingestion/WORKFLOW.md +0 -0
- {scholarx-2.3.4 → scholarx-2.3.6}/scholarx/skills/scholarx-operations/SKILL.md +0 -0
- {scholarx-2.3.4 → scholarx-2.3.6}/scholarx/skills/scholarx-operations/agents/openai.yaml +0 -0
- {scholarx-2.3.4 → scholarx-2.3.6}/scholarx/skills/scholarx-operations/references/catalog.md +0 -0
- {scholarx-2.3.4 → scholarx-2.3.6}/scholarx/skills/scholarx-paper-library/SKILL.md +0 -0
- {scholarx-2.3.4 → scholarx-2.3.6}/scholarx/skills/scholarx-paper-library/WORKFLOW.md +0 -0
- {scholarx-2.3.4 → scholarx-2.3.6}/scholarx/skills/scholarx-paper-search/SKILL.md +0 -0
- {scholarx-2.3.4 → scholarx-2.3.6}/scholarx/skills/scholarx-paper-search/WORKFLOW.md +0 -0
- {scholarx-2.3.4 → scholarx-2.3.6}/scholarx.egg-info/dependency_links.txt +0 -0
- {scholarx-2.3.4 → scholarx-2.3.6}/scholarx.egg-info/top_level.txt +0 -0
- {scholarx-2.3.4 → scholarx-2.3.6}/setup.cfg +0 -0
- {scholarx-2.3.4 → scholarx-2.3.6}/tests/test_action_discovery.py +0 -0
- {scholarx-2.3.4 → scholarx-2.3.6}/tests/test_cli.py +0 -0
- {scholarx-2.3.4 → scholarx-2.3.6}/tests/test_default_content_surfaces.py +0 -0
- {scholarx-2.3.4 → scholarx-2.3.6}/tests/test_init_dynamics.py +0 -0
- {scholarx-2.3.4 → scholarx-2.3.6}/tests/test_kg_media.py +0 -0
- {scholarx-2.3.4 → scholarx-2.3.6}/tests/test_models.py +0 -0
- {scholarx-2.3.4 → scholarx-2.3.6}/tests/test_paper_storage.py +0 -0
- {scholarx-2.3.4 → scholarx-2.3.6}/tests/test_providers.py +0 -0
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: scholarx
|
|
3
|
-
Version: 2.3.
|
|
3
|
+
Version: 2.3.6
|
|
4
4
|
Summary: Universal Research Paper API — single entry point for arXiv, PMC, bioRxiv, medRxiv, PsyArXiv, OSF, and Semantic Scholar
|
|
5
|
-
Author-email:
|
|
5
|
+
Author-email: Repository Maintainers <maintainers@knuckles.team>
|
|
6
6
|
License: MIT
|
|
7
7
|
Requires-Python: <3.15,>=3.12
|
|
8
8
|
Description-Content-Type: text/markdown
|
|
9
9
|
License-File: LICENSE
|
|
10
|
-
Requires-Dist: agent-connector-sdk[mcp]<1.0.0,>=0.
|
|
10
|
+
Requires-Dist: agent-connector-sdk[mcp]<1.0.0,>=0.4.1
|
|
11
11
|
Requires-Dist: httpx>=0.28.1
|
|
12
12
|
Requires-Dist: python-dotenv>=1.2.4
|
|
13
13
|
Requires-Dist: Levenshtein>=0.27.5
|
|
@@ -15,7 +15,7 @@ Requires-Dist: pypdf>=6.21.0
|
|
|
15
15
|
Requires-Dist: rich>=15.0.0
|
|
16
16
|
Requires-Dist: defusedxml>=0.7.1
|
|
17
17
|
Provides-Extra: mcp
|
|
18
|
-
Requires-Dist: agent-connector-sdk[mcp]<1.0.0,>=0.
|
|
18
|
+
Requires-Dist: agent-connector-sdk[mcp]<1.0.0,>=0.4.1; extra == "mcp"
|
|
19
19
|
Provides-Extra: all
|
|
20
20
|
Requires-Dist: scholarx[mcp]; extra == "all"
|
|
21
21
|
Provides-Extra: test
|
|
@@ -48,7 +48,6 @@ Dynamic: license-file
|
|
|
48
48
|

|
|
49
49
|

|
|
50
50
|
|
|
51
|
-
*Version: 2.3.4*
|
|
52
51
|
|
|
53
52
|
> **Documentation** — Installation, deployment, usage across the API, CLI, MCP, and
|
|
54
53
|
> agent interfaces are maintained in the
|
|
@@ -20,7 +20,6 @@
|
|
|
20
20
|

|
|
21
21
|

|
|
22
22
|
|
|
23
|
-
*Version: 2.3.4*
|
|
24
23
|
|
|
25
24
|
> **Documentation** — Installation, deployment, usage across the API, CLI, MCP, and
|
|
26
25
|
> agent interfaces are maintained in the
|
|
@@ -4,14 +4,14 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "scholarx"
|
|
7
|
-
version = "2.3.
|
|
7
|
+
version = "2.3.6"
|
|
8
8
|
description = "Universal Research Paper API — single entry point for arXiv, PMC, bioRxiv, medRxiv, PsyArXiv, OSF, and Semantic Scholar"
|
|
9
9
|
readme = "README.md"
|
|
10
10
|
license = { text = "MIT" }
|
|
11
11
|
requires-python = ">=3.12, <3.15"
|
|
12
|
-
authors = [{ name = "
|
|
12
|
+
authors = [{ name = "Repository Maintainers", email = "maintainers@knuckles.team" }]
|
|
13
13
|
dependencies = [
|
|
14
|
-
"agent-connector-sdk[mcp]>=0.
|
|
14
|
+
"agent-connector-sdk[mcp]>=0.4.1,<1.0.0",
|
|
15
15
|
"httpx>=0.28.1",
|
|
16
16
|
"python-dotenv>=1.2.4",
|
|
17
17
|
"Levenshtein>=0.27.5",
|
|
@@ -21,7 +21,7 @@ dependencies = [
|
|
|
21
21
|
]
|
|
22
22
|
|
|
23
23
|
[project.optional-dependencies]
|
|
24
|
-
mcp = ["agent-connector-sdk[mcp]>=0.
|
|
24
|
+
mcp = ["agent-connector-sdk[mcp]>=0.4.1,<1.0.0"]
|
|
25
25
|
all = ["scholarx[mcp]"]
|
|
26
26
|
test = [
|
|
27
27
|
"pytest-xdist>=3.8.0","pytest>=9.1.1", "pytest-asyncio>=1.4.0", "pytest-cov>=7.1.0", "respx>=0.23.1"]
|
|
@@ -36,9 +36,6 @@ scholarx = "scholarx.skills"
|
|
|
36
36
|
[project.entry-points."agent_connector_sdk.ontology_providers"]
|
|
37
37
|
scholarx = "scholarx.ontology"
|
|
38
38
|
|
|
39
|
-
[project.entry-points."agent_connector_sdk.source_connector_providers"]
|
|
40
|
-
scholarx = "scholarx.connectors"
|
|
41
|
-
|
|
42
39
|
# The one declared connector identity: the fleet name (SDK-CONNECTOR-CONTROL-R071).
|
|
43
40
|
[project.entry-points."agent_connector_sdk.connector"]
|
|
44
41
|
scholarx-mcp = "scholarx"
|
|
@@ -79,3 +76,6 @@ ignore_names = ["request", "config"]
|
|
|
79
76
|
|
|
80
77
|
[tool.pipelines_hooks.ste]
|
|
81
78
|
exempt = ["specs/*", "specs/**/*"]
|
|
79
|
+
|
|
80
|
+
[tool.pipelines.api_integration]
|
|
81
|
+
baseline = 50.0
|
|
@@ -80,7 +80,7 @@ def _schedule_download_tasks(normalized: list[str | None], one_fn) -> list[async
|
|
|
80
80
|
|
|
81
81
|
|
|
82
82
|
def _normalize_download_ids(ids: list[str]) -> list[str | None]:
|
|
83
|
-
"""Normalize each raw id, keeping position; an
|
|
83
|
+
"""Normalize each raw id, keeping position; an unparsable id becomes None."""
|
|
84
84
|
normalized: list[str | None] = []
|
|
85
85
|
for raw_id in ids:
|
|
86
86
|
try:
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
"""Data sources of this connector, declared by tool name (generated by connector-ontology-map migrate).
|
|
2
|
+
|
|
3
|
+
Served live as ``connector://resources``. Regenerate by editing the declarations, not the tools.
|
|
4
|
+
"""
|
|
5
|
+
|
|
6
|
+
# ruff: noqa: E501
|
|
7
|
+
from __future__ import annotations
|
|
8
|
+
|
|
9
|
+
from agent_connector_sdk.ingest.live_declaration import source_meta
|
|
10
|
+
from agent_connector_sdk.ingest.sources import IngestSourceDeclaration, IngestSourceSpec
|
|
11
|
+
|
|
12
|
+
CONNECTOR = "scholarx-mcp"
|
|
13
|
+
|
|
14
|
+
SOURCES = (
|
|
15
|
+
source_meta(
|
|
16
|
+
tool="scholarx_search",
|
|
17
|
+
source_id="scholarx-papers",
|
|
18
|
+
record_type="research_paper",
|
|
19
|
+
id_field="id",
|
|
20
|
+
cursor_field="published_date",
|
|
21
|
+
preset={
|
|
22
|
+
"doc_type": "research_paper",
|
|
23
|
+
"params_style": "args",
|
|
24
|
+
},
|
|
25
|
+
records_path="papers",
|
|
26
|
+
server="scholarx-mcp",
|
|
27
|
+
text_field="abstract",
|
|
28
|
+
title_field="title",
|
|
29
|
+
),
|
|
30
|
+
)
|
|
31
|
+
|
|
32
|
+
SCHEMA_MAPPINGS = {
|
|
33
|
+
"Paper": {
|
|
34
|
+
"fields": {
|
|
35
|
+
"abstract": "xsd:string",
|
|
36
|
+
"citationCount": "xsd:integer",
|
|
37
|
+
"doi": "xsd:string",
|
|
38
|
+
"externalToolId": "xsd:string",
|
|
39
|
+
"pdfUrl": "xsd:string",
|
|
40
|
+
"publishedDate": "xsd:string",
|
|
41
|
+
},
|
|
42
|
+
"ontology_class": "Document",
|
|
43
|
+
},
|
|
44
|
+
"PaperSource": {
|
|
45
|
+
"fields": {
|
|
46
|
+
"abstract": "xsd:string",
|
|
47
|
+
"citationCount": "xsd:integer",
|
|
48
|
+
"doi": "xsd:string",
|
|
49
|
+
"externalToolId": "xsd:string",
|
|
50
|
+
"pdfUrl": "xsd:string",
|
|
51
|
+
"publishedDate": "xsd:string",
|
|
52
|
+
},
|
|
53
|
+
"ontology_class": None,
|
|
54
|
+
},
|
|
55
|
+
"ResearchCategory": {
|
|
56
|
+
"fields": {
|
|
57
|
+
"abstract": "xsd:string",
|
|
58
|
+
"citationCount": "xsd:integer",
|
|
59
|
+
"doi": "xsd:string",
|
|
60
|
+
"externalToolId": "xsd:string",
|
|
61
|
+
"pdfUrl": "xsd:string",
|
|
62
|
+
"publishedDate": "xsd:string",
|
|
63
|
+
},
|
|
64
|
+
"ontology_class": None,
|
|
65
|
+
},
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
RESOURCES = (
|
|
69
|
+
{
|
|
70
|
+
"id_prefix": "paper",
|
|
71
|
+
"label": "Research Paper",
|
|
72
|
+
"name": "Paper",
|
|
73
|
+
},
|
|
74
|
+
{
|
|
75
|
+
"id_prefix": "papersource",
|
|
76
|
+
"label": "Paper Source",
|
|
77
|
+
"name": "PaperSource",
|
|
78
|
+
},
|
|
79
|
+
{
|
|
80
|
+
"id_prefix": "researchcategory",
|
|
81
|
+
"label": "Research Category",
|
|
82
|
+
"name": "ResearchCategory",
|
|
83
|
+
},
|
|
84
|
+
)
|
|
85
|
+
|
|
86
|
+
|
|
87
|
+
def declaration() -> IngestSourceDeclaration:
|
|
88
|
+
"""The declaration the server assembles from this module."""
|
|
89
|
+
specs = []
|
|
90
|
+
for item in SOURCES:
|
|
91
|
+
for entry in item["connector_sources"]:
|
|
92
|
+
body = {k: v for k, v in entry.items() if k not in ("tool", "mapping")}
|
|
93
|
+
specs.append(IngestSourceSpec.model_validate({**body, "tools": (entry["tool"],)}))
|
|
94
|
+
return IngestSourceDeclaration.model_validate(
|
|
95
|
+
{
|
|
96
|
+
"connector": CONNECTOR,
|
|
97
|
+
"sources": specs,
|
|
98
|
+
"schema_mappings": SCHEMA_MAPPINGS,
|
|
99
|
+
"resources": RESOURCES,
|
|
100
|
+
}
|
|
101
|
+
)
|
|
@@ -9,6 +9,7 @@ import asyncio
|
|
|
9
9
|
import logging
|
|
10
10
|
import sys
|
|
11
11
|
from dataclasses import dataclass
|
|
12
|
+
from importlib.metadata import version as _distribution_version
|
|
12
13
|
|
|
13
14
|
from agent_connector_sdk.config import load_config, setting
|
|
14
15
|
from agent_connector_sdk.mcp.action_dispatch import resolve_action
|
|
@@ -19,7 +20,7 @@ from pydantic import Field
|
|
|
19
20
|
|
|
20
21
|
load_config()
|
|
21
22
|
|
|
22
|
-
__version__ = "
|
|
23
|
+
__version__ = _distribution_version("scholarx")
|
|
23
24
|
|
|
24
25
|
# Wall budget for an inline single-paper download before it is handed to the
|
|
25
26
|
# background queue. Kept well under the MCP child-call timeout so a slow source
|
|
@@ -1,13 +1,10 @@
|
|
|
1
1
|
{
|
|
2
|
-
"api_version": "
|
|
2
|
+
"api_version": "graphos.io/v1",
|
|
3
3
|
"artifacts": {
|
|
4
|
-
"connector_manifest.yml": "d88fbe9425a4161a1437334f0120df1c8f1aeb701c90fbe1bf9bdaa308a052e9",
|
|
5
|
-
"scholarx/connectors/mcp_source_presets.json": "e2a46d1357825817c792e9329a58b4e4af33c3147ed9c66fec337584b098ff86",
|
|
6
|
-
"scholarx/connectors/tool_schema_fingerprints.json": "83976eb6a8495978c3df1ea72ce7ead7fcd3d567228343301ab55721e10f3fa8",
|
|
7
4
|
"scholarx/ontology/fixtures/records.json": "b0388efa7f3896eb816a9dd6ff681177e35e08f8cef1b36b50574b539e7c7500",
|
|
8
5
|
"scholarx/ontology/mappings/source.yaml": "18a3036f8139108be4ceefab417c04e7232d0f532bad4cbdf392c503664598dc",
|
|
9
6
|
"scholarx/ontology/migrations/manifest.json": "bfeda48a1409171c681c100c996615d1710e6a56235d52e0e99572d75d1aa892",
|
|
10
|
-
"scholarx/ontology/scholarx.ttl": "
|
|
7
|
+
"scholarx/ontology/scholarx.ttl": "7956ac7953d8f2649d22981d74ef98cfad3d5c19ee55540e0e2f632222c9b88b",
|
|
11
8
|
"scholarx/ontology/shapes/connector.shacl.ttl": "2e223e425a72b24e2227f98f0692baf22c0476ae073febb05e4d5fc7e75be438"
|
|
12
9
|
},
|
|
13
10
|
"checks": {
|
|
@@ -18,7 +15,7 @@
|
|
|
18
15
|
"synthetic_fixture_contract": "passed"
|
|
19
16
|
},
|
|
20
17
|
"compatibility": {
|
|
21
|
-
"
|
|
18
|
+
"agent_utilities": ">=2.5.0,<3",
|
|
22
19
|
"bundle_schema": "2",
|
|
23
20
|
"epistemic_graph": ">=2.27.0,<3"
|
|
24
21
|
},
|
|
@@ -32,5 +29,5 @@
|
|
|
32
29
|
"signer": "UNSIGNED-PREVIEW",
|
|
33
30
|
"signing_public_key": "",
|
|
34
31
|
"status": "source-validated",
|
|
35
|
-
"validated_at": "2026-
|
|
32
|
+
"validated_at": "2026-10-26T16:42:10Z"
|
|
36
33
|
}
|
|
@@ -104,5 +104,7 @@
|
|
|
104
104
|
source repositories, subject categories, authors (shared :Person), abstracts and
|
|
105
105
|
full-text PDFs (shared :Document / :AssetOccurrence) — federated into the agent-connector-sdk
|
|
106
106
|
knowledge-graph hub across arXiv, PMC, bioRxiv, medRxiv, PsyArXiv, OSF and
|
|
107
|
-
Semantic Scholar."""
|
|
108
|
-
|
|
107
|
+
Semantic Scholar.""" .
|
|
108
|
+
|
|
109
|
+
# ontology-codemod R3
|
|
110
|
+
<http://knuckles.team/kg#ResearchCategory> rdfs:subClassOf <http://knuckles.team/kg#Category> .
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: scholarx-development
|
|
3
|
+
skill_type: skill
|
|
4
|
+
domain: development
|
|
5
|
+
description: >-
|
|
6
|
+
Develop, test, gate, and release the scholarx connector. Use this skill
|
|
7
|
+
when changing paper provider mappings, MCP tools, storage, packaging,
|
|
8
|
+
documentation, or repository gates.
|
|
9
|
+
license: MIT
|
|
10
|
+
tags: [scholarx, development, connector, test, gates]
|
|
11
|
+
tier: repository
|
|
12
|
+
metadata:
|
|
13
|
+
author: Genius
|
|
14
|
+
version: '0.1.0'
|
|
15
|
+
---
|
|
16
|
+
|
|
17
|
+
# scholarx development
|
|
18
|
+
|
|
19
|
+
This repository owns the ScholarX paper-provider clients, deduplication and
|
|
20
|
+
storage behavior, MCP tools, packaged connector content, and agent entry
|
|
21
|
+
points. Shared connector contracts and transports belong to
|
|
22
|
+
`agent-connector-sdk`; admission, serving, and durable graph state belong to
|
|
23
|
+
their owning repositories. Read `AGENTS.md` before changing code and keep
|
|
24
|
+
provider credentials, paper paths, and endpoints out of source, logs, and
|
|
25
|
+
skill content.
|
|
26
|
+
|
|
27
|
+
## Rapid delivery: the 5-minute contract
|
|
28
|
+
|
|
29
|
+
Specs are already designed. Deliver small, reviewable slices and cite the
|
|
30
|
+
owning spec row in the commit trailer.
|
|
31
|
+
|
|
32
|
+
- Find the owning row first with `git grep -n "<term>" -- specs` and extend
|
|
33
|
+
that spec before adding new requirement text.
|
|
34
|
+
- Reuse the existing `ScholarXClient`, provider rate limits, deduplication,
|
|
35
|
+
storage, and SDK tool surface. Do not create a second implementation of a
|
|
36
|
+
connector capability.
|
|
37
|
+
- Keep changes scoped to this connector. A change owned by the SDK, Arbora, or
|
|
38
|
+
the knowledge graph belongs in that repository instead.
|
|
39
|
+
- Every delivered requirement needs a bound test. Generated `status.json`
|
|
40
|
+
files are produced by `pipelines-hook spec-status`; never hand-edit them.
|
|
41
|
+
- Mock external paper-provider calls and keep download tests within the
|
|
42
|
+
existing queue and timeout seams; never use live credentials in a local gate.
|
|
43
|
+
- One logical change per commit, with `Spec: <ID>` and the assisting agent
|
|
44
|
+
trailer adjacent in the final paragraph.
|
|
45
|
+
|
|
46
|
+
## Setup and gates
|
|
47
|
+
|
|
48
|
+
Use the pinned environment from `uv sync --locked`. Run the repository gate:
|
|
49
|
+
|
|
50
|
+
```bash
|
|
51
|
+
uvx pre-commit run --all-files
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
For focused feedback, run the smallest affected test file with the locked
|
|
55
|
+
environment, for example:
|
|
56
|
+
|
|
57
|
+
```bash
|
|
58
|
+
uv run --all-extras pytest tests/test_operation_tools.py -q
|
|
59
|
+
uv run --all-extras pytest tests/test_action_discovery.py -q
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
The canonical `.pre-commit-config.yaml` delegates connector-standard, secrets,
|
|
63
|
+
spec, tests-fast, and dependency-readiness checks to `Knuckles-Team/pipelines`
|
|
64
|
+
at `rev: main`. Do not replace those shared hooks with local copies or bypass a
|
|
65
|
+
failing check.
|
|
66
|
+
|
|
67
|
+
## Connector-specific checks
|
|
68
|
+
|
|
69
|
+
- Keep provider fan-out, rate limiting, deduplication, storage, and MCP tool
|
|
70
|
+
surfaces aligned with the SDK.
|
|
71
|
+
- Use mocked arXiv, PMC, bioRxiv, OSF, and Semantic Scholar responses in tests;
|
|
72
|
+
never call live providers from a local gate.
|
|
73
|
+
- Keep `scholarx/skills/`, ontology, prompts, and connector manifests in
|
|
74
|
+
package data when adding content.
|
|
75
|
+
- Documentation lives under `docs/` and is published by the shared Pages
|
|
76
|
+
workflow; source status records live under `specs/`.
|
|
77
|
+
|
|
78
|
+
## Delivery discipline
|
|
79
|
+
|
|
80
|
+
Work in a real Git worktree based on `origin/main`. Inspect the complete diff,
|
|
81
|
+
stage only reviewed paths, and verify `git status --short` after every gate.
|
|
82
|
+
Do not use `git stash`, `git add -A`, or `git add .`; do not claim Pages
|
|
83
|
+
publication until a successful exact-source workflow run and the public page
|
|
84
|
+
are both observed.
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: scholarx
|
|
3
|
-
Version: 2.3.
|
|
3
|
+
Version: 2.3.6
|
|
4
4
|
Summary: Universal Research Paper API — single entry point for arXiv, PMC, bioRxiv, medRxiv, PsyArXiv, OSF, and Semantic Scholar
|
|
5
|
-
Author-email:
|
|
5
|
+
Author-email: Repository Maintainers <maintainers@knuckles.team>
|
|
6
6
|
License: MIT
|
|
7
7
|
Requires-Python: <3.15,>=3.12
|
|
8
8
|
Description-Content-Type: text/markdown
|
|
9
9
|
License-File: LICENSE
|
|
10
|
-
Requires-Dist: agent-connector-sdk[mcp]<1.0.0,>=0.
|
|
10
|
+
Requires-Dist: agent-connector-sdk[mcp]<1.0.0,>=0.4.1
|
|
11
11
|
Requires-Dist: httpx>=0.28.1
|
|
12
12
|
Requires-Dist: python-dotenv>=1.2.4
|
|
13
13
|
Requires-Dist: Levenshtein>=0.27.5
|
|
@@ -15,7 +15,7 @@ Requires-Dist: pypdf>=6.21.0
|
|
|
15
15
|
Requires-Dist: rich>=15.0.0
|
|
16
16
|
Requires-Dist: defusedxml>=0.7.1
|
|
17
17
|
Provides-Extra: mcp
|
|
18
|
-
Requires-Dist: agent-connector-sdk[mcp]<1.0.0,>=0.
|
|
18
|
+
Requires-Dist: agent-connector-sdk[mcp]<1.0.0,>=0.4.1; extra == "mcp"
|
|
19
19
|
Provides-Extra: all
|
|
20
20
|
Requires-Dist: scholarx[mcp]; extra == "all"
|
|
21
21
|
Provides-Extra: test
|
|
@@ -48,7 +48,6 @@ Dynamic: license-file
|
|
|
48
48
|

|
|
49
49
|

|
|
50
50
|
|
|
51
|
-
*Version: 2.3.4*
|
|
52
51
|
|
|
53
52
|
> **Documentation** — Installation, deployment, usage across the API, CLI, MCP, and
|
|
54
53
|
> agent interfaces are maintained in the
|
|
@@ -5,6 +5,7 @@ scholarx/__init__.py
|
|
|
5
5
|
scholarx/__main__.py
|
|
6
6
|
scholarx/api_client.py
|
|
7
7
|
scholarx/cli.py
|
|
8
|
+
scholarx/connector_sources.py
|
|
8
9
|
scholarx/deduplication.py
|
|
9
10
|
scholarx/kg_ingest.py
|
|
10
11
|
scholarx/kg_media.py
|
|
@@ -20,8 +21,6 @@ scholarx.egg-info/entry_points.txt
|
|
|
20
21
|
scholarx.egg-info/requires.txt
|
|
21
22
|
scholarx.egg-info/top_level.txt
|
|
22
23
|
scholarx/connectors/__init__.py
|
|
23
|
-
scholarx/connectors/mcp_source_presets.json
|
|
24
|
-
scholarx/connectors/tool_schema_fingerprints.json
|
|
25
24
|
scholarx/ontology/__init__.py
|
|
26
25
|
scholarx/ontology/certification.json
|
|
27
26
|
scholarx/ontology/scholarx.ttl
|
|
@@ -39,6 +38,7 @@ scholarx/providers/pmc.py
|
|
|
39
38
|
scholarx/providers/rss.py
|
|
40
39
|
scholarx/providers/semantic_scholar.py
|
|
41
40
|
scholarx/skills/__init__.py
|
|
41
|
+
scholarx/skills/scholarx-development/SKILL.md
|
|
42
42
|
scholarx/skills/scholarx-kg-ingestion/SKILL.md
|
|
43
43
|
scholarx/skills/scholarx-kg-ingestion/WORKFLOW.md
|
|
44
44
|
scholarx/skills/scholarx-operations/SKILL.md
|
|
@@ -7,9 +7,6 @@ scholarx = scholarx.ontology
|
|
|
7
7
|
[agent_connector_sdk.skill_providers]
|
|
8
8
|
scholarx = scholarx.skills
|
|
9
9
|
|
|
10
|
-
[agent_connector_sdk.source_connector_providers]
|
|
11
|
-
scholarx = scholarx.connectors
|
|
12
|
-
|
|
13
10
|
[console_scripts]
|
|
14
11
|
scholarx = scholarx.cli:cli
|
|
15
12
|
scholarx-mcp = scholarx.mcp_server:mcp_server
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
agent-connector-sdk[mcp]<1.0.0,>=0.
|
|
1
|
+
agent-connector-sdk[mcp]<1.0.0,>=0.4.1
|
|
2
2
|
httpx>=0.28.1
|
|
3
3
|
python-dotenv>=1.2.4
|
|
4
4
|
Levenshtein>=0.27.5
|
|
@@ -10,7 +10,7 @@ defusedxml>=0.7.1
|
|
|
10
10
|
scholarx[mcp]
|
|
11
11
|
|
|
12
12
|
[mcp]
|
|
13
|
-
agent-connector-sdk[mcp]<1.0.0,>=0.
|
|
13
|
+
agent-connector-sdk[mcp]<1.0.0,>=0.4.1
|
|
14
14
|
|
|
15
15
|
[test]
|
|
16
16
|
pytest-xdist>=3.8.0
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import argparse
|
|
2
|
-
import asyncio
|
|
3
2
|
import json
|
|
4
3
|
import subprocess
|
|
5
4
|
from pathlib import Path
|
|
6
5
|
from unittest.mock import AsyncMock, MagicMock, patch
|
|
7
6
|
|
|
8
7
|
import pytest
|
|
8
|
+
|
|
9
9
|
from scholarx.cli import (
|
|
10
10
|
_run_auto_analysis,
|
|
11
11
|
_show_status,
|
|
@@ -427,7 +427,9 @@ def test_run_auto_analysis_success_details(mock_subproc, tmp_path):
|
|
|
427
427
|
mock_subproc.side_effect = Exception("Subprocess failure")
|
|
428
428
|
with patch("pathlib.Path.exists", mock_exists), patch("scholarx.cli.console.print") as mock_print:
|
|
429
429
|
_run_auto_analysis(args)
|
|
430
|
-
any_err = any(
|
|
430
|
+
any_err = any(
|
|
431
|
+
"Paper analysis failed: Exception" in str(call[0][0]) for call in mock_print.call_args_list if call[0]
|
|
432
|
+
)
|
|
431
433
|
assert any_err
|
|
432
434
|
|
|
433
435
|
|
|
@@ -73,7 +73,7 @@ async def test_ingest_entities_writes_nodes_and_edges(ingest):
|
|
|
73
73
|
assert set(by_id) == {"a", "b"}
|
|
74
74
|
assert request.relationships[0].source.record_id == "a"
|
|
75
75
|
assert request.relationships[0].target.record_id == "b"
|
|
76
|
-
assert request.relationships[0].relation_reference.endswith("/
|
|
76
|
+
assert request.relationships[0].relation_reference.endswith("/publishedInSource")
|
|
77
77
|
|
|
78
78
|
|
|
79
79
|
def test_paper_entities_maps_paper_source_category_author():
|
|
@@ -371,9 +371,7 @@ async def test_sx_storage_download_url_rejects_traversal(mock_client):
|
|
|
371
371
|
mock_client.storage.download_arxiv_id = AsyncMock()
|
|
372
372
|
|
|
373
373
|
with patch("scholarx.mcp_server._get_client", return_value=mock_client):
|
|
374
|
-
result = await call_sx_storage(
|
|
375
|
-
action="download_url", paper_ids="../../outside,https://example.com/a.pdf"
|
|
376
|
-
)
|
|
374
|
+
result = await call_sx_storage(action="download_url", paper_ids="../../outside,https://example.com/a.pdf")
|
|
377
375
|
|
|
378
376
|
assert [item["status"] for item in result["results"]] == ["rejected", "rejected"]
|
|
379
377
|
mock_client.storage.download_arxiv_id.assert_not_awaited()
|
|
@@ -491,9 +489,7 @@ async def test_sx_storage_download_url_deadline_exceeded_precheck(mock_client):
|
|
|
491
489
|
patch("scholarx.mcp_server._get_client", return_value=mock_client),
|
|
492
490
|
patch("scholarx.mcp_server._MAX_DIRECT_DOWNLOAD_SECONDS", -1.0),
|
|
493
491
|
):
|
|
494
|
-
res = await call_sx_storage(
|
|
495
|
-
action="download_url", paper_ids="2603.09022,2603.09023"
|
|
496
|
-
)
|
|
492
|
+
res = await call_sx_storage(action="download_url", paper_ids="2603.09022,2603.09023")
|
|
497
493
|
results = res["results"]
|
|
498
494
|
assert len(results) == 1
|
|
499
495
|
assert results[0] == {
|
|
@@ -1,8 +1,5 @@
|
|
|
1
|
-
"""CONN-SCHOLARX-API-COVERAGE-R001:
|
|
1
|
+
"""CONN-SCHOLARX-API-COVERAGE-R001: direct tools for uncovered operations at the measured baseline."""
|
|
2
2
|
|
|
3
|
-
import subprocess
|
|
4
|
-
import sys
|
|
5
|
-
from pathlib import Path
|
|
6
3
|
from unittest.mock import AsyncMock, MagicMock, patch
|
|
7
4
|
|
|
8
5
|
import pytest
|
|
@@ -12,8 +9,6 @@ from scholarx.models import PaperSource
|
|
|
12
9
|
|
|
13
10
|
pytestmark = pytest.mark.spec("CONN-SCHOLARX-API-COVERAGE-R001")
|
|
14
11
|
|
|
15
|
-
ROOT = Path(__file__).resolve().parents[1]
|
|
16
|
-
|
|
17
12
|
|
|
18
13
|
class MockMCP:
|
|
19
14
|
def __init__(self):
|
|
@@ -86,24 +81,3 @@ async def test_download_urls_requires_ids_and_maps_limit_errors(tools):
|
|
|
86
81
|
with patch("scholarx.mcp_server._get_client", return_value=client):
|
|
87
82
|
assert "error" in await tools.tools["sx_download_urls"](paper_ids="", concurrency=0)
|
|
88
83
|
assert "error" in await tools.tools["sx_download_urls"](paper_ids="1", concurrency=0)
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
def test_coverage_gate_holds_at_the_baseline():
|
|
92
|
-
script = (ROOT / "scripts/verify_api_integration.py").read_text()
|
|
93
|
-
assert '"scholarx": 90.0' in script
|
|
94
|
-
# The checker names the agent from the directory; run it from a directory called scholarx.
|
|
95
|
-
result = subprocess.run(
|
|
96
|
-
[
|
|
97
|
-
sys.executable,
|
|
98
|
-
"-c",
|
|
99
|
-
"import sys, importlib.util as u;"
|
|
100
|
-
"s=u.spec_from_file_location('v', sys.argv[1]);m=u.module_from_spec(s);s.loader.exec_module(m);"
|
|
101
|
-
"r=m.verify_agent(sys.argv[2]);print(r['coverage'])",
|
|
102
|
-
str(ROOT / "scripts/verify_api_integration.py"),
|
|
103
|
-
str(ROOT),
|
|
104
|
-
],
|
|
105
|
-
capture_output=True,
|
|
106
|
-
text=True,
|
|
107
|
-
check=True,
|
|
108
|
-
)
|
|
109
|
-
assert float(result.stdout.strip()) >= 90.0
|
|
@@ -161,9 +161,7 @@ async def test_download_urls_caps_in_flight(tmp_path):
|
|
|
161
161
|
async def download(pid):
|
|
162
162
|
async with lock:
|
|
163
163
|
state["in_flight"] += 1
|
|
164
|
-
state["max_in_flight"] = max(
|
|
165
|
-
state["max_in_flight"], state["in_flight"]
|
|
166
|
-
)
|
|
164
|
+
state["max_in_flight"] = max(state["max_in_flight"], state["in_flight"])
|
|
167
165
|
try:
|
|
168
166
|
await asyncio.sleep(0.02)
|
|
169
167
|
path = tmp_path / f"{pid}.pdf"
|
|
@@ -204,9 +202,7 @@ async def test_download_urls_skips_existing(tmp_path):
|
|
|
204
202
|
|
|
205
203
|
client = _client_with_mock_storage(tmp_path)
|
|
206
204
|
client.storage.download_arxiv_id = download
|
|
207
|
-
results = await client.download_urls(
|
|
208
|
-
["https://arxiv.org/abs/2603.00001", "2603.00002"]
|
|
209
|
-
)
|
|
205
|
+
results = await client.download_urls(["https://arxiv.org/abs/2603.00001", "2603.00002"])
|
|
210
206
|
by_id = {r["paper_id"]: r for r in results}
|
|
211
207
|
|
|
212
208
|
assert by_id["2603.00001"]["status"] == "cached"
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
import asyncio
|
|
2
|
-
import pytest
|
|
3
2
|
import threading
|
|
4
3
|
import time
|
|
5
|
-
from unittest.mock import AsyncMock, MagicMock, patch
|
|
6
4
|
from pathlib import Path
|
|
5
|
+
from unittest.mock import AsyncMock, MagicMock, patch
|
|
6
|
+
|
|
7
|
+
import pytest
|
|
8
|
+
|
|
7
9
|
from scholarx.models import Paper, PaperSource
|
|
8
|
-
from scholarx.queue import
|
|
10
|
+
from scholarx.queue import BACKGROUND_DOWNLOADS, JOB_QUEUE, POOL_SIZE
|
|
9
11
|
|
|
10
12
|
|
|
11
13
|
@pytest.fixture(autouse=True)
|
|
@@ -143,9 +145,7 @@ def test_queue_pool_drains_many_jobs_with_bounded_concurrency(monkeypatch):
|
|
|
143
145
|
|
|
144
146
|
job_ids = []
|
|
145
147
|
for i in range(n_jobs):
|
|
146
|
-
paper = Paper(
|
|
147
|
-
id=f"arxiv:pool-{i}", title=f"Pool Paper {i}", authors=["Z"], source=PaperSource.ARXIV
|
|
148
|
-
)
|
|
148
|
+
paper = Paper(id=f"arxiv:pool-{i}", title=f"Pool Paper {i}", authors=["Z"], source=PaperSource.ARXIV)
|
|
149
149
|
job_id = f"job-pool-{i}"
|
|
150
150
|
job_ids.append(job_id)
|
|
151
151
|
BACKGROUND_DOWNLOADS[job_id] = {"status": "queued", "paper_id": paper.id}
|
|
@@ -190,6 +190,6 @@ def test_rate_gate_throttles_starts(monkeypatch):
|
|
|
190
190
|
t.join()
|
|
191
191
|
|
|
192
192
|
starts.sort()
|
|
193
|
-
gaps = [b - a for a, b in zip(starts, starts[1:])]
|
|
193
|
+
gaps = [b - a for a, b in zip(starts, starts[1:], strict=False)]
|
|
194
194
|
# Every consecutive pair of starts is separated by ~>= the min interval.
|
|
195
195
|
assert all(g >= q._MIN_START_INTERVAL - 0.01 for g in gaps)
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"_comment": "Tier-1 mcp_tool source preset(s) for scholarx (AU-KG.ingest.mcp-tool-connector). Syncs research papers into the KG as research_paper documents via the scholarx MCP server's sx_search tool. Contributed presets win over the central MCP_TOOL_PRESETS.",
|
|
3
|
-
"scholarx-papers": {
|
|
4
|
-
"server": "scholarx-mcp",
|
|
5
|
-
"tool": "scholarx_search",
|
|
6
|
-
"records_path": "papers",
|
|
7
|
-
"id_field": "id",
|
|
8
|
-
"title_field": "title",
|
|
9
|
-
"text_field": "abstract",
|
|
10
|
-
"updated_field": "published_date",
|
|
11
|
-
"doc_type": "research_paper",
|
|
12
|
-
"params_style": "args"
|
|
13
|
-
}
|
|
14
|
-
}
|
|
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
|
|
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
|