Skip to content

Commit faf076e

Browse files
fix(spec): add clarity for descriptions, summaries, and examples
1 parent ff4da1f commit faf076e

1 file changed

Lines changed: 24 additions & 6 deletions

File tree

docs/specification/spec.md

Lines changed: 24 additions & 6 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 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` 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` 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)
@@ -822,7 +840,7 @@ The scoring framework does NOT hide unsafe APIs, but we apply a risk-aware disco
822840

823841
#### Descriptive Richness (descriptive_richness)
824842

825-
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.
826844

827845
Applies to all describable elements, including but not limited to:
828846

0 commit comments

Comments
 (0)