SoufianeDev 713eef51b0
feat(search): add RTL compatibility levels and --rtl filter (#553)
* feat(data): add rtl_level to styles and products

Classify every style and product row for right-to-left interfaces:
full (mirrors unchanged), partial (mirrors with per-component work),
caveats (layout encodes reading direction).

One column is appended per row; existing fields, column order and LF
line endings are untouched. Mirrors under cli/assets and .claude are
synced with npm run sync:assets.

* feat(search): add --rtl filter to style and product searches

search() accepts rtl="all|full|partial|caveats" and projects the new
rtl_level column, so filtered rows still carry their compatibility
level. Without that projection the filter saw None and dropped every
row, which is what broke the earlier attempt.

The filter runs after BM25 scoring but before max_results truncation.
Filtering the corpus before indexing shifted IDF and made calibrated
searches abstain incorrectly (dashboard --domain style --rtl=partial
returned nothing); scoring first keeps the corpus and thresholds
stable while still preventing -n 1 from hiding a matching row.

--rtl requires an explicit style/product domain, and is rejected with
--design-system and --stack.

relevance thresholds: runtimeFingerprint refreshed; every metric is
identical to the committed baseline.

* test: cover rtl data contract and filter ordering

Pin the behaviour the RTL filter depends on:

- rtl_level is projected, not a search signal;
- every row in both CSVs carries a supported level;
- known layouts keep their curated level;
- filtering happens before max_results truncation (saas --domain
  product -n 1 with --rtl=full returns Micro SaaS, while the unfiltered
  top hit is a partial row);
- omitting --rtl keeps previous results;
- unsupported domains raise ValueError and exit non-zero through the
  CLI.

* docs: document the rtl compatibility filter

Explain the three levels, the CLI flag and its domain restriction in
the README, CLAUDE.md, the generated skill content and the
hand-authored Claude skill. The agent guidance tells the skill to add
--rtl for Arabic, Hebrew, Persian and Urdu work and to respect the
returned level instead of silently mirroring a caveats layout.
2026-11-02 23:10:22 +07:00
..