Problem
slugify() in training-import.ts strips all non-ASCII characters, returning an empty string for non-English content:
slugify("日本語スタイルガイド") // → ""
slugify("SQL Style Guide") // → "sql-style-guide" ✓
This breaks training import for teams with Japanese, Chinese, Korean, or other non-Latin style guides.
Location
packages/opencode/src/altimate/tools/training-import.ts:225-231
Suggested Fix
Use transliterate or fall back to a hash-based name when the result is empty:
function slugify(text: string): string {
const slug = text.toLowerCase()
.replace(/[^a-z0-9\s-]/g, "")
.replace(/\s+/g, "-")
.replace(/^-+|-+$/g, "")
.slice(0, 64)
return slug || `entry-${Date.now()}`
}
Found During
PR #350 adversarial testing.