kcode-k1-web-checker-protocol 0.1.0

Own the K1 Web checker request and report protocol
Documentation
# Consumer contract

`kcode-k1-web-checker` is the current consumer. A later K1 Podman caller may validate and encode the same concrete checker request without owning checker runtime behavior.

```rust
pub const SCHEMA_VERSION: u32 = 1;
pub struct WebIdInput { pub authority: String, pub name: String, pub version: String }
pub struct SelectionInput { pub family_authority: String, pub family_name: String, pub selector: String, pub resolved: WebIdInput }
pub struct Request {
    pub schema: u32, pub candidate: WebIdInput, pub candidate_root: PathBuf,
    pub projection_root: PathBuf, pub entry: String, pub tests: String,
    pub selections: Vec<SelectionInput>, pub chromium: PathBuf, pub timeout_ms: u64,
}
pub enum Stage { Validation, Server, Browser, Test, Timeout, Cleanup }
pub enum Outcome { Success, Failure { stage: Stage, message: String } }
pub struct Timings { pub validation_ms: u64, pub server_ms: u64, pub browser_ms: u64, pub cleanup_ms: u64, pub total_ms: u64 }
pub struct Diagnostics {
    pub browser_stdout: Vec<u8>, pub browser_stderr: Vec<u8>,
    pub browser_exit: Option<String>, pub page_error: Option<String>,
    pub server_errors: Vec<String>, pub cleanup_errors: Vec<String>,
}
pub struct Report { pub schema: u32, pub outcome: Outcome, pub diagnostics: Diagnostics, pub timings: Timings }
pub struct ValidatedRequest;
pub fn validate_request(value: &Request) -> Result<ValidatedRequest, String>;
pub fn encode_request(value: &Request) -> Result<Vec<u8>, serde_json::Error>;
pub fn decode_request(bytes: &[u8]) -> Result<Request, serde_json::Error>;
pub fn encode_report(value: &Report) -> Result<Vec<u8>, serde_json::Error>;
pub fn decode_report(bytes: &[u8]) -> Result<Report, serde_json::Error>;
```

`pub fn ValidatedRequest::into_routing_parts(self) -> (WebId, Vec<(WebFamily, DependencySelector, WebId)>)` consumes the opaque validation result and returns the parsed candidate plus ordered parsed selections needed by the checker. It is checker-specific and does not own routing or execution.

The wire data types implement `Debug`, `Serialize`, and `Deserialize`. Codecs use declaration-order compact JSON, reject unknown fields, emit one trailing newline, use snake-case enum values, and tag `Outcome` by `kind`.

Validation requires schema 1; a nonzero timeout in milliseconds; absolute ordinary directory roots; an absolute ordinary Chromium file; safe slash-relative `.js` or `.mjs` module paths; 24-character lowercase hexadecimal authorities; and canonical versions and selectors accepted by `kcode-k1-web-package`. Validation reads only filesystem metadata and does not open Chromium, route modules, or execute a request.

Each encoder is unbenchmarked and linear in its complete output. Each decoder is unbenchmarked and linear in its complete input. Validation is unbenchmarked and linear in the number and total text size of selections and paths, apart from constant-count filesystem metadata lookups. Consuming a validated request is linear in its selection count because it moves the owned vector.