Skip to main content

F0.1 — Performance budgets & workflow scope

The explicit performance contract for the program. Numbers are targets, measured on the large local fixture (F0.4) via the harness (F9.1), warm cache excluded unless noted. p50/p95 are server-side latency for the API call; CLI/MCP add transport + (de)serialization on top, which is why payload ceilings and connection reuse (F4.2) matter as much as query time.

Latency budgets (hot workflows)

WorkflowSurfaceEndpoint / toolp50p95
List MCP toolsMCPtools/list50 ms150 ms
Topic searchAPI/MCP/CLIdriftless_context_search, GET /topics/search120 ms350 ms
Unified retrieveAPI/MCP/CLIcontext retrieve (F1.5)150 ms400 ms
Topics for filesAPI/MCP/CLIdriftless_context_get_for_files, GET /topics/match-files120 ms350 ms
Topic getAPI/MCP/CLIdriftless_context_get, GET /topics/:slug60 ms180 ms
Project card nextAPI/MCP/CLIdriftless_project_card action:next100 ms300 ms
Collection recordsAPI/MCP/CLIdriftless_collection_record list120 ms350 ms
Broker operationsAPI/CLIGET …/broker/connections/:provider/operations250 ms*800 ms*
Broker invokeAPI/CLIPOST …/broker/connections/:provider/invokebound by providerbound by provider
* Broker operations/invoke cross the Nango boundary and a live provider; their budget is the Driftless overhead around the provider call (auth, lookup, audit write), not the provider’s own latency. Cache operation metadata (F7.2/F7.3) so listing operations does not require a live round-trip on every invoke.

Payload ceilings (single read response, JSON, uncompressed)

ReadDefault ceilingNotes
tools/list60 KBcompact schemas (F3.1); paginate beyond (F3.2)
list/search results page40 KBenforce limit, default view=brief
single topic (full)50 KBbrief view drops content/components
project card next bundle40 KBbundle resolved by view (F5.5)
collection records page40 KBpaginate (F6.2)
broker records page40 KBhard-cap output size (F7.4)
Ceilings are enforced by regression tests (F2.2) and the gates in gates.md. Hard backstop (T7): every MCP tool response — static and synthesized — passes through a byte governor at ToolRegistry.call capped at 50 KB (DRIFTLESS_MCP_RESPONSE_MAX_BYTES overrides). Under the cap responses are verbatim; over it the largest lists/strings are shrunk and the response carries truncated: true + a hint (never a silent cut). The per-read ceilings above are what well-behaved envelopes should hit; the governor is the guarantee that an unbounded upstream payload (e.g. a raw provider operations list) can never flood an agent’s context. Enforced by apps/mcp/src/tools/response-budget.spec.ts with worst-case fixtures.

Retrieval quality bars

Measured by the ranking eval harness (F1.6) on a labeled query set:
  • Recall@10 ≥ 0.90 — the right topic is in the top 10 for known queries.
  • MRR ≥ 0.70 — the right topic ranks high, not just present.
  • No regression vs the current ranking on the labeled set when search moves to indexed full-text (F1.2) and match-files candidate selection is redesigned (F1.3).

Scope (workflows in this program)

Topics (search / retrieve / get-files / get), Projects (card next / list / get), Collections (records / context / retrieve), Integrations/Broker (operations / invoke / records), sync, and context retrieval. Dashboard/web read paths are out of scope except where they reuse the same API endpoints being optimized.