Skip to content

feat(cli): add Chinese/English employee-standards selection - #57

Merged
wxhou merged 6 commits into
mainfrom
feat/standards-language
Nov 17, 2026
Merged

wxhou merged 6 commits into
mainfrom
feat/standards-language

Conversation

@wxhou

@wxhou wxhou commented Nov 16, 2026

Copy link
Copy Markdown
Owner

Summary

  • init / update accept --lang zh|en; precedence is explicit flag > installed block > system locale > English.
  • Add employee-standards.en.md (§0–§7; §8 stays Chinese-only) and ship it in the npm package.
  • Detect the installed language from the tool-owned block only, so user prose cannot flip it; doctor compares against the matching SSOT.
  • Missing language files and incomplete English sections fail loudly with exit code 1; invalid --lang exits 2 before any write.

Test plan

  • npm run lint
  • npm run typecheck
  • npm run build && npx vitest run — 1516 passed, 5 skipped
  • tmp/ integration: LANG=zh_CN.UTF-8 → Chinese; LANG=en_US.UTF-8 → English; LANGUAGE=en + LANG=zh_CN.UTF-8 → English
  • real update keeps the installed Chinese block; local-bundle sync switches zh→en and prints the switch message
  • init --lang fr exits 2 with no files written

init/update accept --lang zh|en; precedence is flag > installed block >
system locale > English. Add the English SSOT (§0–§7; §8 stays Chinese),
block-scoped detection, and doctor comparison against the matching SSOT.
Missing files or incomplete English sections fail loudly.

Tests: 1516 passed, 5 skipped. lint/typecheck/build clean. No version bump.
Move language resolution and SSOT validation into
src/commands/standards-source.ts so init.ts drops back below 1500 lines.

Tests: 1516 passed, 5 skipped. lint/typecheck/build clean. No version bump.
The published 0.3.119 bundle has no English SSOT, so an English runner
locale made the smoke exit 1. An installed block keeps the check
independent of the published package.

Tests: unchanged; the Windows smoke is the affected gate. No version bump.
Pristine checks now compare both bundled SSOTs, so `remove` deletes an
English AGENTS.md whole. The update hint keys off block presence, not
anchor detection, so --lang no longer claims to have no effect while it
rewrites the block.

Tests: 1518 passed, 5 skipped. lint/typecheck/build clean. No version bump.
Windows checkouts read the bundled standards with CRLF, so the expected
body kept CRLF while the file content was normalized to LF. Normalize
both sides; pristine English and Chinese AGENTS.md files delete whole
again on Windows.

Tests: 1518 passed, 5 skipped. lint/typecheck/build clean. No version bump.
Keep the repository root for code and entry files. Runtime paths,
npm packaging, the sync script, and tests follow the new location;
update still reads the legacy root layout from older fetched bundles.

Tests: 1519 passed, 5 skipped. lint/typecheck/build clean. No version bump.
@wxhou
wxhou merged commit 4d95935 into main Nov 17, 2026
3 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