Update core engine logic for rhyme and stress patterns#16
Conversation
Updates the core engine in App.jsx to utilize the UniversalLinguisticEngine (ULE) for realistic and robust stress pattern calculation and rhyme consistency checking, replacing hardcoded iambic generation and mock rhyme-group evaluation. Includes error handling to fallback safely on missing or invalid analyses. Co-authored-by: recursive-ai-dev <246750064+recursive-ai-dev@users.noreply.github.com>
|
👋 Jules, reporting for duty! I'm here to lend a hand with this pull request. When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down. I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job! For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with New to Jules? Learn more at jules.google/docs. For security, I will only act on instructions from the user who triggered this task. |
|
Warning Review limit reached
Next review available in: 34 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthrough
ChangesULE analysis and phonetics engine rename
Trace example timestamp refresh
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Up to standards ✅🟢 Issues
|
| Metric | Results |
|---|---|
| Complexity | 0 |
| Duplication | 0 |
NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.
Added console.warn inside the catch blocks of `_getStressPattern` and `_checkRhymeConsistency` in `src/App.jsx` instead of silently catching errors, resolving the SonarCloud Quality Gate failure. Co-authored-by: recursive-ai-dev <246750064+recursive-ai-dev@users.noreply.github.com>
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@src/App.jsx`:
- Line 857: The rhyme scoring in App.jsx is only checking whether
analysis.rhymePart exists, so unrelated words can both get a full score. Update
the rhyme evaluation logic around the current return in the rhyme rule to
compare rhymePart values pairwise against the target or previous ending,
following the same approach used by the Rete rhyme rule, and only return 1 when
the rhyme parts actually match.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: ASSERTIVE
Plan: Pro
Run ID: 449498e8-2b68-40ea-978c-413607ac188e
📒 Files selected for processing (2)
reasoning-trace-example.jsonsrc/App.jsx
📜 Review details
⏰ Context from checks skipped due to timeout. (1)
- GitHub Check: Codacy Static Code Analysis
⚠️ CI failures not shown inline (3)
GitHub Actions: OpenRouter PR Review / 0_ai_review.txt: Update core engine logic for rhyme and stress patterns
Conclusion: failure
##[group]Run set -euo pipefail
�[36;1mset -euo pipefail�[0m
�[36;1m�[0m
�[36;1mRAW_MODEL="${OPENROUTER_MODEL:-openai/gpt-4o-mini:free}"�[0m
�[36;1mif [[ "$RAW_MODEL" != *":free" ]]; then�[0m
�[36;1m echo "❌ Model must be a :free model. Got: $RAW_MODEL"�[0m
�[36;1m exit 1�[0m
�[36;1mfi�[0m
�[36;1mMODEL="$RAW_MODEL"�[0m
�[36;1m�[0m
�[36;1mcat > prompt.txt << 'EOF'�[0m
�[36;1mYou are a senior engineer doing a PR review.�[0m
�[36;1mBe direct, specific, and helpful.�[0m
�[36;1mOutput in Markdown.�[0m
�[36;1m�[0m
�[36;1mInclude sections:�[0m
�[36;1m1) Summary (1-3 bullets)�[0m
�[36;1m2) High-risk issues (bugs, security, perf) - must be actionable�[0m
�[36;1m3) Suggestions (readability, architecture)�[0m
�[36;1m4) Missing tests / quick test ideas�[0m
�[36;1m5) "Approve?" (one of: APPROVE / REQUEST_CHANGES / COMMENT_ONLY) with 1 sentence justification�[0m
�[36;1m�[0m
�[36;1mConstraints:�[0m
�[36;1m- If diff is truncated, mention that.�[0m
�[36;1m- Do not invent files or functions not shown.�[0m
�[36;1mEOF�[0m
�[36;1m�[0m
�[36;1mjq -n \�[0m
�[36;1m --arg model "$MODEL" \�[0m
�[36;1m --arg title "$PR_TITLE" \�[0m
�[36;1m --arg body "${PR_BODY:-}" \�[0m
�[36;1m --arg author "$PR_AUTHOR" \�[0m
�[36;1m --arg truncated "$DIFF_TRUNCATED" \�[0m
�[36;1m --rawfile diff "pr.diff" \�[0m
�[36;1m --rawfile sys prompt.txt \�[0m
�[36;1m '{�[0m
�[36;1m model: $model,�[0m
�[36;1m temperature: 0.2,�[0m
�[36;1m max_tokens: 900,�[0m
�[36;1m messages: [�[0m
�[36;1m {role:"system", content:$sys},�[0m
�[36;1m {role:"user", content: ("PR Title: " + $title + "\nPR Author: " + $author + "\nPR Description:\n" + $body + "\n\nDiff truncated: " + $truncated + "\n\n---\nDIFF:\n" + $diff)}�[0m
�[36;1m ]�[0m
�[36;1m }' > req.json�[0m
�[36;1m�[0m
�[36;1mcurl -sS https://openrouter.ai/api/v1/chat/completions \�[0m
�[36;1m -H "Authorization: ***" \�[0m
�[36;1m -H "Content-Type: application/json" \�[0m
�[36;1m -H "HTTP-Ref...
GitHub Actions: OpenRouter PR Review / ai_review: Update core engine logic for rhyme and stress patterns
Conclusion: failure
##[group]Run set -euo pipefail
�[36;1mset -euo pipefail�[0m
�[36;1m�[0m
�[36;1mRAW_MODEL="${OPENROUTER_MODEL:-openai/gpt-4o-mini:free}"�[0m
�[36;1mif [[ "$RAW_MODEL" != *":free" ]]; then�[0m
�[36;1m echo "❌ Model must be a :free model. Got: $RAW_MODEL"�[0m
�[36;1m exit 1�[0m
�[36;1mfi�[0m
�[36;1mMODEL="$RAW_MODEL"�[0m
�[36;1m�[0m
�[36;1mcat > prompt.txt << 'EOF'�[0m
�[36;1mYou are a senior engineer doing a PR review.�[0m
�[36;1mBe direct, specific, and helpful.�[0m
�[36;1mOutput in Markdown.�[0m
�[36;1m�[0m
�[36;1mInclude sections:�[0m
�[36;1m1) Summary (1-3 bullets)�[0m
�[36;1m2) High-risk issues (bugs, security, perf) - must be actionable�[0m
�[36;1m3) Suggestions (readability, architecture)�[0m
�[36;1m4) Missing tests / quick test ideas�[0m
�[36;1m5) "Approve?" (one of: APPROVE / REQUEST_CHANGES / COMMENT_ONLY) with 1 sentence justification�[0m
�[36;1m�[0m
�[36;1mConstraints:�[0m
�[36;1m- If diff is truncated, mention that.�[0m
�[36;1m- Do not invent files or functions not shown.�[0m
�[36;1mEOF�[0m
�[36;1m�[0m
�[36;1mjq -n \�[0m
�[36;1m --arg model "$MODEL" \�[0m
�[36;1m --arg title "$PR_TITLE" \�[0m
�[36;1m --arg body "${PR_BODY:-}" \�[0m
�[36;1m --arg author "$PR_AUTHOR" \�[0m
�[36;1m --arg truncated "$DIFF_TRUNCATED" \�[0m
�[36;1m --rawfile diff "pr.diff" \�[0m
�[36;1m --rawfile sys prompt.txt \�[0m
�[36;1m '{�[0m
�[36;1m model: $model,�[0m
�[36;1m temperature: 0.2,�[0m
�[36;1m max_tokens: 900,�[0m
�[36;1m messages: [�[0m
�[36;1m {role:"system", content:$sys},�[0m
�[36;1m {role:"user", content: ("PR Title: " + $title + "\nPR Author: " + $author + "\nPR Description:\n" + $body + "\n\nDiff truncated: " + $truncated + "\n\n---\nDIFF:\n" + $diff)}�[0m
�[36;1m ]�[0m
�[36;1m }' > req.json�[0m
�[36;1m�[0m
�[36;1mcurl -sS https://openrouter.ai/api/v1/chat/completions \�[0m
�[36;1m -H "Authorization: ***" \�[0m
�[36;1m -H "Content-Type: application/json" \�[0m
�[36;1m -H "HTTP-Ref...
Commit Status: CircleCI Pipeline: CircleCI Pipeline
Conclusion: failure
No configuration was found in your project. Please refer to https://circleci.com/docs/2.0/ to get started with your configuration.
🧰 Additional context used
🪛 GitHub Check: SonarCloud Code Analysis
src/App.jsx
[warning] 601-603: Handle this exception or don't catch it at all.
[warning] 858-860: Handle this exception or don't catch it at all.
🔍 Remote MCP Context7
Additional review context
- Context7 did not find a direct library/docs match for
UniversalLinguisticEngine; the closest relevant docs it returned were CMUdict and Phon. - CMUdict exposes pronunciations as lists of ARPAbet phones, can return multiple pronunciations for a word, and the example lookup path explicitly handles missing words via
None/KeyError. It also includes stress markers in its symbol set. - Phon’s docs show rhymes are based on matching trailing phonemes, and phoneme retrieval can optionally keep stress markers. This supports the PR’s move from fixed stress/rhyme logic toward pronunciation-based analysis.
🔇 Additional comments (2)
reasoning-trace-example.json (1)
5-10: LGTM!src/App.jsx (1)
597-604: LGTM!
| return this._getRhymeGroup(lastWord) !== null ? 1 : 0.5; | ||
| try { | ||
| const analysis = this.ule.analyze(lastWord); | ||
| return analysis.rhymePart ? 1 : 0.5; |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟠 Major | 🏗️ Heavy lift
Compare rhyme parts, not merely their noble existence.
Line 857 scores any analyzable word with a rhymePart as consistent, without comparing it to a target or previous ending. Use pairwise rhymePart comparison, like the Rete rhyme rule already does, so unrelated endings do not both score 1.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@src/App.jsx` at line 857, The rhyme scoring in App.jsx is only checking
whether analysis.rhymePart exists, so unrelated words can both get a full score.
Update the rhyme evaluation logic around the current return in the rhyme rule to
compare rhymePart values pairwise against the target or previous ending,
following the same approach used by the Rete rhyme rule, and only return 1 when
the rhyme parts actually match.
Source: MCP tools
The OpenRouter API returns a 401 "User not found" when the Authorization header is improperly formatted. This commit fixes the PR review workflow by correctly referencing the $OPENROUTER_API_KEY environment variable. Co-authored-by: recursive-ai-dev <246750064+recursive-ai-dev@users.noreply.github.com>
Per user request to focus on MVP capabilities, the failing OpenRouter PR review workflow has been deleted. Additionally, the `PhoneticEngine` has been renamed to `G2PEngine` (Grapheme-to-Phoneme) to better reflect its algorithmic purpose in detecting dynamic rhymes and meters. Co-authored-by: recursive-ai-dev <246750064+recursive-ai-dev@users.noreply.github.com>
Added console.warn inside the catch blocks of `_getStressPattern` and `_checkRhymeConsistency` in `src/App.jsx` instead of silently catching errors, resolving the SonarCloud Quality Gate failure. Co-authored-by: recursive-ai-dev <246750064+recursive-ai-dev@users.noreply.github.com>
Added console.warn inside the catch blocks of `_getStressPattern` and `_checkRhymeConsistency` in `src/App.jsx` instead of silently catching errors, resolving the SonarCloud Quality Gate failure. Co-authored-by: recursive-ai-dev <246750064+recursive-ai-dev@users.noreply.github.com>
|



this.ule.analyze()inside_getStressPattern()and_checkRhymeConsistency().PR created automatically by Jules for task 1503298084988789004 started by @recursive-ai-dev