# Consumer contract
`RustCodeDocument::new` validates one identity and the exact UTF-8 contents of `Documentation.md`, `Cargo.toml`, and `src/lib.rs`. The manifest has the identity-qualified package name, stable version, Rust 2024 with Rust 1.97, MIT license, disabled automatic targets, one matching library target, forbidden unsafe code, and workspace resolver 3. Ordinary crates.io dependencies and authority-qualified K1 dependencies remain supported.
`RustCodeDocument::from_source_package` accepts only that three-file shape and `into_source_package` returns it without changing bytes. `approved_default` generates the canonical manifest plus documentation `# Consumer contract\n\n\`run\` performs no operation.\n` and code `pub fn run() {}\n`.
`identity`, `documentation`, `manifest`, and `code` borrow the represented values. `code_chunk_ranges` returns contiguous byte ranges that reconstruct the code exactly. It uses an 800-Unicode-scalar floor and safe boundaries after complete top-level items and direct impl or trait members. An empty file returns `0..0`; a short tail is retained with its preceding chunk, indivisible syntax has no maximum, and parsing or span uncertainty returns the whole file.
Failures return `RustCodeDocumentError`; `message` provides its stable explanatory text. Operations perform no I/O.