From 469c12f19c3d2f60d04efe576a7901c7afa46cdd Mon Sep 17 00:00:00 2001 From: ScriptedAlchemy Date: Mon, 24 Aug 2026 21:00:04 +0000 Subject: [PATCH 1/4] fix(clippy): clear workspace lint failures in crates CI clippy has been red on this branch across roughly ten commits. Groups publish_verified_inner's three mode parameters into a struct rather than passing eight positionally, and clears field-reassign-after-default, redundant clone-to-slice, redundant deref, and a no-op drop of a type with no Drop impl. Co-Authored-By: Claude Opus 5 (1M context) --- .../src/session_temporal/projection/tests.rs | 2 +- .../src/registry/publication.rs | 57 ++++++++++++++----- .../src/writer/worker/mod.rs | 10 ++-- .../src/runtime/codex/tests.rs | 32 ++++++----- .../src/runtime/lcm/gc/tests.rs | 4 +- .../src/runtime/lcm/query.rs | 2 +- 6 files changed, 70 insertions(+), 37 deletions(-) diff --git a/crates/tracedecay-global-db/src/session_temporal/projection/tests.rs b/crates/tracedecay-global-db/src/session_temporal/projection/tests.rs index 49a620470..e54ef8bc5 100644 --- a/crates/tracedecay-global-db/src/session_temporal/projection/tests.rs +++ b/crates/tracedecay-global-db/src/session_temporal/projection/tests.rs @@ -542,7 +542,7 @@ async fn multi_output_projection_reuses_source_derivation_and_activates_shared_a counted.query_count(), batch.occurrences().len() ); - drop(counted); + // `counted` holds no Drop impl, so dropping it only extends its borrows. drop(transaction); store diff --git a/crates/tracedecay-graph-db/src/registry/publication.rs b/crates/tracedecay-graph-db/src/registry/publication.rs index 9da236808..3b6387ac1 100644 --- a/crates/tracedecay-graph-db/src/registry/publication.rs +++ b/crates/tracedecay-graph-db/src/registry/publication.rs @@ -29,6 +29,21 @@ use crate::{ GraphProjectionIdentity, GraphReplayCollectionOutcome, VerifiedGraphCommit, }; +/// The three publication mode choices `publish_verified_inner` varies on. +/// +/// Grouped because passing them positionally put the function at 8 arguments, +/// and three adjacent bools at a call site read as noise: `false, true` says +/// nothing about which knob is which. +struct GraphPublishModeV1 { + /// A manifest supplied by the caller instead of one derived from replay. + supplied_manifest: Option>, + /// Reopen metadata rather than treating the existing handle as current. + reopen_metadata: bool, + /// This call writes a durable staging page, so it retries across the + /// boundary to prove the exact commit rather than assuming it landed. + durable_stage_boundary: bool, +} + impl GraphDbRegistry { #[hotpath::measure(label = "graph_db.replay_pool.retire", impl_type = "GraphDbRegistry")] pub fn retire_one_code_generation_replay( @@ -410,9 +425,11 @@ impl GraphDbRegistry { authority, context, publication_key, - supplied_manifest, - false, - false, + GraphPublishModeV1 { + supplied_manifest, + reopen_metadata: false, + durable_stage_boundary: false, + }, ) } @@ -434,9 +451,11 @@ impl GraphDbRegistry { authority, context, publication_key, - supplied_manifest, - false, - true, + GraphPublishModeV1 { + supplied_manifest, + reopen_metadata: false, + durable_stage_boundary: true, + }, ) } @@ -458,9 +477,11 @@ impl GraphDbRegistry { authority, context, publication_key, - None, - false, - false, + GraphPublishModeV1 { + supplied_manifest: None, + reopen_metadata: false, + durable_stage_boundary: false, + }, ) } @@ -477,12 +498,15 @@ impl GraphDbRegistry { authority, context, publication_key, - None, - true, - false, + GraphPublishModeV1 { + supplied_manifest: None, + reopen_metadata: true, + durable_stage_boundary: false, + }, ) } + #[hotpath::measure(label = "graph_db.generation.publish", impl_type = "GraphDbRegistry")] fn publish_verified_inner( &self, @@ -490,10 +514,13 @@ impl GraphDbRegistry { authority: &mut dyn GraphPublicationStoreV1, context: &GraphPublicationOperationContextV1<'_>, publication_key: &GraphPublicationKeyV1, - supplied_manifest: Option>, - reopen_metadata: bool, - durable_stage_boundary: bool, + mode: GraphPublishModeV1, ) -> Result { + let GraphPublishModeV1 { + supplied_manifest, + reopen_metadata, + durable_stage_boundary, + } = mode; operation.check(self, context)?; operation.require_publication_binding(publication_key)?; let database = operation.database().clone(); diff --git a/crates/tracedecay-rusqlite-runtime/src/writer/worker/mod.rs b/crates/tracedecay-rusqlite-runtime/src/writer/worker/mod.rs index 9cd145539..f2e7e34f3 100644 --- a/crates/tracedecay-rusqlite-runtime/src/writer/worker/mod.rs +++ b/crates/tracedecay-rusqlite-runtime/src/writer/worker/mod.rs @@ -1612,10 +1612,12 @@ mod auxiliary_scheduling_tests { /// validated, reported in telemetry, and never obeyed. #[test] fn writer_checkpoint_policy_is_the_configured_wal_budget() { - let mut admission = tracedecay_store::AdmissionConfigV1::default(); - admission.wal = tracedecay_store::WalBudgetV1 { - soft_limit_bytes: 4 * 1024 * 1024, - hard_limit_bytes: 64 * 1024 * 1024, + let admission = tracedecay_store::AdmissionConfigV1 { + wal: tracedecay_store::WalBudgetV1 { + soft_limit_bytes: 4 * 1024 * 1024, + hard_limit_bytes: 64 * 1024 * 1024, + }, + ..Default::default() }; admission .validate() diff --git a/crates/tracedecay-sessions/src/runtime/codex/tests.rs b/crates/tracedecay-sessions/src/runtime/codex/tests.rs index 4147e1259..484b95d34 100644 --- a/crates/tracedecay-sessions/src/runtime/codex/tests.rs +++ b/crates/tracedecay-sessions/src/runtime/codex/tests.rs @@ -1005,13 +1005,15 @@ mod recent_first_discovery_tests { #[test] fn indexed_replay_starts_at_the_acknowledged_btree_position() { - let mut index = CodexReplayIndex::default(); - index.complete = true; - index.frontier = CodexDiscoveryFrontier::complete(CodexCorpusEpoch { - high: 1, - low: 2, - files: 8192, - }); + let mut index = CodexReplayIndex { + complete: true, + frontier: CodexDiscoveryFrontier::complete(CodexCorpusEpoch { + high: 1, + low: 2, + files: 8192, + }), + ..Default::default() + }; for value in 0..8192 { index.paths.insert(CodexIndexedPath { root_order: 0, @@ -1041,13 +1043,15 @@ mod recent_first_discovery_tests { #[test] fn indexed_replay_preserves_recent_sessions_before_archive() { - let mut index = CodexReplayIndex::default(); - index.complete = true; - index.frontier = CodexDiscoveryFrontier::complete(CodexCorpusEpoch { - high: 1, - low: 2, - files: 3, - }); + let mut index = CodexReplayIndex { + complete: true, + frontier: CodexDiscoveryFrontier::complete(CodexCorpusEpoch { + high: 1, + low: 2, + files: 3, + }), + ..Default::default() + }; let newest = CodexIndexedPath { root_order: 0, path: PathBuf::from("/sessions/2026/08/24/rollout-new.jsonl"), diff --git a/crates/tracedecay-sessions/src/runtime/lcm/gc/tests.rs b/crates/tracedecay-sessions/src/runtime/lcm/gc/tests.rs index 1c3d42f1c..bbd94ba99 100644 --- a/crates/tracedecay-sessions/src/runtime/lcm/gc/tests.rs +++ b/crates/tracedecay-sessions/src/runtime/lcm/gc/tests.rs @@ -1695,8 +1695,8 @@ async fn pending_delete_drain_batches_mixed_metadata_presence() -> Result<(), St .await .map_err(|err| err.to_string())?; - assert_eq!(drain.outcomes.preserved.refs, [live_ref.clone()]); - assert_eq!(drain.outcomes.removed.refs, [dead_ref.clone()]); + assert_eq!(drain.outcomes.preserved.refs, *std::slice::from_ref(&live_ref)); + assert_eq!(drain.outcomes.removed.refs, *std::slice::from_ref(&dead_ref)); assert!(dir.join(&live_ref).is_file(), "live payload was unlinked"); assert!(!dir.join(&dead_ref).exists(), "dead payload survived"); Ok(()) diff --git a/crates/tracedecay-sessions/src/runtime/lcm/query.rs b/crates/tracedecay-sessions/src/runtime/lcm/query.rs index e3c9d6ef7..b1f30179a 100644 --- a/crates/tracedecay-sessions/src/runtime/lcm/query.rs +++ b/crates/tracedecay-sessions/src/runtime/lcm/query.rs @@ -1048,7 +1048,7 @@ mod tests { ) .await .expect("session schema"); - schema::ensure_lcm_schema(&*conn).await.expect("LCM schema"); + schema::ensure_lcm_schema(&conn).await.expect("LCM schema"); conn.execute( "INSERT INTO sessions(provider, session_id, project_key, project_path) VALUES ('cursor', 'session-a', '/p', '/p')", From 322ad531c99603dfb43035d3d9f45b9632f07623 Mon Sep 17 00:00:00 2001 From: ScriptedAlchemy Date: Mon, 24 Aug 2026 21:26:43 +0000 Subject: [PATCH 2/4] fix(clippy): clear root crate lint failures Names the retired-owner return shape, iterates the owner map by keys, collapses a nested if, elides two needless lifetimes, backticks two doc identifiers, and states the idle recheck interval in minutes. cargo clippy --workspace --all-targets --locked -- -D warnings is clean. Co-Authored-By: Claude Opus 5 (1M context) --- src/daemon/bootstrap.rs | 2 +- src/daemon/code_index_scheduler/tests.rs | 8 ++++---- src/daemon/database_owner_registry.rs | 9 ++++++--- src/daemon/invocation_state.rs | 2 +- src/daemon/session_temporal_refresh_scheduler/worker.rs | 2 +- src/mcp/tools/handlers/dashboard.rs | 8 ++++---- 6 files changed, 17 insertions(+), 14 deletions(-) diff --git a/src/daemon/bootstrap.rs b/src/daemon/bootstrap.rs index 4b90dade5..5bf6fb94f 100644 --- a/src/daemon/bootstrap.rs +++ b/src/daemon/bootstrap.rs @@ -769,7 +769,7 @@ async fn run_foreground_unix( } /// Install the daemon-wide worker authority from the profile's exact -/// ProfileSessions configuration before publishing a transport endpoint. +/// `ProfileSessions` configuration before publishing a transport endpoint. /// Account-deletion-only boots return before this point and never start /// projectless capture work. async fn install_profile_worker_plan( diff --git a/src/daemon/code_index_scheduler/tests.rs b/src/daemon/code_index_scheduler/tests.rs index 611374d2b..0855c87cb 100644 --- a/src/daemon/code_index_scheduler/tests.rs +++ b/src/daemon/code_index_scheduler/tests.rs @@ -9144,10 +9144,10 @@ async fn resident_memory_graph_refusal_seats_text_serving_without_graph() { let deadline = std::time::Instant::now() + Duration::from_secs(5); let latest = loop { - if let Some(latest) = registry.latest_complete_serving_for_scope(&scope).await { - if latest.query_owners_are_warm() { - break latest; - } + if let Some(latest) = registry.latest_complete_serving_for_scope(&scope).await + && latest.query_owners_are_warm() + { + break latest; } assert!( std::time::Instant::now() <= deadline, diff --git a/src/daemon/database_owner_registry.rs b/src/daemon/database_owner_registry.rs index 0936772c8..c389ad2a0 100644 --- a/src/daemon/database_owner_registry.rs +++ b/src/daemon/database_owner_registry.rs @@ -9,6 +9,9 @@ use super::*; /// evicted to stay within the registry's capacity bound. pub(super) type BoundRouteInsertionV1 = (Server, bool, Vec<(ProjectServerKey, Server)>); +/// One retired owner and the project servers that were mounted under it. +pub(super) type RetiredOwnerServersV1 = (StoreOwnerKey, Vec<(ProjectServerKey, Server)>); + // Fields are `pub(super)` so `branch_admin` can read `server` directly. pub(super) struct DatabaseOwnerEntry { pub(super) server: Server, @@ -285,14 +288,14 @@ impl DatabaseOwnerRegistry { pub(super) fn retire_lru_ready_under_graph_pressure( &mut self, mut is_leased: F, - ) -> std::result::Result)>, ()> + ) -> std::result::Result>, ()> where F: FnMut(&Server) -> bool, { let owners = self .servers - .iter() - .map(|(key, _)| key.owner.clone()) + .keys() + .map(|key| key.owner.clone()) .collect::>(); let evict = owners .into_iter() diff --git a/src/daemon/invocation_state.rs b/src/daemon/invocation_state.rs index 624f48d7d..f6fc9f207 100644 --- a/src/daemon/invocation_state.rs +++ b/src/daemon/invocation_state.rs @@ -79,7 +79,7 @@ impl DaemonInvocationState { } /// Mount the profile-owned background-worker plan before any projectless - /// session or host-admission work can start. The exact ProfileSessions + /// session or host-admission work can start. The exact `ProfileSessions` /// shard is the persisted user-profile authority; project configuration /// must never win this process-wide installation by opening first. pub(crate) async fn install_profile_worker_plan( diff --git a/src/daemon/session_temporal_refresh_scheduler/worker.rs b/src/daemon/session_temporal_refresh_scheduler/worker.rs index 037a973c9..5a7cf5ebb 100644 --- a/src/daemon/session_temporal_refresh_scheduler/worker.rs +++ b/src/daemon/session_temporal_refresh_scheduler/worker.rs @@ -25,7 +25,7 @@ use crate::store::{ GlobalDbSessionTemporalStore, SessionRefreshRecoveryV1, SessionRefreshRestartStateV1, }; -const HISTORY_IDLE_RECHECK_INTERVAL: Duration = Duration::from_secs(60); +const HISTORY_IDLE_RECHECK_INTERVAL: Duration = Duration::from_mins(1); #[hotpath::measure] pub(super) async fn run_session_temporal_refresh_scheduler( diff --git a/src/mcp/tools/handlers/dashboard.rs b/src/mcp/tools/handlers/dashboard.rs index 58b2a5cfb..34d1fc09c 100644 --- a/src/mcp/tools/handlers/dashboard.rs +++ b/src/mcp/tools/handlers/dashboard.rs @@ -84,7 +84,7 @@ pub(crate) fn compose_dashboard_profile_code_index_worker_settings( impl DashboardProfileCodeIndexWorkerSettingsPort for DashboardProfileCodeIndexWorkerSettingsAdapter { - fn read<'a>(&'a self) -> DashboardCodeIndexWorkerSettingsFuture<'a> { + fn read(&self) -> DashboardCodeIndexWorkerSettingsFuture<'_> { let database = self.database.clone(); let profile_id = self.profile_id.clone(); Box::pin(async move { @@ -98,12 +98,12 @@ impl DashboardProfileCodeIndexWorkerSettingsPort }) } - fn commit<'a>( - &'a self, + fn commit( + &self, selection: CodeIndexWorkerSelectionV1, expected_revision: ConfigurationRevisionId, idempotency_key: ConfigurationIdempotencyKey, - ) -> DashboardCodeIndexWorkerSettingsCommitFuture<'a> { + ) -> DashboardCodeIndexWorkerSettingsCommitFuture<'_> { let database = self.database.clone(); let profile_id = self.profile_id.clone(); let project_root = self.project_root.clone(); From 5ebfabbb007d7a75c669ca343b61308784ae6237 Mon Sep 17 00:00:00 2001 From: ScriptedAlchemy Date: Mon, 24 Aug 2026 21:54:44 +0000 Subject: [PATCH 3/4] style: apply rustfmt to the clippy fixes --- crates/tracedecay-graph-db/src/registry/publication.rs | 1 - crates/tracedecay-sessions/src/runtime/lcm/gc/tests.rs | 10 ++++++++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/crates/tracedecay-graph-db/src/registry/publication.rs b/crates/tracedecay-graph-db/src/registry/publication.rs index 3b6387ac1..3a0c4117c 100644 --- a/crates/tracedecay-graph-db/src/registry/publication.rs +++ b/crates/tracedecay-graph-db/src/registry/publication.rs @@ -506,7 +506,6 @@ impl GraphDbRegistry { ) } - #[hotpath::measure(label = "graph_db.generation.publish", impl_type = "GraphDbRegistry")] fn publish_verified_inner( &self, diff --git a/crates/tracedecay-sessions/src/runtime/lcm/gc/tests.rs b/crates/tracedecay-sessions/src/runtime/lcm/gc/tests.rs index bbd94ba99..6c0aa9057 100644 --- a/crates/tracedecay-sessions/src/runtime/lcm/gc/tests.rs +++ b/crates/tracedecay-sessions/src/runtime/lcm/gc/tests.rs @@ -1695,8 +1695,14 @@ async fn pending_delete_drain_batches_mixed_metadata_presence() -> Result<(), St .await .map_err(|err| err.to_string())?; - assert_eq!(drain.outcomes.preserved.refs, *std::slice::from_ref(&live_ref)); - assert_eq!(drain.outcomes.removed.refs, *std::slice::from_ref(&dead_ref)); + assert_eq!( + drain.outcomes.preserved.refs, + *std::slice::from_ref(&live_ref) + ); + assert_eq!( + drain.outcomes.removed.refs, + *std::slice::from_ref(&dead_ref) + ); assert!(dir.join(&live_ref).is_file(), "live payload was unlinked"); assert!(!dir.join(&dead_ref).exists(), "dead payload survived"); Ok(()) From 4cd043bbbd9bf97bb208d90509c0c628c60703ac Mon Sep 17 00:00:00 2001 From: ScriptedAlchemy Date: Mon, 24 Aug 2026 22:03:31 +0000 Subject: [PATCH 4/4] fix(clippy): heap-allocate the 64 KiB generation IO buffers The streaming publication path put three 64 KiB scratch buffers on the stack, four times clippy's large-stack-array ceiling. They are I/O scratch, so the heap is the right home and no frame pays for them. Co-Authored-By: Claude Opus 5 (1M context) --- src/daemon/code_index_scheduler.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/daemon/code_index_scheduler.rs b/src/daemon/code_index_scheduler.rs index 10d44a035..aa8d391bc 100644 --- a/src/daemon/code_index_scheduler.rs +++ b/src/daemon/code_index_scheduler.rs @@ -567,7 +567,7 @@ impl DaemonCodeIndexPublicationStoreV1 { fn state_digest_file(path: &Path) -> Result { let mut file = File::open(path).map_err(Self::unavailable)?; let mut hasher = Sha256::new(); - let mut buffer = [0_u8; DURABLE_GENERATION_IO_CHUNK_BYTES_V1]; + let mut buffer = vec![0_u8; DURABLE_GENERATION_IO_CHUNK_BYTES_V1]; loop { let read = file.read(&mut buffer).map_err(Self::unavailable)?; if read == 0 { @@ -591,8 +591,8 @@ impl DaemonCodeIndexPublicationStoreV1 { } let mut left = File::open(left).map_err(Self::unavailable)?; let mut right = File::open(right).map_err(Self::unavailable)?; - let mut left_buffer = [0_u8; DURABLE_GENERATION_IO_CHUNK_BYTES_V1]; - let mut right_buffer = [0_u8; DURABLE_GENERATION_IO_CHUNK_BYTES_V1]; + let mut left_buffer = vec![0_u8; DURABLE_GENERATION_IO_CHUNK_BYTES_V1]; + let mut right_buffer = vec![0_u8; DURABLE_GENERATION_IO_CHUNK_BYTES_V1]; loop { let left_read = left.read(&mut left_buffer).map_err(Self::unavailable)?; if left_read == 0 {