Expand description
In-band CCR on the proxy wire (#493): <lc_expand:HASH> markers a model
echoed are spliced back into the request body before it leaves.
The content-addressed tee store itself (persist, resolve, bounded read)
lives in lean_ctx::core::ccr; it is re-exported here for the proxy’s
callers.
Enums§
- TeeResolve
Error - Why a canonical tee handle could not be resolved.
Constants§
- EXPAND_
CLOSE - Closing delimiter of an in-band retrieval marker.
- EXPAND_
OPEN - Opening delimiter of an in-band retrieval marker:
<lc_expand:HASH>(#493). - LITELLM_
HASH_ LEN - Length of a LiteLLM gateway retrieval hash (#702): LiteLLM’s headroom
guardrail scans compressed text with
hash=([a-f0-9]{24})(BerriAI/litellm#31681), so the marker must carry exactly 24 lowercase hex. - MIN_
TEE_ BYTES - Originals smaller than this are not worth a tee file + handle; the caller keeps its plain stub. Matches the spirit of the prune length thresholds.
Functions§
- inband_
locator - The in-band marker for
handleonly when in-band CCR is enabled (#493), elseNone. Stub sites use this to advertise an echo-able<lc_expand:HASH>solely in in-band mode: a normal (shared-filesystem) deployment keeps its path handle, so the model never sees a marker the proxy would not splice. - inband_
marker - The in-band retrieval marker
<lc_expand:HASH>for a CCRhandle(#493). - litellm_
hash - The 24-hex gateway retrieval hash for
content(#702): the first 24 chars of the full blake3 hex. A strict extension of the 16-hex tee name (crate::core::hasher::hash_shortis the same digest truncated to 16), sohash[..16]resolves the tee file while the extra 8 chars keep the marker collision-resistant on the gateway side. Pure — the marker embedding it stays byte-stable per content (#498). - persist
- Persist
contentverbatim (best-effort, secret-redacted) to the content-addressed tee store and return its retrieval handle (the absolute path). ReturnsNonefor protected originless data, invalid/oversized input or persistence failure. Re-persisting identical content keeps the same path; callers must preserve useful fresh output when no recovery handle is available. - persist_
conversation - Persist a dropped conversation message under a compact
conv_handle. - persist_
html - Persist an HTML page’s verbatim original (#1124) under the
html_prefix and return its{state}/tee/html_{hash}.loghandle. The extracted markdown is the compressed form; the full HTML is recoverable viaresolve_tee/ctx_expand. Shares the content-address and best-effort write contract ofpersist. - persist_
json - Persist a JSON crusher’s verbatim original (#936) under the
json_prefix and return its{state}/tee/json_{hash}.loghandle. Used by the lossy crush stage so a dropped column is always recoverable out-of-band viaresolve_tee/ctx_expand, never reconstructed from the (lossy) text. Shares the content-address and best-effort write contract ofpersist, so the embedded handle stays deterministic (cache-safe). - persist_
once - Like
persist, but a content-addressed copy that is already on disk is named as it is: no rewrite, no new relevance registration. A copy the TTL cleanup removed is written again (self-healing). Under protection nothing originless is named, existing or not. - persist_
tabular - Persist a tabular (CSV/TSV) crusher’s verbatim original (#982) under the
tbl_prefix and return its{state}/tee/tbl_{hash}.loghandle. Used by the lossy column-drop stage so a dropped column is always recoverable out-of-band viaresolve_tee/ctx_expand, never reconstructed from the (lossy) text. Shares the content-address and best-effort write contract ofpersist. - persist_
yaml - Persist a YAML crusher’s verbatim original (#985) under the
yaml_prefix and return its{state}/tee/yaml_{hash}.loghandle. Used by the lossy column-drop stage so a dropped column is always recoverable out-of-band viaresolve_tee/ctx_expand, never reconstructed from the (lossy) text. Shares the content-address and best-effort write contract ofpersist. - read_
checked_ tee - One bounded, no-follow read shared by selectors, HTTP, CLI and in-band recovery. Policy is freshly resolved before I/O and rechecked at publication.
- read_
tee - Resolve and read a tee handle in one step.
- read_
tee_ detailed - read_
tee_ file - Read a tee file that
resolve_teereturned. One read path for every caller: bounded, no-follow and bound to the checked file, re-checked against the current policy and re-admitted by the context gateway. - resolve_
tee - Back-compatible resolver used by
ctx_expand. - resolve_
tee_ checked - Resolve a retrieval ID through the same canonical store path used by
ctx_expand, while distinguishing malformed IDs and policy refusals. - write_
tee - Never publish an incomplete, oversized, unfiltered or protected originless copy. Atomic replacement preserves shell’s latest-output handle contract.