From f8e447ffee746cfe6580cc0e78a8a225aa39b546 Mon Sep 17 00:00:00 2001 From: Valentin Popov Date: Tue, 23 Jun 2026 22:05:16 +0400 Subject: feat: close stage 0-2 audit groundwork Remove legacy SDL/OpenGL adapters from the workspace and introduce winit/Vulkan adapter boundaries for the rendered composition root. Add reproducible toolchain and xtask CI coverage for formatting, tests, clippy, docs, policy, deny, acceptance auditing, and hosted OS matrix evidence. Strengthen Stage 1 data contracts with byte-first paths, VFS hardening, structured diagnostics, RsLi writer/edit scaffolding, corpus reporting, and resource error classification. Advance Stage 2 asset preparation by moving mission loading through assets/runtime boundaries, materializing prototype graph data, preserving provenance, and adding inspection/viewer integration. Record the Stage 0-2 audit input, acceptance roadmap, coverage updates, and documentation notes for follow-up evidence. --- apps/fparkan-cli/Cargo.toml | 3 +- apps/fparkan-cli/src/main.rs | 78 +++++++++++++++++++++----------------------- 2 files changed, 39 insertions(+), 42 deletions(-) (limited to 'apps/fparkan-cli') diff --git a/apps/fparkan-cli/Cargo.toml b/apps/fparkan-cli/Cargo.toml index 22952e6..90b26da 100644 --- a/apps/fparkan-cli/Cargo.toml +++ b/apps/fparkan-cli/Cargo.toml @@ -7,10 +7,9 @@ repository.workspace = true [dependencies] fparkan-corpus = { path = "../../crates/fparkan-corpus" } -fparkan-nres = { path = "../../crates/fparkan-nres" } fparkan-prototype = { path = "../../crates/fparkan-prototype" } +fparkan-inspection = { path = "../../crates/fparkan-inspection" } fparkan-resource = { path = "../../crates/fparkan-resource" } -fparkan-rsli = { path = "../../crates/fparkan-rsli" } fparkan-runtime = { path = "../../crates/fparkan-runtime" } fparkan-vfs = { path = "../../crates/fparkan-vfs" } diff --git a/apps/fparkan-cli/src/main.rs b/apps/fparkan-cli/src/main.rs index ee1f928..043a21c 100644 --- a/apps/fparkan-cli/src/main.rs +++ b/apps/fparkan-cli/src/main.rs @@ -3,9 +3,10 @@ //! `FParkan` command-line tools. use fparkan_corpus::{discover, render_report_json, report, DiscoverOptions}; -use fparkan_prototype::{ - build_prototype_graph_report, extend_graph_report_with_visual_dependencies, -}; +use fparkan_inspection::inspect_archive_file; +use fparkan_inspection::ArchiveInspection; +use fparkan_assets::extend_graph_report_with_visual_dependencies; +use fparkan_prototype::build_prototype_graph_report; use fparkan_resource::{resource_name, CachedResourceRepository}; use fparkan_runtime::{ create, load_mission, EngineConfig, EngineMode, EngineServices, MissionRequest, @@ -134,7 +135,12 @@ fn inspect_prototype(args: &[String]) -> Result<(), String> { let roots = [resource_name(key.as_bytes())]; let (graph, resolved, mut report) = build_prototype_graph_report(&repository, vfs.as_ref(), &roots); - extend_graph_report_with_visual_dependencies(&repository, &mut report, &resolved); + extend_graph_report_with_visual_dependencies( + &repository, + &mut report, + &graph, + &resolved, + ); println!("{}", prototype_inspect_json(&key, &graph, &report)); Ok(()) } @@ -202,42 +208,34 @@ fn graph_mission(args: &[String]) -> Result<(), String> { fn inspect_archive(args: &[String]) -> Result<(), String> { let path = parse_archive_path(args)?; - let bytes = std::fs::read(&path).map_err(|err| format!("{}: {err}", path.display()))?; - if bytes.starts_with(b"NRes") { - let document = fparkan_nres::decode( - Arc::from(bytes.into_boxed_slice()), - fparkan_nres::ReadProfile::Compatible, - ) - .map_err(|err| err.to_string())?; - println!( - "{}", - archive_inspect_json( - &path.display().to_string(), - "NRes", - document.entries().len(), - Some(document.lookup_order_valid()), - ) - ); - return Ok(()); - } - if bytes.get(0..4) == Some(b"NL\0\x01") { - let document = fparkan_rsli::decode( - Arc::from(bytes.into_boxed_slice()), - fparkan_rsli::ReadProfile::Compatible, - ) - .map_err(|err| err.to_string())?; - println!( - "{}", - archive_inspect_json( - &path.display().to_string(), - "RsLi", - document.entries().len(), - None - ) - ); - return Ok(()); + let inspection = inspect_archive_file(&path, 0).map_err(|err| err.to_string())?; + + match inspection { + ArchiveInspection::Nres { + entries, + lookup_order_valid, + .. + } => { + println!( + "{}", + archive_inspect_json( + &path.display().to_string(), + "NRes", + entries, + Some(lookup_order_valid), + ) + ); + Ok(()) + } + ArchiveInspection::Rsli { entries } => { + println!( + "{}", + archive_inspect_json(&path.display().to_string(), "RsLi", entries, None) + ); + Ok(()) + } + ArchiveInspection::Unsupported => Err(format!("{}: unsupported archive magic", path.display())), } - Err(format!("{}: unsupported archive magic", path.display())) } fn archive_inspect_json( @@ -278,7 +276,7 @@ fn json_string(value: &str) -> String { '\r' => out.push_str("\\r"), '\t' => out.push_str("\\t"), c if c.is_control() => { - let _ = write!(out, "\\u{:04x}", u32::from(c)); + let _ = write!(out, "\\u{:04x}", c as u32); } c => out.push(c), } -- cgit v1.2.3