Skip to content

Commit e83e5f1

Browse files
committed
planner: lift the ThinkingStyle compat alias back to thinking:: (D-TSC-1 regression fix)
1a11038 (D-TSC-1) renamed the planner 12-space ThinkingStyle -> StyleFamily and left `#[deprecated] pub type ThinkingStyle = StyleFamily;` in thinking/style.rs "for external compat" — but the same commit dropped ThinkingStyle from the `thinking/mod.rs` re-export (line 22 went from `pub use style::{…, ThinkingStyle}` to `…, StyleFamily`). So the alias was stranded one level down: `thinking::style::ThinkingStyle` resolved, but `thinking::ThinkingStyle` — the natural, pre-existing consumer import path — hard-broke. Not a compat shim; a compat shim I forgot to wire up. Same second-order break for the methods that used to be inherent on the old enum (cluster/tau_address/modulation): they moved onto the `PlannerStyleExt` ext trait, which was only privately `use`d in mod.rs, so `style.cluster()` broke even with the type alias present. Fix: re-export ThinkingStyle at thinking/mod.rs (with `#[allow(deprecated)]` on the re-export line so the crate stays -D warnings clean) and lift PlannerStyleExt via `pub use`. Consumers on the old paths now compile again (with the deprecation warning steering them to StyleFamily) instead of failing outright. `cargo build -p lance-graph-planner` clean, no new warnings (the 2 remaining are pre-existing deprecated-CausalEdge64 calls in nars_engine.rs, untouched). thinking-engine's alias was already at its prior path (cognitive_stack::) so it never broke; #674 audited clean (RESERVE-DON'T-RECLAIM, no stranded alias). Board: EPIPHANIES E-COMPAT-ALIAS-MUST-BE-LIFTED-1. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Awg6TXocHcwTtc6eGsHcdD
1 parent b9ae704 commit e83e5f1

2 files changed

Lines changed: 21 additions & 2 deletions

File tree

.claude/board/EPIPHANIES.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,12 @@
1+
## 2026-07-13 — E-COMPAT-ALIAS-MUST-BE-LIFTED-1 — a compat alias left in a leaf module but not re-exported at the consumer import path is a hard break, not a shim (D-TSC-1 regression, fixed)
2+
3+
**Status:** CORRECTION (fixes a real consumer-facing regression shipped in `1a11038` / D-TSC-1; grade [G] — reproduced by compile).
4+
**The break:** D-TSC-1 renamed the planner 12-space `ThinkingStyle` → `StyleFamily` (moved to `lance_graph_contract::style_family`) and left `#[deprecated] pub type ThinkingStyle = StyleFamily;` in `planner thinking/style.rs` "for external compat." But the SAME commit changed `planner thinking/mod.rs` line 22 from `pub use style::{…, ThinkingStyle}` to `pub use style::{…, StyleFamily}` — dropping the re-export. Result: `lance_graph_planner::thinking::style::ThinkingStyle` still resolved, but `lance_graph_planner::thinking::ThinkingStyle` (the natural, pre-existing import path) **hard-broke**. The alias was left in the basement and not lifted back to the floor consumers import from. Same for the methods that were inherent on the old enum (`cluster()`/`tau_address()`/modulation) — they moved to the `PlannerStyleExt` ext trait, which was only privately `use`d in mod.rs, never `pub use`d, so `style.cluster()` broke even with the type alias present.
5+
**The gate gap that let it through:** the D-TSC-1 gate was `G1 grep = 1 enum def + 3 deprecated aliases` — it counted alias **definitions**, never verified they were **reachable from the paths consumers actually import** (module-root re-exports). Counting a `pub type X = Y` in a leaf proves nothing about whether `crate::mod::X` still resolves.
6+
**The rule:** when a rename leaves a compat alias, the alias MUST be re-exported at **every module level the old name was reachable from before** — not just defined in the leaf. A compat-alias gate must assert the old import PATH resolves (`use crate::path::OldName;` compiles), not that an alias token exists somewhere. Extension traits that absorb former inherent methods must be lifted to the same module root as the type, so the consumer fix is one `use …::PlannerStyleExt`, not a hunt into a submodule.
7+
**Fix (this commit):** `planner thinking/mod.rs` re-exports `ThinkingStyle` (with `#[allow(deprecated)]` on the re-export) + lifts `PlannerStyleExt` via `pub use`. `-p lance-graph-planner` builds clean, no new warnings. thinking-engine's alias was already at its pre-existing path (`cognitive_stack::ThinkingStyle`) so it never broke; the driver had no public `ThinkingStyle` type. #674 (node-layout / 4+12 facet) was audited for the same disease and is CLEAN — it followed RESERVE-DON'T-RECLAIM (`NodeGuid::new` still callable, `CLASSID_*_LEGACY` aliases preserved, contract lib.rs change purely additive); its break is doctrinal (migrate mints to `mint_for`), not a stranded-alias compile break.
8+
**Cross-ref:** `1a11038` (the regression), D-TSC-1 spec, I-LEGACY-API-FEATURE-GATED (sibling doctrine — same "backward-compat shims need systematic coverage" spirit, applied to module re-export paths rather than layout bits).
9+
110
## 2026-07-12 — E-THINKING-SPINE-CHESS-EVIDENCE-1 — chess arc mapped onto the temporal-markov spine (Track A/B evidence layer)
211

312
**Status:** SYNTHESIS (session evidence addendum on `.claude/plans/temporal-markov-and-style-classes-v1.md`; grades explicit; no ruling changed).

crates/lance-graph-planner/src/thinking/mod.rs

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,22 @@ pub mod style;
1919
pub use nars_dispatch::{NarsInferenceType, QueryStrategy};
2020
pub use semiring_selection::SemiringChoice;
2121
pub use sigma_chain::{SigmaStage, ThinkingAtom};
22-
pub use style::{FieldModulation, StyleFamily, ThinkingCluster};
22+
// `ThinkingStyle` is the deprecated compat alias for `StyleFamily` (D-TSC-1);
23+
// re-exported here so pre-1a11038 consumers importing
24+
// `lance_graph_planner::thinking::ThinkingStyle` keep compiling (with the
25+
// deprecation warning steering them to `StyleFamily`), instead of hard-breaking.
26+
#[allow(deprecated)]
27+
pub use style::{FieldModulation, StyleFamily, ThinkingCluster, ThinkingStyle};
2328

2429
use crate::mul::MulAssessment;
2530
use crate::plan::PlannerConfig;
2631
use lance_graph_contract::cognitive_shader::RungLevel;
27-
use style::PlannerStyleExt;
32+
// Lifted (not just `use`d internally): the cluster/τ/modulation methods that
33+
// used to be inherent on the old `ThinkingStyle` enum now live on this ext
34+
// trait. Re-exporting it at the module root means a pre-1a11038 consumer whose
35+
// `style.cluster()` broke needs one obvious `use thinking::PlannerStyleExt`,
36+
// not a hunt into the `style` submodule.
37+
pub use style::PlannerStyleExt;
2838

2939
/// Complete thinking context produced by orchestration.
3040
/// This is what the query planner receives as input alongside the query.

0 commit comments

Comments
 (0)