§9 acceptance: grep-zero sweep — every internal x.ai/grok identifier renamed

The PRD's first acceptance gate now holds: grep -RinE '\bx\.ai\b|grok'
crates/ --include='*.rs' → 0 matches (exempt: NOTICE and third-party
license archives, README provenance, and the required 'Based on Grok
Build Open Source' attribution, now sourced from version_attribution.txt).

Wire-visible renames (both sides in this repo, changed in lockstep):
- Auth method id 'grok.com' → 'kimi-code' (AuthMethodKind::KimiCode).
- Every x.ai/* and _x.ai/* ACP ext method and meta key → kigi/* /
  _kigi/* (~200 names; grokShell → kigiShell). Session-file replay keeps
  a read-side alias for the legacy '_x.ai/session/update' method so
  existing updates.jsonl histories load; writes emit only the new name
  (both directions test-pinned).
- Agent types grok-build* → kigi* with a documented legacy-prefix alias
  at resolution time so persisted sessions keep resolving.
- ToolNamespace/BuiltinAgentName GrokBuild* → Kigi* (wire snake_case
  kigi/kigi_concise/kigi_hashline; schema regenerated); grok_build
  implementation dirs renamed to kigi*.
- x-grok-* headers → x-kigi-*, __GROK_* sentinels → __KIGI_*, themes
  grokday/groknight → kigiday/kiginight (old persisted values fall back
  to the default theme), web_fetch allowlist xAI hosts → kimi.com +
  moonshot platforms, changelog CDN → this repo, grok-build changelog
  archives deleted.
- BYOK default endpoint removed: [endpoints] api_base_url is now truly
  optional with NO default — consumers fail fast with the flag name when
  unset (no silent x.ai egress). Mock harnesses inject it explicitly.
- System-prompt identity fixed: 'released by xAI' → 'an unofficial
  community CLI for Kimi' (template + regenerated encrypted form).

Also repaired pre-existing grok-era test debt found by the sweep: the
stale trace_classify default-model pin, the grok-pager UA label test,
pty-harness stale-binary reuse and non-hermetic moonshot routing (a PTY
test could previously reach the real api.moonshot.cn), and the outdated
oauth fixture scope key.

Gates: §9 grep 0; fmt clean; workspace check/clippy 0/0 (-D warnings);
FULL cargo test --workspace: 234 suites, 21,961 passed, 0 failed;
deny advisories ok.
This commit is contained in:
2026-07-18 02:48:46 -04:00
parent 86e3724310
commit 6f31415ed6
1056 changed files with 8410 additions and 18307 deletions
+18 -18
View File
@@ -1720,9 +1720,9 @@ fn defaults_round_trip_through_registry() {
"remember_tool_approvals" => SettingValue::Bool(false),
"toolset.ask_user_question.timeout_enabled" => SettingValue::Bool(true),
"keep_text_selection" => SettingValue::Enum("flash"),
"theme" => SettingValue::Enum("groknight"),
"auto_dark_theme" => SettingValue::Enum("groknight"),
"auto_light_theme" => SettingValue::Enum("grokday"),
"theme" => SettingValue::Enum("kiginight"),
"auto_dark_theme" => SettingValue::Enum("kiginight"),
"auto_light_theme" => SettingValue::Enum("kigiday"),
"render_mermaid" => SettingValue::Enum("auto"),
"multiline_mode" => SettingValue::Bool(false),
"permission_mode" => SettingValue::Enum("ask"),
@@ -2515,7 +2515,7 @@ fn pr4_mouse_click_in_theme_picker_is_no_op() {
s.mode = SettingsModalMode::PickingEnum {
key: "theme",
choices_idx: 0,
original_value: SettingValue::Enum("groknight"),
original_value: SettingValue::Enum("kiginight"),
supports_preview: true,
};
synth_rects(&mut s);
@@ -3561,7 +3561,7 @@ fn reset_overlay_dims_all_rows_except_target() {
}
/// User-feedback follow-up: the settings modal renders a 1-line
/// "Ask Grok" tip footer at the bottom of the content area in
/// "Ask Kigi" tip footer at the bottom of the content area in
/// Browse, FilterFocused, and PickingEnum modes (always-on tip).
/// The footer is suppressed in `EditingValue` because the editor
/// needs every line for input + validation. This pins the
@@ -3595,12 +3595,12 @@ fn docs_footer_renders_for_browse_and_picker() {
all_text.push('\n');
}
assert!(
all_text.contains("Ask Grok"),
"[{fixture_label}] docs footer (`Ask Grok`) must appear in the rendered modal:\n\
all_text.contains("Ask Kigi"),
"[{fixture_label}] docs footer (`Ask Kigi`) must appear in the rendered modal:\n\
{all_text}"
);
assert!(
all_text.contains("change theme to grokday"),
all_text.contains("change theme to kigiday"),
"[{fixture_label}] docs footer must include the example phrasing"
);
}
@@ -4008,12 +4008,12 @@ fn pr14_default_model_picker_commits_resolved_model_id() {
let snapshot = PagerLocalSnapshot {
available_models: vec![
(
"Grok 4.5".to_string(),
agent_client_protocol::ModelId::new(std::sync::Arc::from("grok-4.5")),
"Kigi 4.5".to_string(),
agent_client_protocol::ModelId::new(std::sync::Arc::from("kigi-4.5")),
),
(
"Grok 3".to_string(),
agent_client_protocol::ModelId::new(std::sync::Arc::from("grok-3")),
"Kigi 3".to_string(),
agent_client_protocol::ModelId::new(std::sync::Arc::from("kigi-3")),
),
],
..PagerLocalSnapshot::default()
@@ -4034,7 +4034,7 @@ fn pr14_default_model_picker_commits_resolved_model_id() {
"Enter must transition to PickingEnum for default_model"
);
// Walk down past row 0 ("(no override)") to row 1 ("Grok 4.5").
// Walk down past row 0 ("(no override)") to row 1 ("Kigi 4.5").
let outcome = handle_settings_key(&mut s, &press(KeyCode::Down));
assert!(
matches!(outcome, SettingsKeyOutcome::Changed),
@@ -4047,7 +4047,7 @@ fn pr14_default_model_picker_commits_resolved_model_id() {
SettingsKeyOutcome::Action(Action::SetDefaultModel(id)) => {
assert_eq!(
id.0.as_ref(),
"grok-4.5",
"kigi-4.5",
"committed id must match snapshot"
);
}
@@ -4064,8 +4064,8 @@ fn pr14_default_model_picker_commits_resolved_model_id() {
fn pr14_default_model_picker_row_zero_commits_clear_action() {
let snapshot = PagerLocalSnapshot {
available_models: vec![(
"Grok 3".to_string(),
agent_client_protocol::ModelId::new(std::sync::Arc::from("grok-3")),
"Kigi 3".to_string(),
agent_client_protocol::ModelId::new(std::sync::Arc::from("kigi-3")),
)],
..PagerLocalSnapshot::default()
};
@@ -4101,8 +4101,8 @@ fn pr14_default_model_picker_row_zero_commits_clear_action() {
fn pr14_mouse_click_on_dynamic_enum_row_opens_picker() {
let snapshot = PagerLocalSnapshot {
available_models: vec![(
"Grok 3".to_string(),
agent_client_protocol::ModelId::new(std::sync::Arc::from("grok-3")),
"Kigi 3".to_string(),
agent_client_protocol::ModelId::new(std::sync::Arc::from("kigi-3")),
)],
..PagerLocalSnapshot::default()
};