From afb0a166c3cb71c78ee9abd37b6c837ac2a612fe Mon Sep 17 00:00:00 2001 From: Claude Date: Mon, 13 Jul 2026 20:36:04 +0000 Subject: [PATCH] notebook-query: migrate to StyleFamily + PlannerStyleExt (lance-graph drift) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit lance-graph-planner (PR #688 upstream) reshaped the thinking-style API: - the 12-family orchestration space is now `StyleFamily` (canonical type in lance_graph_contract::style_family, re-exported from thinking::style); - `ThinkingStyle` became a deprecated alias for it; - the planner-local semantics `cluster()` and `default_modulation()` moved onto the `PlannerStyleExt` extension trait (StyleFamily is a foreign contract type, so the methods can't be inherent). Against the pinned lance-graph this broke the `planner`-feature build of the cockpit-server: 4 E0599 "method not found on &StyleFamily" errors in diagnostics.rs (the trait was not in scope) plus 33 deprecation warnings. Migrate both consumers to the canonical type: - diagnostics.rs: import `{PlannerStyleExt, StyleFamily}`; the all_styles array uses `StyleFamily::*`. Trait in scope -> cluster()/default_modulation() resolve. - lib.rs: the style-name match constructs variants only, so import `StyleFamily` (no trait needed) and use `StyleFamily::*`. Verified: `cargo build -p notebook-query --features planner` finishes clean against lance-graph origin/main (the commit Railway builds) — 0 errors, and the 33 ThinkingStyle deprecation warnings are gone. Co-Authored-By: Claude Opus 4.8 Claude-Session: https://claude.ai/code/session_012jEwwaT5JZ5x8qWvcnaMYC --- .../stubs/notebook-query/src/diagnostics.rs | 34 ++++++++++--------- crates/stubs/notebook-query/src/lib.rs | 31 +++++++++-------- 2 files changed, 35 insertions(+), 30 deletions(-) diff --git a/crates/stubs/notebook-query/src/diagnostics.rs b/crates/stubs/notebook-query/src/diagnostics.rs index 873ba61d9..bc944b2b1 100644 --- a/crates/stubs/notebook-query/src/diagnostics.rs +++ b/crates/stubs/notebook-query/src/diagnostics.rs @@ -10,11 +10,13 @@ use serde::{Deserialize, Serialize}; #[cfg(feature = "planner")] use lance_graph_planner::api::{Planner, PlanResult}; -// ThinkingStyle from its canonical module, not the api re-export — the re-export was -// added to lance-graph after this pin, so importing from `api` breaks the build against -// the pinned lance-graph; `thinking::style` exists in every version. +// The 12-family orchestration space is `StyleFamily` (canonical type in +// lance_graph_contract::style_family, re-exported here). `ThinkingStyle` is now a +// deprecated alias for it, and the planner-local semantics (`cluster()`, +// `default_modulation()`) live on the `PlannerStyleExt` extension trait, which must be +// in scope for those method calls to resolve. #[cfg(feature = "planner")] -use lance_graph_planner::thinking::style::ThinkingStyle; +use lance_graph_planner::thinking::style::{PlannerStyleExt, StyleFamily}; // ── Strategy Self-Check ────────────────────────────────────────────────────── @@ -241,18 +243,18 @@ fn run_demo_analyses(planner: &Planner) -> Vec { ]; let all_styles = [ - ThinkingStyle::Analytical, - ThinkingStyle::Convergent, - ThinkingStyle::Systematic, - ThinkingStyle::Creative, - ThinkingStyle::Divergent, - ThinkingStyle::Exploratory, - ThinkingStyle::Focused, - ThinkingStyle::Diffuse, - ThinkingStyle::Peripheral, - ThinkingStyle::Intuitive, - ThinkingStyle::Deliberate, - ThinkingStyle::Metacognitive, + StyleFamily::Analytical, + StyleFamily::Convergent, + StyleFamily::Systematic, + StyleFamily::Creative, + StyleFamily::Divergent, + StyleFamily::Exploratory, + StyleFamily::Focused, + StyleFamily::Diffuse, + StyleFamily::Peripheral, + StyleFamily::Intuitive, + StyleFamily::Deliberate, + StyleFamily::Metacognitive, ]; demo_queries.iter().map(|query| { diff --git a/crates/stubs/notebook-query/src/lib.rs b/crates/stubs/notebook-query/src/lib.rs index 78fe31aab..a70beeb51 100644 --- a/crates/stubs/notebook-query/src/lib.rs +++ b/crates/stubs/notebook-query/src/lib.rs @@ -359,7 +359,10 @@ fn run_planner_with_options( demonstrated_competence: Option, ) -> Option { use lance_graph_planner::api::Planner; - use lance_graph_planner::thinking::style::ThinkingStyle; // canonical path; api re-export postdates the pin + // The 12-family orchestration space is `StyleFamily`; `ThinkingStyle` is now a + // deprecated alias for it. This block only constructs variants, so the extension + // trait `PlannerStyleExt` is not needed here. + use lance_graph_planner::thinking::style::StyleFamily; let planner = Planner::new(); @@ -374,19 +377,19 @@ fn run_planner_with_options( } else if let Some(style_name) = style_override { // Style override — parse the style name let style = match style_name.to_lowercase().as_str() { - "analytical" => ThinkingStyle::Analytical, - "convergent" => ThinkingStyle::Convergent, - "systematic" => ThinkingStyle::Systematic, - "creative" => ThinkingStyle::Creative, - "divergent" => ThinkingStyle::Divergent, - "exploratory" => ThinkingStyle::Exploratory, - "focused" => ThinkingStyle::Focused, - "diffuse" => ThinkingStyle::Diffuse, - "peripheral" => ThinkingStyle::Peripheral, - "intuitive" => ThinkingStyle::Intuitive, - "deliberate" => ThinkingStyle::Deliberate, - "metacognitive" => ThinkingStyle::Metacognitive, - _ => ThinkingStyle::Analytical, // default fallback + "analytical" => StyleFamily::Analytical, + "convergent" => StyleFamily::Convergent, + "systematic" => StyleFamily::Systematic, + "creative" => StyleFamily::Creative, + "divergent" => StyleFamily::Divergent, + "exploratory" => StyleFamily::Exploratory, + "focused" => StyleFamily::Focused, + "diffuse" => StyleFamily::Diffuse, + "peripheral" => StyleFamily::Peripheral, + "intuitive" => StyleFamily::Intuitive, + "deliberate" => StyleFamily::Deliberate, + "metacognitive" => StyleFamily::Metacognitive, + _ => StyleFamily::Analytical, // default fallback }; planner.plan_with_style(source, style) } else {