Modules§
- background_
shell - Explicit, in-process background jobs for
ctx_shell. - bounded_
lock - bypass_
hint - compaction_
sync - context_
gate - dynamic_
tools - The name logic lives in
lean_ctx::core::dynamic_tools; this module keeps the helpers that resolve a call throughctx_call/ctxto its inner tool. - elicitation
- helpers
- mcp_
idle - Idle behaviour of a stdio MCP server.
- multi_
path - native_
receipts - Host-owned native receipt handoff; never populated from MCP arguments.
- notifications
- permission_
inheritance - Pre-dispatch permission-inheritance gate.
- policy_
guard - Context-policy-pack enforcement for the MCP server pipeline (GL #673).
- predictive_
preload - Predict file reads before the agent asks for them.
- progress
- prompts
- reference_
store - registry
- resources
- role_
guard - Role-based tool access guard for the MCP server pipeline.
- roots
- schema_
hook - Server bridge for Context Kernel list-tools schema optimization.
- tool_
trait - tool_
visibility - The tool-visibility policy lives in
lean_ctx::core::tool_visibilityso engine code outside the MCP server can read it; re-exported here for the server’s own callers. - tools_
config_ watch - Detects tool-profile config changes at runtime and notifies MCP clients.
Constants§
- WORKFLOW_
PASSTHROUGH_ TOOLS - Tools that always pass through the workflow gate regardless of state.
Read-only tools should never be blocked — agents need them for context
recovery after crashes or session transitions. The server passes this
list to
tool_gateon both call paths.
Functions§
- build_
claude_ code_ instructions_ for_ test - build_
claude_ code_ static_ instructions_ for_ test - Deterministic STATIC Claude Code instructions (cold first-contact, no dynamic session/knowledge/gotcha payload) for the char-budget benchmark.
- build_
instructions_ for_ test - canonicalize_
arg_ aliases - Renames an alias to the canonical parameter when the tool declares the
canonical name but not the alias, and the caller sent only the alias. A
tool that declares the alias itself keeps its own meaning for it, and an
explicit canonical value always wins.
Nonewhen nothing changed, so the common call borrows the original map. - derive_
project_ root_ from - The project an MCP session started in
cwdbinds to. The dashboard binds a folder by the same rule, so both name one project the same way. - derive_
project_ root_ from_ cwd - is_
workflow_ stale - A workflow is stale if it hasn’t been updated in 30 minutes. This prevents dead workflows from blocking tools across sessions.
- register_
protected_ shell_ runner - Hand this executor to the protected supervisor
(
core::protected_execution), which runs brokeredctx_shellcommands with it. The CLI calls this at start-up; the first registration wins. - tool_
descriptions_ for_ test - tool_
schemas_ json_ for_ test