jentic-apitools-score 0.0.0a9__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.
- jentic_apitools_score-0.0.0a9/LICENSE +202 -0
- jentic_apitools_score-0.0.0a9/NOTICE +4 -0
- jentic_apitools_score-0.0.0a9/PKG-INFO +59 -0
- jentic_apitools_score-0.0.0a9/README.md +43 -0
- jentic_apitools_score-0.0.0a9/pyproject.toml +29 -0
- jentic_apitools_score-0.0.0a9/src/jentic/apitools/score/framework/README.md +267 -0
- jentic_apitools_score-0.0.0a9/src/jentic/apitools/score/framework/__init__.py +64 -0
- jentic_apitools_score-0.0.0a9/src/jentic/apitools/score/framework/calculators/__init__.py +23 -0
- jentic_apitools_score-0.0.0a9/src/jentic/apitools/score/framework/calculators/dimensions/__init__.py +59 -0
- jentic_apitools_score-0.0.0a9/src/jentic/apitools/score/framework/calculators/dimensions/airu/__init__.py +11 -0
- jentic_apitools_score-0.0.0a9/src/jentic/apitools/score/framework/calculators/dimensions/airu/arax.py +66 -0
- jentic_apitools_score-0.0.0a9/src/jentic/apitools/score/framework/calculators/dimensions/airu/au.py +66 -0
- jentic_apitools_score-0.0.0a9/src/jentic/apitools/score/framework/calculators/dimensions/fdx/__init__.py +11 -0
- jentic_apitools_score-0.0.0a9/src/jentic/apitools/score/framework/calculators/dimensions/fdx/dxj.py +66 -0
- jentic_apitools_score-0.0.0a9/src/jentic/apitools/score/framework/calculators/dimensions/fdx/fc.py +66 -0
- jentic_apitools_score-0.0.0a9/src/jentic/apitools/score/framework/calculators/dimensions/tsd/__init__.py +11 -0
- jentic_apitools_score-0.0.0a9/src/jentic/apitools/score/framework/calculators/dimensions/tsd/aid.py +66 -0
- jentic_apitools_score-0.0.0a9/src/jentic/apitools/score/framework/calculators/dimensions/tsd/sec.py +66 -0
- jentic_apitools_score-0.0.0a9/src/jentic/apitools/score/framework/calculators/final_score.py +81 -0
- jentic_apitools_score-0.0.0a9/src/jentic/apitools/score/framework/calculators/grade.py +109 -0
- jentic_apitools_score-0.0.0a9/src/jentic/apitools/score/framework/calculators/groups/__init__.py +57 -0
- jentic_apitools_score-0.0.0a9/src/jentic/apitools/score/framework/calculators/groups/airu.py +58 -0
- jentic_apitools_score-0.0.0a9/src/jentic/apitools/score/framework/calculators/groups/fdx.py +58 -0
- jentic_apitools_score-0.0.0a9/src/jentic/apitools/score/framework/calculators/groups/tsd.py +58 -0
- jentic_apitools_score-0.0.0a9/src/jentic/apitools/score/framework/calculators/maturity.py +91 -0
- jentic_apitools_score-0.0.0a9/src/jentic/apitools/score/framework/calculators/readiness.py +81 -0
- jentic_apitools_score-0.0.0a9/src/jentic/apitools/score/framework/calculators/signals/__init__.py +45 -0
- jentic_apitools_score-0.0.0a9/src/jentic/apitools/score/framework/calculators/signals/airu/__init__.py +13 -0
- jentic_apitools_score-0.0.0a9/src/jentic/apitools/score/framework/calculators/signals/airu/arax/__init__.py +17 -0
- jentic_apitools_score-0.0.0a9/src/jentic/apitools/score/framework/calculators/signals/airu/arax/description_coverage.py +130 -0
- jentic_apitools_score-0.0.0a9/src/jentic/apitools/score/framework/calculators/signals/airu/arax/error_standardization.py +137 -0
- jentic_apitools_score-0.0.0a9/src/jentic/apitools/score/framework/calculators/signals/airu/arax/opid_quality.py +249 -0
- jentic_apitools_score-0.0.0a9/src/jentic/apitools/score/framework/calculators/signals/airu/arax/summary_coverage.py +123 -0
- jentic_apitools_score-0.0.0a9/src/jentic/apitools/score/framework/calculators/signals/airu/au/__init__.py +17 -0
- jentic_apitools_score-0.0.0a9/src/jentic/apitools/score/framework/calculators/signals/airu/au/complexity_comfort.py +184 -0
- jentic_apitools_score-0.0.0a9/src/jentic/apitools/score/framework/calculators/signals/fdx/__init__.py +15 -0
- jentic_apitools_score-0.0.0a9/src/jentic/apitools/score/framework/calculators/signals/fdx/dxj/__init__.py +18 -0
- jentic_apitools_score-0.0.0a9/src/jentic/apitools/score/framework/calculators/signals/fdx/dxj/example_density.py +112 -0
- jentic_apitools_score-0.0.0a9/src/jentic/apitools/score/framework/calculators/signals/fdx/dxj/example_validity.py +126 -0
- jentic_apitools_score-0.0.0a9/src/jentic/apitools/score/framework/calculators/signals/fdx/dxj/response_coverage.py +122 -0
- jentic_apitools_score-0.0.0a9/src/jentic/apitools/score/framework/calculators/signals/fdx/dxj/tooling_readiness.py +114 -0
- jentic_apitools_score-0.0.0a9/src/jentic/apitools/score/framework/calculators/signals/fdx/fc/__init__.py +18 -0
- jentic_apitools_score-0.0.0a9/src/jentic/apitools/score/framework/calculators/signals/fdx/fc/lint_results.py +123 -0
- jentic_apitools_score-0.0.0a9/src/jentic/apitools/score/framework/calculators/signals/fdx/fc/resolution_completeness.py +102 -0
- jentic_apitools_score-0.0.0a9/src/jentic/apitools/score/framework/calculators/signals/fdx/fc/spec_validity.py +130 -0
- jentic_apitools_score-0.0.0a9/src/jentic/apitools/score/framework/calculators/signals/fdx/fc/structural_integrity.py +139 -0
- jentic_apitools_score-0.0.0a9/src/jentic/apitools/score/framework/calculators/signals/registry.py +279 -0
- jentic_apitools_score-0.0.0a9/src/jentic/apitools/score/framework/calculators/signals/tsd/__init__.py +13 -0
- jentic_apitools_score-0.0.0a9/src/jentic/apitools/score/framework/calculators/signals/tsd/aid/__init__.py +17 -0
- jentic_apitools_score-0.0.0a9/src/jentic/apitools/score/framework/calculators/signals/tsd/aid/descriptive_richness.py +236 -0
- jentic_apitools_score-0.0.0a9/src/jentic/apitools/score/framework/calculators/signals/tsd/sec/__init__.py +17 -0
- jentic_apitools_score-0.0.0a9/src/jentic/apitools/score/framework/calculators/signals/tsd/sec/auth_strength.py +348 -0
- jentic_apitools_score-0.0.0a9/src/jentic/apitools/score/framework/constants.py +22 -0
- jentic_apitools_score-0.0.0a9/src/jentic/apitools/score/framework/enums.py +430 -0
- jentic_apitools_score-0.0.0a9/src/jentic/apitools/score/framework/models.py +291 -0
- jentic_apitools_score-0.0.0a9/src/jentic/apitools/score/framework/normalizers.py +639 -0
- jentic_apitools_score-0.0.0a9/src/jentic/apitools/score/score.py +232 -0
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
|
|
2
|
+
Apache License
|
|
3
|
+
Version 2.0, January 2004
|
|
4
|
+
http://www.apache.org/licenses/
|
|
5
|
+
|
|
6
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
7
|
+
|
|
8
|
+
1. Definitions.
|
|
9
|
+
|
|
10
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
11
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
12
|
+
|
|
13
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
14
|
+
the copyright owner that is granting the License.
|
|
15
|
+
|
|
16
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
17
|
+
other entities that control, are controlled by, or are under common
|
|
18
|
+
control with that entity. For the purposes of this definition,
|
|
19
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
20
|
+
direction or management of such entity, whether by contract or
|
|
21
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
22
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
23
|
+
|
|
24
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
25
|
+
exercising permissions granted by this License.
|
|
26
|
+
|
|
27
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
28
|
+
including but not limited to software source code, documentation
|
|
29
|
+
source, and configuration files.
|
|
30
|
+
|
|
31
|
+
"Object" form shall mean any form resulting from mechanical
|
|
32
|
+
transformation or translation of a Source form, including but
|
|
33
|
+
not limited to compiled object code, generated documentation,
|
|
34
|
+
and conversions to other media types.
|
|
35
|
+
|
|
36
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
37
|
+
Object form, made available under the License, as indicated by a
|
|
38
|
+
copyright notice that is included in or attached to the work
|
|
39
|
+
(an example is provided in the Appendix below).
|
|
40
|
+
|
|
41
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
42
|
+
form, that is based on (or derived from) the Work and for which the
|
|
43
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
44
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
45
|
+
of this License, Derivative Works shall not include works that remain
|
|
46
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
47
|
+
the Work and Derivative Works thereof.
|
|
48
|
+
|
|
49
|
+
"Contribution" shall mean any work of authorship, including
|
|
50
|
+
the original version of the Work and any modifications or additions
|
|
51
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
52
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
53
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
54
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
55
|
+
means any form of electronic, verbal, or written communication sent
|
|
56
|
+
to the Licensor or its representatives, including but not limited to
|
|
57
|
+
communication on electronic mailing lists, source code control systems,
|
|
58
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
59
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
60
|
+
excluding communication that is conspicuously marked or otherwise
|
|
61
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
62
|
+
|
|
63
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
64
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
65
|
+
subsequently incorporated within the Work.
|
|
66
|
+
|
|
67
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
68
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
69
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
70
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
71
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
72
|
+
Work and such Derivative Works in Source or Object form.
|
|
73
|
+
|
|
74
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
75
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
76
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
77
|
+
(except as stated in this section) patent license to make, have made,
|
|
78
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
79
|
+
where such license applies only to those patent claims licensable
|
|
80
|
+
by such Contributor that are necessarily infringed by their
|
|
81
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
82
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
83
|
+
institute patent litigation against any entity (including a
|
|
84
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
85
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
86
|
+
or contributory patent infringement, then any patent licenses
|
|
87
|
+
granted to You under this License for that Work shall terminate
|
|
88
|
+
as of the date such litigation is filed.
|
|
89
|
+
|
|
90
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
91
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
92
|
+
modifications, and in Source or Object form, provided that You
|
|
93
|
+
meet the following conditions:
|
|
94
|
+
|
|
95
|
+
(a) You must give any other recipients of the Work or
|
|
96
|
+
Derivative Works a copy of this License; and
|
|
97
|
+
|
|
98
|
+
(b) You must cause any modified files to carry prominent notices
|
|
99
|
+
stating that You changed the files; and
|
|
100
|
+
|
|
101
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
102
|
+
that You distribute, all copyright, patent, trademark, and
|
|
103
|
+
attribution notices from the Source form of the Work,
|
|
104
|
+
excluding those notices that do not pertain to any part of
|
|
105
|
+
the Derivative Works; and
|
|
106
|
+
|
|
107
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
108
|
+
distribution, then any Derivative Works that You distribute must
|
|
109
|
+
include a readable copy of the attribution notices contained
|
|
110
|
+
within such NOTICE file, excluding those notices that do not
|
|
111
|
+
pertain to any part of the Derivative Works, in at least one
|
|
112
|
+
of the following places: within a NOTICE text file distributed
|
|
113
|
+
as part of the Derivative Works; within the Source form or
|
|
114
|
+
documentation, if provided along with the Derivative Works; or,
|
|
115
|
+
within a display generated by the Derivative Works, if and
|
|
116
|
+
wherever such third-party notices normally appear. The contents
|
|
117
|
+
of the NOTICE file are for informational purposes only and
|
|
118
|
+
do not modify the License. You may add Your own attribution
|
|
119
|
+
notices within Derivative Works that You distribute, alongside
|
|
120
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
121
|
+
that such additional attribution notices cannot be construed
|
|
122
|
+
as modifying the License.
|
|
123
|
+
|
|
124
|
+
You may add Your own copyright statement to Your modifications and
|
|
125
|
+
may provide additional or different license terms and conditions
|
|
126
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
127
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
128
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
129
|
+
the conditions stated in this License.
|
|
130
|
+
|
|
131
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
132
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
133
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
134
|
+
this License, without any additional terms or conditions.
|
|
135
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
136
|
+
the terms of any separate license agreement you may have executed
|
|
137
|
+
with Licensor regarding such Contributions.
|
|
138
|
+
|
|
139
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
140
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
141
|
+
except as required for reasonable and customary use in describing the
|
|
142
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
143
|
+
|
|
144
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
145
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
146
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
147
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
148
|
+
implied, including, without limitation, any warranties or conditions
|
|
149
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
150
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
151
|
+
appropriateness of using or redistributing the Work and assume any
|
|
152
|
+
risks associated with Your exercise of permissions under this License.
|
|
153
|
+
|
|
154
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
155
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
156
|
+
unless required by applicable law (such as deliberate and grossly
|
|
157
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
158
|
+
liable to You for damages, including any direct, indirect, special,
|
|
159
|
+
incidental, or consequential damages of any character arising as a
|
|
160
|
+
result of this License or out of the use or inability to use the
|
|
161
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
162
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
163
|
+
other commercial damages or losses), even if such Contributor
|
|
164
|
+
has been advised of the possibility of such damages.
|
|
165
|
+
|
|
166
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
167
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
168
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
169
|
+
or other liability obligations and/or rights consistent with this
|
|
170
|
+
License. However, in accepting such obligations, You may act only
|
|
171
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
172
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
173
|
+
defend, and hold each Contributor harmless for any liability
|
|
174
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
175
|
+
of your accepting any such warranty or additional liability.
|
|
176
|
+
|
|
177
|
+
END OF TERMS AND CONDITIONS
|
|
178
|
+
|
|
179
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
180
|
+
|
|
181
|
+
To apply the Apache License to your work, attach the following
|
|
182
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
183
|
+
replaced with your own identifying information. (Don't include
|
|
184
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
185
|
+
comment syntax for the file format. We also recommend that a
|
|
186
|
+
file or class name and description of purpose be included on the
|
|
187
|
+
same "printed page" as the copyright notice for easier
|
|
188
|
+
identification within third-party archives.
|
|
189
|
+
|
|
190
|
+
Copyright [yyyy] [name of copyright owner]
|
|
191
|
+
|
|
192
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
193
|
+
you may not use this file except in compliance with the License.
|
|
194
|
+
You may obtain a copy of the License at
|
|
195
|
+
|
|
196
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
197
|
+
|
|
198
|
+
Unless required by applicable law or agreed to in writing, software
|
|
199
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
200
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
201
|
+
See the License for the specific language governing permissions and
|
|
202
|
+
limitations under the License.
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: jentic-apitools-score
|
|
3
|
+
Version: 0.0.0a9
|
|
4
|
+
Summary: Jentic Apitools Score - Calculate AI-readiness scores for OpenAPI specifications using the 6-dimension framework
|
|
5
|
+
Author: Jentic
|
|
6
|
+
Author-email: Jentic <hello@jentic.com>
|
|
7
|
+
License-Expression: Apache-2.0
|
|
8
|
+
License-File: LICENSE
|
|
9
|
+
License-File: NOTICE
|
|
10
|
+
Requires-Dist: pydantic>=2.7,<3.0
|
|
11
|
+
Requires-Dist: jentic-apitools-common~=0.0.0a9
|
|
12
|
+
Requires-Dist: jentic-apitools-analyze~=0.0.0a9
|
|
13
|
+
Requires-Python: >=3.11
|
|
14
|
+
Project-URL: Homepage, https://github.com/jentic/jentic-apitools
|
|
15
|
+
Description-Content-Type: text/markdown
|
|
16
|
+
|
|
17
|
+
# score
|
|
18
|
+
|
|
19
|
+
AI-readiness scoring framework for OpenAPI specifications using 6 dimensions organized into 3 groups: FDX (Foundational and DX), AIRU (AI-Readiness and Usability), and TSD (Trust, Security and Discoverability).
|
|
20
|
+
|
|
21
|
+
## Key Features
|
|
22
|
+
|
|
23
|
+
The scoring framework evaluates specs across six dimensions (FC, DXJ, ARAX, AU, SEC, AID), each fed by multiple signals that measure specific quality aspects like spec validity, example density, description coverage, error standardization, auth strength, and more. Signal values are normalized and aggregated into dimension scores (0-100), group scores, and a final weighted score using a harmonic mean. The final score maps to a letter grade (A+ through F) and a maturity level (non-ready, foundational, ai-aware, ai-ready, agent-optimized).
|
|
24
|
+
|
|
25
|
+
## Dependencies
|
|
26
|
+
|
|
27
|
+
Internal: `jentic.apitools.common`, `jentic.apitools.analyze`.
|
|
28
|
+
|
|
29
|
+
## Installation
|
|
30
|
+
|
|
31
|
+
```bash
|
|
32
|
+
uv add score
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
## Quick Start
|
|
36
|
+
|
|
37
|
+
```python
|
|
38
|
+
from pathlib import Path
|
|
39
|
+
from jentic.apitools.score.score import calculate_score
|
|
40
|
+
|
|
41
|
+
score = calculate_score(
|
|
42
|
+
spec_path=Path("spec.json"),
|
|
43
|
+
spec_content={"openapi": "3.1.0", ...},
|
|
44
|
+
diagnostics=diagnostics,
|
|
45
|
+
vendor="example",
|
|
46
|
+
api_name="my-api",
|
|
47
|
+
version="1.0",
|
|
48
|
+
oas_version="3.1.0",
|
|
49
|
+
oas_request_meta=meta,
|
|
50
|
+
source_url="https://example.com/api.json",
|
|
51
|
+
artifacts_root=Path("/tmp"),
|
|
52
|
+
)
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
## Testing
|
|
56
|
+
|
|
57
|
+
```bash
|
|
58
|
+
uv run --package score pytest packages/score/tests -v
|
|
59
|
+
```
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
# score
|
|
2
|
+
|
|
3
|
+
AI-readiness scoring framework for OpenAPI specifications using 6 dimensions organized into 3 groups: FDX (Foundational and DX), AIRU (AI-Readiness and Usability), and TSD (Trust, Security and Discoverability).
|
|
4
|
+
|
|
5
|
+
## Key Features
|
|
6
|
+
|
|
7
|
+
The scoring framework evaluates specs across six dimensions (FC, DXJ, ARAX, AU, SEC, AID), each fed by multiple signals that measure specific quality aspects like spec validity, example density, description coverage, error standardization, auth strength, and more. Signal values are normalized and aggregated into dimension scores (0-100), group scores, and a final weighted score using a harmonic mean. The final score maps to a letter grade (A+ through F) and a maturity level (non-ready, foundational, ai-aware, ai-ready, agent-optimized).
|
|
8
|
+
|
|
9
|
+
## Dependencies
|
|
10
|
+
|
|
11
|
+
Internal: `jentic.apitools.common`, `jentic.apitools.analyze`.
|
|
12
|
+
|
|
13
|
+
## Installation
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
uv add score
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
## Quick Start
|
|
20
|
+
|
|
21
|
+
```python
|
|
22
|
+
from pathlib import Path
|
|
23
|
+
from jentic.apitools.score.score import calculate_score
|
|
24
|
+
|
|
25
|
+
score = calculate_score(
|
|
26
|
+
spec_path=Path("spec.json"),
|
|
27
|
+
spec_content={"openapi": "3.1.0", ...},
|
|
28
|
+
diagnostics=diagnostics,
|
|
29
|
+
vendor="example",
|
|
30
|
+
api_name="my-api",
|
|
31
|
+
version="1.0",
|
|
32
|
+
oas_version="3.1.0",
|
|
33
|
+
oas_request_meta=meta,
|
|
34
|
+
source_url="https://example.com/api.json",
|
|
35
|
+
artifacts_root=Path("/tmp"),
|
|
36
|
+
)
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
## Testing
|
|
40
|
+
|
|
41
|
+
```bash
|
|
42
|
+
uv run --package score pytest packages/score/tests -v
|
|
43
|
+
```
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
[project]
|
|
2
|
+
name = "jentic-apitools-score"
|
|
3
|
+
version = "0.0.0-alpha.9"
|
|
4
|
+
description = "Jentic Apitools Score - Calculate AI-readiness scores for OpenAPI specifications using the 6-dimension framework"
|
|
5
|
+
readme = "README.md"
|
|
6
|
+
authors = [{ name = "Jentic", email = "hello@jentic.com" }]
|
|
7
|
+
license = "Apache-2.0"
|
|
8
|
+
license-files = ["LICENSE", "NOTICE"]
|
|
9
|
+
requires-python = ">=3.11"
|
|
10
|
+
dependencies = [
|
|
11
|
+
"pydantic>=2.7,<3.0",
|
|
12
|
+
"jentic-apitools-common~=0.0.0-alpha.9",
|
|
13
|
+
"jentic-apitools-analyze~=0.0.0-alpha.9",
|
|
14
|
+
]
|
|
15
|
+
|
|
16
|
+
[tool.uv]
|
|
17
|
+
package = true
|
|
18
|
+
|
|
19
|
+
[tool.uv.build-backend]
|
|
20
|
+
namespace = true
|
|
21
|
+
module-name = "jentic.apitools.score"
|
|
22
|
+
module-root = "src/"
|
|
23
|
+
|
|
24
|
+
[project.urls]
|
|
25
|
+
Homepage = "https://github.com/jentic/jentic-apitools"
|
|
26
|
+
|
|
27
|
+
[build-system]
|
|
28
|
+
requires = ["uv_build~=0.8.15"]
|
|
29
|
+
build-backend = "uv_build"
|
|
@@ -0,0 +1,267 @@
|
|
|
1
|
+
# Jentic API Scoring Framework
|
|
2
|
+
|
|
3
|
+
A comprehensive framework for evaluating OpenAPI specifications across multiple dimensions to assess their AI-Readiness.
|
|
4
|
+
|
|
5
|
+
## Overview
|
|
6
|
+
|
|
7
|
+
The framework evaluates APIs in three main groups:
|
|
8
|
+
|
|
9
|
+
- **FDX (Foundational & DX)**: Standards compliance and developer experience
|
|
10
|
+
- **AIRU (AI-Readiness & Usability)**: Semantic clarity and agent operability
|
|
11
|
+
- **TSD (Trust/Safety & Discoverability)**: Security and findability
|
|
12
|
+
|
|
13
|
+
Each group contains multiple dimensions, which in turn are composed of individual signals. Scores are calculated using a weighted harmonic mean to ensure balanced quality across all dimensions.
|
|
14
|
+
|
|
15
|
+
**Current Version**: 0.1.0
|
|
16
|
+
|
|
17
|
+
This framework implements version **0.2.0** of the [Jentic API AI-Readiness Framework (JAIRF) Specification](https://github.com/jentic/api-ai-readiness-framework), currently focusing on Group A (Foundational & DX) with partial Group B (AI-Readiness & Usability) implementation.
|
|
18
|
+
|
|
19
|
+
## Quick Start
|
|
20
|
+
|
|
21
|
+
```python
|
|
22
|
+
import yaml
|
|
23
|
+
from pathlib import Path
|
|
24
|
+
from jentic_openapi.score.framework import calculate_readiness, ScoreContext
|
|
25
|
+
|
|
26
|
+
# Load your OpenAPI specification
|
|
27
|
+
spec_path = Path("path/to/openapi.yaml")
|
|
28
|
+
spec_source = spec_path.read_text()
|
|
29
|
+
spec_document = yaml.safe_load(spec_source)
|
|
30
|
+
|
|
31
|
+
# Create scoring context
|
|
32
|
+
ctx = ScoreContext(
|
|
33
|
+
spec_uri=spec_path.as_uri(), # e.g., "file:///path/to/openapi.yaml"
|
|
34
|
+
spec_source=spec_source, # Raw YAML/JSON string
|
|
35
|
+
spec_document=spec_document, # Parsed dict/mapping
|
|
36
|
+
spec_type="openapi", # Optional: spec type
|
|
37
|
+
spec_version="3.1.0", # Optional: detected version
|
|
38
|
+
diagnostics=[], # Optional: validation diagnostics
|
|
39
|
+
metadata={"vendor": "acme"}, # Optional: custom metadata
|
|
40
|
+
)
|
|
41
|
+
|
|
42
|
+
# Calculate complete AI-Readiness assessment
|
|
43
|
+
readiness = calculate_readiness(ctx)
|
|
44
|
+
|
|
45
|
+
# Access results
|
|
46
|
+
print(f"Overall Score: {readiness.final_score.score:.1f}/100")
|
|
47
|
+
print(f"Maturity Level: {readiness.maturity.value}")
|
|
48
|
+
|
|
49
|
+
# Access dimension details
|
|
50
|
+
for dimension in readiness.final_score.dimension_scores:
|
|
51
|
+
print(f"{dimension.name}: {dimension.score:.1f}")
|
|
52
|
+
for signal in dimension.signals:
|
|
53
|
+
print(f" {signal.name}: {signal.value:.2f}")
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
## Public API
|
|
57
|
+
|
|
58
|
+
The framework exports a minimal, focused API:
|
|
59
|
+
|
|
60
|
+
### Functions
|
|
61
|
+
|
|
62
|
+
- **`calculate_readiness(ctx)`** - Primary entry point returning complete assessment (scores + maturity)
|
|
63
|
+
- **`calculate_final_score(ctx)`** - Calculate detailed scores only
|
|
64
|
+
- **`calculate_maturity(ctx, final_score=None)`** - Classify maturity level with optional pre-calculated score
|
|
65
|
+
|
|
66
|
+
### Result Types
|
|
67
|
+
|
|
68
|
+
- **`Readiness`** - Complete assessment combining `FinalScore` and `Maturity`
|
|
69
|
+
- **`FinalScore`** - Overall score (0-100) with breakdowns by group and dimension
|
|
70
|
+
- **`Maturity`** - Categorical level (Level 0-4) representing AI-Readiness stage
|
|
71
|
+
- **`GroupScore`** - Score for a specific group (FDX, AIRU, or TSD)
|
|
72
|
+
- **`DimensionScore`** - Score for a specific dimension (FC, DXJ, ARAX, AU, SEC, AID)
|
|
73
|
+
- **`Signal`** - Individual signal measurement with normalized value (0-1)
|
|
74
|
+
|
|
75
|
+
### Input Types
|
|
76
|
+
|
|
77
|
+
- **`ScoreContext`** - Input context containing:
|
|
78
|
+
- `spec_uri` (required): URI where spec was loaded from (e.g., "file:///path/to/spec.yaml")
|
|
79
|
+
- `spec_source` (required): Raw YAML/JSON string source
|
|
80
|
+
- `spec_document` (required): Parsed OpenAPI specification as dict/mapping (or None if parse failed)
|
|
81
|
+
- `spec_type` (optional): Type of spec (e.g., "openapi")
|
|
82
|
+
- `spec_version` (optional): Version string (e.g., "3.0.0", "3.1.0")
|
|
83
|
+
- `diagnostics` (optional): List of validation/linting diagnostics
|
|
84
|
+
- `metadata` (optional): Additional custom metadata dict
|
|
85
|
+
|
|
86
|
+
### Navigation Enums
|
|
87
|
+
|
|
88
|
+
- **`GroupKind`** - Group identifiers: `FDX`, `AIRU`, `TSD`
|
|
89
|
+
- **`DimensionKind`** - Dimension identifiers: `FC`, `DXJ`, `ARAX`, `AU`, `SEC`, `AID`
|
|
90
|
+
|
|
91
|
+
### Version Tracking
|
|
92
|
+
|
|
93
|
+
- **`SCORING_VERSION`** - Framework calculation version (currently "0.1.0")
|
|
94
|
+
- Increment when: weights change, maturity logic changes, signals added/modified, algorithms change
|
|
95
|
+
- Use this to track which framework version generated a score
|
|
96
|
+
|
|
97
|
+
## Understanding Results
|
|
98
|
+
|
|
99
|
+
### Maturity Levels
|
|
100
|
+
|
|
101
|
+
APIs are classified into 5 maturity levels based on final score and gating rules:
|
|
102
|
+
|
|
103
|
+
| Level | Score Range | Description |
|
|
104
|
+
|-------|-------------|-------------|
|
|
105
|
+
| Level 0 | < 40 | Not Ready - significant quality issues |
|
|
106
|
+
| Level 1 | 40-60 | Foundational / Developer Ready |
|
|
107
|
+
| Level 2 | 60-75 | AI-Aware - basic AI agent interaction |
|
|
108
|
+
| Level 3 | 75-90 | AI-Ready - well-optimized for AI |
|
|
109
|
+
| Level 4 | 90+ | Agent-Optimized - excellence in AI-Readiness |
|
|
110
|
+
|
|
111
|
+
**Gating Rule**: If Foundational Compliance (FC) score < 40, the API is automatically classified as Level 0 regardless of overall score.
|
|
112
|
+
|
|
113
|
+
### Score Hierarchy
|
|
114
|
+
|
|
115
|
+
```
|
|
116
|
+
Readiness
|
|
117
|
+
├── FinalScore (0-100)
|
|
118
|
+
│ ├── GroupScore (FDX)
|
|
119
|
+
│ │ ├── DimensionScore (FC)
|
|
120
|
+
│ │ │ ├── Signal (spec_validity)
|
|
121
|
+
│ │ │ ├── Signal (resolution_completeness)
|
|
122
|
+
│ │ │ ├── Signal (lint_results)
|
|
123
|
+
│ │ │ └── Signal (structural_integrity)
|
|
124
|
+
│ │ └── DimensionScore (DXJ)
|
|
125
|
+
│ │ ├── Signal (example_density)
|
|
126
|
+
│ │ ├── Signal (example_validity)
|
|
127
|
+
│ │ ├── Signal (response_coverage)
|
|
128
|
+
│ │ └── Signal (tooling_readiness)
|
|
129
|
+
│ ├── GroupScore (AIRU)
|
|
130
|
+
│ │ ├── DimensionScore (ARAX)
|
|
131
|
+
│ │ │ ├── Signal (summary_coverage)
|
|
132
|
+
│ │ │ ├── Signal (description_coverage)
|
|
133
|
+
│ │ │ ├── Signal (error_standardization)
|
|
134
|
+
│ │ │ └── Signal (opid_quality)
|
|
135
|
+
│ │ └── DimensionScore (AU)
|
|
136
|
+
│ │ └── Signal (complexity_comfort)
|
|
137
|
+
│ └── GroupScore (TSD)
|
|
138
|
+
│ ├── DimensionScore (SEC)
|
|
139
|
+
│ │ └── Signal (auth_strength)
|
|
140
|
+
│ └── DimensionScore (AID)
|
|
141
|
+
│ └── Signal (descriptive_richness)
|
|
142
|
+
└── Maturity (Level 0-4)
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
### Accessing Specific Results
|
|
146
|
+
|
|
147
|
+
```python
|
|
148
|
+
readiness = calculate_readiness(ctx)
|
|
149
|
+
|
|
150
|
+
# Access by enum
|
|
151
|
+
from jentic_openapi.score.framework import DimensionKind, GroupKind
|
|
152
|
+
|
|
153
|
+
fc_dimension = next(
|
|
154
|
+
d for d in readiness.final_score.dimension_scores
|
|
155
|
+
if d.kind == DimensionKind.FC
|
|
156
|
+
)
|
|
157
|
+
print(f"FC Score: {fc_dimension.score:.1f}")
|
|
158
|
+
|
|
159
|
+
# Iterate through all signals
|
|
160
|
+
for signal in fc_dimension.signals:
|
|
161
|
+
print(f"{signal.name}: {signal.value:.2f}")
|
|
162
|
+
```
|
|
163
|
+
|
|
164
|
+
## Architecture
|
|
165
|
+
|
|
166
|
+
### Groups and Dimensions
|
|
167
|
+
|
|
168
|
+
**Group A: Foundational & DX (FDX)** - Weight: 34%
|
|
169
|
+
- **FC (Foundational Compliance)**: 16% - Base layer of validity and soundness
|
|
170
|
+
- **DXJ (Developer Experience & Jentic)**: 18% - Clarity, completeness, ingestion readiness
|
|
171
|
+
|
|
172
|
+
**Group B: AI-Readiness & Usability (AIRU)** - Weight: 44%
|
|
173
|
+
- **ARAX (AI-Readiness & Agent Experience)**: 24% - Semantic breadth and comprehension
|
|
174
|
+
- **AU (Agent Usability)**: 20% - Functional utility and orchestration
|
|
175
|
+
|
|
176
|
+
**Group C: Trust/Safety & Discoverability (TSD)** - Weight: 22%
|
|
177
|
+
- **SEC (Security)**: 12% - Trust, compliance, risk posture
|
|
178
|
+
- **AID (AI Discoverability)**: 10% - Findability and reasoning readiness
|
|
179
|
+
|
|
180
|
+
### Calculation Method
|
|
181
|
+
|
|
182
|
+
The final score uses a **weighted harmonic mean** to ensure balanced quality:
|
|
183
|
+
|
|
184
|
+
```
|
|
185
|
+
Final Score = (sum of dimension_weights) / (sum of (dimension_weight / dimension_score))
|
|
186
|
+
```
|
|
187
|
+
|
|
188
|
+
This penalizes low scores in any dimension, requiring balanced excellence across all areas.
|
|
189
|
+
|
|
190
|
+
## Dimension Weights
|
|
191
|
+
|
|
192
|
+
All dimensions use their target weights:
|
|
193
|
+
|
|
194
|
+
| Dimension | Weight | Focus | Status |
|
|
195
|
+
|-----------|--------|-------|--------|
|
|
196
|
+
| **FC** | **16%** | Foundational quality | ✅ Fully implemented |
|
|
197
|
+
| **DXJ** | **18%** | Developer & tooling readiness | 🔨 Partially implemented |
|
|
198
|
+
| **ARAX** | **24%** | AI semantic clarity | 🔨 Partially implemented |
|
|
199
|
+
| **AU** | **20%** | Agent operational utility | 🔨 Partially implemented |
|
|
200
|
+
| **SEC** | **12%** | Security posture | 🔨 Partially implemented |
|
|
201
|
+
| **AID** | **10%** | Discoverability | 🔨 Partially implemented |
|
|
202
|
+
|
|
203
|
+
## Advanced Usage
|
|
204
|
+
|
|
205
|
+
### Lower-Level Calculation
|
|
206
|
+
|
|
207
|
+
```python
|
|
208
|
+
from jentic_openapi.score.framework import (
|
|
209
|
+
calculate_final_score,
|
|
210
|
+
calculate_maturity
|
|
211
|
+
)
|
|
212
|
+
|
|
213
|
+
# Calculate scores without maturity
|
|
214
|
+
final_score = calculate_final_score(ctx)
|
|
215
|
+
|
|
216
|
+
# Calculate maturity separately (reusing final_score for efficiency)
|
|
217
|
+
maturity = calculate_maturity(ctx, final_score=final_score)
|
|
218
|
+
```
|
|
219
|
+
|
|
220
|
+
### Accessing Internal APIs
|
|
221
|
+
|
|
222
|
+
For internal development or testing, non-public items can be imported from submodules:
|
|
223
|
+
|
|
224
|
+
```python
|
|
225
|
+
# Import from specific submodules
|
|
226
|
+
from jentic_openapi.score.framework.enums import SpecType, BuiltinSignal
|
|
227
|
+
from jentic_openapi.score.framework.constants import EPSILON
|
|
228
|
+
from jentic_openapi.score.framework.normalizers import coverage, binary
|
|
229
|
+
from jentic_openapi.score.framework.calculators.signals.registry import register_signal
|
|
230
|
+
|
|
231
|
+
# These are not part of the public API and may change between versions
|
|
232
|
+
```
|
|
233
|
+
|
|
234
|
+
## Implementation Status
|
|
235
|
+
|
|
236
|
+
**Version 0.1.0** implements:
|
|
237
|
+
- ✅ Group A (FDX):
|
|
238
|
+
- FC dimension: All 4 signals (spec_validity, resolution_completeness, lint_results, structural_integrity)
|
|
239
|
+
- DXJ dimension: Partial (4/5 signals - example_density, example_validity, response_coverage, tooling_readiness)
|
|
240
|
+
- ✅ Group B (AIRU):
|
|
241
|
+
- ARAX dimension: Partial (4/7 signals - summary_coverage, description_coverage, error_standardization, opid_quality)
|
|
242
|
+
- AU dimension: Partial (1/5 signals - complexity_comfort)
|
|
243
|
+
- ✅ Group C (TSD):
|
|
244
|
+
- SEC dimension: Partial (1/6 signals - auth_strength)
|
|
245
|
+
- AID dimension: Partial (1/4 signals - descriptive_richness)
|
|
246
|
+
- ✅ Final score calculation with weighted harmonic mean
|
|
247
|
+
- ✅ Maturity classification with FC gating rule
|
|
248
|
+
|
|
249
|
+
Future versions will implement remaining DXJ signal (doc_clarity), remaining ARAX signals, remaining AU signals, remaining SEC signals, and remaining AID signals.
|
|
250
|
+
|
|
251
|
+
## Error Handling
|
|
252
|
+
|
|
253
|
+
```python
|
|
254
|
+
from jentic_openapi.score.framework import calculate_readiness, ScoreContext
|
|
255
|
+
|
|
256
|
+
try:
|
|
257
|
+
readiness = calculate_readiness(ctx)
|
|
258
|
+
except ValueError as e:
|
|
259
|
+
# Raised if FC dimension is missing (indicates framework bug)
|
|
260
|
+
print(f"Framework error: {e}")
|
|
261
|
+
```
|
|
262
|
+
|
|
263
|
+
The framework expects all dimensions to be present in calculation results. If the FC dimension is missing during maturity calculation, a `ValueError` is raised.
|
|
264
|
+
|
|
265
|
+
## Thread Safety
|
|
266
|
+
|
|
267
|
+
The framework is thread-safe. You can safely calculate scores for different APIs in parallel across multiple threads.
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
"""Jentic API Scoring Framework.
|
|
2
|
+
|
|
3
|
+
This module implements the comprehensive API scoring system that evaluates
|
|
4
|
+
APIs across multiple dimensions to assess their AI-Readiness.
|
|
5
|
+
|
|
6
|
+
The framework evaluates APIs in three main groups:
|
|
7
|
+
- A. Foundational & DX: Standards compliance and developer experience
|
|
8
|
+
- B. AI-Readiness & Usability: Semantic clarity and agent operability
|
|
9
|
+
- C. Trust/Safety & Discoverability: Security and findability
|
|
10
|
+
"""
|
|
11
|
+
|
|
12
|
+
from .calculators import calculate_final_score, calculate_maturity, calculate_readiness
|
|
13
|
+
from .calculators.grade import calculate_grade
|
|
14
|
+
from .enums import DimensionKind, Grade, GroupKind, Maturity, SpecType
|
|
15
|
+
from .models import DimensionScore, FinalScore, GroupScore, Readiness, ScoreContext, Signal
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
__all__ = [
|
|
19
|
+
# Functions
|
|
20
|
+
"calculate_readiness",
|
|
21
|
+
"calculate_final_score",
|
|
22
|
+
"calculate_maturity",
|
|
23
|
+
"calculate_grade",
|
|
24
|
+
# Result Types
|
|
25
|
+
"Readiness",
|
|
26
|
+
"FinalScore",
|
|
27
|
+
"Maturity",
|
|
28
|
+
"Grade",
|
|
29
|
+
"GroupScore",
|
|
30
|
+
"DimensionScore",
|
|
31
|
+
"Signal",
|
|
32
|
+
# Input Types
|
|
33
|
+
"ScoreContext",
|
|
34
|
+
# Navigation Enums
|
|
35
|
+
"GroupKind",
|
|
36
|
+
"DimensionKind",
|
|
37
|
+
"SpecType",
|
|
38
|
+
# Version
|
|
39
|
+
"SCORING_VERSION",
|
|
40
|
+
"JAIRF_VERSION",
|
|
41
|
+
"__version__",
|
|
42
|
+
]
|
|
43
|
+
|
|
44
|
+
SCORING_VERSION = "0.4.0"
|
|
45
|
+
"""Scoring calculation version - increment when weights, maturity logic, signals, or algorithms change.
|
|
46
|
+
|
|
47
|
+
This version tracks the implementation and may increment more frequently than JAIRF_VERSION due to
|
|
48
|
+
bugfixes and implementation enhancements that don't affect the specification but affect the scoring engine.
|
|
49
|
+
"""
|
|
50
|
+
|
|
51
|
+
JAIRF_VERSION = "1.0.0"
|
|
52
|
+
"""Jentic API AI-Readiness Framework (JAIRF) Specification version used to implement scoring calculations.
|
|
53
|
+
|
|
54
|
+
This tracks the JAIRF specification version and changes less frequently than SCORING_VERSION, only when
|
|
55
|
+
the underlying specification itself is updated. These versions may diverge as the implementation evolves
|
|
56
|
+
independently from the specification.
|
|
57
|
+
"""
|
|
58
|
+
|
|
59
|
+
__version__ = f"{SCORING_VERSION}+jairf.{JAIRF_VERSION}"
|
|
60
|
+
"""Complete version string combining scoring implementation and JAIRF specification versions.
|
|
61
|
+
|
|
62
|
+
Format: {SCORING_VERSION}+jairf.{JAIRF_VERSION} (e.g., 0.1.0+jairf.1.0.0)
|
|
63
|
+
The scoring version is the main semver for comparison; JAIRF version is build metadata.
|
|
64
|
+
"""
|