Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,14 +42,14 @@ Both methods return a JSON response of the following form:
```json
{
"scan": {
"algorithmVersion": 4,
"algorithmVersion": 6,
"grade": "A+",
"error": null,
"score": 105,
"statusCode": 200,
"testsFailed": 0,
"testsPassed": 10,
"testsQuantity": 10,
"testsPassed": 12,
"testsQuantity": 12,
"responseHeaders": {
...
}
Expand Down Expand Up @@ -127,15 +127,15 @@ On success, a JSON object is returned, structured like this example response:
{
"id": 77666718,
"details_url": "https://developer.mozilla.org/en-US/observatory/analyze?host=mdn.dev",
"algorithm_version": 4,
"algorithm_version": 6,
"scanned_at": "2024-08-12T08:20:18.926Z",
"error": null,
"grade": "A+",
"score": 105,
"status_code": 200,
"tests_failed": 0,
"tests_passed": 10,
"tests_quantity": 10
"tests_passed": 12,
"tests_quantity": 12
}
```

Expand Down
28 changes: 28 additions & 0 deletions REVIEWING.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,31 @@ This process is described in detail on the [Pull request guidelines](https://dev
* Add them to this section below if they are unique to this repository only.

-->

## Algorithm version

`ALGORITHM_VERSION` in `src/constants.js` identifies the scoring rubric, not the implementation.
It is stored with every scan and returned by the API, so that scores produced under different rubrics can be told apart.

Bump it when a site with an unchanged configuration is expected to get a different score or grade because of a deliberate decision:

- A test is added to or removed from `ALL_TESTS`.
- A score modifier in `src/grader/charts.js` changes.
- A result is added, removed, or reclassified (pass/fail), so that affected sites score differently.
- The score-to-grade mapping or the aggregation rules change (grade thresholds, bonus eligibility, score floor or cap).
- The stance on a header or directive changes (for example, un-deprecating `X-Frame-Options`).

Do not bump it when:

- A bug fix makes the implementation match the documented rubric, even if some sites score differently as a result (for example, handling of malformed or duplicate headers).
- Only copy changes (descriptions, recommendations, links).
- The retriever, API, database, CLI, or dependencies change, or code is refactored, without altering the rubric.
- Bundled data is refreshed (HSTS preload list, TLD list).
- Output fields are added that do not affect the score.

When bumping:

- Increment by exactly 1, in the same pull request as the scoring change, and at most once per pull request.
- Never decrease or reuse a number, and do not rewrite the version of existing scans.
- Use a `feat` pull request title and describe the rubric change, so that it appears in the changelog.
- Update the example responses in `README.md`.
1 change: 1 addition & 0 deletions src/constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,4 +73,5 @@ export const ALL_RESULTS = [

export const NUM_TESTS = ALL_TESTS.length;

// Identifies the scoring rubric; see REVIEWING.md for when to bump.
export const ALGORITHM_VERSION = 6;
2 changes: 0 additions & 2 deletions src/types.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@
* @property {number} status
*/

export const ALGORITHM_VERSION = 4;

export class Responses {
/** @type {Response | null} */
auto = null;
Expand Down
Loading