Skip to main content

Module protocol

Module protocol 

Source

Structs§

InstructionTemplate

Functions§

detect_project_root
Finds the outermost project root by walking up from file_path. For monorepos with nested .git dirs (e.g. mono/backend/.git + mono/frontend/.git), returns the outermost ancestor containing .git, a workspace marker, or a known monorepo config file — so the whole monorepo is treated as one project.
detect_project_root_or_cwd
encode_instructions
Encode an instruction suffix using short codes with budget hints. Response budget is dynamic based on task complexity to shape LLM output length.
encode_instructions_with_snr
Encode instructions with SNR metric for context quality awareness.
format_savings
instruction_decoder_block
Build the decoder block that explains all instruction codes (sent once per session).
shorten_path