Self-hosted, Self-Improving, Federated Everything App — dev management, agent orchestration, persistent mind, digital twin, second brain, and creative pipeline from a single dashboard over Tailscale to port the user into the OS
JavaScript ai-agentsdashboarddeveloper-toolsdigital-twinquantified-selfsecond-brainself-hostedtailscale
address review (codex): Unicode-aware name boundary so accented names (José, Élodie) match
Adam Eivy50647374fb72
diff --git a/client/src/lib/scenePrompt.js b/client/src/lib/scenePrompt.jsindex 5869335817..5db0774b49 100644--- a/client/src/lib/scenePrompt.js+++ b/client/src/lib/scenePrompt.js@@ -64,7 +64,12 @@ function matchEntriesByCandidates(text, entries, candidatesFn) {const wordBoundary = (needle) => {if (!needle) return false;const escaped = needle.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');- return new RegExp(`\\b${escaped}\\b`, 'i').test(haystack);+ // Unicode-aware boundary instead of ASCII `\b`: a name starting/ending with a+ // non-ASCII letter (José, Élodie, Zoë) has no `\b` adjacent to the accented+ // char, so `\b…\b` would silently miss it. Lookarounds over `[\p{L}\p{N}_]`+ // with the `u` flag reproduce word-boundary semantics for all scripts+ // (still won't match "Mira" inside "Miranda").+ return new RegExp(`(?<![\\p{L}\\p{N}_])${escaped}(?![\\p{L}\\p{N}_])`, 'iu').test(haystack);};for (const entry of entries) {const key = entry.id || entry.name;diff --git a/server/lib/scenePrompt.js b/server/lib/scenePrompt.jsindex d29599e02b..096d8314ed 100644--- a/server/lib/scenePrompt.js+++ b/server/lib/scenePrompt.js@@ -79,7 +79,12 @@ function matchEntriesByCandidates(text, entries, candidatesFn) {const wordBoundary = (needle) => {if (!needle) return false;const escaped = needle.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');- return new RegExp(`\\b${escaped}\\b`, 'i').test(haystack);+ // Unicode-aware boundary instead of ASCII `\b`: a name starting/ending with a+ // non-ASCII letter (José, Élodie, Zoë) has no `\b` adjacent to the accented+ // char, so `\b…\b` would silently miss it. Lookarounds over `[\p{L}\p{N}_]`+ // with the `u` flag reproduce word-boundary semantics for all scripts+ // (still won't match "Mira" inside "Miranda").+ return new RegExp(`(?<![\\p{L}\\p{N}_])${escaped}(?![\\p{L}\\p{N}_])`, 'iu').test(haystack);};for (const entry of entries) {const key = entry.id || entry.name;diff --git a/server/services/pipeline/textStages.js b/server/services/pipeline/textStages.jsindex 6fadfad715..e8589649bc 100644--- a/server/services/pipeline/textStages.js+++ b/server/services/pipeline/textStages.js@@ -197,13 +197,15 @@ function resolveSourceStageIds({ issue, stageId, sourceStageIds }) {// series principals than the whole 68-character cast.const PRINCIPAL_ROLE_RE = /\b(main|lead|protagonist|principal|recurring|primary|hero|central)\b/i;-// Word-boundary, case-insensitive containment test (same escaping the bible-// matcher in scenePrompt.js uses). Local copy so the first-name supplement below-// doesn't have to widen the shared matcher (which `canonReadiness` also calls).+// Word-boundary, case-insensitive containment test (same Unicode-aware boundary+// the bible matcher in scenePrompt.js uses — lookarounds over `[\p{L}\p{N}_]` so+// accented first names like "José" still match). Local copy so the first-name+// supplement below doesn't have to widen the shared matcher (`canonReadiness`+// also calls it).const wordInText = (needle, haystack) => {if (!needle) return false;const escaped = needle.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');- return new RegExp(`\\b${escaped}\\b`, 'i').test(haystack);+ return new RegExp(`(?<![\\p{L}\\p{N}_])${escaped}(?![\\p{L}\\p{N}_])`, 'iu').test(haystack);};// First-name token of a multi-word canon name ("Mira Reyes" → "Mira"). Draftsdiff --git a/server/services/pipeline/textStages.test.js b/server/services/pipeline/textStages.test.jsindex 88fd899a8d..ee168f5d04 100644--- a/server/services/pipeline/textStages.test.js+++ b/server/services/pipeline/textStages.test.js@@ -584,6 +584,19 @@ describe('pipeline text stage generator', () => {.toEqual(['Mira Reyes']);});+ it('scopeCharactersForIssue: matches non-ASCII names (accented) the ASCII \\b matcher would miss', () => {+ const cast = [+ { name: 'José Marín', role: 'pilot' },+ { name: 'Élodie', role: 'lead' }, // principal — match must come from text, not fallback+ { name: 'Mira', role: 'extra' },+ ];+ // Source names José (by first name) and Élodie (accented single name).+ const got = textStages.__testing.scopeCharactersForIssue(cast, 'José and Élodie shared a look').map((c) => c.name);+ expect(got).toContain('José Marín');+ expect(got).toContain('Élodie');+ expect(got).not.toContain('Mira');+ });+it('scopeCharactersForIssue: falls back to principals when no name is matched', () => {const cast = [{ name: 'Mira', role: 'main protagonist' },