diff --git a/hive-ag3nt/src/events.rs b/hive-ag3nt/src/events.rs index 660e25d0..f55494be 100644 --- a/hive-ag3nt/src/events.rs +++ b/hive-ag3nt/src/events.rs @@ -13,10 +13,10 @@ use std::sync::atomic::{AtomicBool, AtomicI64, AtomicU64, Ordering}; use std::sync::{Arc, Mutex}; use hive_claude::TokenUsage; +use hive_sh4re::wire_time::now_unix; use rusqlite::{Connection, params}; use serde::{Deserialize, Serialize}; use tokio::sync::broadcast; -use hive_sh4re::wire_time::now_unix; const CHANNEL_CAPACITY: usize = 256; /// Max `LiveEvent`s the `Bus` returns from `history()` and keeps in @@ -214,7 +214,6 @@ pub fn write_forge_cursor( write_harness_json(&v); } - const SCHEMA: &str = " CREATE TABLE IF NOT EXISTS events ( id INTEGER PRIMARY KEY AUTOINCREMENT, diff --git a/hive-ag3nt/src/stats.rs b/hive-ag3nt/src/stats.rs index 743e86d5..b244e4ab 100644 --- a/hive-ag3nt/src/stats.rs +++ b/hive-ag3nt/src/stats.rs @@ -568,7 +568,6 @@ fn u64_from_i64(v: i64) -> u64 { u64::try_from(v).unwrap_or(0) } - #[cfg(test)] mod tests { use super::*; diff --git a/hive-ag3nt/src/vacuum.rs b/hive-ag3nt/src/vacuum.rs index 4b1eba93..c33ec8ad 100644 --- a/hive-ag3nt/src/vacuum.rs +++ b/hive-ag3nt/src/vacuum.rs @@ -17,8 +17,8 @@ use std::path::Path; use std::time::Duration; -use rusqlite::{Connection, Result, params}; use hive_sh4re::wire_time::now_unix; +use rusqlite::{Connection, Result, params}; /// How often the sweep runs. const VACUUM_INTERVAL: Duration = Duration::from_hours(1); @@ -131,4 +131,3 @@ fn vacuum_events(path: &Path) -> Result { )?; Ok(u64::try_from(removed).unwrap_or(0)) } - diff --git a/hive-c0re/src/approvals.rs b/hive-c0re/src/approvals.rs index 613d20bf..f9235a2d 100644 --- a/hive-c0re/src/approvals.rs +++ b/hive-c0re/src/approvals.rs @@ -6,9 +6,9 @@ use std::path::Path; use std::sync::Mutex; use anyhow::{Context, Result, bail}; +use hive_sh4re::wire_time::now_unix; use hive_sh4re::{Approval, ApprovalKind, ApprovalStatus}; use rusqlite::{Connection, OptionalExtension, params}; -use hive_sh4re::wire_time::now_unix; const SCHEMA: &str = r" CREATE TABLE IF NOT EXISTS approvals ( @@ -367,7 +367,6 @@ fn row_to_approval(row: &rusqlite::Row<'_>) -> rusqlite::Result { }) } - fn kind_from_str(s: &str) -> Result { Ok(match s { "apply_commit" => ApprovalKind::ApplyCommit, @@ -380,7 +379,6 @@ fn kind_from_str(s: &str) -> Result { }) } - #[cfg(test)] mod tests { use super::*; diff --git a/hive-c0re/src/audit_log.rs b/hive-c0re/src/audit_log.rs index 549e5b35..6dee6ea0 100644 --- a/hive-c0re/src/audit_log.rs +++ b/hive-c0re/src/audit_log.rs @@ -25,9 +25,9 @@ use std::sync::{Arc, Mutex, OnceLock}; use anyhow::{Context, Result}; use chrono::{DateTime, Utc}; +use hive_sh4re::wire_time::now_unix; use rusqlite::{Connection, params}; use serde::Serialize; -use hive_sh4re::wire_time::now_unix; /// Process-singleton handle, set once at coordinator startup. Mirrors /// `build_logs::GLOBAL` — lets recording sites write without threading an @@ -259,7 +259,6 @@ fn row_to_entry(r: &rusqlite::Row) -> rusqlite::Result { }) } - #[cfg(test)] mod tests { use super::*; diff --git a/hive-c0re/src/broker.rs b/hive-c0re/src/broker.rs index 20c13a0d..c816029e 100644 --- a/hive-c0re/src/broker.rs +++ b/hive-c0re/src/broker.rs @@ -8,11 +8,11 @@ use std::sync::Mutex; use anyhow::{Context, Result}; use chrono::{DateTime, Utc}; +use hive_sh4re::wire_time::now_unix; use hive_sh4re::{InboxRow, Message}; use rusqlite::{Connection, OptionalExtension, params}; use serde::Serialize; use tokio::sync::broadcast; -use hive_sh4re::wire_time::now_unix; const SCHEMA: &str = r" CREATE TABLE IF NOT EXISTS messages ( @@ -1136,7 +1136,6 @@ fn ensure_reminder_columns(conn: &Connection) -> Result<()> { ) } - #[cfg(test)] mod tests { use super::*; diff --git a/hive-c0re/src/build_logs.rs b/hive-c0re/src/build_logs.rs index 67fa9ca8..87f271c6 100644 --- a/hive-c0re/src/build_logs.rs +++ b/hive-c0re/src/build_logs.rs @@ -7,10 +7,10 @@ use std::path::Path; use std::sync::{Arc, Mutex, OnceLock}; use anyhow::{Context, Result}; +use hive_sh4re::wire_time::now_unix; use rusqlite::{Connection, OptionalExtension, params}; use serde::Serialize; use tokio::sync::broadcast; -use hive_sh4re::wire_time::now_unix; /// Process-singleton handle, set once at coordinator startup. Lets /// the `lifecycle` module's `run` / `prebuild_toplevel` access the @@ -438,7 +438,6 @@ fn row_to_header(r: &rusqlite::Row) -> rusqlite::Result { }) } - #[cfg(test)] mod tests { use super::*; diff --git a/hive-c0re/src/hive_stats.rs b/hive-c0re/src/hive_stats.rs index 3558a5ea..da1f2d49 100644 --- a/hive-c0re/src/hive_stats.rs +++ b/hive-c0re/src/hive_stats.rs @@ -226,7 +226,6 @@ struct AgentAgg { bash: HashMap, } - #[allow( clippy::cast_sign_loss, clippy::cast_possible_truncation, diff --git a/hive-c0re/src/job_queue/mod.rs b/hive-c0re/src/job_queue/mod.rs index 133afb84..b38dca51 100644 --- a/hive-c0re/src/job_queue/mod.rs +++ b/hive-c0re/src/job_queue/mod.rs @@ -28,8 +28,8 @@ mod tests; use std::collections::{HashMap, VecDeque}; use std::sync::Mutex; -use tokio::sync::Notify; use hive_sh4re::wire_time::now_unix; +use tokio::sync::Notify; pub use model::{ Dag, DagSpec, DagView, DepWhen, Node, NodeId, NodeKind, PermPayload, Source, State, Template, @@ -566,4 +566,3 @@ impl JobQueue { inner.dags = kept.into_iter().rev().collect(); } } - diff --git a/hive-c0re/src/loose_ends.rs b/hive-c0re/src/loose_ends.rs index f73031ef..741d0789 100644 --- a/hive-c0re/src/loose_ends.rs +++ b/hive-c0re/src/loose_ends.rs @@ -13,7 +13,6 @@ //! the dashboard uses, so the bottleneck would be json //! (de)serialisation, not the read. - use anyhow::Result; use hive_sh4re::LooseEnd; @@ -143,7 +142,6 @@ fn saturating_age(now: i64, then: i64) -> u64 { u64::try_from(delta).unwrap_or(0) } - #[cfg(test)] mod tests { use super::*; diff --git a/hive-c0re/src/operator_questions.rs b/hive-c0re/src/operator_questions.rs index b9b9dd67..2a99699f 100644 --- a/hive-c0re/src/operator_questions.rs +++ b/hive-c0re/src/operator_questions.rs @@ -15,9 +15,9 @@ use std::sync::Mutex; use anyhow::{Context, Result, bail}; use chrono::{DateTime, Utc}; +use hive_sh4re::wire_time::now_unix; use rusqlite::{Connection, OptionalExtension, params}; use serde::Serialize; -use hive_sh4re::wire_time::now_unix; const SCHEMA: &str = r" CREATE TABLE IF NOT EXISTS operator_questions ( @@ -271,4 +271,3 @@ fn row_to_question(row: &rusqlite::Row<'_>) -> rusqlite::Result { target: row.get(9)?, }) } - diff --git a/hive-c0re/src/power.rs b/hive-c0re/src/power.rs index 72a8068d..a5900adb 100644 --- a/hive-c0re/src/power.rs +++ b/hive-c0re/src/power.rs @@ -18,8 +18,8 @@ use std::path::Path; use std::sync::Mutex; use anyhow::{Context, Result}; -use rusqlite::{Connection, OptionalExtension, params}; use hive_sh4re::wire_time::now_unix; +use rusqlite::{Connection, OptionalExtension, params}; const SCHEMA: &str = " CREATE TABLE IF NOT EXISTS agent_power ( @@ -158,7 +158,6 @@ impl PowerStore { } } - #[cfg(test)] mod tests { use super::*; diff --git a/hive-c0re/src/scheduled_prompts.rs b/hive-c0re/src/scheduled_prompts.rs index cac39829..7aaaff1f 100644 --- a/hive-c0re/src/scheduled_prompts.rs +++ b/hive-c0re/src/scheduled_prompts.rs @@ -16,9 +16,9 @@ use std::path::Path; use std::sync::Mutex; use anyhow::{Context, Result, bail}; +use hive_sh4re::wire_time::now_unix; use rusqlite::{Connection, OptionalExtension, params}; use serde::{Deserialize, Serialize}; -use hive_sh4re::wire_time::now_unix; /// Typed error returned by [`ScheduledPrompts::pause`] and /// [`ScheduledPrompts::resume`] when the target row does not exist or @@ -675,7 +675,6 @@ fn load_targets(conn: &Connection, schedule_id: i64) -> Result