Skip to content

Commit 921c3ab

Browse files
Merge pull request #8 from jentic/frankkilcommins/minor-cleanup
docs(spec): `complexity_comfort`, `summary_coverage`, `description_coverage`, and `example_density` clarifications
2 parents 8d01d19 + fca2cbc commit 921c3ab

1 file changed

Lines changed: 33 additions & 11 deletions

File tree

docs/specification/spec.md

Lines changed: 33 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -288,7 +288,7 @@ An API with strong DXJ SHOULD be predictable and pleasant for both human develop
288288

289289
| Signal | Description | Normalisation Rule |
290290
| ---------------- | -------------------- | ---------------------------- |
291-
| `example_density` | MUST represent richness of examples across eligible locations. | [coverage](#coverage-normalisation) |
291+
| `example_density` | MUST indicate presence of examples across eligible locations. | [coverage](#coverage-normalisation) |
292292
| `example_validity` | MUST show schema-conformance of examples. | [coverage](#coverage-normalisation) |
293293
| `doc_clarity` | MUST quantify linguistic clarity of summaries and descriptions. | [min-max inverted](#minmax-inverted-normalisation) |
294294
| `response_coverage` | MUST indicate presence of meaningful success and error responses. | [coverage](#coverage-normalisation) |
@@ -297,10 +297,20 @@ An API with strong DXJ SHOULD be predictable and pleasant for both human develop
297297

298298
#### Example Density (example_density)
299299

300+
example_density MUST measure coverage of examples across all eligible specification locations.
301+
It represents whether each location includes at least one example, and NOT how many examples are provided.
302+
300303
```text
301304
example_density = present_examples / expected_examples
302305
```
303306

307+
Where:
308+
309+
- each eligible location contributes one (`1`) to `expected_examples`, regardless of whether the location supports both _example_ and _examples_ fields from an OpenAPI perspective.
310+
- multiple _examples_ defined inside an _examples_ array MUST not increase `present_examples` beyond `1`.
311+
312+
313+
304314
If `expected_examples = 0`, the value MUST be `1.0`.
305315

306316
#### Example Validity (example_validity)
@@ -366,8 +376,8 @@ ARAX evaluates whether an API is semantically interpretable by AI systems—spec
366376

367377
| Signal | Description | Normalisation Rule |
368378
| ----------------- | --------------------- | ----------------------------- |
369-
| `summary_coverage` | MUST represent presence of concise summaries across operations/tags/info. | [coverage](#coverage-normalisation) |
370-
| `description_coverage` | MUST represent descriptive completeness across applicable API elements. | [coverage](#coverage-normalisation) |
379+
| `summary_coverage` | MUST represent presence of concise summaries across specification objects with a `summary` field (e.g.,operations/tags/info etc). | [coverage](#coverage-normalisation) |
380+
| `description_coverage` | MUST represent descriptive completeness across applicable API specification objects with a `description` field. | [coverage](#coverage-normalisation) |
371381
| `type_specificity` | MUST quantify richness of datatype modelling. | [weighted categorical](#weighted-categorical-normalisation) |
372382
| `policy_presence` | SHOULD represent inclusion of SLA/rate-limit/policy metadata. | [coverage](#coverage-normalisation) |
373383
| `error_standardization` | SHOULD favour structured error formats (RFC 9457/7807). | [coverage](#coverage-normalisation) |
@@ -381,12 +391,16 @@ ARAX evaluates whether an API is semantically interpretable by AI systems—spec
381391
summary_coverage = summaries_present / summaries_expected
382392
```
383393

394+
Where:
395+
396+
- `summaries_expected` MUST take into account every specification object with `summary` fixed field.
397+
384398
##### Example
385399

386400
```text
387401
summary_coverage = 0.78
388402
389-
# 78% of operations/tags/info objects include a summary field
403+
# 78% of operations/tags/info objects etc. include a summary field
390404
```
391405

392406
#### Description Coverage (description_coverage)
@@ -395,12 +409,16 @@ summary_coverage = 0.78
395409
description_coverage = described_elements / describable_elements
396410
```
397411

412+
Where:
413+
414+
- `describable_elements` MUST take into account every specification object with a `description` fixed field.
415+
398416
##### Example
399417

400418
```text
401419
description_coverage = 0.82
402420
403-
# 82% of info objects, operations, schemas, and parameters include descriptions
421+
# 82% of info objects, operations, schemas, parameters etc. include a description
404422
```
405423

406424
#### Type Specificity (type_specificity)
@@ -531,12 +549,14 @@ normalised_endpoint_count = min(1, total_operations / endpoint_baseline)
531549

532550
Where:
533551

534-
- `total_operations` = count of unique operations (method + path pairs)
535-
- `endpoint_baseline` = 50
552+
- `total_operations` is the count of unique forward-callable operations (method + path pairs). [Callbacks](https://spec.openapis.org/oas/v3.2.0.html#callback-object) and [webhooks](https://spec.openapis.org/oas/v3.2.0.html#oas-webhooks) MUST NOT be counted as endpoints.
553+
- `endpoint_baseline` is set at `50`.
554+
555+
536556

537557
##### Normalised Schema Depth (normalised_schema_depth)
538558

539-
A normalised indicator of schema nesting and structure depth across request/response bodies.
559+
A normalised indicator of schema nesting and structure depth across all schemas.
540560

541561
Agent reasoning difficulty can be correlated to object depth, degree of polymorphism, and highly nested schemas.
542562

@@ -548,8 +568,10 @@ normalised_schema_depth = min(1, max_schema_depth / depth_baseline)
548568

549569
Where:
550570

551-
- `max_schema_depth` = deepest nesting found across all schemas
552-
- `depth_baseline` = 8
571+
- `max_schema_depth` is the deepest nesting found across all schemas
572+
- `depth_baseline` is set at `8`.
573+
574+
Schemas referenced by callbacks/webhooks MUST be included in `normalised_schema_depth`, because they contribute to the overall semantic model complexity.
553575

554576
#### Distinctiveness (distinctiveness)
555577

@@ -818,7 +840,7 @@ The scoring framework does NOT hide unsafe APIs, but we apply a risk-aware disco
818840

819841
#### Descriptive Richness (descriptive_richness)
820842

821-
The descriptive_richness signal evaluates the semantic value of textual descriptions within an API description. It measures whether descriptions are sufficiently clear and detailed for AI systems to infer purpose, behaviour, and domain context.
843+
The `descriptive_richness` signal evaluates the semantic value of textual descriptions within an API description. It measures whether descriptions are sufficiently clear and detailed for AI systems to infer purpose, behaviour, and domain context.
822844

823845
Applies to all describable elements, including but not limited to:
824846

0 commit comments

Comments
 (0)