Structs§
- Delta
Explicit Decision - Outcome of
resolve_explicit_delta_mode: the (possibly rewritten) read mode plus an optional advisory note to surface to the agent. - Read
Output - Pre-counted read output carrying the output string, resolved mode, and token count computed during mode processing.
Functions§
- handle
- Reads a file through the cache and applies the requested compression mode.
- handle_
fresh - Like
handle, but invalidates the cache first to force a fresh disk read. - handle_
fresh_ with_ task - Fresh read with task-aware filtering (invalidates cache first).
- handle_
fresh_ with_ task_ resolved - Fresh read with task-aware filtering, also returns the resolved mode name and pre-counted tokens.
- handle_
fresh_ with_ task_ resolved_ tuned - Fresh-read variant of
handle_with_task_resolved_tuned(#714). - handle_
with_ task - Reads a file with task-aware filtering to prioritize task-relevant content.
- handle_
with_ task_ resolved - Like
handle_with_task, also returns the resolved mode name and pre-counted tokens. - handle_
with_ task_ resolved_ tuned - Like
handle_with_task_resolvedbut with an explicit per-call aggressiveness (thectx_readaggressivenessarg, #714).Nonefalls back to theLEAN_CTX_AGGRESSIVENESSenv var / config field. - is_
instruction_ file - read_
file_ lossy - Reads a file as UTF-8 with lossy fallback, enforcing binary detection and max read size limit. Defense-in-depth: verifies that the canonical path stays within the process’s project root (if determinable) even though callers SHOULD have already jail-checked the path.
- resolve_
explicit_ delta_ mode - Decide whether an explicit
full/lines:N-Mre-read of a session-cached file should be served as a delta instead of re-emitting content the model already holds (thedelta_explicitopt-in; envLCTX_DELTA_EXPLICIT). - try_
stub_ hit_ readonly - Attempt to serve a
mode="full"cache hit ([unchanged …]) using only a shared borrow of the cache.