kcode-k1-ese-format 0.1.0

Strict wire types and codec for the K1 External Subsystem Enabler
Documentation
# K1 ESE format

`kcode-k1-ese-format` defines the strict current wire format and owned values for the K1 External Subsystem Enabler.

## Public API

```rust
pub use kcode_k1_access_types::{Authority, GroupId, TxId, UserId};

#[derive(Clone, Debug, Eq, Hash, PartialEq)]
pub struct ExternalSubsystem;
impl ExternalSubsystem {
    pub fn new(authority: Authority, name: String) -> Result<Self, String>;
    pub const fn authority(&self) -> Authority;
    pub fn name(&self) -> &str;
    pub fn into_parts(self) -> (Authority, String);
}

#[derive(Clone, Debug, Eq, PartialEq)]
pub enum Event {
    Register { actor: UserId, stream: ExternalSubsystem },
    Submit { actor: UserId, stream: ExternalSubsystem, operation_id: [u8; 32], payload: Vec<u8> },
}

pub fn encode(event: &Event) -> Result<Vec<u8>, String>;
pub fn decode(bytes: &[u8]) -> Result<Event, String>;
```

A stream is exactly `(Authority, exact UTF-8 name)`. Names are nonempty and receive no normalization, case folding, or package-owned cap. Sentinel group authorities are invalid.

Wire version 1 starts with one version byte and one kind byte. Both kinds then contain the actor user ID, authority tag and 12-byte authority ID, little-endian `u64` name length, and exact name bytes. Submit additionally contains a 32-byte operation ID, little-endian `u64` payload length, and exact opaque payload. Decode rejects unknown versions or kinds, invalid authorities, invalid or empty UTF-8 names, inconsistent lengths, platform-size overflow, and trailing bytes. There is no legacy decoder or migration.

Encoding and decoding are synchronous and stateless. Work and memory are linear in the name plus payload bytes, with one output allocation. There is no I/O, authorization decision, persistence, retry, timeout, compression, hashing, or payload interpretation.