§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:
@@ -86,8 +86,8 @@ mod tests {
|
||||
|
||||
#[test]
|
||||
fn minimal_entry_converts_with_defaults() {
|
||||
let cfg = tool_config_from_entry(0, entry("GrokBuild:read_file")).unwrap();
|
||||
assert_eq!(cfg.id, "GrokBuild:read_file");
|
||||
let cfg = tool_config_from_entry(0, entry("Kigi:read_file")).unwrap();
|
||||
assert_eq!(cfg.id, "Kigi:read_file");
|
||||
assert_eq!(cfg.params, None);
|
||||
assert_eq!(cfg.name_override, None);
|
||||
assert_eq!(cfg.params_name_overrides, None);
|
||||
@@ -98,7 +98,7 @@ mod tests {
|
||||
|
||||
#[test]
|
||||
fn fully_populated_entry_converts_field_by_field() {
|
||||
let mut e = entry("GrokBuild:grep");
|
||||
let mut e = entry("Kigi:grep");
|
||||
e.params_json = Some(r#"{"max_results": 50}"#.to_owned());
|
||||
e.name_override = Some("search".to_owned());
|
||||
e.params_name_overrides =
|
||||
@@ -130,11 +130,11 @@ mod tests {
|
||||
|
||||
#[test]
|
||||
fn invalid_params_json_is_a_parse_error() {
|
||||
let mut e = entry("GrokBuild:bash");
|
||||
let mut e = entry("Kigi:bash");
|
||||
e.params_json = Some("{not json".to_owned());
|
||||
let err = tool_config_from_entry(3, e).unwrap_err();
|
||||
assert_eq!(err.index, 3);
|
||||
assert_eq!(err.tool_id, "GrokBuild:bash");
|
||||
assert_eq!(err.tool_id, "Kigi:bash");
|
||||
assert_eq!(err.field_path(), "tools[3].params_json");
|
||||
assert!(matches!(
|
||||
&err.kind,
|
||||
@@ -144,7 +144,7 @@ mod tests {
|
||||
|
||||
#[test]
|
||||
fn non_object_params_json_is_a_type_error() {
|
||||
let mut e = entry("GrokBuild:bash");
|
||||
let mut e = entry("Kigi:bash");
|
||||
e.params_json = Some("[1, 2]".to_owned());
|
||||
let err = tool_config_from_entry(1, e).unwrap_err();
|
||||
assert_eq!(
|
||||
@@ -158,8 +158,8 @@ mod tests {
|
||||
|
||||
#[test]
|
||||
fn name_override_valid_tool_id_charset_is_accepted() {
|
||||
for name in ["search", "GrokBuild:grep", "a-b_C9"] {
|
||||
let mut e = entry("GrokBuild:grep");
|
||||
for name in ["search", "Kigi:grep", "a-b_C9"] {
|
||||
let mut e = entry("Kigi:grep");
|
||||
e.name_override = Some(name.to_owned());
|
||||
let cfg = tool_config_from_entry(0, e).unwrap();
|
||||
assert_eq!(cfg.name_override.as_deref(), Some(name));
|
||||
@@ -169,11 +169,11 @@ mod tests {
|
||||
#[test]
|
||||
fn name_override_outside_tool_id_charset_is_rejected() {
|
||||
for name in ["has space", "", "a:b:c", "emoji✨", "dot.name"] {
|
||||
let mut e = entry("GrokBuild:grep");
|
||||
let mut e = entry("Kigi:grep");
|
||||
e.name_override = Some(name.to_owned());
|
||||
let err = tool_config_from_entry(2, e).unwrap_err();
|
||||
assert_eq!(err.index, 2, "name={name:?}");
|
||||
assert_eq!(err.tool_id, "GrokBuild:grep");
|
||||
assert_eq!(err.tool_id, "Kigi:grep");
|
||||
assert_eq!(err.field_path(), "tools[2].name_override");
|
||||
assert!(
|
||||
matches!(
|
||||
@@ -188,7 +188,7 @@ mod tests {
|
||||
|
||||
#[test]
|
||||
fn server_config_conversion_rejects_invalid_name_override_entry() {
|
||||
let mut bad = entry("GrokBuild:grep");
|
||||
let mut bad = entry("Kigi:grep");
|
||||
bad.name_override = Some("bad name".to_owned());
|
||||
let err = tool_server_config_from_entries(vec![entry("ok"), bad]).unwrap_err();
|
||||
assert_eq!(err.index, 1, "fails closed on the offending entry");
|
||||
@@ -200,9 +200,9 @@ mod tests {
|
||||
|
||||
#[test]
|
||||
fn server_config_conversion_preserves_valid_name_overrides() {
|
||||
let mut a = entry("GrokBuild:grep");
|
||||
let mut a = entry("Kigi:grep");
|
||||
a.name_override = Some("search".to_owned());
|
||||
let cfg = tool_server_config_from_entries(vec![a, entry("GrokBuild:bash")]).unwrap();
|
||||
let cfg = tool_server_config_from_entries(vec![a, entry("Kigi:bash")]).unwrap();
|
||||
assert_eq!(cfg.tools.len(), 2);
|
||||
assert_eq!(cfg.tools[0].name_override.as_deref(), Some("search"));
|
||||
assert_eq!(cfg.tools[1].name_override, None);
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user