Personal_AI_Infrastructure icon indicating copy to clipboard operation
Personal_AI_Infrastructure copied to clipboard

[bug] Non-Latin titles collapse to an empty or shared key in ~25 places, so notes,…

Open IvanLeontev-stack opened this issue 1 week ago • 1 comments

What happened

non-Latin titles collapse to an empty or shared key in about 25 places (slugify, kebabCase, storyKey, tokenizers), so records overwrite or merge each other

Summary

Across 8.761.0, names, ids and word lists are built with [^a-z0-9] or [a-z0-9]+. Text in any other script loses every letter. Names collapse to an empty string or one shared fallback ("untitled", "top", "upgrade"), so two unrelated items get the same file, id or key. Word lists come out empty, so search, overlap and duplicate checks see nothing.

This is the same class as #2920 and #2505 (fixed for KnowledgeDistill), at the other sites. It is not a request for a localization layer (#2230): Greek and Chinese break the same way as Russian, and English output can stay byte-identical.

Repro on a clean v8.761.0 checkout, from the repo root:

bun -e '
import {slugify} from "./LifeOS/install/LIFEOS/TOOLS/MemoryTypes.ts";
import {slug} from "./LifeOS/install/LIFEOS/ERRATA/Rules.ts";
import {storyKey} from "./LifeOS/install/LIFEOS/VIGIL/Editor.ts";
import {tokens} from "./LifeOS/install/skills/HillClimb/Tools/Population.ts";
import {hashWords} from "./LifeOS/install/hooks/lib/system-file-guard-core.ts";
const S=["Fund structure decision","Решение по структуре фонда","Выбор депозита","Απόφαση για το ταμείο","基金结构决定"];
console.log(S.map(slugify), S.map(slug), S.map(storyKey), S.map(s=>[...tokens(s)]), S.map(s=>hashWords(s).length));'

Actual: slugify gives untitled for all four non-Latin titles. Rules.slug gives top, storyKey gives "", tokens gives an empty set, and hashWords gives 0 words. The English title works in every case.

Names and keys that collide (same pattern at each line)

  1. LIFEOS/TOOLS/MemoryTypes.ts:375 slugify: unrelated notes share one file path.
  2. LIFEOS/TOOLS/HarvestExecutor.ts:839 kebabCase: a second harvested idea lands on the first one's file and is skipped.
  3. LIFEOS/TOOLS/KnowledgeHarvester.ts:530 toKebabCase: after the first non-Latin candidate, every later one reads as a duplicate and is dropped with no log line.
  4. LIFEOS/TOOLS/CreateUpdate.ts:94 kebabCase: the change-log id is a bare timestamp, and two records in the same second overwrite each other.
  5. LIFEOS/TOOLS/ISARender.ts:181: all non-Latin headings share one empty anchor, so the contents links go to the wrong place.
  6. LIFEOS/TOOLS/Upgrades.ts:145 claim hash: a second non-Latin rule is rejected as a repeat of the first.
  7. LIFEOS/TOOLS/Upgrades.ts:151 slugify: every non-Latin proposal is named upgrade.
  8. LIFEOS/ERRATA/Rules.ts:85 slug: every non-Latin section becomes rule top.
  9. hooks/lib/isa-utils.ts:1365 task slug: two sessions started in the same minute write one work-registry row, and one drops off the board.
  10. hooks/WorkCompletionLearning.hook.ts:189: the second learning file is not written ("already exists").
  11. LIFEOS/TOOLS/RecurrenceLedger.ts:111: different tool errors share the signature unknown.
  12. LIFEOS/IDEALSTATE/Wants.ts:102: all non-Latin wants get one id.
  13. LIFEOS/VIGIL/Editor.ts:54 storyKey and LIFEOS/VIGIL/Route.ts:98 subject key: any two non-Latin events count as the same story, and the second is suppressed.
  14. LIFEOS/ASSAY/QuestionSystem.ts:339 propositionKey: any two non-Latin yes/no questions fail validation as "the same question".
  15. LIFEOS/ATLAS/collectors/Gear.ts:35 and Projects.ts:59: keys gear:- and project:-, so items merge into one node.
  16. LIFEOS/PEOPLE/merge.ts:120: non-Latin names normalize to empty, so two cards for one person with a shared phone are not merged.

Word lists that come out empty

  1. hooks/lib/system-file-guard-core.ts:412 hashWords (and the pairs at :442): the personal-word leak guard sees no words in non-Latin text, in the pre-commit hook too. A non-Latin private word passes the guard.
  2. LIFEOS/TOOLS/Cortex.ts:238 terms: a non-Latin record cannot be found, even by its exact title, and a non-Latin query is rejected as invalid input.
  3. LIFEOS/TOOLS/HarvestExecutor.ts:488 tokenizeForOverlap: an identical existing title scores zero overlap and is harvested again.
  4. LIFEOS/TOOLS/lib/rule-duplication.ts:48: a non-Latin rule becomes an empty word list, so duplicates are never flagged.
  5. LIFEOS/ERRATA/Rules.ts:195: a complaint cannot be matched to a non-Latin rule.
  6. skills/HillClimb/Tools/Population.ts:288 tokens: every non-Latin hypothesis has an empty word set, so the similarity gate cannot tell them apart.
  7. LIFEOS/ERRATA/Coverage.ts:128: sentences split only before an ASCII capital, so a non-Latin rule excerpt is cut off mid-text.
  8. skills/Cortex/Tools/ContextSearch.ts:214 tokenize: decomposed (NFD) text is split at the combining mark. This also affects accented Latin text.

Suggested fix

Two small shared helpers would cover every site:

  1. For names and keys, keep the current ASCII result. When the input contains a letter outside ASCII, append a short hash of the NFC-normalized input. ASCII input gives exactly the name it gives today, so existing files and ids do not move.
  2. For word lists, use text.normalize("NFC").match(/[\p{L}\p{N}]+/gu) in place of [a-z0-9]+. ASCII text gives the same tokens as today.

I run both patterns locally at all of these sites. English fixtures give the same output as before.

Details

  • Kind: bug
  • LifeOS version: 8.761.0

Filed with the LifeOS /feedback command. The reporter approved this exact text before it was sent; paths, secrets and personal details were stripped locally.

IvanLeontev-stack avatar Nov 28 '26 16:11 IvanLeontev-stack

[!NOTE] 🤖 Kai (AI assistant) responding on behalf of Daniel Miessler

Thanks for this. Feature requests and larger changes now live in Discussions under Ideas, so the issue list only tracks defects we're fixing now. I moved this one there with your full write-up: https://github.com/danielmiessler/LifeOS/discussions/3107. Nothing is lost, and that's where we'll pick it up. Closing here.

danielmiessler avatar Dec 01 '26 18:12 danielmiessler