Repository navigation
Conversation
There was a problem hiding this comment.
Approve with nits (1 P2, 1 P3)
Scope: base main, merge base 77abdcb3, 1 commit, 3 files reviewed. I loaded ponytail-review (sections 1–3) and did not load coderbook or karpathy-guidelines. The review ran alone in a separate session.
Findings
P2
apps/node-services/src/memory/graph/inferred-edges.ts:28 — the plain-word alias filter only knows ASCII, and this change lets non-Latin aliases through to it
plainWordPattern = /^[A-Z]?[a-z]+$/u is the rule that keeps an ordinary one-word alias such as "Sequence" from being treated as a name. Before this change, an alias written only in Cyrillic or Greek letters was dropped by the length check in normalizedName, because it had 0 ASCII letters. So the filter never had to deal with those scripts. Now the length check counts \p{L}\p{N}, and those aliases pass it, but plainWordPattern still does not match them:
"Sequence" plainWord=true oldLen=8 newLen=8
"Проект" (Проект, "Project") plainWord=false oldLen=0 newLen=6
Example: a project has the frontmatter alias Проект. Every Session page that starts a sentence with "Проект ..." now gets a mention edge to that project, and flashback (flashback/service.ts:196, flashback/suggest.ts:105) suggests it. That is the "an epic effort" false positive the doc comment says is prevented. The README line "Existing short-name, case and ambiguous-name filters still apply" is true, but the plain-word filter does not hold for the newly admitted names.
Fix: make the pattern Unicode-aware, /^\p{Lu}?\p{Ll}+$/u. Then add a test that mirrors the existing "Sequence" alias case (tests/memory/inferred-edges.test.ts:138) with a Cyrillic word written as escaped code points. Arabic and other scripts without letter case still pass the filter, and that is acceptable.
P3
apps/node-services/src/memory/graph/inferred-edges.ts:148 — dense scripts other than Han still use the Latin 4-character minimum
Only Han gets the 2-character minimum. Names in other dense scripts still need 4 letters:
김민수 (Korean, 3 syllables) -> 3 rejected
さくら (kana, 3 characters) -> 3 rejected
A typical three-syllable Korean name, or a three-kana Japanese name, still never matches. That does not live up to the title "match entity names across Unicode scripts". Either apply the Han minimum to Hangul and kana too (\p{Script=Hangul}, \p{Script=Hiragana}, \p{Script=Katakana}), or narrow the title and the README sentence to the scripts that are actually covered. Nothing regresses here, since these names were also rejected before.
Verified as fine
- Name matching already uses Unicode word boundaries:
namePattern(inferred-edges.ts:159) uses(?<![\p{L}\p{N}])…(?![\p{L}\p{N}]), so the new names inJosé, Cyrillic and Arabic match as whole words. One-word names compile without theiflag, so they stay case-sensitive in Cyrillic too. - Emoji and punctuation do not count toward the minimum.
\p{L}\p{N}excludes them, and the new emoji test covers this. Decomposed accents (\p{M}) are stripped too, without making a Latin name too short. - ASCII names behave as before: for pure ASCII input,
[^\p{L}\p{N}]aftertoLowerCase()keeps the same characters as[^a-z0-9]. - The function's only callers,
graph/build.ts:60,flashback/service.ts:196andflashback/suggest.ts:105, need no change. Its signature is unchanged. - The README under
src/memory/is updated. There are no contract, env or dependency changes, and the user message →provider_readypath is untouched. - No CJK text in added lines or in the commit message. The tests use escaped code points.
Process notes
- One commit, no merge commits or fixup commits.
CI
The checks that ran (repository-gate, changes, check (web)) passed. The rest were skipped by path. The PR CI does not run the node-services suite. The author reports pnpm --filter @linger/node-services check passing on this head. I did not rerun it, because the worktree has no node_modules. I checked the length and plain-word behaviour directly with node -e on the same regexes.
Automated review by Claude Code
Automated review of f0cab93 by Claude Code.
There was a problem hiding this comment.
Request changes (1 P0) — the logic is right; the only blocker is a formatting failure that keeps repository-gate red.
Scope: follow-up on f0cab93, now reviewing 687655d. Base main, merge base 77abdcb, 2 commits, 3 files. Loaded the helper skills coderbook (§2, §3, §5), ponytail-review (§1–3) and karpathy-guidelines (§2–3). This review ran in a separate session.
Previous findings
- P2: plain-word alias filter only recognized ASCII. Resolved.
apps/node-services/src/memory/graph/inferred-edges.ts:28is now/^\p{Lu}?\p{Ll}+$/u. New tests cover lowercase and capitalized Cyrillic and Greek aliases, which are now filtered, and all-caps Cyrillic and uncased Arabic aliases, which are kept (inferred-edges.test.ts:170-211). Without this change, the old ASCII pattern would letПроектthrough, and the firstit.eachwould see an extraprojects/researchedge. - P3: Hangul and kana names still need 4 characters, which contradicts the "across Unicode scripts" claim. Resolved through docs. The README (
apps/node-services/src/memory/README.md:17-22) now says the PR admits accented Latin, Cyrillic and Arabic names and does not lower the threshold for short Hangul or kana names. ThementionEdgesdoc comment now says "4 letters or digits in other scripts". The PR body only claims accented, Cyrillic and Arabic names.
Findings
P0
apps/node-services/tests/memory/inferred-edges.test.ts:193: the new test is not Prettier-formatted, sorepository-gatefails.- Evidence: the CI log for
make check-repository-gateshows[warn] apps/node-services/tests/memory/inferred-edges.test.ts — Code style issues found, followed byError 1. I reproduced it locally withprettier --check. - Cause: Prettier wants the two-element
it.each([...])array on one line, with the test name and callback as wrapped arguments. - Impact:
mainrequires this check, so the PR cannot merge. - Fix: run
pnpm exec prettier --write apps/node-services/tests/memory/inferred-edges.test.tsand amend the change into the commit that adds the test.
- Evidence: the CI log for
Verified as fine
normalizedName(inferred-edges.ts:141-151):- Names without Han count code points of
\p{L}\p{N}against the existing minimum of 4. - Names containing Han keep the 2-character rule.
- The spread
[...]counts astral characters as one, not as UTF-16 code units.
- Names without Han count code points of
namePattern(inferred-edges.ts:154-161) already used Unicode-aware(?<![\p{L}\p{N}])boundaries. Non-Latin one-word names therefore match whole words, and their case stays sensitive because theiflag is only added for names that contain whitespace.- Plain-word filtering applies only to aliases, not titles (
inferred-edges.ts:118-120), as before. Uncased scripts (Arabic\p{Lo}) never match\p{Lu}?\p{Ll}+, so their one-word aliases are kept. That matches the README sentence "plain-word aliases in scripts with letter case". entityNamePatternsis the single source for both mention edges and flashback, so both paths pick up the change. There are no other callers ofnormalizedNameorplainWordPattern.- No contract, env, dependency or cross-app change. The doc comment and README were updated in the same PR. No CJK in added lines or commit messages.
Process notes
- The branch is 338 commits behind
mainand needs a rebase. 687655d("preserve Unicode plain-word alias filtering") only patches behaviour introduced inf0cab93in response to review.maintakes rebase merges, so squash it intof0cab93(for example withgit rebase -i --autosquash).- Both commits have no body that explains what changed and why.
CI
- Fails:
repository-gate(Prettier on the test file, as above). - Passes:
changesandcheck (web). All other jobs were skipped by the path plan. - No
node-servicesjob ran in CI for this head. Locally, I ranvitest run tests/memory/inferred-edges.test.ts: 17/17 passed.
Automated review by Claude Code
Automated review of 687655d by Claude Code.
There was a problem hiding this comment.
Approve (0 findings)
Scope: follow-up on 687655d. Base main, merge base 77abdcb3; 3 commits, 3 files reviewed at 7d187509. Helper skills were not loaded in this headless run; the review used the linger-pr-review checklist directly. It ran in a separate session.
Previous findings
- P0: new
it.eachblock not Prettier-formatted (apps/node-services/tests/memory/inferred-edges.test.ts): Resolved.7d187509reformats it, andprettier --checkwith the repo-pinned 3.8.4 passes on all three changed files.repository-gateis green.
Findings
None.
Verified as fine
- Length threshold (
apps/node-services/src/memory/graph/inferred-edges.ts:145-149): non-Han names now count code points matching\p{L}\p{N}and still need at least 4. Digits counted before too ([^a-z0-9]), so ASCII names behave as they did. Emoji and punctuation don't count, and the new emoji test covers that. Han keeps the 2-character rule. - Plain-word alias filter (
inferred-edges.ts:28):/^\p{Lu}?\p{Ll}+$/ukeeps the old ASCII behaviour ([A-Z]?[a-z]+is a subset) and now also drops ordinary capitalised or lowercase one-word aliases in other cased scripts. Uncased scripts (Arabic) and all-caps aliases are kept. Tests cover all three cases (Cyrillic and Greek dropped; all-caps Cyrillic and Arabic kept). - Whole-word boundaries (
inferred-edges.ts:159):namePatternwas already Unicode-aware ((?<![\p{L}\p{N}])...(?![\p{L}\p{N}]),uflag), so newly admitted non-Latin names match on whole words without further changes. One-word names stay case-sensitive (gu). - Scripts without spaces (kana, Thai): 4+ letter names are now admitted, but the whole-word lookarounds stop them matching inside running text. The result is a missed match, never a false one, and neither script matched on the base before this PR. The README says as much.
- Callers:
entityNamePatternsis used bymentionEdges(inferred-edges.ts:59),flashback/suggest.ts:105andflashback/service.ts:196. All of them go through the samenormalizedNameandnamePattern, so graph edges and flashback cues stay consistent. - Docs:
apps/node-services/src/memory/README.mddescribes the new rule, matching the code. - Repo rules: no CJK in added lines or commit messages, no config, env var or contract change, and nothing added to the
provider_readypath.
Process notes
687655d6(plain-word alias fix) and7d187509(formatting) only patchf0cab93efrom this same PR.maintakes rebase merges, so consider squashing them (git rebase -i --autosquash).- The commit author is linked to GitHub (
Afloat16).
CI
repository-gateandcheck (web)pass. Every other app check was skipped by the change plan, and no node-services check appears in this run.- Run locally:
vitest run tests/memory/inferred-edges.test.ts tests/memory/flashback.test.ts tests/memory/graph-build.test.ts, 3 files / 33 tests, all passed.prettier --check(3.8.4) on the changed files also passed.
Automated review by Claude Code
Automated review of 7d18750 by Claude Code.
|
Addressed P2 and P3 from review 6052805628 in The plain-word alias filter now uses The title and README now describe the Unicode length check and its existing thresholds. Names without Han still need four letters or digits; short Hangul/kana names receive no new special case. The complete |
There was a problem hiding this comment.
Approve (0 findings)
Scope: base main, merge base 77abdcb3, 3 commits, 3 files (inferred-edges.ts, its test, memory/README.md). Follow-up on 7d187509: the head is the same commit as last time, so there are no new changes. I re-ran the assumption check over the whole merge-base diff. Helper skills: coderbook, ponytail-review, karpathy-guidelines (guidance only). Ran in a separate session.
Previous findings
The previous review of 7d18750 had no findings, so there is nothing to track.
Findings
None.
Verified as fine
- Length check.
normalizedName(apps/node-services/src/memory/graph/inferred-edges.ts:141-151) now counts code points matching\p{L}\p{N}for names without Han and keeps the Han rule of 2 or more characters. I checked it in Node:José/Ériccount 4,Алина5,أحمد4, and four rocket emoji count 0, so the emoji name is rejected. This matches the new tests. - Plain-word alias filter.
/^\p{Lu}?\p{Ll}+$/u(inferred-edges.ts:28) is applied only to aliases (inferred-edges.ts:118-120). Titles are not filtered, so a title such asJoséis still matched. Cyrillic and Greek ordinary words (Проект,σχέδιο) are now filtered like ASCIISequence. All-uppercaseПРОЕКТand Arabicأحمد, which has no letter case, stay. The one behavior change is for accented Latin one-word aliases:Renéewas admitted before and is now filtered. This is consistent with the stated rule that ordinary one-word aliases in cased scripts are excluded. - Whole-word matching.
namePattern(inferred-edges.ts:154-160) already used\p{L}\p{N}lookarounds, so non-Latin names get correct word boundaries with no further change. One-word names stay case-sensitive (guflags). - Callers. All three consumers go through
entityNamePatterns:graph/build.ts:60(viamentionEdges),flashback/service.ts:196andflashback/suggest.ts:105. They pick up the rule consistently, with no second copy of the rule to drift. - PR description vs. diff. No threshold is lowered for Hangul or kana: the minimum stays at 4 letters, and unspaced text rarely satisfies the word-boundary lookarounds anyway. No contract, env or dependency change. The README is updated in the same PR. Test inputs use escaped code points, and there is no CJK in added lines or commit messages.
- Tests. The regressions cover the four admitted scripts, the emoji/punctuation negative case, filtered cased aliases (both capitalized and lowercase), and kept uncased or uppercase aliases.
Process notes
- The branch is 338 commits behind
main.mainrequires up-to-date branches, so it needs a rebase (merge state: BLOCKED). 687655d6(review follow-up to the alias filter) and7d187509(formatting of those tests) only patch the PR's own first commitf0cab93e. Consider squashing them withgit rebase -i --autosquashbefore the rebase merge.- All commits are linked to
Afloat16. There are no merge commits.
CI
repository-gate, changes and check (web) pass; the other app checks were skipped by path. By design, CI does not run check-node-services (see the ci.yml header), so the touched memory tests are not covered by CI. The author reports a local pnpm --filter @linger/node-services check pass. I did not run Vitest because deps are not installed in this worktree. Instead, I checked the regex and length logic directly in Node against the test inputs, and it matches the expected results.
Automated review by Claude Code
Automated review of 7d18750 by Claude Code.
What and why
Count Unicode letters and numbers when applying the existing minimum length for non-Han entity names, while retaining Han thresholds, ambiguous-name exclusion and case-sensitive single words. Ordinary one-word aliases in scripts with letter case remain excluded.
Qualifying accented Latin, Cyrillic and Arabic names can participate in inferred memory relations and flashback retrieval. Names without Han still need at least four letters or digits; this change does not lower the threshold for short Hangul or kana names.
How it was verified
Original comparison base:
77abdcb37f779f9c9d2de89fa245efa88d3f6584. Linux, Node 26.5.0 and pnpm 11.7.0.The original length-check regressions: four non-ASCII names fail on the comparison base, while seven controls pass. The initial implementation passed all 27 inferred-edge, graph-build and flashback tests.
Review 6052805628, P2: added four regressions for capitalized and lowercase ordinary aliases in Cyrillic and Greek. Against
f0cab93e45ac540710184bc10ca16ee5535604f4, the three complete related test files produced 4 failed / 29 passed. With Unicode uppercase/lowercase categories in the plain-word alias filter, all 33 tests passed. Positive controls retain all-uppercase Cyrillic aliases, uncased Arabic aliases, and existing Unicode entity titles.Focused command:
pnpm --filter @linger/node-services exec vitest run tests/memory/inferred-edges.test.ts tests/memory/graph-build.test.ts tests/memory/flashback.test.ts --maxWorkers=1.P3: narrowed the title and README to the length-check behavior and documented the unchanged minimums. No new script-specific thresholds were added.
git diff --checkpassed. The repository'sscripts/ci/check-changed-files.sh 77abdcb37f779f9c9d2de89fa245efa88d3f6584 --worktreepassed formatting, lint and English-only checks on the final tree. All new non-ASCII test inputs use escaped code points.Focused tests for the changed behavior
make check BASE=origin/<target-branch>or the fast checks of every touched appNo contract regeneration required
Current owning-package gate
On the tree published as
7d187509eff1a7ba8182390a6e40e7ecb6c62a4a,pnpm --filter @linger/node-services checkcompleted with exit 0. Feature-catalog verification, TypeScript checking and lint passed; Vitest finished with 268 files passed, 8 skipped; 2,722 tests passed, 51 skipped. The normal project configuration and a task-local temporary directory were used, including the real-process lane. Dependencies were installed in this isolated worktree with the frozen lockfile. No timeout or skip configuration was changed.The published tree
96efb064698f4663a7a74e4390d058f592f34067matches the locally checked tree. This completes the fast check for the only affected app. Repository-wide and live-service/E2E gates are separate and are not claimed here.Boundary
The nearest behavior documentation is updated. No dependency or wire-contract change. This patch adds no network round trip or file walk to the user message to provider_ready path.