hyperframes icon indicating copy to clipboard operation
hyperframes copied to clipboard

Lint: flag crypto.randomUUID() as non-deterministic

Open jrusso1020 opened this issue 4 weeks ago • 2 comments

The non_deterministic_code lint rule flags Math.random and crypto.getRandomValues (packages/lint/src/rules/core.ts, pattern list around lines 938-982), but not crypto.randomUUID(). The render shim seeds getRandomValues only (packages/producer/src/services/fileServer.ts), so randomUUID() stays random between renders and workers. A composition that uses it lints clean today.

Scope

  • Add crypto.randomUUID to the rule's pattern list.

Files: packages/lint/src/rules/core.ts, packages/lint/src/rules/core.test.ts

Done when: a new test shows a composition using crypto.randomUUID() gets the non_deterministic_code finding.

Mentor: @jrusso1020. Comment here before you start so we can avoid duplicate PRs.

jrusso1020 avatar Nov 06 '26 00:11 jrusso1020

I'll take this — planning to add crypto.randomUUID to the non_deterministic_code pattern list in packages/lint/src/rules/core.ts and cover it with a unit test in core.test.ts.

ump45nose avatar Nov 06 '26 15:11 ump45nose

Picking this up — will add crypto.randomUUID to the non_deterministic_code pattern list in packages/lint/src/rules/core.ts with a test in core.test.ts showing a composition using it gets flagged.

rezamuliawijaya avatar Nov 06 '26 15:11 rezamuliawijaya