§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:
@@ -6,7 +6,7 @@ use std::collections::HashMap;
|
||||
use std::path::Path;
|
||||
|
||||
use kigi_tool_types::{SubagentCapabilityMode, SubagentIsolationMode};
|
||||
use kigi_tools::implementations::grok_build::task::types::SubagentRuntimeOverrides;
|
||||
use kigi_tools::implementations::kigi::task::types::SubagentRuntimeOverrides;
|
||||
use serde::de::DeserializeOwned;
|
||||
|
||||
use crate::config::{SubagentPersona, SubagentRole};
|
||||
@@ -205,7 +205,7 @@ fn resolve_persona_instructions(
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use super::*;
|
||||
use kigi_tools::implementations::grok_build::task::types::ModelOverrideProvenance;
|
||||
use kigi_tools::implementations::kigi::task::types::ModelOverrideProvenance;
|
||||
|
||||
/// Helper to build an overrides struct with only the fields we care about.
|
||||
fn make_overrides(
|
||||
@@ -236,26 +236,26 @@ mod tests {
|
||||
|
||||
#[test]
|
||||
fn explicit_model_overrides_role() {
|
||||
let overrides = make_overrides(Some("grok-light"), None, None, None, None);
|
||||
let overrides = make_overrides(Some("kigi-light"), None, None, None, None);
|
||||
let role = SubagentRole {
|
||||
model: Some("grok-3".into()),
|
||||
model: Some("kigi-3".into()),
|
||||
..Default::default()
|
||||
};
|
||||
let result =
|
||||
resolve_effective_overrides(&overrides, Some(&role), &empty_personas(), None, None);
|
||||
assert_eq!(result.model.as_deref(), Some("grok-light"));
|
||||
assert_eq!(result.model.as_deref(), Some("kigi-light"));
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn role_model_used_when_no_explicit() {
|
||||
let overrides = make_overrides(None, None, None, None, None);
|
||||
let role = SubagentRole {
|
||||
model: Some("grok-3".into()),
|
||||
model: Some("kigi-3".into()),
|
||||
..Default::default()
|
||||
};
|
||||
let result =
|
||||
resolve_effective_overrides(&overrides, Some(&role), &empty_personas(), None, None);
|
||||
assert_eq!(result.model.as_deref(), Some("grok-3"));
|
||||
assert_eq!(result.model.as_deref(), Some("kigi-3"));
|
||||
}
|
||||
|
||||
#[test]
|
||||
@@ -265,13 +265,13 @@ mod tests {
|
||||
personas.insert(
|
||||
"researcher".to_string(),
|
||||
SubagentPersona {
|
||||
model: Some("grok-3-fast".into()),
|
||||
model: Some("kigi-3-fast".into()),
|
||||
instructions: Some("Research things.".into()),
|
||||
..Default::default()
|
||||
},
|
||||
);
|
||||
let result = resolve_effective_overrides(&overrides, None, &personas, None, None);
|
||||
assert_eq!(result.model.as_deref(), Some("grok-3-fast"));
|
||||
assert_eq!(result.model.as_deref(), Some("kigi-3-fast"));
|
||||
}
|
||||
|
||||
#[test]
|
||||
@@ -625,9 +625,9 @@ mod tests {
|
||||
fn persona_not_found_error_is_non_fatal() {
|
||||
// "not found" is a config-level error: persona_error is set but
|
||||
// other fields still resolve from role/overrides.
|
||||
let overrides = make_overrides(Some("grok-3"), Some("missing"), None, None, None);
|
||||
let overrides = make_overrides(Some("kigi-3"), Some("missing"), None, None, None);
|
||||
let role = SubagentRole {
|
||||
model: Some("grok-light".into()),
|
||||
model: Some("kigi-light".into()),
|
||||
default_isolation: Some("worktree".into()),
|
||||
..Default::default()
|
||||
};
|
||||
@@ -640,7 +640,7 @@ mod tests {
|
||||
// Non-fatal: other fields ARE resolved (explicit model takes precedence)
|
||||
assert_eq!(
|
||||
result.model.as_deref(),
|
||||
Some("grok-3"),
|
||||
Some("kigi-3"),
|
||||
"explicit model should resolve despite persona error"
|
||||
);
|
||||
}
|
||||
@@ -648,7 +648,7 @@ mod tests {
|
||||
#[test]
|
||||
fn persona_file_error_returns_early_with_defaults() {
|
||||
// File I/O errors ARE fatal: early return with defaults.
|
||||
let overrides = make_overrides(Some("grok-3"), Some("broken"), None, None, None);
|
||||
let overrides = make_overrides(Some("kigi-3"), Some("broken"), None, None, None);
|
||||
let dir = tempfile::tempdir().unwrap();
|
||||
let mut personas = HashMap::new();
|
||||
personas.insert(
|
||||
@@ -660,7 +660,7 @@ mod tests {
|
||||
},
|
||||
);
|
||||
let role = SubagentRole {
|
||||
model: Some("grok-light".into()),
|
||||
model: Some("kigi-light".into()),
|
||||
..Default::default()
|
||||
};
|
||||
let result = resolve_effective_overrides(&overrides, Some(&role), &personas, None, None);
|
||||
|
||||
Reference in New Issue
Block a user