[ENG-2691] Language selection 5/5 — brv config set/get + release notes + ship gate#714
Conversation
Final commit of the language-selection initiative (#616). Ships the user-facing CLI for language preference and the release notes that close the issue end-to-end. New `brv config set <key> <value>` and `brv config get <key>` commands — generic project-config infrastructure (not a one-off `brv language` command). Today's keys: `language.mode` and `language.code`; future project-config keys plug into the `SETTERS` / `GETTERS` dispatch with no new oclif surface area. CLI behavior: - `brv config set language.mode auto | fixed` — reject `fixed` when no `language.code` is set, with a redirect message pointing at `brv config set language.code <iso>`. Prevents writing a config that `isBrvConfigJson` would refuse on next load. - `brv config set language.code <iso>` — validates against the `LANGUAGE_NAMES` map (24 entries, no `iso-639-1` dependency). Unknown codes rejected with a sorted supported-list error. - `brv config get language.<key>` — symmetric reader; returns "(not set)" for absent fields, or the value (in text or JSON mode). Other: - New `BrvConfig.withLanguage(language?)` method following the existing `with*` pattern. Used by the set command's setters; previously a future caller would have to spread BrvConfig fields by hand. - Pure dispatcher functions (`applyConfigSet`, `applyConfigGet`) separated from the oclif Command class so the validation contract is testable in isolation. Release notes under [Unreleased] in CHANGELOG.md crediting Dmitriy K and including the **restoration recipe** for users who prefer the prior implicit-English behavior: brv config set language.code en brv config set language.mode fixed Tests (22 new): - 12 cases on `applyConfigSet` covering: auto / fixed / mode transitions, code update preserves mode, English restoration recipe, rejection paths (fixed-without-code, unknown mode value, unknown ISO code, unknown config key, totally unrelated key). - 5 cases on `applyConfigGet`: unset → undefined, both modes, both keys, unknown-key rejection. - 5 cases on `withLanguage`: replace, set-when-unset, clear via undefined, no mutation of original, all-other-fields-preserved. Ship gate: - Typecheck + lint clean (pre-existing complexity warning unchanged). - 242 mocha tests green across the affected surfaces (BrvConfig + config CLI + prompt builders + clause module + curate-session + brv-curate-tool + CJK tokenizer + language roundtrip integration + validate-brv-config init hook). - Auto-test harness 13/13 green after rebuild — including the 4 cross-language curate→query roundtrips and the 7 original English cases (zero structural drift). - Manual CLI smoke test: full restoration recipe roundtrip + unknown- code rejection. Post-merge action: post on #616 with feature summary, link to release notes, and pointer to backlog.md so Dmitriy can comment on what to prioritize next (per-curate --lang flag, TUI panel, per-domain overrides). Don't auto-close — let Dmitriy close after confirming the feature works for him.
|
Claude finished @danhdoan's task in 3m 50s —— View job Code Review —
|
Summary
Final commit of the language-selection initiative. Ships the user-facing CLI (
brv config set/brv config get) and the release notes that close #616 end-to-end.After this lands, the feature is shippable to any release that includes proj/language-selection. The four prior PRs (#710 / #711 / #712 / #713) plus this one form the complete delivery.
Plan: `features/language-selection/plan.md` in the research repo. Spec: `tasks/commit-05-cli-release.md`.
What landed
CLI — generic project-config infrastructure (not a one-off)
Domain
Architecture
Release notes
```bash
brv config set language.code en
brv config set language.mode fixed
```
Test plan
Post-merge actions
Manual step — once this PR is merged and `proj/language-selection` ships to a numbered release, post on #616 with:
Reviewer notes
What's done
After 5 PRs spanning ENG-2687 through ENG-2691:
Feature is complete. Closes #616.