Skip to content

fix: retire rules/zh from the always-loaded default rules install#2170

Open
konstapukarifastnetfi wants to merge 1 commit into
affaan-m:mainfrom
Spartallan:fix/rules-default-install-scope
Open

fix: retire rules/zh from the always-loaded default rules install#2170
konstapukarifastnetfi wants to merge 1 commit into
affaan-m:mainfrom
Spartallan:fix/rules-default-install-scope

Conversation

@konstapukarifastnetfi
Copy link
Copy Markdown

@konstapukarifastnetfi konstapukarifastnetfi commented Jun 5, 2026

What Changed

  • Deleted the 11-file rules/zh/ tree (~17 KB of drifted Chinese rule translations) plus rules/zh/README.md installer docs from the default rule tree
  • Moved the one file with no maintained-locale counterpart (rules/zh/code-review.md) to its correct gated home: docs/zh-CN/rules/common/code-review.md
  • tests/scripts/trae-install.test.js: replaced the now-broken positive manifest assertion with a valid substitute (rules/web/performance.md)
  • tests/lib/install-targets.test.js: removed the negative Cursor-plan assertion that referenced the deleted rules/zh/README.md (it passed vacuously after the deletion); the adjacent rules/README.md assertion still covers the behavior

Why This Change

rules-core installs the whole rules/ directory, so every default install auto-loads the drifted zh translations and installer READMEs into session context. The docs-zh-cn locale module (--locale zh-CN) is the gated home for Chinese content; the remaining 10 deleted files were already covered by maintained copies under docs/zh-CN/rules/common/.

Testing Done

  • Manual testing completed - verified each deleted file has a maintained docs/zh-CN counterpart (or was moved there)
  • Automated tests pass locally (node tests/run-all.js) - full suite 2619/2619 in a clean Linux container (node:22-bookworm, fresh npm ci)
  • Edge cases considered and tested - Cursor flatten-install plan covered by the surviving rules/README.md negative assertion

Type of Change

  • fix: Bug fix

Security & Quality Checklist

  • No secrets or API keys committed (ghp_, sk-, AKIA, xoxb, xoxp patterns checked)
  • JSON files validate cleanly
  • Shell scripts pass shellcheck (if applicable)
  • Pre-commit hooks pass locally (if configured)
  • No sensitive data exposed in logs or output
  • Follows conventional commits format

Documentation

  • Updated relevant documentation - moved file lives under docs/zh-CN now
  • Added comments for complex logic - n/a
  • README updated (if needed) - n/a

Summary by cubic

Retired rules/zh from the default rules/ install to stop auto-loading outdated Chinese translations; moved the only unique file to the gated docs/zh-CN locale. This keeps zh content behind --locale zh-CN and reduces noise in session context.

  • Bug Fixes
    • Deleted rules/zh/ and its README from the always-installed rule tree (~11 files, ~17 KB).
    • Moved rules/zh/code-review.md to docs/zh-CN/rules/common/code-review.md to preserve zh parity.
    • Updated tests: switched manifest assertion to rules/web/performance.md in tests/scripts/trae-install.test.js; removed the obsolete negative assertion referencing rules/zh/README.md in tests/lib/install-targets.test.js.

Written for commit 4a07369. Summary will update on new commits.

Review in cubic

Summary by CodeRabbit

  • Documentation

    • Removed Chinese-language rules documentation files covering development workflows, coding standards, security protocols, performance optimization, and testing requirements.
  • Tests

    • Updated test assertions to reflect documentation changes.

rules/zh shipped ~17KB of Chinese rule text into the auto-loaded rules tree
of every default install (rules-core installs the bare 'rules' path with
defaultInstall: true), with no paths: frontmatter gating. The content had
also drifted behind both rules/common and the maintained translations in
docs/zh-CN/rules/common (e.g. zh/coding-style.md 48 lines vs the 52-line
docs/zh-CN copy), and 'zh' was already dropped from the installer's language
help in favor of the gated docs-zh-cn locale module (--locale zh-CN).

- move rules/zh/code-review.md to docs/zh-CN/rules/common/code-review.md:
  the only file with no counterpart in the maintained locale tree (fills a
  zh-CN parity gap with rules/common/code-review.md)
- delete the remaining 10 rules/zh files, all older duplicates of
  docs/zh-CN/rules/common content
- update trae-install test to assert the rules tree via rules/web instead

Not addressed here: rules/README.md (~5.5KB of installer docs) still ships
into the auto-loaded tree via the bare 'rules' module path; filtering README
files from rule-tree expansion is a separate decision
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Jun 5, 2026

PR changed again? Review this PR in Change Stack to compare snapshots and stay oriented.

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: eded5cfb-fd9d-45eb-a8cf-4a2fb5ea827d

📥 Commits

Reviewing files that changed from the base of the PR and between 7113b5b and 4a07369.

📒 Files selected for processing (13)
  • docs/zh-CN/rules/common/code-review.md
  • rules/zh/README.md
  • rules/zh/agents.md
  • rules/zh/coding-style.md
  • rules/zh/development-workflow.md
  • rules/zh/git-workflow.md
  • rules/zh/hooks.md
  • rules/zh/patterns.md
  • rules/zh/performance.md
  • rules/zh/security.md
  • rules/zh/testing.md
  • tests/lib/install-targets.test.js
  • tests/scripts/trae-install.test.js
💤 Files with no reviewable changes (11)
  • rules/zh/README.md
  • rules/zh/performance.md
  • rules/zh/security.md
  • rules/zh/hooks.md
  • rules/zh/testing.md
  • rules/zh/development-workflow.md
  • rules/zh/agents.md
  • rules/zh/patterns.md
  • rules/zh/git-workflow.md
  • rules/zh/coding-style.md
  • tests/lib/install-targets.test.js

📝 Walkthrough

Walkthrough

This pull request removes all Chinese localized documentation from rules/zh/ (README, agents, coding style, development workflow, git workflow, hooks, patterns, performance, security, and testing guidance) and updates test assertions to reflect these removals by switching from Chinese-specific path checks to base rule documentation or alternative file paths.

Changes

Chinese Documentation Cleanup

Layer / File(s) Summary
Test assertions updated for documentation removal
tests/lib/install-targets.test.js, tests/scripts/trae-install.test.js
Install and manifest tests are updated to expect rules/README.md exclusion and rules/web/performance.md inclusion instead of the removed rules/zh/README.md checks.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Poem

📖✨ The Chinese docs depart with grace,
As tests adapt to find their place,
From /zh/ paths, a gentle sweep,
New assertions for rules to keep. 🐰

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and accurately describes the main objective: retiring the Chinese rules tree from default installation to resolve content drift and consolidate localization.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 ESLint

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

ESLint install failed. For unrecoverable errors, disable the tool in CodeRabbit configuration.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 13 files

Re-trigger cubic

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