Skip to main content

Module ctx_read

Module ctx_read 

Source

Structs§

ReadOutput
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_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.
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.