Skip to content

fix(lint): flag crypto.randomUUID() as non-deterministic - #7322

Merged
jrusso1020 merged 1 commit into
heygen-com:mainfrom
ump45nose:fix-7276-lint-crypto-randomuuid
Nov 7, 2026
Merged

jrusso1020 merged 1 commit into
heygen-com:mainfrom
ump45nose:fix-7276-lint-crypto-randomuuid

Conversation

@ump45nose

Copy link
Copy Markdown
Contributor

What

Add crypto.randomUUID() to the non_deterministic_code lint rule so compositions that call it are flagged the same way as Math.random() / crypto.getRandomValues().

Why

The render shim seeds getRandomValues only (packages/producer/src/services/fileServer.ts), so crypto.randomUUID() stays random between renders and workers. Issue #7276 tracks this gap.

Related work

Fixes #7276

How

  • Add a crypto.randomUUID pattern (same seeded-PRNG hint as the other crypto RNG entry) in packages/lint/src/rules/core.ts
  • Add a unit test that a composition using crypto.randomUUID() yields a non_deterministic_code finding

Test plan

  • Unit tests added/updated
  • Manual testing performed
  • Documentation updated (if applicable)
  • Comments follow CONTRIBUTING.md "Comments": they say why, not what, and a bug fix says what the code must do and how to reproduce the bug

Verification locally:

bun run --filter @hyperframes/parsers build
bun run --filter @hyperframes/lint test

Result: 24 files / 1276 tests passed.

AI assistance

AI-assisted implementation; I reviewed the change and ran the package tests above.

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 jrusso1020 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@jrusso1020
jrusso1020 added this pull request to the merge queue Nov 7, 2026
Merged via the queue into heygen-com:main with commit cc7a760 Nov 7, 2026
81 checks passed
SanHsien added a commit to SanHsien/hyperframes that referenced this pull request Nov 7, 2026
…-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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

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

2 participants