Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
212 changes: 0 additions & 212 deletions .github/workflows/openrouter-pr-review.yml

This file was deleted.

4 changes: 2 additions & 2 deletions reasoning-trace-example.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
"metadata": {
"version": "1.0",
"engine": "AG-TUNE",
"timestamp": "2026-06-28T00:00:15.058Z",
"timestamp": "2026-06-29T18:51:26.775Z",
"description": "Example reasoning trace for interpretability validation"
},
"trace": {
"line": "shadows dance beneath the moon",
"timestamp": "2026-06-28T00:00:15.046Z",
"timestamp": "2026-06-29T18:51:26.774Z",
"emotionalVector": [
0.32,
-0.15,
Expand Down
19 changes: 17 additions & 2 deletions src/App.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -594,7 +594,15 @@ class AGTuneEngine {
* Generate iambic pentameter stress pattern (alternating 0/1)
*/
_getStressPattern(words) {
return words.map((_, idx) => idx % 2 === 1 ? 1 : 0);
return words.flatMap(word => {
try {
const analysis = this.ule.analyze(word);
return analysis.stressPattern;
} catch (e) {
console.warn('Stress analysis failed for word:', word, e.message);
return [0];
}
});
}

/**
Expand Down Expand Up @@ -843,8 +851,15 @@ class AGTuneEngine {
}

_checkRhymeConsistency(tokens) {
if (!tokens || tokens.length === 0) return 0.5;
const lastWord = tokens[tokens.length - 1];
return this._getRhymeGroup(lastWord) !== null ? 1 : 0.5;
try {
const analysis = this.ule.analyze(lastWord);
return analysis.rhymePart ? 1 : 0.5;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🎯 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

} catch (e) {
console.warn('Rhyme analysis failed for word:', lastWord, e.message);
return 0.5;
}
}

_calculateRepetitionScore(tokens) {
Expand Down
4 changes: 2 additions & 2 deletions src/UniversalLinguisticEngine.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ export class UniversalLinguisticEngine {
this.clock = clock ?? new DeterministicClock(0);
this.idGenerator = idGenerator ?? new CounterIdGenerator();
this.logger = logger ?? new NullLogger();
this.phonetics = new PhoneticEngine();
this.phonetics = new G2PEngine();
this.grammar = new ConstraintGrammar(this.rng);
}

Expand Down Expand Up @@ -173,7 +173,7 @@ export class UniversalLinguisticEngine {
}
}

class PhoneticEngine {
class G2PEngine {
constructor() {
this.rules = [
{ regex: /tion$/g, repl: 'S u n' },
Expand Down
Loading