v0.1.4-pre.016-fix.001
This commit is contained in:
@@ -1,12 +1,12 @@
|
|||||||
# file: Cargo.toml
|
# file: Cargo.toml
|
||||||
# version: 86
|
# version: 87
|
||||||
|
|
||||||
[workspace]
|
[workspace]
|
||||||
resolver = "3"
|
resolver = "3"
|
||||||
members = ["crates/ksp-app-config-desk", "crates/ksp-config-lib", "crates/ksp-core-lib", "crates/ksp-logging-lib"]
|
members = ["crates/ksp-app-config-desk", "crates/ksp-config-lib", "crates/ksp-core-lib", "crates/ksp-logging-lib"]
|
||||||
|
|
||||||
[workspace.package]
|
[workspace.package]
|
||||||
version = "0.1.4-pre.16"
|
version = "0.1.4-pre.16.fix.1"
|
||||||
edition = "2024"
|
edition = "2024"
|
||||||
license = "MIT"
|
license = "MIT"
|
||||||
repository = "https://git.sasedev.com/Sasedev/khadhroony-solana-project"
|
repository = "https://git.sasedev.com/Sasedev/khadhroony-solana-project"
|
||||||
@@ -23,7 +23,7 @@ tracing = { version = "^0.1", default-features = false, features = ["std"] }
|
|||||||
tracing-subscriber = { version = "^0.3", default-features = false, features = ["fmt", "json", "ansi"] }
|
tracing-subscriber = { version = "^0.3", default-features = false, features = ["fmt", "json", "ansi"] }
|
||||||
tracing-appender = { version = "^0.2", default-features = false }
|
tracing-appender = { version = "^0.2", default-features = false }
|
||||||
tokio = { version = "^1.53", default-features = false, features = ["rt", "rt-multi-thread", "macros", "time"] }
|
tokio = { version = "^1.53", default-features = false, features = ["rt", "rt-multi-thread", "macros", "time"] }
|
||||||
time = { version = "^0.3", default-features = false, features = ["std"] }
|
chrono = { version = "^0.4", default-features = false, features = ["std", "now"] }
|
||||||
tauri = { version = "^2.11" }
|
tauri = { version = "^2.11" }
|
||||||
tauri-build = { version = "^2.6" }
|
tauri-build = { version = "^2.6" }
|
||||||
tauri-plugin-tracing = { version = "^0.3" }
|
tauri-plugin-tracing = { version = "^0.3" }
|
||||||
|
|||||||
@@ -72,6 +72,76 @@
|
|||||||
"target_prefix": "ksp-app-config-desk"
|
"target_prefix": "ksp-app-config-desk"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"console": {
|
||||||
|
"ansi": true,
|
||||||
|
"enabled": true,
|
||||||
|
"filter": {
|
||||||
|
"domains": [
|
||||||
|
"*"
|
||||||
|
],
|
||||||
|
"level": "debug",
|
||||||
|
"targets": [
|
||||||
|
"*"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"format": "compact",
|
||||||
|
"output": "stderr"
|
||||||
|
},
|
||||||
|
"default_filter": "info",
|
||||||
|
"files": [
|
||||||
|
{
|
||||||
|
"ansi": false,
|
||||||
|
"enabled": true,
|
||||||
|
"filter": {
|
||||||
|
"domains": [
|
||||||
|
"*"
|
||||||
|
],
|
||||||
|
"level": "debug",
|
||||||
|
"targets": [
|
||||||
|
"*"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"format": "human",
|
||||||
|
"output_id": "file.all.debug",
|
||||||
|
"path": "debug2/ksp-debug.log",
|
||||||
|
"rotation": "daily"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"ansi": false,
|
||||||
|
"enabled": true,
|
||||||
|
"filter": {
|
||||||
|
"domains": [
|
||||||
|
"config"
|
||||||
|
],
|
||||||
|
"level": "error",
|
||||||
|
"targets": [
|
||||||
|
"ksp-config-lib"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"format": "json",
|
||||||
|
"output_id": "file.config.error",
|
||||||
|
"path": "config2/ksp-config-errors.jsonl",
|
||||||
|
"rotation": "hourly"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"profile_id": "local_test",
|
||||||
|
"span_events": "off",
|
||||||
|
"target_filters": [
|
||||||
|
{
|
||||||
|
"level": "trace",
|
||||||
|
"target_prefix": "ksp-config-lib"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"level": "debug",
|
||||||
|
"target_prefix": "ksp-logging-lib"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"level": "debug",
|
||||||
|
"target_prefix": "ksp-app-config-desk"
|
||||||
|
}
|
||||||
|
]
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
# file: crates/ksp-app-config-desk/Cargo.toml
|
# file: crates/ksp-app-config-desk/Cargo.toml
|
||||||
# version: 6
|
# version: 7
|
||||||
|
|
||||||
[package]
|
[package]
|
||||||
name = "ksp-app-config-desk"
|
name = "ksp-app-config-desk"
|
||||||
@@ -30,7 +30,7 @@ serde.workspace = true
|
|||||||
serde_json.workspace = true
|
serde_json.workspace = true
|
||||||
tauri.workspace = true
|
tauri.workspace = true
|
||||||
tauri-plugin-tracing.workspace = true
|
tauri-plugin-tracing.workspace = true
|
||||||
time.workspace = true
|
chrono.workspace = true
|
||||||
tokio.workspace = true
|
tokio.workspace = true
|
||||||
ts-rs.workspace = true
|
ts-rs.workspace = true
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
// file: crates/ksp-app-config-desk/src/logging_runtime.rs
|
// file: crates/ksp-app-config-desk/src/logging_runtime.rs
|
||||||
// version: 1
|
// version: 2
|
||||||
|
|
||||||
//! Runtime Logging metadata, launch identity and explicit profile application for Config Desk.
|
//! Runtime Logging metadata, launch identity and explicit profile application for Config Desk.
|
||||||
|
|
||||||
@@ -51,19 +51,7 @@ pub(crate) struct LoggingRuntimeStatusDto {
|
|||||||
|
|
||||||
/// Creates the stable runtime identity for this Config Desk process launch.
|
/// Creates the stable runtime identity for this Config Desk process launch.
|
||||||
pub(crate) fn launch_identity() -> ksp_core_lib::Result<ksp_logging_lib::LoggingRuntimeIdentity> {
|
pub(crate) fn launch_identity() -> ksp_core_lib::Result<ksp_logging_lib::LoggingRuntimeIdentity> {
|
||||||
let now = time::OffsetDateTime::now_utc();
|
let timestamp = format!("{}-p{}", chrono::Utc::now().format("%Y%m%d-%H%M%S%.3fZ"), std::process::id());
|
||||||
let milliseconds = now.nanosecond() / 1_000_000;
|
|
||||||
let timestamp = format!(
|
|
||||||
"{:04}{:02}{:02}-{:02}{:02}{:02}.{:03}Z-p{}",
|
|
||||||
now.year(),
|
|
||||||
now.month() as u8,
|
|
||||||
now.day(),
|
|
||||||
now.hour(),
|
|
||||||
now.minute(),
|
|
||||||
now.second(),
|
|
||||||
milliseconds,
|
|
||||||
std::process::id(),
|
|
||||||
);
|
|
||||||
return ksp_logging_lib::LoggingRuntimeIdentity::new(crate::TRACING_TARGET, timestamp);
|
return ksp_logging_lib::LoggingRuntimeIdentity::new(crate::TRACING_TARGET, timestamp);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
// file: crates/ksp-logging-lib/src/runtime.rs
|
// file: crates/ksp-logging-lib/src/runtime.rs
|
||||||
// version: 12
|
// version: 13
|
||||||
|
|
||||||
use tracing_subscriber::Layer; // rust-rules: trait-import
|
use tracing_subscriber::Layer; // rust-rules: trait-import
|
||||||
use tracing_subscriber::layer::SubscriberExt; // rust-rules: trait-import
|
use tracing_subscriber::layer::SubscriberExt; // rust-rules: trait-import
|
||||||
@@ -282,10 +282,6 @@ pub fn reinitialize(guard: &mut crate::LoggingGuard, settings: &crate::LoggingSe
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
fn prepare_runtime(settings: &crate::LoggingSettings) -> ksp_core_lib::Result<PreparedRuntime> {
|
|
||||||
return prepare_runtime_with_identity(settings, std::option::Option::None);
|
|
||||||
}
|
|
||||||
|
|
||||||
fn prepare_runtime_with_identity(
|
fn prepare_runtime_with_identity(
|
||||||
settings: &crate::LoggingSettings,
|
settings: &crate::LoggingSettings,
|
||||||
runtime_identity: std::option::Option<&crate::LoggingRuntimeIdentity>,
|
runtime_identity: std::option::Option<&crate::LoggingRuntimeIdentity>,
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
// file: crates/ksp-logging-lib/unit_tests/runtime.rs
|
// file: crates/ksp-logging-lib/unit_tests/runtime.rs
|
||||||
// version: 10
|
// version: 11
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn level_mapping_covers_all_ksp_levels() {
|
fn level_mapping_covers_all_ksp_levels() {
|
||||||
@@ -48,7 +48,7 @@ fn file_rotation_mapping_covers_supported_cadences() {
|
|||||||
#[test]
|
#[test]
|
||||||
fn disabled_runtime_has_no_layers_or_outputs() {
|
fn disabled_runtime_has_no_layers_or_outputs() {
|
||||||
let settings = crate::LoggingSettings::new(crate::LogFilterLevel::Info, crate::SpanEvents::Off, std::option::Option::None, std::vec::Vec::new());
|
let settings = crate::LoggingSettings::new(crate::LogFilterLevel::Info, crate::SpanEvents::Off, std::option::Option::None, std::vec::Vec::new());
|
||||||
let result = super::prepare_runtime(&settings);
|
let result = super::prepare_runtime_with_identity(&settings, std::option::Option::None);
|
||||||
assert!(result.is_ok());
|
assert!(result.is_ok());
|
||||||
let prepared = match result {
|
let prepared = match result {
|
||||||
std::result::Result::Ok(prepared) => prepared,
|
std::result::Result::Ok(prepared) => prepared,
|
||||||
@@ -67,7 +67,7 @@ fn console_runtime_composes_takeover_filter_before_formatter_and_owns_guard() {
|
|||||||
std::option::Option::Some(crate::ConsoleSettings::stdout()),
|
std::option::Option::Some(crate::ConsoleSettings::stdout()),
|
||||||
std::vec::Vec::new(),
|
std::vec::Vec::new(),
|
||||||
);
|
);
|
||||||
let result = super::prepare_runtime(&settings);
|
let result = super::prepare_runtime_with_identity(&settings, std::option::Option::None);
|
||||||
assert!(result.is_ok());
|
assert!(result.is_ok());
|
||||||
let prepared = match result {
|
let prepared = match result {
|
||||||
std::result::Result::Ok(prepared) => prepared,
|
std::result::Result::Ok(prepared) => prepared,
|
||||||
@@ -137,7 +137,7 @@ fn multi_sink_runtime_accepts_metadata_routing_formats_and_console_ansi() {
|
|||||||
std::option::Option::Some(console),
|
std::option::Option::Some(console),
|
||||||
std::vec![first_file, second_file],
|
std::vec![first_file, second_file],
|
||||||
);
|
);
|
||||||
let result = super::prepare_runtime(&settings);
|
let result = super::prepare_runtime_with_identity(&settings, std::option::Option::None);
|
||||||
assert!(result.is_ok());
|
assert!(result.is_ok());
|
||||||
let prepared = match result {
|
let prepared = match result {
|
||||||
std::result::Result::Ok(prepared) => prepared,
|
std::result::Result::Ok(prepared) => prepared,
|
||||||
@@ -164,7 +164,7 @@ fn domain_routing_is_accepted_by_runtime_preparation() {
|
|||||||
);
|
);
|
||||||
let settings = crate::LoggingSettings::new(crate::LogFilterLevel::Info, crate::SpanEvents::Off, std::option::Option::Some(console), std::vec::Vec::new());
|
let settings = crate::LoggingSettings::new(crate::LogFilterLevel::Info, crate::SpanEvents::Off, std::option::Option::Some(console), std::vec::Vec::new());
|
||||||
assert!(settings.validate().is_ok());
|
assert!(settings.validate().is_ok());
|
||||||
let result = super::prepare_runtime(&settings);
|
let result = super::prepare_runtime_with_identity(&settings, std::option::Option::None);
|
||||||
assert!(result.is_ok());
|
assert!(result.is_ok());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
71
deltas/0.1.4/pre.016-fix.001.md
Normal file
71
deltas/0.1.4/pre.016-fix.001.md
Normal file
@@ -0,0 +1,71 @@
|
|||||||
|
<!-- file: deltas/0.1.4/pre.016-fix.001.md -->
|
||||||
|
<!-- version: 1 -->
|
||||||
|
|
||||||
|
# Delta `0.1.4-pre.016-fix.001` — Chrono et nettoyage du runtime Logging
|
||||||
|
|
||||||
|
## Base
|
||||||
|
|
||||||
|
`0.1.4-pre.016` a été appliquée puis contrôlée localement. `cargo check --workspace` et `cargo clippy --workspace --all-targets` ont signalé un warning `dead_code` sur `prepare_runtime()` dans `ksp-logging-lib`.
|
||||||
|
|
||||||
|
Avant validation fonctionnelle complète de la tranche, la dépendance temporelle directe choisie pour construire l'identité de lancement est également remplacée à la demande : KSP utilise `chrono` plutôt que `time` pour ce besoin calendaire UTC.
|
||||||
|
|
||||||
|
## Correctifs
|
||||||
|
|
||||||
|
### Dépendance temporelle
|
||||||
|
|
||||||
|
La dépendance workspace directe :
|
||||||
|
|
||||||
|
```toml
|
||||||
|
time = { version = "^0.3", default-features = false, features = ["std"] }
|
||||||
|
```
|
||||||
|
|
||||||
|
est remplacée par :
|
||||||
|
|
||||||
|
```toml
|
||||||
|
chrono = { version = "^0.4", default-features = false, features = ["std", "now"] }
|
||||||
|
```
|
||||||
|
|
||||||
|
`ksp-app-config-desk` consomme désormais `chrono.workspace = true`.
|
||||||
|
|
||||||
|
Cette modification ne cherche pas à imposer Chrono pour les mesures monotoniques : les durées/lifecycles continuent d'utiliser `std::time::Instant` et `std::time::Duration`. Chrono est utilisé uniquement pour construire le timestamp UTC calendaire de l'identité de lancement.
|
||||||
|
|
||||||
|
Le token conserve le contrat fonctionnel de `pre.016` :
|
||||||
|
|
||||||
|
```text
|
||||||
|
YYYYMMDD-HHMMSS.mmmZ-p<PID>
|
||||||
|
```
|
||||||
|
|
||||||
|
et reste construit une seule fois par lancement puis réutilisé lors des hot reloads.
|
||||||
|
|
||||||
|
### Warning `dead_code`
|
||||||
|
|
||||||
|
Le wrapper privé `prepare_runtime()` n'était plus utilisé par le code de production depuis l'introduction de l'identité runtime. Il est supprimé plutôt que masqué avec une annotation.
|
||||||
|
|
||||||
|
Les tests unitaires appellent directement `prepare_runtime_with_identity(..., None)`, ce qui conserve exactement la couverture du chemin sans identité tout en évitant un helper mort dans la bibliothèque normale.
|
||||||
|
|
||||||
|
## Hors périmètre
|
||||||
|
|
||||||
|
Aucun comportement de hot reload, sélection de profil, rollback, génération runtime ou naming de sink n'est modifié.
|
||||||
|
|
||||||
|
`config/std.logging.json` n'est pas modifié.
|
||||||
|
|
||||||
|
## Version technique
|
||||||
|
|
||||||
|
```text
|
||||||
|
workspace.package.version = 0.1.4-pre.16.fix.1
|
||||||
|
```
|
||||||
|
|
||||||
|
## Validation attendue
|
||||||
|
|
||||||
|
```bash
|
||||||
|
cargo fmt --all
|
||||||
|
cargo check --workspace
|
||||||
|
cargo clippy --workspace --all-targets
|
||||||
|
cargo test -p ksp-app-config-desk
|
||||||
|
cargo test -p ksp-config-lib
|
||||||
|
cargo test -p ksp-logging-lib
|
||||||
|
cargo tree -p ksp-app-config-desk
|
||||||
|
cargo tauri dev -c crates/ksp-app-config-desk/tauri.conf.json
|
||||||
|
```
|
||||||
|
|
||||||
|
Attendu en particulier : aucun warning `dead_code` sur `prepare_runtime` et `chrono` comme dépendance directe de Config Desk à la place de `time`.
|
||||||
Reference in New Issue
Block a user