# Consumer contract
`K1RustCoding` is the synchronous, caller-owned coding service for one user. `open` reuses that user’s disposable Cargo downloads, compiled output, workspaces, internal K1 registry, and successful-check receipts across ordinary service restarts when the schema and toolchain policy still match. `reset` explicitly replaces that cache. Operations are serialized through `&mut self`; the package owns no retries, background work, deployment, or cross-user state.
`check(package)` treats every published K1 library as public. It recursively resolves each K1 dependency to the newest compatible published version, installs the exact resolved closure into the local Cargo registry, materializes the candidate, and runs one network-enabled Podman check when no matching receipt exists. The container may fetch ordinary crates.io dependencies and reuses the user’s Cargo and compilation caches, but it receives no K1 state, credentials, host controls, or Podman socket. A successful receipt binds the candidate source, generated lockfile, exact resolved K1 dependency versions, image, Rust toolchain, target, check policy, and command policy.
`publish(package, gate)` first checks the package, then asks `RustPublishAuthorization` whether this user may publish under the package’s authority immediately before writing the immutable source through the K1 Rust projection. Published and idempotent results are installed into the user’s local registry without contacting crates.io. Public reading and dependency use require no authorization. A completed publication followed by local-cache failure is returned as `AfterPublish`.
`build_binary(package, binary)` checks the package and performs the separate requested release build, returning the exact executable path and complete diagnostics. `CheckOutcome` distinguishes exact receipt reuse from a performed check. `RustCodingError` distinguishes local state, publish-authorization infrastructure, unavailable compatible public dependencies, denied publication, Podman failures, and post-publication local failures.