Expand description
View-building helpers for the interception-port call sites (PLUGIN-SPEC §4’s nine rows, P2).
The bounds here are the §3.2 byte bounds and §7.6’s frame bound,
enforced before serialization; the digests are the §3.2
*_sha256 fields. They live in kian-plugin because K10 allows
exactly one new dependency this round (sha2, here) — every call
site (kian-loop, kian-cli) digests through these functions
instead of growing its own sha2 edge, and kian-dsh (which may
not depend on this crate at all, §3.5) ships its own local
implementation over the same constants.
Redaction is deliberately absent: tier-0 handlers receive the unredacted view (§3.2 — same process, same authority), and the secret redactor runs at the sidecar wire (P3), not at these call sites.
Constants§
- FRAME_
PAYLOAD_ MAX_ BYTES - §7.6’s frame bound: one line, either direction, is at most
max_payload_kib(256 KiB) — the bound a §3.2.5argumentsvalue must fit to ride parsed. - PREVIEW_
MAX_ BYTES - §3.2’s
content_previewbound: ≤4096 bytes of the head of the content, cut at a UTF-8 character boundary.
Functions§
- bounded_
value - §3.2.5’s exhaustive two-form rule for
arguments: the parsed value when its serialization fits the frame bound, else the longest character-boundary prefix that fits, as a string — never a partially serialized object. Returns(arguments, truncated). - preview
- §3.2’s preview rule: the head of
content, at mostPREVIEW_MAX_BYTESbytes, cut at a UTF-8 character boundary; the flag is true when the preview is shorter than the content. - serialized
- The exact serialized form a digest or byte count describes
(§3.2:
content_bytesis the serialized length). Compact JSON — the same bytesserde_json::to_stringproduces everywhere else. - sha256_
hex - The §3.2
*_sha256digest fields: SHA-256 over the exact bytes, lowercase hex.