Skip to content

Add --chinese startup prayer mode - #18

Open
functionstackx wants to merge 1 commit into
masterfrom
feat/cli-chinese-prayer
Open

functionstackx wants to merge 1 commit into
masterfrom
feat/cli-chinese-prayer

Conversation

@functionstackx

@functionstackx functionstackx commented Sep 18, 2026

Copy link
Copy Markdown
Contributor

Change

Add --chinese to print the startup prayer in Simplified Chinese. English remains the default. The flag works before or after audit, its profiles, and its targets:

cmax --chinese audit
cmax audit --chinese
cmax audit security --chinese
为集群祈祷
GPU 之主啊,请在启程之前赐福这座集群。
愿我们的时钟频率常高,愿我们的 NCCL 永不挂起。
求你使我们免于 Xid 错误,远离静默数据损坏。
对齐者有福了。
阿门。

Only the prayer heading and verses are translated. Help, confirmation prompts, audit reports, GPU settings, and machine-readable data are not translated or changed by this flag.

Chinese text wraps by terminal display cells rather than character count. Terminals that cannot encode the Chinese text, or are only one column wide, fall back to English. Pipes, inspection commands, and CLUSTERMAX_PROGRESS=0 still suppress the banner.

Validation

  • Full suite: python -m pytest -q passed with 1,362 tests and 835 subtests.
  • Added 44 test cases for flag placement across every command level, repeated flags, default-English behavior, live dispatch, UTF-8/GB18030 rendering, ASCII/Latin-1 fallback, narrow-terminal wrapping, banner suppression, YAML stdout/file parity, and invalid arguments.
  • Built and installed the wheel in a clean virtual environment. From outside the checkout, passed six English/Chinese output comparisons and three help checks.
  • Captured the installed wheel in a real terminal at the audit confirmation prompt. No audit was run.
  • git diff --check passed.

Note

Low Risk
Cosmetic startup banner text only; audit logic and structured output are explicitly unchanged, with safe encoding fallback so decoration cannot break a run.

Overview
Adds --chinese so interactive live audits can show the decorative startup prayer in Simplified Chinese instead of English. The flag is accepted at the top level and on every audit subcommand (profiles, targets, review), before or after other arguments; _show_banner passes it through to print_banner(chinese=...).

print_banner now chooses a Chinese title and CHINESE_PRAYER verses when requested, wraps lines with _wrap_prayer_line (display cells via get_cwidth, English still uses textwrap), and falls back to English if the stream encoding cannot encode the text (including GB18030 when supported) or the terminal is only one column wide. Pipes, CLUSTERMAX_PROGRESS=0, and existing banner-suppression paths behave the same; help, confirmation, reports, and machine-readable output are unchanged.

README documents usage and fallback behavior. Tests cover flag placement, rendering, wrapping, encoding fallback, banner suppression, and parity of inspection/YAML output with English.

Reviewed by Cursor Bugbot for commit 6a86909. Bugbot is set up for automated code reviews on this repo. Configure here.

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 6a86909. Configure here.

Comment thread cmax/cli.py
action="store_true",
default=argparse.SUPPRESS,
help="Print the startup prayer in Simplified Chinese (other output is unchanged).",
)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

New flag shadows existing abbreviations

Low Severity

Adding --chinese beside --container and --command makes argparse’s default prefix matching treat --c as ambiguous, so previously valid --c invocations now error instead of selecting the container target or a review command.

Additional Locations (2)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 6a86909. Configure here.

This branch has not been deployed

No deployments
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