academic-research-kernel 2.0.0__py3-none-any.whl
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.
- academic_research_kernel/__init__.py +2 -0
- academic_research_kernel/__main__.py +3 -0
- academic_research_kernel/_version.py +2 -0
- academic_research_kernel/artifact-adapter-matrix.json +178 -0
- academic_research_kernel/cli.py +90 -0
- academic_research_kernel/graph.py +1184 -0
- academic_research_kernel/hardware_probe.py +156 -0
- academic_research_kernel/identity.py +524 -0
- academic_research_kernel/ingestion/__init__.py +52 -0
- academic_research_kernel/ingestion/adapters.py +1989 -0
- academic_research_kernel/ingestion/commitments.py +265 -0
- academic_research_kernel/ingestion/contracts.py +212 -0
- academic_research_kernel/ingestion/engine.py +269 -0
- academic_research_kernel/ingestion/models.py +1024 -0
- academic_research_kernel/ingestion/registry.py +115 -0
- academic_research_kernel/ledger.py +2348 -0
- academic_research_kernel/mcp_server.py +898 -0
- academic_research_kernel/provenance.py +941 -0
- academic_research_kernel/recompute.py +513 -0
- academic_research_kernel/schemas/artifact-ingestion-receipt.schema.json +356 -0
- academic_research_kernel/schemas/claim-evidence-graph.schema.json +176 -0
- academic_research_kernel/schemas/computation-artifact.schema.json +17 -0
- academic_research_kernel/schemas/compute-receipt.schema.json +98 -0
- academic_research_kernel/schemas/cross-review-artifact.schema.json +23 -0
- academic_research_kernel/schemas/decision-ledger-receipt.schema.json +667 -0
- academic_research_kernel/schemas/evidence-receipt.schema.json +81 -0
- academic_research_kernel/schemas/ingestion-kernel-state.schema.json +116 -0
- academic_research_kernel/schemas/legacy-academic-evidence.schema.json +174 -0
- academic_research_kernel/schemas/lineage-receipt.schema.json +196 -0
- academic_research_kernel/schemas/literature-analysis-artifact.schema.json +48 -0
- academic_research_kernel/schemas/literature-delta.schema.json +14 -0
- academic_research_kernel/schemas/opaque-manuscript.schema.json +15 -0
- academic_research_kernel/schemas/quantitative-audit.schema.json +66 -0
- academic_research_kernel/schemas/reproduction-receipt.schema.json +21 -0
- academic_research_kernel/schemas/research-artifact-envelope.schema.json +112 -0
- academic_research_kernel/schemas/research-object.schema.json +164 -0
- academic_research_kernel/schemas/retraction-delta.schema.json +117 -0
- academic_research_kernel/schemas/review-finding.schema.json +47 -0
- academic_research_kernel/schemas/review-panel-spec.schema.json +69 -0
- academic_research_kernel/schemas/review-result.schema.json +36 -0
- academic_research_kernel/schemas/review-run-receipt.schema.json +52 -0
- academic_research_kernel/schemas/systematic-review-artifact.schema.json +18 -0
- academic_research_kernel/shared_contracts/__init__.py +33 -0
- academic_research_kernel/shared_contracts/evidence.py +1167 -0
- academic_research_kernel-2.0.0.dist-info/METADATA +229 -0
- academic_research_kernel-2.0.0.dist-info/RECORD +53 -0
- academic_research_kernel-2.0.0.dist-info/WHEEL +4 -0
- academic_research_kernel-2.0.0.dist-info/entry_points.txt +2 -0
- academic_research_kernel-2.0.0.dist-info/licenses/LICENSE +176 -0
- academic_research_kernel-2.0.0.dist-info/licenses/LICENSE-APPLICATION.md +21 -0
- academic_research_kernel-2.0.0.dist-info/licenses/LICENSE-HISTORY.md +26 -0
- academic_research_kernel-2.0.0.dist-info/licenses/LICENSES/MIT-pre-SLL.txt +21 -0
- academic_research_kernel-2.0.0.dist-info/licenses/SOURCE-LINEAGE.md +38 -0
|
@@ -0,0 +1,178 @@
|
|
|
1
|
+
{
|
|
2
|
+
"protocol": "artifact-adapter-matrix-1.0",
|
|
3
|
+
"total_adapters": 14,
|
|
4
|
+
"adapters": [
|
|
5
|
+
{
|
|
6
|
+
"adapter_id": "adapter-academic-source-verification",
|
|
7
|
+
"adapter_version": "1.0.0",
|
|
8
|
+
"tier": 1,
|
|
9
|
+
"is_lossless": true,
|
|
10
|
+
"accepted_producers": [
|
|
11
|
+
"academic-source-verification"
|
|
12
|
+
],
|
|
13
|
+
"accepted_schemas": [
|
|
14
|
+
"academic-evidence-1.0",
|
|
15
|
+
"evidence-receipt-1.0"
|
|
16
|
+
]
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
"adapter_id": "adapter-research-object-identity",
|
|
20
|
+
"adapter_version": "1.0.0",
|
|
21
|
+
"tier": 1,
|
|
22
|
+
"is_lossless": true,
|
|
23
|
+
"accepted_producers": [
|
|
24
|
+
"research-object-identity"
|
|
25
|
+
],
|
|
26
|
+
"accepted_schemas": [
|
|
27
|
+
"lineage-receipt-1.0",
|
|
28
|
+
"research-object-1.0"
|
|
29
|
+
]
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
"adapter_id": "adapter-claim-evidence-graph",
|
|
33
|
+
"adapter_version": "1.0.0",
|
|
34
|
+
"tier": 1,
|
|
35
|
+
"is_lossless": true,
|
|
36
|
+
"accepted_producers": [
|
|
37
|
+
"claim-evidence-graph"
|
|
38
|
+
],
|
|
39
|
+
"accepted_schemas": [
|
|
40
|
+
"ceg-snapshot-1.0",
|
|
41
|
+
"claim-evidence-graph-1.0"
|
|
42
|
+
]
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
"adapter_id": "adapter-decision-ledger",
|
|
46
|
+
"adapter_version": "1.0.0",
|
|
47
|
+
"tier": 1,
|
|
48
|
+
"is_lossless": true,
|
|
49
|
+
"accepted_producers": [
|
|
50
|
+
"decision-ledger"
|
|
51
|
+
],
|
|
52
|
+
"accepted_schemas": [
|
|
53
|
+
"decision-ledger-1.0"
|
|
54
|
+
]
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
"adapter_id": "adapter-quantitative-paper-audit",
|
|
58
|
+
"adapter_version": "1.0.0",
|
|
59
|
+
"tier": 2,
|
|
60
|
+
"is_lossless": false,
|
|
61
|
+
"accepted_producers": [
|
|
62
|
+
"quantitative-paper-audit"
|
|
63
|
+
],
|
|
64
|
+
"accepted_schemas": [
|
|
65
|
+
"quantitative-audit-1.0"
|
|
66
|
+
]
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
"adapter_id": "adapter-research-reproducibility",
|
|
70
|
+
"adapter_version": "1.0.0",
|
|
71
|
+
"tier": 2,
|
|
72
|
+
"is_lossless": false,
|
|
73
|
+
"accepted_producers": [
|
|
74
|
+
"research-reproducibility"
|
|
75
|
+
],
|
|
76
|
+
"accepted_schemas": [
|
|
77
|
+
"reproduction-receipt-1.0"
|
|
78
|
+
]
|
|
79
|
+
},
|
|
80
|
+
{
|
|
81
|
+
"adapter_id": "adapter-cross-review-five",
|
|
82
|
+
"adapter_version": "1.0.0",
|
|
83
|
+
"tier": 2,
|
|
84
|
+
"is_lossless": false,
|
|
85
|
+
"accepted_producers": [
|
|
86
|
+
"cross-review-five"
|
|
87
|
+
],
|
|
88
|
+
"accepted_schemas": [
|
|
89
|
+
"cross-review-2.0",
|
|
90
|
+
"cross-review-finding-1.0"
|
|
91
|
+
]
|
|
92
|
+
},
|
|
93
|
+
{
|
|
94
|
+
"adapter_id": "adapter-systematic-review",
|
|
95
|
+
"adapter_version": "1.0.0",
|
|
96
|
+
"tier": 2,
|
|
97
|
+
"is_lossless": false,
|
|
98
|
+
"accepted_producers": [
|
|
99
|
+
"systematic-review-meta-analysis"
|
|
100
|
+
],
|
|
101
|
+
"accepted_schemas": [
|
|
102
|
+
"meta-analysis-1.0",
|
|
103
|
+
"screening-matrix-1.0"
|
|
104
|
+
]
|
|
105
|
+
},
|
|
106
|
+
{
|
|
107
|
+
"adapter_id": "adapter-literature-analysis",
|
|
108
|
+
"adapter_version": "1.0.0",
|
|
109
|
+
"tier": 2,
|
|
110
|
+
"is_lossless": false,
|
|
111
|
+
"accepted_producers": [
|
|
112
|
+
"literature-analysis"
|
|
113
|
+
],
|
|
114
|
+
"accepted_schemas": [
|
|
115
|
+
"canonical-work-1.0",
|
|
116
|
+
"corpus-matrix-1.0"
|
|
117
|
+
]
|
|
118
|
+
},
|
|
119
|
+
{
|
|
120
|
+
"adapter_id": "adapter-literature-watch",
|
|
121
|
+
"adapter_version": "1.0.0",
|
|
122
|
+
"tier": 2,
|
|
123
|
+
"is_lossless": false,
|
|
124
|
+
"accepted_producers": [
|
|
125
|
+
"literature-watch"
|
|
126
|
+
],
|
|
127
|
+
"accepted_schemas": [
|
|
128
|
+
"literature-delta-1.0"
|
|
129
|
+
]
|
|
130
|
+
},
|
|
131
|
+
{
|
|
132
|
+
"adapter_id": "adapter-retraction-watch",
|
|
133
|
+
"adapter_version": "1.0.0",
|
|
134
|
+
"tier": 2,
|
|
135
|
+
"is_lossless": false,
|
|
136
|
+
"accepted_producers": [
|
|
137
|
+
"retraction-watch"
|
|
138
|
+
],
|
|
139
|
+
"accepted_schemas": [
|
|
140
|
+
"retraction-alert-1.0",
|
|
141
|
+
"retraction-delta-1.0"
|
|
142
|
+
]
|
|
143
|
+
},
|
|
144
|
+
{
|
|
145
|
+
"adapter_id": "adapter-math-computation",
|
|
146
|
+
"adapter_version": "1.0.0",
|
|
147
|
+
"tier": 2,
|
|
148
|
+
"is_lossless": false,
|
|
149
|
+
"accepted_producers": [
|
|
150
|
+
"math-computation"
|
|
151
|
+
],
|
|
152
|
+
"accepted_schemas": [
|
|
153
|
+
"computation-receipt-1.0"
|
|
154
|
+
]
|
|
155
|
+
},
|
|
156
|
+
{
|
|
157
|
+
"adapter_id": "adapter-academic-writing",
|
|
158
|
+
"adapter_version": "1.0.0",
|
|
159
|
+
"tier": 3,
|
|
160
|
+
"is_lossless": false,
|
|
161
|
+
"accepted_producers": [
|
|
162
|
+
"academic-writing"
|
|
163
|
+
],
|
|
164
|
+
"accepted_schemas": [
|
|
165
|
+
"manuscript-opaque-1.0",
|
|
166
|
+
"submission-package-1.0"
|
|
167
|
+
]
|
|
168
|
+
},
|
|
169
|
+
{
|
|
170
|
+
"adapter_id": "adapter-opaque-fallback",
|
|
171
|
+
"adapter_version": "1.0.0",
|
|
172
|
+
"tier": 3,
|
|
173
|
+
"is_lossless": false,
|
|
174
|
+
"accepted_producers": [],
|
|
175
|
+
"accepted_schemas": []
|
|
176
|
+
}
|
|
177
|
+
]
|
|
178
|
+
}
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
"""Small installation/stdio boundary; no research workflow orchestration."""
|
|
2
|
+
import argparse
|
|
3
|
+
import importlib
|
|
4
|
+
from importlib import metadata, resources, util
|
|
5
|
+
import json
|
|
6
|
+
import os
|
|
7
|
+
import platform
|
|
8
|
+
import sys
|
|
9
|
+
|
|
10
|
+
from ._version import __version__
|
|
11
|
+
|
|
12
|
+
REQUIRED = ('jsonschema', 'numpy', 'scipy', 'statsmodels')
|
|
13
|
+
OPTIONAL = ('sympy', 'matplotlib', 'sklearn', 'networkx', 'lifelines', 'arch', 'pingouin', 'torch', 'cupy')
|
|
14
|
+
SERVICES = ('OPENALEX_API_KEY', 'UNPAYWALL_EMAIL', 'SCITE_API_KEY', 'WOS_API_KEY',
|
|
15
|
+
'SCOPUS_API_KEY', 'DIMENSIONS_API_KEY')
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
def doctor():
|
|
19
|
+
"""Offline installation check. Values of external configuration never leave here."""
|
|
20
|
+
report = {'version': __version__, 'python': {'executable': sys.executable,
|
|
21
|
+
'version': platform.python_version()}, 'package_location': str(resources.files('academic_research_kernel')),
|
|
22
|
+
'required_dependencies': {}, 'optional_dependencies': {},
|
|
23
|
+
'external_services': {key: 'configured' if os.environ.get(key) else 'unconfigured (optional)' for key in SERVICES},
|
|
24
|
+
'errors': []}
|
|
25
|
+
for name in REQUIRED:
|
|
26
|
+
try:
|
|
27
|
+
importlib.import_module(name)
|
|
28
|
+
report['required_dependencies'][name] = metadata.version(name)
|
|
29
|
+
except Exception as exc:
|
|
30
|
+
report['required_dependencies'][name] = 'unavailable'
|
|
31
|
+
report['errors'].append(f'{name}: {type(exc).__name__}')
|
|
32
|
+
for name in OPTIONAL:
|
|
33
|
+
report['optional_dependencies'][name] = 'available' if util.find_spec(name) else 'not installed (optional)'
|
|
34
|
+
try:
|
|
35
|
+
from jsonschema import Draft202012Validator
|
|
36
|
+
schemas = list(resources.files('academic_research_kernel').joinpath('schemas').iterdir())
|
|
37
|
+
schemas = [p for p in schemas if p.name.endswith('.json')]
|
|
38
|
+
if len(schemas) != 23:
|
|
39
|
+
raise ValueError('incomplete schema inventory')
|
|
40
|
+
for path in schemas:
|
|
41
|
+
Draft202012Validator.check_schema(json.loads(path.read_text(encoding='utf-8')))
|
|
42
|
+
report['schema_resources'] = {'status': 'ok', 'count': len(schemas)}
|
|
43
|
+
matrix = resources.files('academic_research_kernel').joinpath('artifact-adapter-matrix.json')
|
|
44
|
+
json.loads(matrix.read_text(encoding='utf-8'))
|
|
45
|
+
except Exception as exc:
|
|
46
|
+
report['schema_resources'] = {'status': 'error'}
|
|
47
|
+
report['errors'].append(f'resources: {type(exc).__name__}')
|
|
48
|
+
try:
|
|
49
|
+
from . import mcp_server
|
|
50
|
+
report['mcp'] = {'importable': True, 'tool_count': len(mcp_server.TOOLS)}
|
|
51
|
+
if len(mcp_server.TOOLS) != 12:
|
|
52
|
+
raise ValueError('unexpected tool count')
|
|
53
|
+
pct = mcp_server.handle_tool_call('academic_check_percentage', {'count': 10, 'percent': 50, 'sample_size': 20})
|
|
54
|
+
if pct.get('consistent') is not True:
|
|
55
|
+
raise ValueError('statistics check failed')
|
|
56
|
+
except Exception as exc:
|
|
57
|
+
report['mcp'] = {'importable': False}
|
|
58
|
+
report['errors'].append(f'MCP: {type(exc).__name__}')
|
|
59
|
+
report['status'] = 'ok' if not report['errors'] else 'error'
|
|
60
|
+
return report
|
|
61
|
+
|
|
62
|
+
|
|
63
|
+
def main(argv=None):
|
|
64
|
+
if not (3, 10) <= sys.version_info[:2] < (3, 15):
|
|
65
|
+
print('academic-research-kernel requires Python 3.10–3.14; use uvx --python 3.12 academic-research-kernel.', file=sys.stderr)
|
|
66
|
+
return 2
|
|
67
|
+
parser = argparse.ArgumentParser(description=__doc__)
|
|
68
|
+
parser.add_argument('--version', action='version', version=__version__)
|
|
69
|
+
commands = parser.add_subparsers(dest='command', required=True)
|
|
70
|
+
check = commands.add_parser('doctor', help='offline environment diagnostic')
|
|
71
|
+
check.add_argument('--json', action='store_true', help='machine-readable JSON')
|
|
72
|
+
commands.add_parser('mcp', help='serve the existing 12 MCP tools over stdio')
|
|
73
|
+
args = parser.parse_args(argv)
|
|
74
|
+
if args.command == 'doctor':
|
|
75
|
+
report = doctor()
|
|
76
|
+
if args.json:
|
|
77
|
+
print(json.dumps(report, indent=2))
|
|
78
|
+
else:
|
|
79
|
+
print(f'academic-research-kernel {__version__}: {report["status"]}')
|
|
80
|
+
for key, value in report.items():
|
|
81
|
+
if key not in ('version', 'status'):
|
|
82
|
+
print(f'{key}: {json.dumps(value, ensure_ascii=False)}')
|
|
83
|
+
return 0 if report['status'] == 'ok' else 1
|
|
84
|
+
try:
|
|
85
|
+
from .mcp_server import main as serve
|
|
86
|
+
except ImportError:
|
|
87
|
+
print('Incomplete runtime installation. Run academic-research-kernel doctor.', file=sys.stderr)
|
|
88
|
+
return 1
|
|
89
|
+
serve()
|
|
90
|
+
return 0
|