Skip to main content

Module server

Module server 

Source

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 through ctx_call/ctx to 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_visibility so 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_gate on 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. None when nothing changed, so the common call borrows the original map.
derive_project_root_from
The project an MCP session started in cwd binds 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 brokered ctx_shell commands with it. The CLI calls this at start-up; the first registration wins.
tool_descriptions_for_test
tool_schemas_json_for_test