From 8de3afdcdd6488bd98d1e9596041c00ff8c3435a Mon Sep 17 00:00:00 2001 From: Matthew Thomas <25988124+Ma11hewThomas@users.noreply.github.com> Date: Sat, 24 Oct 2026 13:17:31 +0100 Subject: [PATCH 1/2] Clarify deterministic UUID guidance for test identifiers --- CHANGELOG.md | 4 ++++ spec/ctrf.md | 28 +++++++++++++++++++++------- 2 files changed, 25 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c0fb2d1..95cabf3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +### Changed + +- Clarified deterministic `testId` guidance for UUID version 5 and documented name-based UUID version 8 schemes using RFC 9562. + ## [0.2.0] - 2026-10-10 ### Added diff --git a/spec/ctrf.md b/spec/ctrf.md index 25e1399..7198e45 100644 --- a/spec/ctrf.md +++ b/spec/ctrf.md @@ -40,8 +40,8 @@ is published. **[RFC2119]** Bradner, S., "Key words for use in RFCs to Indicate Requirement Levels", BCP 14, RFC 2119, March 1997. -**[RFC4122]** Leach, P., Mealling, M., Salz, R., “A Universally Unique IDentifier (UUID) URN Namespace”, RFC 4122, July 2005. - +**[RFC9562]** Davis, K., Peabody, B., Leach, P., “Universally Unique IDentifiers (UUIDs)”, RFC 9562, May 2024.\ + **[RFC3986]** Berners-Lee, T., Fielding, R., Masinter, L., “Uniform Resource Identifier (URI): Generic Syntax”, RFC 3986, January 2005. @@ -534,7 +534,7 @@ A unique identifier for this CTRF document instance. **Requirements:** `reportId` is OPTIONAL. -If present, it MUST be a valid UUID as defined in [RFC4122]. +If present, it MUST be a valid UUID as defined in [RFC9562].\ When `reportId` is used, each emitted document SHOULD receive a distinct `reportId`. Retransmitting the same report means sending or uploading the same already-emitted CTRF document again without changing its content. A retransmission of the same report SHOULD preserve the same `reportId` when `reportId` is used. @@ -886,7 +886,7 @@ A unique, stable identifier for the test case. **Requirements:** `id` is OPTIONAL. -If present, it MUST be a valid UUID as defined in [RFC4122]. +If present, it MUST be a valid UUID as defined in [RFC9562].\ Producers SHOULD prefer `testId` for new implementations. When both `id` and `testId` are present, consumers SHOULD use `testId`. Consumers SHOULD treat `id` as legacy unless a producer documents stronger semantics. @@ -903,7 +903,9 @@ A stable identifier for the logical test case. If present, it MUST be a non-empty string. `testId` SHOULD be deterministic and stable across runs for the same test case. When generated by a producer, `testId` SHOULD be derived from stable test attributes such as file path, suite path, and test name. -A producer MAY use a canonical string directly, or MAY encode that canonical string as a deterministic identifier such as a UUID version 5 or hash. +A producer MAY use a canonical string directly, or MAY encode that canonical string using a deterministic scheme such as UUID version 5, a documented name-based UUID version 8 scheme, or a hash. + +> **Informative note.** UUID version 5 uses SHA-1. Under [RFC9562], name-based UUIDs derived from SHA-256 or newer SHA methods MUST use the UUID version 8 space rather than UUID version 5. UUID version 8 defines a custom UUID space, not a single deterministic generation algorithm, and does not by itself guarantee determinism, uniqueness, or interoperability. Producers using a name-based UUID version 8 scheme SHOULD document the hash algorithm, namespace, canonicalization rules, truncation, and bit layout. Consumers MUST treat the `testId` value as opaque. Consumers MUST NOT assume that `testId` values generated by different producers are globally comparable unless the producers document a shared generation scheme. @@ -1909,7 +1911,7 @@ The unique identifier of the baseline report. **Requirements:** `reportId` MUST be present. -It MUST be a valid UUID as defined in [RFC4122]. +It MUST be a valid UUID as defined in [RFC9562].\ The referenced report SHOULD correspond to a valid CTRF document. ### 17.2. `timestamp` @@ -2828,7 +2830,7 @@ Producers MAY use the resulting canonical string directly. For example: tests/auth/login.test.ts::auth > login::user can log in ``` -Producers MAY also encode the canonical string as a deterministic identifier such as a UUID version 5 or hash. +Producers MAY also encode the canonical string using a deterministic scheme such as UUID version 5, a documented name-based UUID version 8 scheme, or a hash. This approach ensures that the same test retains the same `testId` across runs, enabling consumers to analyze historical trends, flakiness, and stability. @@ -2840,6 +2842,18 @@ When generating deterministic test identifiers, producers SHOULD: When UUID version 5 is used, the namespace UUID is intentionally not fixed by this specification. +UUID version 5 uses SHA-1. Under [RFC9562], name-based UUIDs derived from SHA-256 or newer SHA methods MUST use the UUID version 8 space rather than UUID version 5. UUID version 8 defines a custom UUID space, not a single deterministic generation algorithm, and does not by itself guarantee determinism, uniqueness, or interoperability. + +Producers using a name-based UUID version 8 scheme SHOULD document: + +- the hash algorithm +- the namespace +- the canonicalization rules +- the truncation method +- the bit layout + +Consumers MUST treat `testId` values as opaque and MUST NOT assume cross-producer comparability without a shared documented generation scheme. + Note: `testId` accepts any string format. Producers MAY use other deterministic schemes provided the output is stable for a given test case. --- From 612380763f13949be79dc32c009205bee13ff8cb Mon Sep 17 00:00:00 2001 From: Matthew Thomas <25988124+Ma11hewThomas@users.noreply.github.com> Date: Sun, 25 Oct 2026 09:35:00 +0000 Subject: [PATCH 2/2] Simplify deterministic UUID guidance --- CHANGELOG.md | 2 +- spec/ctrf.md | 26 ++++++-------------------- 2 files changed, 7 insertions(+), 21 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 95cabf3..2c4ea8a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,7 +9,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Changed -- Clarified deterministic `testId` guidance for UUID version 5 and documented name-based UUID version 8 schemes using RFC 9562. +- Updated UUID references to RFC 9562 and clarified optional deterministic UUID generation for `testId`. ## [0.2.0] - 2026-10-10 diff --git a/spec/ctrf.md b/spec/ctrf.md index 7198e45..833d5ce 100644 --- a/spec/ctrf.md +++ b/spec/ctrf.md @@ -40,7 +40,7 @@ is published. **[RFC2119]** Bradner, S., "Key words for use in RFCs to Indicate Requirement Levels", BCP 14, RFC 2119, March 1997. -**[RFC9562]** Davis, K., Peabody, B., Leach, P., “Universally Unique IDentifiers (UUIDs)”, RFC 9562, May 2024.\ +**[RFC9562]** Davis, K., Peabody, B., Leach, P., “Universally Unique IDentifiers (UUIDs)”, RFC 9562, May 2024. **[RFC3986]** Berners-Lee, T., Fielding, R., Masinter, L., “Uniform Resource Identifier (URI): Generic Syntax”, RFC 3986, January 2005. @@ -534,7 +534,7 @@ A unique identifier for this CTRF document instance. **Requirements:** `reportId` is OPTIONAL. -If present, it MUST be a valid UUID as defined in [RFC9562].\ +If present, it MUST be a valid UUID as defined in [RFC9562]. When `reportId` is used, each emitted document SHOULD receive a distinct `reportId`. Retransmitting the same report means sending or uploading the same already-emitted CTRF document again without changing its content. A retransmission of the same report SHOULD preserve the same `reportId` when `reportId` is used. @@ -886,7 +886,7 @@ A unique, stable identifier for the test case. **Requirements:** `id` is OPTIONAL. -If present, it MUST be a valid UUID as defined in [RFC9562].\ +If present, it MUST be a valid UUID as defined in [RFC9562]. Producers SHOULD prefer `testId` for new implementations. When both `id` and `testId` are present, consumers SHOULD use `testId`. Consumers SHOULD treat `id` as legacy unless a producer documents stronger semantics. @@ -903,9 +903,7 @@ A stable identifier for the logical test case. If present, it MUST be a non-empty string. `testId` SHOULD be deterministic and stable across runs for the same test case. When generated by a producer, `testId` SHOULD be derived from stable test attributes such as file path, suite path, and test name. -A producer MAY use a canonical string directly, or MAY encode that canonical string using a deterministic scheme such as UUID version 5, a documented name-based UUID version 8 scheme, or a hash. - -> **Informative note.** UUID version 5 uses SHA-1. Under [RFC9562], name-based UUIDs derived from SHA-256 or newer SHA methods MUST use the UUID version 8 space rather than UUID version 5. UUID version 8 defines a custom UUID space, not a single deterministic generation algorithm, and does not by itself guarantee determinism, uniqueness, or interoperability. Producers using a name-based UUID version 8 scheme SHOULD document the hash algorithm, namespace, canonicalization rules, truncation, and bit layout. +A producer MAY use a canonical string directly, or MAY derive a deterministic identifier from it, such as a UUID generated deterministically in accordance with [RFC9562], or a hash. Consumers MUST treat the `testId` value as opaque. Consumers MUST NOT assume that `testId` values generated by different producers are globally comparable unless the producers document a shared generation scheme. @@ -1911,7 +1909,7 @@ The unique identifier of the baseline report. **Requirements:** `reportId` MUST be present. -It MUST be a valid UUID as defined in [RFC9562].\ +It MUST be a valid UUID as defined in [RFC9562]. The referenced report SHOULD correspond to a valid CTRF document. ### 17.2. `timestamp` @@ -2830,7 +2828,7 @@ Producers MAY use the resulting canonical string directly. For example: tests/auth/login.test.ts::auth > login::user can log in ``` -Producers MAY also encode the canonical string using a deterministic scheme such as UUID version 5, a documented name-based UUID version 8 scheme, or a hash. +Producers MAY also derive a deterministic identifier from the canonical string, such as a UUID generated deterministically in accordance with [RFC9562], or a hash. This approach ensures that the same test retains the same `testId` across runs, enabling consumers to analyze historical trends, flakiness, and stability. @@ -2842,18 +2840,6 @@ When generating deterministic test identifiers, producers SHOULD: When UUID version 5 is used, the namespace UUID is intentionally not fixed by this specification. -UUID version 5 uses SHA-1. Under [RFC9562], name-based UUIDs derived from SHA-256 or newer SHA methods MUST use the UUID version 8 space rather than UUID version 5. UUID version 8 defines a custom UUID space, not a single deterministic generation algorithm, and does not by itself guarantee determinism, uniqueness, or interoperability. - -Producers using a name-based UUID version 8 scheme SHOULD document: - -- the hash algorithm -- the namespace -- the canonicalization rules -- the truncation method -- the bit layout - -Consumers MUST treat `testId` values as opaque and MUST NOT assume cross-producer comparability without a shared documented generation scheme. - Note: `testId` accepts any string format. Producers MAY use other deterministic schemes provided the output is stable for a given test case. ---