Merged
Conversation
Contributor
There was a problem hiding this comment.
1 issue found across 2 files (changes from recent commits).
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="frontend/eslint.config.js">
<violation number="1" location="frontend/eslint.config.js:31">
P1: Custom agent: **Check for Cursor Rules Drift**
Cursor rules drift: a new frontend security convention (forbid `Math.random`, require Web Crypto RNG) was added in ESLint but not reflected in the relevant Cursor frontend rule (`.cursor/rules/frontend-rules.mdc`). Update that rule so Cursor-generated code follows the same CSPRNG requirement.</violation>
</file>
Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.
3f29242 to
832af30
Compare
felixschmetz
approved these changes
Mar 13, 2026
b5ec467 to
7afa37e
Compare
Contributor
There was a problem hiding this comment.
1 issue found across 1 file (changes from recent commits).
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name=".cursor/rules/frontend-rules.mdc">
<violation number="1" location=".cursor/rules/frontend-rules.mdc:345">
P1: Custom agent: **Check for Cursor Rules Drift**
Update the backend Cursor rule too. This PR introduces a repo-wide randomness convention, but the added rule only covers frontend APIs; `.cursor/rules/backend-rules.mdc` still lacks guidance to use Python `secrets.*` instead of `random.*`, so Cursor remains out of sync for backend changes.</violation>
</file>
Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.
The lint rules banning `Math.random()` (3592d4b) and `random.*` (13bc3b6) were not reflected in the Cursor AI rules files. AI-generated code could still use the banned APIs, producing immediate lint failures. Add a Security/Randomness subsection to both `frontend-rules.mdc` and `backend-rules.mdc` so that Cursor-generated code uses the correct CSPRNG APIs (`crypto.getRandomValues` / `secrets.*`) from the start.
f311308 to
eb63d84
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
CASA-46 requires all random value generation to use cryptographically secure PRNGs. This migrates every call site in both backend and frontend.
Backend:
random.uniform,random.randint, andrandom.choicesare replaced withsecrets.randbelowthroughout OAuth retry jitter, email scheduling, and web-fetcher backoff. Readable ID generation is extracted intocore/readable_id.pyusingsecrets.choice(rejection-sampled, zero bias), deduplicating logic fromcollection.pyandconnection.py.Frontend: inline
Math.randomID generators are consolidated intolib/readable-id.tsusingcrypto.getRandomValues(new Uint32Array(...)).Uint32Arrayis used instead ofUint8Arrayto avoid modulo bias (256 % 36 = 4 biased values).FilterBuilderModalswitches tocrypto.randomUUIDfor React keys. The unusedInputimport inCreateCollectionViewis removed.