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:
2026-07-17 22:34:10 -04:00
parent 5919526e91
commit fa75eb139a
90 changed files with 452 additions and 9702 deletions
+4 -73
View File
@@ -110,12 +110,6 @@ See ~/.kigi/README.md for more information.
},
/// Manage git worktrees
Worktree(crate::worktree_cmd::WorktreeArgs),
/// Expose this workspace to the Computer Hub (via the leader).
///
/// Disabled by default and enabled server-side per account; set
/// `KIGI_WORKSPACE_COMMAND=1` to enable it locally for testing.
#[command(hide = true)]
Workspace(WorkspaceMgmtArgs),
/// Open the Agent Dashboard view at startup.
///
/// Centralised, agent-native overview of every session (top-level and
@@ -138,7 +132,7 @@ pub struct WrapArgs {
)]
pub command: Vec<String>,
}
/// Targets a running leader process by PID (used by `kigi leader` / `kigi workspace`).
/// Targets a running leader process by PID (used by `kigi leader`).
#[derive(Debug, clap::Args, Clone, Default)]
pub struct LeaderTargetArgs {
/// Leader process ID from `kigi leader list`.
@@ -169,69 +163,6 @@ pub enum LeaderMgmtCommand {
/// Stop all running leader processes
Kill,
}
#[derive(Debug, clap::Args, Clone)]
pub struct WorkspaceMgmtArgs {
#[command(subcommand)]
pub command: WorkspaceMgmtCommand,
}
#[derive(Debug, Subcommand, Clone)]
pub enum WorkspaceMgmtCommand {
/// Start (or update) the workspace→hub exposure.
Start(WorkspaceStartArgs),
/// Drain and disconnect from the hub, keeping the exposure warm.
Pause {
#[command(flatten)]
target: LeaderTargetArgs,
/// Emit machine-readable JSON output.
#[arg(long)]
json: bool,
},
/// Reconnect a paused exposure to the hub.
Resume {
#[command(flatten)]
target: LeaderTargetArgs,
/// Emit machine-readable JSON output.
#[arg(long)]
json: bool,
},
/// Stop exposing the workspace (the leader keeps running).
Stop {
#[command(flatten)]
target: LeaderTargetArgs,
/// Emit machine-readable JSON output.
#[arg(long)]
json: bool,
},
/// Restart the exposure (stop, then start with the given options).
Restart(WorkspaceStartArgs),
/// Show the current workspace-exposure status.
#[command(visible_alias = "list")]
Status {
#[command(flatten)]
target: LeaderTargetArgs,
/// Emit machine-readable JSON output.
#[arg(long)]
json: bool,
},
}
#[derive(Debug, clap::Args, Clone)]
pub struct WorkspaceStartArgs {
/// Computer Hub WebSocket URL (default: `[hub].url`, then the prod hub).
#[arg(long, value_name = "URL")]
pub hub_url: Option<String>,
/// Workspace root directory to expose. Defaults to the current directory.
#[arg(long, value_name = "DIR", value_hint = ValueHint::DirPath)]
pub cwd: Option<PathBuf>,
/// Force leader mode for this command, overriding config.
#[arg(long, conflicts_with = "no_leader")]
pub leader: bool,
/// Refuse to start even when config enables leader mode.
#[arg(long, conflicts_with = "leader")]
pub no_leader: bool,
/// Emit machine-readable JSON output.
#[arg(long)]
pub json: bool,
}
/// Arguments for the `agent` subcommand.
#[derive(Debug, clap::Args, Clone)]
pub struct AgentArgs {
@@ -276,9 +207,9 @@ pub struct AgentArgs {
/// Override the CLI chat proxy base URL.
#[arg(long = "coding-api-base-url")]
pub coding_api_base_url: Option<String>,
/// Override the public xAI API base URL.
#[arg(long = "xai-api-base-url")]
pub xai_api_base_url: Option<String>,
/// Override the direct (BYOK / external-API-key) API base URL.
#[arg(long = "api-base-url")]
pub api_base_url: Option<String>,
/// Agent runtime mode. Optional: bare `kigi agent` (and the `kigi acp`
/// alias) default to stdio.
#[command(subcommand)]
@@ -1619,7 +1619,7 @@ fn sanitize_user_error_strips_auth_prefixes() {
#[test]
fn sanitize_user_error_collapses_disk_full() {
assert_eq!(
sanitize_user_error("couldn't create worktree: Internal error: \"hub error: Worktree creation failed: not enough free disk space\""),
sanitize_user_error("couldn't create worktree: Internal error: \"workspace error: Worktree creation failed: not enough free disk space\""),
"Out of disk space."
);
assert_eq!(
@@ -318,7 +318,7 @@ impl PagerLeaderCluster {
let env = vec![
crate::test_util::EnvVarGuard::set("KIGI_SHARE_DIR", kigi_home.path()),
crate::test_util::EnvVarGuard::set("KIGI_CODE_BASE_URL", server.url()),
crate::test_util::EnvVarGuard::set("KIGI_XAI_API_BASE_URL", server.url()),
crate::test_util::EnvVarGuard::set("KIGI_API_BASE_URL", server.url()),
crate::test_util::EnvVarGuard::set("XAI_API_KEY", "test-key-for-ci"),
crate::test_util::EnvVarGuard::set("KIGI_TELEMETRY_ENABLED", "false"),
crate::test_util::EnvVarGuard::set("KIGI_FEEDBACK_ENABLED", "false"),
-1
View File
@@ -48,7 +48,6 @@ pub use cli::{
AgentArgs, AgentCmd, Command, LeaderArgs, LeaderMgmtArgs, LeaderMgmtCommand, LeaderTargetArgs,
OutputFormat, PagerArgs, ServeArgs, WrapArgs,
};
pub use cli::{WorkspaceMgmtArgs, WorkspaceMgmtCommand, WorkspaceStartArgs};
use crossterm::cursor::{self, SetCursorStyle};
use crossterm::event;
use crossterm::execute;