M2 audit: excise the Computer Hub stack — Kigi's last remote-cloud surface
Removed root-and-branch for the zero-egress guarantee (the hub was xAI's remote-workspace/cloud-sandbox service): - Crates deleted: kigi-computer-hub-core, kigi-computer-hub-sdk, kigi-computer-hub-mcp-adapter, kigi-workspace-client (hub-proxied workspace RPC client), and kigi-tracing (its sole network path was the OTLP gRPC exporter; zero consumers remained). kigi-tracing-macros (purely local) stays. - kigi-workspace: every hub surface deleted — hub server/channel/auth, HITL-over-hub permissions, donation/metrics pumps, file upload RPCs, hub tool-snapshot merge (resolve pipeline is MCP-only now), WorkspaceOps::Proxy. Local worktrees, sessions, leader IPC, MCP, and the ACP permission prompt path are untouched; LocalRegistry re-homed into kigi-tool-runtime on the existing ToolDyn types so in-process tool dispatch is unchanged. - kigi-shell: leader workspace-exposure control surface (incl. the wss://computer-hub... URL), [hub] config, ObservabilityBridge, hub WebSocket proxy, dead OTLP config knobs. ClientMode::Headless (never constructed) removed. - kigi-tui/bin: hidden `kigi workspace` command removed (`kigi worktree` stays). - Renames: --xai-api-base-url → --api-base-url / KIGI_API_BASE_URL / [endpoints] api_base_url (serde alias keeps old configs working; the flag feeds BYOK/custom-endpoint routing, not main inference); grok_version → kigi_version in inspect/models-cache/trace metadata (old caches self-heal via version-mismatch refetch). - Dependency tree: dropped fastrace*, opentelemetry-otlp/http/proto, tokio-tungstenite from the workspace; fixed the 4 real useless_format violations the fastrace lint allowance was masking and removed the allowance. - marketplaceAllowlist kept: it gates the LOCAL plugin-marketplace feature, not an xAI service. Known §9 leftover (deliberate, for the M3 sweep): the BYOK default base URL string. Gates: workspace check/clippy 0/0, fmt, deny ok; suites green (workspace 1042, shell 4918, tui 6634, tools 2608, tool-runtime 47, mcp 154).
This commit is contained in:
@@ -1323,7 +1323,7 @@ const CACHE_TTL: std::time::Duration = std::time::Duration::from_secs(300);
|
||||
struct ModelsCache {
|
||||
fetched_at: DateTime<Utc>,
|
||||
#[serde(default, skip_serializing_if = "Option::is_none")]
|
||||
grok_version: Option<String>,
|
||||
kigi_version: Option<String>,
|
||||
#[serde(default, skip_serializing_if = "Option::is_none")]
|
||||
auth_method: Option<CacheAuthMethod>,
|
||||
/// Models-list URL this catalog was fetched from
|
||||
@@ -1418,7 +1418,7 @@ impl ModelsCacheManager {
|
||||
) -> Option<ModelsCache> {
|
||||
let data = std::fs::read(&self.path).ok()?;
|
||||
let cache: ModelsCache = serde_json::from_slice(&data).ok()?;
|
||||
if cache.grok_version.as_deref() != Some(kigi_version::VERSION) {
|
||||
if cache.kigi_version.as_deref() != Some(kigi_version::VERSION) {
|
||||
tracing::debug!("models cache version mismatch");
|
||||
return None;
|
||||
}
|
||||
@@ -1447,7 +1447,7 @@ impl ModelsCacheManager {
|
||||
) {
|
||||
let cache = ModelsCache {
|
||||
fetched_at: Utc::now(),
|
||||
grok_version: Some(kigi_version::VERSION.to_string()),
|
||||
kigi_version: Some(kigi_version::VERSION.to_string()),
|
||||
auth_method: Some(auth_method),
|
||||
origin: Some(origin.to_string()),
|
||||
etag: etag.map(|s| s.to_string()),
|
||||
@@ -3064,7 +3064,7 @@ mod tests {
|
||||
let auth_method = mgr.inner.fetch_auth.read().cache_auth_method();
|
||||
let stale = ModelsCache {
|
||||
fetched_at: Utc::now() - ChronoDuration::seconds(3600),
|
||||
grok_version: Some(kigi_version::VERSION.to_string()),
|
||||
kigi_version: Some(kigi_version::VERSION.to_string()),
|
||||
auth_method: Some(auth_method),
|
||||
origin: Some(mgr.cache_origin()),
|
||||
etag: Some("etag-stale".into()),
|
||||
@@ -3140,7 +3140,7 @@ mod tests {
|
||||
let auth_method = mgr.inner.fetch_auth.read().cache_auth_method();
|
||||
let legacy = ModelsCache {
|
||||
fetched_at: Utc::now(),
|
||||
grok_version: Some(kigi_version::VERSION.to_string()),
|
||||
kigi_version: Some(kigi_version::VERSION.to_string()),
|
||||
auth_method: Some(auth_method),
|
||||
origin: None,
|
||||
etag: Some("etag-legacy".into()),
|
||||
@@ -4100,7 +4100,7 @@ mod tests {
|
||||
let cache = ModelsCacheManager::new();
|
||||
let stale = ModelsCache {
|
||||
fetched_at: Utc::now() - ChronoDuration::seconds(86_400),
|
||||
grok_version: Some(kigi_version::VERSION.to_string()),
|
||||
kigi_version: Some(kigi_version::VERSION.to_string()),
|
||||
auth_method: Some(CacheAuthMethod::Platforms),
|
||||
origin: Some(origin),
|
||||
etag: None,
|
||||
@@ -4187,7 +4187,7 @@ mod tests {
|
||||
let cache = ModelsCacheManager::new();
|
||||
cache.atomic_write(&ModelsCache {
|
||||
fetched_at: Utc::now() - ChronoDuration::seconds(86_400),
|
||||
grok_version: Some(kigi_version::VERSION.to_string()),
|
||||
kigi_version: Some(kigi_version::VERSION.to_string()),
|
||||
auth_method: Some(CacheAuthMethod::Platforms),
|
||||
origin: Some(with_key_origin),
|
||||
etag: None,
|
||||
|
||||
Reference in New Issue
Block a user