v0.1.4-pre.015

This commit is contained in:
2026-08-16 17:38:23 +02:00
parent 789ffb16ce
commit d7185905d8
17 changed files with 1124 additions and 305 deletions

View File

@@ -1,5 +1,5 @@
// file: crates/ksp-config-lib/src/management.rs
// version: 3
// version: 4
/// Raw source of one registered Config document read for explicit management/correction.
#[derive(Clone, Eq, PartialEq)]
@@ -482,6 +482,11 @@ impl LoggingFileConfig {
return self.ansi;
}
/// Sets whether ANSI output is requested. Persistence validation currently requires persistent file ANSI to remain disabled.
pub fn set_ansi(&mut self, value: bool) {
self.ansi = value;
}
/// Returns the output filter.
#[must_use]
pub const fn filter(&self) -> &LoggingOutputFilterConfig {

View File

@@ -1,5 +1,5 @@
// file: crates/ksp-config-lib/tests/public_api.rs
// version: 13
// version: 14
//! Integration tests for the public `ksp-config-lib` bootstrap, registry, JSON/profile/composite, environment-resolution, sensitivity, Logging-adapter and
//! management contracts.
@@ -219,6 +219,12 @@ fn management_contracts_are_available_from_crate_root() {
assert_eq!(logging.profiles()[0].profile_id(), "local_dev");
assert_eq!(logging.profiles()[0].files().len(), 2);
assert!(!logging.profiles()[0].files()[0].ansi());
if let std::option::Option::Some(profile) = logging.profiles_mut().first_mut() {
if let std::option::Option::Some(file) = profile.files_mut().first_mut() {
file.set_ansi(false);
assert!(!file.ansi());
}
}
}
}
let save_source_candidate: fn(

View File

@@ -1,5 +1,5 @@
// file: crates/ksp-config-lib/unit_tests/management.rs
// version: 3
// version: 4
static NEXT_FIXTURE_ID: std::sync::atomic::AtomicU64 = std::sync::atomic::AtomicU64::new(1);
@@ -211,6 +211,15 @@ fn raw_source_candidate_rejects_schema_and_unknown_file_ids_without_filesystem_e
cleanup_fixture(&fixture);
}
#[test]
fn logging_file_ansi_mutator_completes_typed_management_surface() {
let filter = crate::LoggingOutputFilterConfig::new("info", std::vec!["*".to_owned()], std::vec!["*".to_owned()]);
let mut file = crate::LoggingFileConfig::new("file.test", true, "test.log", "daily", "human", filter);
assert!(!file.ansi());
file.set_ansi(true);
assert!(file.ansi());
}
#[test]
fn typed_logging_document_can_be_mutated_validated_and_persisted_atomically() {
let fixture = management_fixture();