Repository navigation
test(corpus): add comprehensive real-world ChatGPT Persian medical bidi test fixtures - #168
Open
CodeinScrubs wants to merge 1 commit into
Open
CodeinScrubs wants to merge 1 commit into
CodeinScrubs wants to merge 1 commit into
Conversation
…di test fixtures - Add 28 schema-validated conformance fixtures in corpus/fixtures/fa/ derived from authentic OpenAI ChatGPT medical chats in Persian and English. - Cover 6 real-world failure patterns: leading English terms, reaction arrows, diagnostic tables, leading emojis, Persian quotations, and loanword suffixes. - Add automated conformance test suite in packages/core/src/conformance-chatgpt-fa.test.ts (13 tests passing). - Add reproducible generator script scripts/generate-chatgpt-fixtures.ts. - Add docs/CHATGPT_REAL_WORLD_CASES.md detailing root causes, UAX #9 first-strong defects, and integration guide for LLM chat engines.
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds 28 comprehensive, schema-validated conformance fixtures in
corpus/fixtures/fa/derived directly from authentic user sessions with OpenAI ChatGPT in Persian and English. These fixtures capture the severe bidirectional layout breakdown observed in state-of-the-art conversational AI platforms when medical, scientific, and technical terminology is mixed into right-to-left prose.Problem Context
Under standard browser heuristics (HTML
dir="auto"or default LTR containers), paragraphs starting with Latin medical terms (e.g.,Capsule مثل...,Macrophage برای...,Pyruvate kinase یکی...) have their direction evaluated by UAX #9 rules P2/P3 ("first strong character"). Because the leading character is Latin, browsers assigndir="ltr"to the entire paragraph, scrambling the visual reading order, pushing leading terms to the far left, inverting Persian word flow, and throwing sentence-final punctuation across the screen.6 Failure Patterns Covered
Capsule,Macrophage,Pyruvate kinase,1) Splenic macrophages,spherocyte,target-cell pattern,Reticulocyteها.PEP + ADP → Pyruvate + ATP,IgG / IgM + C3b → phagocytosis ↑,glucose → glycolysis → ...,S. pneumoniae ← مهمترین, and pathway chains with arrows (→,←,↑,↓).بیماری | سرنخ) and mixed English/Persian diagnostic findings (chronic DAT− hemolysis,spherocytes ولی DAT+,microcytosis شدید).🔴 Bottom line:,🧠 تصویر ذهنی,🔑 Take-home:,✅ واقعیت:....«این آشغالِ بیبرق دیگه رد نمیشه.»,«پس قبلش چرا مشکل ایجاد نمیکنند؟»).macrophageها,enzymeهایی,slitهای,RBCهای,Reticulocyteها.Included Assets
corpus/fixtures/fa/: 28 individual JSON files adhering tocorpus/fixture.schema.json.corpus/fixtures/fa/README.md: Fixture documentation and categorization.packages/core/src/conformance-chatgpt-fa.test.ts: Automated conformance test suite (13 passing tests).scripts/generate-chatgpt-fixtures.ts: Deterministic fixture generator.docs/CHATGPT_REAL_WORLD_CASES.md: In-depth analysis of UAX chore(deps-dev): bump globals from 17.7.0 to 17.8.0 in the development-tooling group across 1 directory #9 first-strong breakdowns, breakdown mechanics, and drop-in integration recipes for LLM chat platforms (React, Web Component, Markdown).Verification
pnpm run check: unicode, typecheck, lint, coverage, corpus, docs, build, and action checks all passed cleanly.pnpm test: 23 test files, 613 tests passed, 0 failures.