Skip to content

fix(compression): Unicode-aware word boundaries in every rule pack + user overlay dir (#15677) - #15812

Merged
diegosouzapw merged 4 commits into
release/v3.8.52from
fix/15677-rule-packs-unicode-boundary
Oct 10, 2026
Merged

diegosouzapw merged 4 commits into
release/v3.8.52from
fix/15677-rule-packs-unicode-boundary

Conversation

@diegosouzapw

Copy link
Copy Markdown
Owner

Refs #15677 — follow-up to #15719 (depends on #15719, which fixed the ru packs; this branch is stacked on it).

Root cause

JS \b is ASCII-only without u+\p{L}, so rules wrapped in \b...\b never match when the keyword starts/ends with an accented or non-Latin letter. #15719 fixed ru; the same dead-boundary class existed in the de/es/fr/it/pt-BR/hu packs (120 rules with non-ASCII keywords). Also, docs/compression/EXTENDING_COMPRESSION.md documented a user pack dir ~/.omniroute/compression/rules that the loader never read.

Changes

  • Rule packs de/es/fr/it/pt-BR/hu/...: for rules with non-ASCII keywords, \b -> (?<![\p{L}\p{N}_]) / (?![\p{L}\p{N}_]) and u flag added. Bounded lookarounds, no new quantifiers (ReDoS-safe). ASCII-only rules untouched. languageDetector.ts untouched (done in fix: use Unicode-aware word boundaries for non-ASCII language detection #15708).
  • ruleLoader.ts: user overlay dir $DATA_DIR/compression/rules (default ~/.omniroute): same-name rules override bundled ones, new names are appended, invalid user files are ignored with a warning. Docs corrected (dropped the never-implemented project-level path).

Tests

tests/unit/compression/rule-packs-unicode-boundary-15677.test.ts (new): invariant that no non-ASCII rule uses \b, that every literal keyword of every pack matches, plus overlay tests using a temp DATA_DIR.
RED on the unfixed packs: de/de_question_directive still uses \b and keyword-match invariant failing. GREEN after: 5/5. Existing compression/caveman/language-pack tests: 121 pass, 0 fail.

Gates

file-size, complexity, cognitive-complexity, eslint (changed files), prettier, typecheck:core, check:compression-budget all green; pre-commit hooks ran. check:docs-all reports only pre-existing unrelated drift (migration counts in README/AGENTS/llm.txt, readCodeFacts); the edited doc is not flagged. i18n mirrors of EXTENDING_COMPRESSION.md not regenerated.

⚠️ base-red inherited: #15306 — unit/integration/package-artifact gates timing out, vitest open-sse/mcp-server/tests/audit.test.ts, check:ai-attribution range error

…ru-compression-boundary

# Conflicts:
#	open-sse/services/compression/languageDetector.ts
…in every mirror (#15677)

Mechanical, language-neutral edit (one code-block line removed in the source and
in all 66 mirrors); .i18n-state.json re-adopted for this doc only so the drift
gate stays truthful.
@diegosouzapw

Copy link
Copy Markdown
Owner Author

Merge integrity red is check:agent-skills-sync (exit 2): dry-run wants to regenerate skills/omni-auth/SKILL.md (OIDC allowlist prose) and skills/omni-settings/references/endpoints.md. That is not this PR's compression diff — it is the same skills-mirror drift as #15682. Not mixing SKILL.md into this branch (instruction surface). Holding merge until that drain lands on the tip or the owner OKs the skill regen here.

@github-actions

github-actions Bot commented Oct 8, 2026

Copy link
Copy Markdown
Contributor

CI Coverage Report

  • Coverage job: skipped
  • PR test policy: success

Coverage artifact was not available for this run.

@diegosouzapw
diegosouzapw merged commit ec710bb into release/v3.8.52 Oct 10, 2026
36 of 56 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant