diff --git a/CHANGELOG.md b/CHANGELOG.md index 1711c39..1a6bf05 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,6 +15,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Changed +- Updated UUID references to RFC 9562 and clarified optional deterministic UUID generation for `testId`. + - Clarified that Test `threadId` identifies the thread or worker that executed the final attempt, and recommended qualifying `threadId` values when test cases run across processes or hosts (#74). diff --git a/spec/ctrf.md b/spec/ctrf.md index 8c4772f..f0e8667 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,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 as a deterministic identifier such as a UUID version 5 or hash. +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. @@ -1550,7 +1550,7 @@ The timestamp indicating when the attempt ended, in milliseconds since the Unix If present, it MUST be an integer. If both `start` and `stop` are present, `stop` SHOULD be greater than or equal to `start`. -### 11.12.1. `threadId` +### 11.13. `threadId` **Description:** Identifies the thread or worker that executed this attempt. @@ -1560,7 +1560,7 @@ Identifies the thread or worker that executed this attempt. If present, it MUST be a string. When test cases run in more than one process or on more than one host, producers SHOULD qualify the value with the process or host to avoid collisions, for example, `"host-a/worker-1"`. -### 11.13. `attachments` +### 11.14. `attachments` **Description:** An array of attachment objects associated with this attempt. @@ -1570,7 +1570,7 @@ An array of attachment objects associated with this attempt. If present, it MUST be an array. Each element MUST follow the structure defined in Section 12 (Attachment Object). -### 11.14. `extra` +### 11.15. `extra` **Description:** An extensibility object containing arbitrary metadata. @@ -1920,7 +1920,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` @@ -2843,7 +2843,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 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.