kcode-k1-rust-transaction 0.2.1

Encode canonical K1 Rust source-state transactions
Documentation
1
2
3
4
5
6
7
# K1 Rust source transaction contract

`RustSourceTransaction` is the version-1 canonical wire event for the complete K1 Rust source-state stream. `Create` creates the first unpublished worktree in a previously absent family, `Fork` creates a new unpublished worktree from existing source, `Overwrite` replaces one exact unpublished revision, and `Publish` claims one immutable semantic version. Create and Fork derive their stable unpublished ID from the enclosing KTO transaction ID; Overwrite carries that ID and the expected prior revision.

`encode` emits one deterministic representation and `decode` accepts only that representation. Every event includes one complete validated `SourcePackage`; Overwrite additionally includes two raw 12-byte transaction IDs. The package representation contains authority, logical name, stable working or published semantic version, and every exact source file in canonical path order. There is no source digest or policy size limit.

Decoding rejects unknown wire versions or event kinds, truncation, noncanonical source order, trailing bytes, representational overflow, allocation failure, and every package invariant rejected by `kcode-k1-rust-package`. The codec performs no I/O, KTO submission, authorization, publication, mutation of caller data, compatibility decoding, or migration.