Repository navigation
fix(lint): flag crypto.randomUUID() as non-deterministic - #7322
Conversation
The non_deterministic_code rule already catches Math.random and crypto.getRandomValues, but crypto.randomUUID() stayed unseeded across renders/workers. Add it to the pattern list and cover it with a unit test. Fixes heygen-com#7276
jrusso1020
left a comment
There was a problem hiding this comment.
Reviewed at 92761eefd5119d3161c21981d421edbc8640fa54.
crypto.randomUUID() joins the existing nondeterminism pattern list (packages/lint/src/rules/core.ts:967) with its existing seeded-PRNG guidance. Compared #7285/#7325: production changes are equivalent; this test additionally pins the fix hint.
Validation at this head: bun run --cwd packages/lint test src/rules/core.test.ts → 200 passed. Focused tests ran after a full build on current main; built shared parser dependencies were reused. No full render replay or native Windows run locally. git merge-tree --write-tree origin/main 92761eefd5119d3161c21981d421edbc8640fa54 passed against main 539c70cee. No prior substantive reviews or inline comments were present.
Need: yes, requested starter issue · Size: ok · Reuse: existing lint/parser and manifest contracts · Simpler: already minimal · Structure: fine
Risk: low — bounded diagnostic or registry-lint change with focused coverage
— hf-review
Verdict: APPROVE
Reasoning: The requested behavior is implemented using the existing contracts, and the focused regression tests pass. No Important defect found.
…-com#7336-heygen-com#7358 Adopt heygen-com#7304 (without CLI renderDiagnostic, needs heygen-com#6725), heygen-com#7331, heygen-com#7332, heygen-com#7334, heygen-com#7337, heygen-com#7336, heygen-com#7339, heygen-com#7289, heygen-com#5594, heygen-com#6900, heygen-com#7322, heygen-com#7342, heygen-com#7343, heygen-com#7350 (onProgress only), heygen-com#7352, heygen-com#7348, heygen-com#7344, heygen-com#7353, heygen-com#7356 and heygen-com#7355. Defer heygen-com#5708 (needs heygen-com#6911) and heygen-com#7345 (READ_VERSION 4 vs 7); heygen-com#7307 not applicable. Re-read 14 moved pins, pin 6 new PRs (monitored 126). Make checkReportFile module-private and suppress the cross-package closeTestChrome duplicate for fallow. Co-authored-by: Miguel Ángel <miguel.sierra@heygen.com> Co-authored-by: SophiaHuangCc <129631224+SophiaHuangCc@users.noreply.github.com> Co-authored-by: Dante <duanjl.china@gmail.com> Co-authored-by: Muzzy5150 <muzzy5150yt@gmail.com> Co-authored-by: ump45nose <52391318+ump45nose@users.noreply.github.com> Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
What
Add
crypto.randomUUID()to thenon_deterministic_codelint rule so compositions that call it are flagged the same way asMath.random()/crypto.getRandomValues().Why
The render shim seeds
getRandomValuesonly (packages/producer/src/services/fileServer.ts), socrypto.randomUUID()stays random between renders and workers. Issue #7276 tracks this gap.Related work
Fixes #7276
How
crypto.randomUUIDpattern (same seeded-PRNG hint as the other crypto RNG entry) inpackages/lint/src/rules/core.tscrypto.randomUUID()yields anon_deterministic_codefindingTest plan
Verification locally:
bun run --filter @hyperframes/parsers build bun run --filter @hyperframes/lint testResult: 24 files / 1276 tests passed.
AI assistance
AI-assisted implementation; I reviewed the change and ran the package tests above.