refactor(profile): extract profile models and index rules

Move profile models and index rules into the crate, preserving serialization and returning a typed missing-profile error.
This commit is contained in:
Tunglies
2026-11-30 18:44:12 +08:00
parent b1281d78fe
commit e31c01894a
19 changed files with 1017 additions and 856 deletions
+2 -2
View File
@@ -2,7 +2,7 @@ use super::{CoreManager, PROFILE_SELECTIONS_PENDING_COMMIT, RunningMode};
use crate::core::notify::NoticeStatus;
use crate::core::service::StageRequest;
use crate::{
config::{Config, IProfiles, runtime::IRuntime},
config::{Config, IProfiles, profiles::save_profiles, runtime::IRuntime},
constants::timing,
core::{
handle,
@@ -243,7 +243,7 @@ impl CoreManager {
crate::config::profiles::restore_selected_nodes().await;
return Ok(Err(outcome));
}
match candidate.save_file().await {
match save_profiles(candidate).await {
Ok(()) => {
tracing::Span::current().record("outcome", "committed");
Ok(Ok(guard))