You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
add the offline @proj-airi/pattern-disruptor package with EN/RU word banks, random/contextual/double-pass word injection, and synonym freshness scanning
persist per-card pattern disruptor settings and compose its prompt supplement with existing toolset guidance
add AIRI card editor controls and English i18n entries
Tests
pnpm -F @proj-airi/pattern-disruptor test:run
pnpm -F @proj-airi/pattern-disruptor typecheck
pnpm -F @proj-airi/pattern-disruptor build
pnpm -F @proj-airi/stage-ui exec vitest run src/stores/modules/airi-card.test.ts src/stores/chat.contract.test.ts
pnpm -F @proj-airi/stage-pages typecheck
Known Verification Gap
pnpm -F @proj-airi/stage-ui typecheck currently fails on unrelated test typing errors already present on the origin/main base (for example tts-session.test.ts and character/orchestrator/index.test.ts).
We reviewed changes in f0ebbad...f32dcb1 on this pull request. Below is the summary for the review, and you can see the individual issues we found as inline review comments.
Some issues found as part of this review are outside of the diff in this pull request and aren't shown in the inline review comments due to GitHub's API limitations. You can see those issues on the DeepSource dashboard.
AI Review is run only on demand for your team. We're only showing results of static analysis review right now. To trigger AI Review, comment @deepsourcebot review on this thread.
The reason will be displayed to describe this comment to others. Learn more.
`normalizeToken` has a cyclomatic complexity of 15 with "medium" risk
A function with high cyclomatic complexity can be hard to understand and
maintain. Cyclomatic complexity is a software metric that measures the number of
independent paths through a function. A higher cyclomatic complexity indicates
that the function has more decision points and is more complex.
The reason will be displayed to describe this comment to others. Learn more.
Function has a cyclomatic complexity of 7 with "medium" risk
A function with high cyclomatic complexity can be hard to understand and
maintain. Cyclomatic complexity is a software metric that measures the number of
independent paths through a function. A higher cyclomatic complexity indicates
that the function has more decision points and is more complex.
The reason will be displayed to describe this comment to others. Learn more.
`uniqueWords` has a cyclomatic complexity of 7 with "medium" risk
A function with high cyclomatic complexity can be hard to understand and
maintain. Cyclomatic complexity is a software metric that measures the number of
independent paths through a function. A higher cyclomatic complexity indicates
that the function has more decision points and is more complex.
The reason will be displayed to describe this comment to others. Learn more.
`generateRandomWords` has a cyclomatic complexity of 6 with "medium" risk
A function with high cyclomatic complexity can be hard to understand and
maintain. Cyclomatic complexity is a software metric that measures the number of
independent paths through a function. A higher cyclomatic complexity indicates
that the function has more decision points and is more complex.
The reason will be displayed to describe this comment to others. Learn more.
`collectTokenStats` has a cyclomatic complexity of 6 with "medium" risk
A function with high cyclomatic complexity can be hard to understand and
maintain. Cyclomatic complexity is a software metric that measures the number of
independent paths through a function. A higher cyclomatic complexity indicates
that the function has more decision points and is more complex.
The reason will be displayed to describe this comment to others. Learn more.
No default export found in imported module "./tabs/CardCreationTabPatternDisruptor.vue"
It is recommended to use default imports only if there is a default export in the module being imported. If there are no default exports in the source module, it is better to use named imports, and it helps the build tools while optimizing the code.
The reason will be displayed to describe this comment to others. Learn more.
Code Review
This pull request introduces the @proj-airi/pattern-disruptor package, an offline prompt disruption engine designed to vary AI character responses through random word injection and synonym overuse tracking, alongside its integration into the settings UI and chat orchestrator. The review feedback highlights several critical areas for improvement: the template renderer should allow optional whitespace inside double braces; the word length filters in the random words generator and synonym scanner should be adjusted to support 3-letter Russian words like 'сад'; basic Russian inflection handling is needed to prevent dictionary matching failures; and the pattern disruptor state should be reset when switching sessions or characters to avoid word history leakage.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
The reason will be displayed to describe this comment to others. Learn more.
The template renderer uses a strict regular expression /\{\{(\w+)\}\}/g which does not allow any whitespace inside the double braces. If a user customizes their prompt and writes {{ words }} instead of {{words}}, the replacement will silently fail. Adding optional whitespace handling makes the template rendering much more robust.
The reason will be displayed to describe this comment to others. Learn more.
The filter enforces token.length >= 4, which prevents valid 3-letter words like сад (garden) from being matched as contextual anchors. Since сад is a key in ru/synonyms.json, it will be completely ignored in contextual mode. Since we already check Boolean(input.synonyms[token]), the length check is redundant and can be safely removed.
The reason will be displayed to describe this comment to others. Learn more.
The scanner enforces normalizedWord.length < 4, which prevents 3-letter words like сад (garden) from being scanned for overuse. Lowering this limit to 3 ensures that all valid words in the Russian vocabulary are correctly tracked.
The reason will be displayed to describe this comment to others. Learn more.
Since Russian is a highly inflected language, returning the token as-is (if (language === 'ru') return lower) means that inflected forms (e.g., 'саду', 'яркая', 'историю') will fail to match the dictionary keys in synonyms.json (like 'сад', 'яркий', 'история'). This significantly reduces the effectiveness of the contextual mode and synonym scanner for Russian conversations. Consider implementing a basic suffix-stripper or mapping for the small Russian vocabulary to ensure effective matching.
The reason will be displayed to describe this comment to others. Learn more.
The patternDisruptorStore.resetState() function is defined but never called when switching sessions or characters. This can lead to word history leakage, where recently injected words from a previous character or session are carried over and affect the random word selection of a new session. Consider calling patternDisruptorStore.resetState() when the active session or active card changes.
The reason will be displayed to describe this comment to others. Learn more.
Expected to return a value at the end of function 'getKnownRussianSuffixCandidate'
Any code paths that do not have explicit returns will return undefined. It is recommended to replace any implicit dead-ends that return undefined with a return null statement.
The reason will be displayed to describe this comment to others. Learn more.
`isAllowedWordBankEntry` has a cyclomatic complexity of 6 with "medium" risk
A function with high cyclomatic complexity can be hard to understand and
maintain. Cyclomatic complexity is a software metric that measures the number of
independent paths through a function. A higher cyclomatic complexity indicates
that the function has more decision points and is more complex.
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
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.
Summary
Tests
Known Verification Gap
Ready for Gemini review.