§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:
@@ -1476,11 +1476,11 @@ mod tests {
|
||||
DashboardRowId::TopLevel(AgentId(0)),
|
||||
fields("Response", &["hello"]),
|
||||
);
|
||||
panel.model_name = Some("Grok 4 Fast".to_string());
|
||||
panel.model_name = Some("Kigi 4 Fast".to_string());
|
||||
panel.auto_approve = true;
|
||||
let bottom = badge_row(&panel, 6);
|
||||
assert!(
|
||||
bottom.contains("Grok 4 Fast"),
|
||||
bottom.contains("Kigi 4 Fast"),
|
||||
"model on bottom border: {bottom:?}"
|
||||
);
|
||||
assert!(
|
||||
@@ -1497,10 +1497,10 @@ mod tests {
|
||||
];
|
||||
q.request_id = Some(1);
|
||||
let mut qpanel = PeekPanelState::new(DashboardRowId::TopLevel(AgentId(0)), q);
|
||||
qpanel.model_name = Some("Grok 4 Fast".to_string());
|
||||
qpanel.model_name = Some("Kigi 4 Fast".to_string());
|
||||
let qbottom = badge_row(&qpanel, 8);
|
||||
assert!(
|
||||
qbottom.contains("Grok 4 Fast"),
|
||||
qbottom.contains("Kigi 4 Fast"),
|
||||
"model shows in question/approval mode: {qbottom:?}",
|
||||
);
|
||||
|
||||
@@ -1509,7 +1509,7 @@ mod tests {
|
||||
DashboardRowId::TopLevel(AgentId(0)),
|
||||
fields("Response", &["hi"]),
|
||||
);
|
||||
plain.model_name = Some("Grok 4 Fast".to_string());
|
||||
plain.model_name = Some("Kigi 4 Fast".to_string());
|
||||
plain.auto_approve = false;
|
||||
let plain_bottom = badge_row(&plain, 6);
|
||||
assert!(
|
||||
@@ -1523,7 +1523,7 @@ mod tests {
|
||||
DashboardRowId::TopLevel(AgentId(0)),
|
||||
fields("Response", &["hi"]),
|
||||
);
|
||||
planp.model_name = Some("Grok 4 Fast".to_string());
|
||||
planp.model_name = Some("Kigi 4 Fast".to_string());
|
||||
planp.plan_mode = true;
|
||||
let plan_bottom = badge_row(&planp, 6);
|
||||
assert!(
|
||||
|
||||
@@ -2494,7 +2494,7 @@ fn render_empty_state(buf: &mut Buffer, area: Rect, theme: &Theme, loading: bool
|
||||
/// chrome reflects what Enter will do: dispatch a new session vs.
|
||||
/// enqueue / send a prompt to the currently-selected agent.
|
||||
/// Paint a short right-aligned feedback badge onto the dispatch box's
|
||||
/// **top border** (e.g. `✗ Session no longer exists`, `✓ Theme: Grok
|
||||
/// **top border** (e.g. `✗ Session no longer exists`, `✓ Theme: Kigi
|
||||
/// Day`), in a neutral accent colour. The message is painted VERBATIM:
|
||||
/// it already carries its own status glyph — errors are built via
|
||||
/// [`DashboardState::set_error_toast`] (`✗`), while successes / info
|
||||
@@ -4661,7 +4661,7 @@ mod tests {
|
||||
let mut state = DashboardState::new();
|
||||
// A distinct absolute path outside $HOME (rendered verbatim) that
|
||||
// differs from the process cwd. No git cache entry → no branch span.
|
||||
state.cwd = std::path::PathBuf::from("/grok-staged-cwd-marker");
|
||||
state.cwd = std::path::PathBuf::from("/kigi-staged-cwd-marker");
|
||||
|
||||
let mut buf = Buffer::empty(area);
|
||||
render_header(&mut buf, area, &theme, &rows, &mut state);
|
||||
@@ -4670,7 +4670,7 @@ mod tests {
|
||||
.map(|x| buf[(x, 0)].symbol().to_string())
|
||||
.collect();
|
||||
assert!(
|
||||
top_row.contains("/grok-staged-cwd-marker"),
|
||||
top_row.contains("/kigi-staged-cwd-marker"),
|
||||
"header must render the staged cwd, not the process cwd; got: {top_row:?}",
|
||||
);
|
||||
}
|
||||
@@ -5629,12 +5629,12 @@ mod tests {
|
||||
let theme = Theme::current();
|
||||
let mut state = DashboardState::new();
|
||||
let check = crate::glyphs::check_mark();
|
||||
state.error_toast = Some(format!("{check} Theme: Grok Day"));
|
||||
state.error_toast = Some(format!("{check} Theme: Kigi Day"));
|
||||
let _ = render_dispatch(&mut buf, Rect::new(0, 0, 80, 3), &theme, &mut state, None);
|
||||
|
||||
let top_row: String = (0..80).map(|x| buf[(x, 0)].symbol().to_string()).collect();
|
||||
assert!(
|
||||
top_row.contains(&format!("{check} Theme: Grok Day")),
|
||||
top_row.contains(&format!("{check} Theme: Kigi Day")),
|
||||
"badge must paint the message verbatim, got: {top_row:?}",
|
||||
);
|
||||
assert!(
|
||||
@@ -7051,7 +7051,7 @@ mod tests {
|
||||
let area = Rect::new(0, 0, 80, 24);
|
||||
// A temp dir with a `.git` child so the toggle is eligible (hermetic,
|
||||
// unlike depending on the test's real cwd being a repo).
|
||||
let repo = std::env::temp_dir().join("grok-loc-wt-toggle-repo-test");
|
||||
let repo = std::env::temp_dir().join("kigi-loc-wt-toggle-repo-test");
|
||||
std::fs::create_dir_all(repo.join(".git")).expect("mk .git");
|
||||
let mut modal =
|
||||
LocationPickerState::new(vec![], repo.clone(), std::collections::HashMap::new());
|
||||
@@ -7111,7 +7111,7 @@ mod tests {
|
||||
let area = Rect::new(0, 0, 80, 24);
|
||||
let mut modal = LocationPickerState::new(
|
||||
vec![],
|
||||
std::path::PathBuf::from("/grok-not-a-repo-xyz-12345"),
|
||||
std::path::PathBuf::from("/kigi-not-a-repo-xyz-12345"),
|
||||
std::collections::HashMap::new(),
|
||||
);
|
||||
let mut buf = Buffer::empty(area);
|
||||
|
||||
@@ -1665,12 +1665,12 @@ mod tests {
|
||||
fn append_roster_rows_uses_model_id_as_secondary_line() {
|
||||
let empty = std::collections::BTreeSet::new();
|
||||
let entry = RosterEntry {
|
||||
model_id: Some("grok-4.5".to_string()),
|
||||
model_id: Some("kigi-4.5".to_string()),
|
||||
..roster_entry_with("m", Some("Fix the bug"), RosterActivity::Dormant)
|
||||
};
|
||||
let rows = collect_roster(&[entry], &empty);
|
||||
assert_eq!(rows.len(), 1);
|
||||
assert_eq!(rows[0].secondary_line.as_deref(), Some("grok-4.5"));
|
||||
assert_eq!(rows[0].secondary_line.as_deref(), Some("kigi-4.5"));
|
||||
}
|
||||
/// Without a model id there's genuinely nothing to show, so the
|
||||
/// second line stays empty rather than rendering a placeholder.
|
||||
@@ -1742,7 +1742,7 @@ mod tests {
|
||||
/// the list uncluttered).
|
||||
#[test]
|
||||
fn idle_local_agent_without_message_has_blank_secondary() {
|
||||
let agent = make_idle_agent_with_model(Some("grok-4.5"));
|
||||
let agent = make_idle_agent_with_model(Some("kigi-4.5"));
|
||||
assert_eq!(classify_top_level(&agent), RowState::Idle);
|
||||
let row = top_level_row(AgentId(0), &agent, false, false, None);
|
||||
assert_eq!(
|
||||
|
||||
@@ -4445,7 +4445,7 @@ pub fn load_persisted_from_path(path: &std::path::Path) -> Option<PersistedDashb
|
||||
/// + rename, so concurrent readers never observe a half-truncated file.
|
||||
pub fn write_persisted(p: &PersistedDashboard) -> std::io::Result<()> {
|
||||
let path = config_path()
|
||||
.ok_or_else(|| std::io::Error::new(std::io::ErrorKind::NotFound, "no grok home"))?;
|
||||
.ok_or_else(|| std::io::Error::new(std::io::ErrorKind::NotFound, "no kigi home"))?;
|
||||
write_persisted_to_path(&path, p)
|
||||
}
|
||||
|
||||
@@ -4788,8 +4788,8 @@ mod tests {
|
||||
|
||||
#[test]
|
||||
fn compact_cwd_strips_home() {
|
||||
let p = Path::new("/Users/alice/projects/grok");
|
||||
assert_eq!(compact_cwd(p, Some("/Users/alice")), "~/projects/grok");
|
||||
let p = Path::new("/Users/alice/projects/kigi");
|
||||
assert_eq!(compact_cwd(p, Some("/Users/alice")), "~/projects/kigi");
|
||||
}
|
||||
|
||||
#[test]
|
||||
|
||||
Reference in New Issue
Block a user