From e53a66d1131108a9938365d36a41dd2c0c11b230 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=9B=B7=E7=94=B5=E8=8A=BD=E8=A1=A3?= Date: Wed, 22 Jul 2026 21:16:49 -0400 Subject: [PATCH] =?UTF-8?q?feat(graph):=20/graph=20ships=20on=20by=20defau?= =?UTF-8?q?lt=20=E2=80=94=20end=20the=20KIGI=5FGRAPH=20gray=20release?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit resolve_graph() read only the KIGI_GRAPH env var with default(false) (plan.md G0 gate), so /graph existed solely on machines whose environment exported the dev flag — which presented as '/graph is missing on Windows'. There was never any platform-conditional code: the Mac worked because the dev env var was set there. Default is now true (matching /goal's shipped state); KIGI_GRAPH=0 remains the off-switch, and availability still requires the goal harness (BuiltinGate::Graph). AGENTS.md updated; new test pins fresh-install-on plus env-zero-off. Verified: kigi-shell 5262 + kigi-tui 6874 tests green, clippy clean. --- AGENTS.md | 5 ++-- crates/codegen/kigi-shell/src/agent/config.rs | 26 ++++++++++++++++--- 2 files changed, 26 insertions(+), 5 deletions(-) diff --git a/AGENTS.md b/AGENTS.md index fe8bc7c..b1ee2a4 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -89,8 +89,9 @@ node as one ordinary goal — the agentic loop lives INSIDE the node; the edges stay deterministic Rust. The harness appends a terminal `gn-final` verification node depending on every planner node. -- Feature flag `KIGI_GRAPH=1` (default off); availability additionally - requires the goal harness (`BuiltinGate::Graph`). +- Enabled by default (`KIGI_GRAPH=0` is the off-switch; the G0 gray + release is over); availability additionally requires the goal harness + (`BuiltinGate::Graph`). - Key modules (kigi-shell): `session/graph_tracker.rs` (pure state machine; reuses `GoalStatus`/`GoalPhase`/`GoalPauseReason`), `session/graph_plan.rs` (planner-JSON contract + validation + fnv id diff --git a/crates/codegen/kigi-shell/src/agent/config.rs b/crates/codegen/kigi-shell/src/agent/config.rs index 382ed3c..bfa860b 100644 --- a/crates/codegen/kigi-shell/src/agent/config.rs +++ b/crates/codegen/kigi-shell/src/agent/config.rs @@ -1881,12 +1881,14 @@ impl Config { .default(true) .resolve() } - /// Graph mode (`/graph`) master switch. Default OFF — gray-released via - /// `KIGI_GRAPH=1` only (plan.md G0 gate). Graph mode additionally + /// Graph mode (`/graph`) master switch. Default ON — the gray release + /// (plan.md G0, `KIGI_GRAPH=1` only) is over; every install gets the + /// same commands (its absence on non-dev machines read as a platform + /// bug). `KIGI_GRAPH=0` remains the off-switch. Graph mode additionally /// requires the goal harness (nodes execute as goals), enforced at /// availability time, not here. pub(crate) fn resolve_graph(&self) -> Resolved { - BoolFlag::env("KIGI_GRAPH").default(false).resolve() + BoolFlag::env("KIGI_GRAPH").default(true).resolve() } /// Max graph nodes running concurrently (`KIGI_GRAPH_CONCURRENCY`). /// 1 = serial (G0-identical); clamped to [1, 8] — the coordinator has @@ -4337,6 +4339,24 @@ mod tests { /// Catalog key of the bundled fallback default (`default_models.json`): /// `{platform_id}/{model_id}` for `crate::models::default_model()`. const BUNDLED_DEFAULT_KEY: &str = "kimi-code/kimi-for-coding"; + + /// `/graph` ships ON by default: the G0 gray release (`KIGI_GRAPH=1` + /// only) made the command exist solely on machines with the dev env + /// var — which read as "missing on Windows". A fresh install with no + /// env must resolve `true`; `KIGI_GRAPH=0` stays the off-switch. + #[test] + #[serial] + fn graph_defaults_on_and_env_zero_disables() { + let cfg = Config::default(); + { + let _unset = EnvGuard::unset("KIGI_GRAPH"); + assert!(cfg.resolve_graph().value, "fresh install must offer /graph"); + } + { + let _off = EnvGuard::set("KIGI_GRAPH", "0"); + assert!(!cfg.resolve_graph().value, "KIGI_GRAPH=0 must disable"); + } + } #[test] fn main_cli_tools_override_preserves_profile_injection_policy() { let overrides = CliAgentOverrides {