Skip to main content

Module layered

Module layered 

Source
Expand description

Per-session layered-pipeline state for the MCP server.

Wraps a devboy_format_pipeline::layered_pipeline::LayeredPipeline in Arc<Mutex<…>> so it can sit in McpServer (which takes &self in handlers) and still be advanced through the L0 dedup cache. The pipeline is created once per server process and persists across all tools/call requests on that connection.

Wiring contract:

  • On every successful tools/call, the server invokes SessionPipeline::process with the raw response text. A hint is returned when the L0 cache fires, otherwise the unmodified body passes through (L1/L2 encoders are typed-domain and live in devboy-format-pipeline::Pipeline; this hot path covers cross-turn dedup only).
  • Mutating tools (Edit / Write / MultiEdit / NotebookEdit) call SessionPipeline::invalidate_file before the cache is consulted on the next Read, ensuring the agent sees fresh contents after an edit.
  • On /compact (host-side compaction), the host calls SessionPipeline::on_compaction_boundary to advance the partition counter and drop entries that would otherwise outlive the cache window.

Structs§

SessionPipeline
Per-session pipeline handle. Cloneable; holds an Arc to the inner LayeredPipeline plus Paper 3 enricher state (recent-tools window, effectiveness counters, fail-fast circuit).

Functions§

extract_file_path
Pull file_path / path / notebook_path out of a tool call’s arguments. Tools not in the file-operating family produce None.
is_mutating_tool
True iff name is a mutating file-operating tool. Server uses this to fire a cache invalidation before the tool is dispatched.