commit 180c003f6e709fb7ed30e8fa99df6c426e9ca758
parent 49bc5ed289cc2e52171898dee909bbed6b5e6535
Author: triesap <tyson@radroots.org>
Date: Wed, 1 Jul 2026 11:29:20 +0000
studio: guard production dead-code suppressions
- make the today agenda replacement helper test-only
- add a production source guard for dead-code allowances
- keep test fixture allowance coverage scoped to tests
- validate source guards and future-incompat check through extbuild
Diffstat:
2 files changed, 19 insertions(+), 1 deletion(-)
diff --git a/crates/desktop/src/runtime.rs b/crates/desktop/src/runtime.rs
@@ -1024,7 +1024,7 @@ impl DesktopAppRuntime {
self.lock_state_mut().reset_local_device_state()
}
- #[allow(dead_code)]
+ #[cfg(test)]
pub fn replace_today_agenda(&self, projection: TodayAgendaProjection) -> bool {
self.lock_state_mut()
.state_store
diff --git a/crates/desktop/src/source_guards.rs b/crates/desktop/src/source_guards.rs
@@ -1534,6 +1534,24 @@ fn app_production_sdk_boundary_usage_is_exception_scoped() {
}
#[test]
+fn app_production_sources_do_not_suppress_dead_code() {
+ let forbidden = ["#[allow(", "dead_code", ")]"].concat();
+
+ for (relative_path, source) in app_rust_source_files() {
+ let production_source = production_source_without_tests(relative_path.as_str(), &source)
+ .unwrap_or_else(|error| {
+ panic!("{} source classification failed: {error}", relative_path)
+ });
+
+ assert!(
+ !production_source.contains(forbidden.as_str()),
+ "{} contains production dead-code suppression",
+ relative_path
+ );
+ }
+}
+
+#[test]
fn app_store_current_schema_surfaces_reject_retired_terms() {
let app_root = app_root();
let mut paths = vec![