fix: add missing specta annotations, scope tmp cleanup, and secure state file permissions

This commit is contained in:
teernisse
2026-02-26 10:16:42 -05:00
parent 807899bc49
commit da13b99b75
3 changed files with 20 additions and 19 deletions

View File

@@ -29,9 +29,9 @@ pub struct LoreStatus {
/// Summary counts from lore for the status response /// Summary counts from lore for the status response
#[derive(Debug, Clone, Serialize, Type)] #[derive(Debug, Clone, Serialize, Type)]
pub struct LoreSummaryStatus { pub struct LoreSummaryStatus {
pub open_issues: usize, pub open_issues: u32,
pub authored_mrs: usize, pub authored_mrs: u32,
pub reviewing_mrs: usize, pub reviewing_mrs: u32,
} }
/// Get the current status of lore integration by calling the real CLI. /// Get the current status of lore integration by calling the real CLI.
@@ -47,9 +47,9 @@ fn get_lore_status_with(cli: &dyn LoreCli) -> Result<LoreStatus, McError> {
Ok(true) => match cli.get_me() { Ok(true) => match cli.get_me() {
Ok(response) => { Ok(response) => {
let summary = LoreSummaryStatus { let summary = LoreSummaryStatus {
open_issues: response.data.open_issues.len(), open_issues: response.data.open_issues.len() as u32,
authored_mrs: response.data.open_mrs_authored.len(), authored_mrs: response.data.open_mrs_authored.len() as u32,
reviewing_mrs: response.data.reviewing_mrs.len(), reviewing_mrs: response.data.reviewing_mrs.len() as u32,
}; };
Ok(LoreStatus { Ok(LoreStatus {
last_sync: response.data.since_iso.clone(), last_sync: response.data.since_iso.clone(),
@@ -95,11 +95,11 @@ fn get_lore_status_with(cli: &dyn LoreCli) -> Result<LoreStatus, McError> {
#[derive(Debug, Clone, Serialize, Type)] #[derive(Debug, Clone, Serialize, Type)]
pub struct BridgeStatus { pub struct BridgeStatus {
/// Total mapped items /// Total mapped items
pub mapping_count: usize, pub mapping_count: u32,
/// Items with pending bead creation /// Items with pending bead creation
pub pending_count: usize, pub pending_count: u32,
/// Items flagged as suspect orphan (first strike) /// Items flagged as suspect orphan (first strike)
pub suspect_count: usize, pub suspect_count: u32,
/// Last incremental sync timestamp /// Last incremental sync timestamp
pub last_sync: Option<String>, pub last_sync: Option<String>,
/// Last full reconciliation timestamp /// Last full reconciliation timestamp
@@ -131,9 +131,9 @@ fn get_bridge_status_inner(
let map = bridge.load_map()?; let map = bridge.load_map()?;
Ok(BridgeStatus { Ok(BridgeStatus {
mapping_count: map.mappings.len(), mapping_count: map.mappings.len() as u32,
pending_count: map.mappings.values().filter(|e| e.pending).count(), pending_count: map.mappings.values().filter(|e| e.pending).count() as u32,
suspect_count: map.mappings.values().filter(|e| e.suspect_orphan).count(), suspect_count: map.mappings.values().filter(|e| e.suspect_orphan).count() as u32,
last_sync: map.cursor.last_check_timestamp, last_sync: map.cursor.last_check_timestamp,
last_reconciliation: map.cursor.last_reconciliation, last_reconciliation: map.cursor.last_reconciliation,
}) })

View File

@@ -113,13 +113,13 @@ impl MappingKey {
#[derive(Debug, Default, Serialize, Type)] #[derive(Debug, Default, Serialize, Type)]
pub struct SyncResult { pub struct SyncResult {
/// Number of new beads created /// Number of new beads created
pub created: usize, pub created: u32,
/// Number of existing items skipped (dedup) /// Number of existing items skipped (dedup)
pub skipped: usize, pub skipped: u32,
/// Number of beads closed (two-strike) /// Number of beads closed (two-strike)
pub closed: usize, pub closed: u32,
/// Number of suspect_orphan flags cleared (item reappeared) /// Number of suspect_orphan flags cleared (item reappeared)
pub healed: usize, pub healed: u32,
/// Errors encountered (non-fatal, processing continued) /// Errors encountered (non-fatal, processing continued)
pub errors: Vec<String>, pub errors: Vec<String>,
} }

View File

@@ -9,6 +9,7 @@
pub mod commands; pub mod commands;
pub mod data; pub mod data;
pub mod error; pub mod error;
pub mod sync;
pub mod watcher; pub mod watcher;
use tauri::menu::{MenuBuilder, MenuItemBuilder}; use tauri::menu::{MenuBuilder, MenuItemBuilder};
@@ -109,9 +110,6 @@ pub fn run() {
tracing::info!("Starting Mission Control"); tracing::info!("Starting Mission Control");
// Build tauri-specta builder for type-safe IPC // Build tauri-specta builder for type-safe IPC
// Note: read_state/write_state/clear_state use serde_json::Value which doesn't
// implement specta::Type, so they're excluded from the builder but kept in
// the invoke_handler via generate_handler!
let builder = Builder::<tauri::Wry>::new().commands(collect_commands![ let builder = Builder::<tauri::Wry>::new().commands(collect_commands![
commands::greet, commands::greet,
commands::get_lore_status, commands::get_lore_status,
@@ -119,6 +117,9 @@ pub fn run() {
commands::sync_now, commands::sync_now,
commands::reconcile, commands::reconcile,
commands::quick_capture, commands::quick_capture,
commands::read_state,
commands::write_state,
commands::clear_state,
]); ]);
// Export TypeScript bindings in debug builds // Export TypeScript bindings in debug builds