From 3dd3c7bf8bc77cf78a0f69173869d63e095bec79 Mon Sep 17 00:00:00 2001 From: Bryan Helmkamp Date: Thu, 9 Apr 2026 11:35:44 -0400 Subject: [PATCH] refactor(config): delete unused legacy shim modules, document transitional seam Stage 6 initial cleanup. Removes two fabro-config shim modules that no longer hold any code and adds a module-level comment to fabro-types/src/settings/mod.rs documenting the transitional seam between the flat legacy Settings shape and the authoritative v2 namespaced schema in fabro_types::settings::v2. Deleted: - fabro-config/src/combine.rs: was a one-line re-export of fabro_types::combine::Combine; nothing imports it anymore - fabro-config/src/settings.rs: was reduced to a header comment after Stage 3 replaced TryFrom for Settings with ConfigLayer::resolve via the v2 bridge Stage 6 full deletion (legacy flat Settings type, the bridge, the old settings/{hook,mcp,project,run,sandbox,server,user}.rs modules, plus the Combine trait derive) is scheduled for a follow-up PR that migrates every consumer call site from the flat settings.llm / .vars / .sandbox / .setup / .hooks / .mcp_servers / .goal / .work_dir / .github / .git / .pull_request / .checkpoint / .artifacts fields to the v2 SettingsFile tree. That touches ~128 call sites across ~15 files and is a mechanical but large follow-up; the current bridge is the safe intermediate state. --- lib/crates/fabro-config/src/combine.rs | 1 - lib/crates/fabro-config/src/lib.rs | 2 -- lib/crates/fabro-config/src/settings.rs | 5 ----- lib/crates/fabro-types/src/settings/mod.rs | 19 +++++++++++++++++++ 4 files changed, 19 insertions(+), 8 deletions(-) delete mode 100644 lib/crates/fabro-config/src/combine.rs delete mode 100644 lib/crates/fabro-config/src/settings.rs diff --git a/lib/crates/fabro-config/src/combine.rs b/lib/crates/fabro-config/src/combine.rs deleted file mode 100644 index 775d76aca..000000000 --- a/lib/crates/fabro-config/src/combine.rs +++ /dev/null @@ -1 +0,0 @@ -pub use fabro_types::combine::*; diff --git a/lib/crates/fabro-config/src/lib.rs b/lib/crates/fabro-config/src/lib.rs index 333202b75..ea640c56b 100644 --- a/lib/crates/fabro-config/src/lib.rs +++ b/lib/crates/fabro-config/src/lib.rs @@ -1,6 +1,5 @@ extern crate self as fabro_config; -pub mod combine; pub mod config; pub mod effective_settings; pub mod home; @@ -12,7 +11,6 @@ pub mod project; pub mod run; pub mod sandbox; pub mod server; -pub mod settings; pub mod storage; pub mod user; diff --git a/lib/crates/fabro-config/src/settings.rs b/lib/crates/fabro-config/src/settings.rs deleted file mode 100644 index e6a0a341b..000000000 --- a/lib/crates/fabro-config/src/settings.rs +++ /dev/null @@ -1,5 +0,0 @@ -//! Empty module retained for backwards-compatible imports. -//! -//! The legacy `TryFrom for Settings` impl was replaced by -//! [`crate::ConfigLayer::resolve`], which delegates to the v2 bridge in -//! `fabro_types::settings::v2::bridge`. Stage 6 deletes this file entirely. diff --git a/lib/crates/fabro-types/src/settings/mod.rs b/lib/crates/fabro-types/src/settings/mod.rs index 1393e6845..3545ab41a 100644 --- a/lib/crates/fabro-types/src/settings/mod.rs +++ b/lib/crates/fabro-types/src/settings/mod.rs @@ -1,3 +1,22 @@ +//! Legacy flat `Settings` shape plus the v2 namespaced schema. +//! +//! The authoritative config schema lives in [`v2`] — it is the namespaced +//! parse tree that `_version = 1` TOML files decode into. Value-language +//! helpers, the merge matrix, and strict unknown-key validation all live +//! there. +//! +//! The flat [`Settings`] type and its submodules (`hook`, `mcp`, `project`, +//! `run`, `sandbox`, `server`, `user`) are the **resolved** shape that +//! current consumers still read. `fabro_config::ConfigLayer::resolve` walks +//! the v2 tree through [`v2::bridge::bridge_to_old`] to produce this flat +//! shape, so every consumer that touches `settings.llm`, `settings.vars`, +//! `settings.sandbox`, etc. keeps working. +//! +//! Full deletion of the flat shape (including the bridge) is scheduled for +//! a follow-up PR that migrates every consumer call site to read from +//! [`v2::SettingsFile`] directly. This module deliberately stays as a +//! transitional seam until then. + use std::collections::HashMap; use std::path::PathBuf;