Skip to content

content-real-2 (b7): container and content gaps

Status words: tested = unit/integration test passes on Linux; nothing here is verified on a Mac.

On this base most of the assignment already existed: real nsz-tool NSZ/XCZ fixtures (solid, block, 0x4000 straddle), NCA0/NCA2 tests, and personalized-ticket vectors (OpenSSL) wired into Container. Remaining gaps closed:

  • tests/container_real.rs: truncation and byte-flip sweep over every real-writer fixture (NSZ solid/block, XCZ, rights NSZ) through Container::load_with_keys and Nca::open: Err, never a panic (tested).
  • HtmlDocument: romfs_tree (nested-directory RomFS builder, tests/support) replaces the flat builder for the HtmlDocument NCA; html_document_written_next_to_romfs_map now covers img/ui/b.png, css/main.css (tested). The flat romfs_flat only rejected nothing: the reader handled nesting, only the test fixture did not. New write_html unit test; HtmlFiles type alias (clippy).
  • docs/architecture/module-format.md: nested layout and the offline web resolve contract with the runtime.
  • Fuzz-hardening mutation tests untouched and green.

Not done: Mac check (napple build of a real title writes html/, golden data builds byte-identical). Pre-existing clippy warning left: unknown lint clippy::chunks_exact_to_as_chunks in napple-core nca.rs (newer toolchain).