Surface Contract

July 17, 2026 ยท View on GitHub

DocPull aligns core workflows across CLI, Python SDK, and MCP, with each surface optimized for its user.

In this project, API means the Python SDK / library API. Hosted or remote HTTP APIs are outside the OSS release surface until separately promoted into a public contract.

Hosted execution is a product boundary, not a hidden default. The OSS surfaces own local evidence production, v3 pack contracts, budget/accounting policy, and agent-ready exports. Managed execution, schedules, browser/proxy infrastructure, profiles, queues, alerts, dashboards, collaboration, retention, SSO, audit logs, and SLAs remain future hosted concerns, not this release contract.

Surface Roles

SurfaceRoleShould optimize for
CLIFull human/operator workflow surfaceExplicit commands, diagnostics, file outputs, validation, export, and release workflows
Python SDK/APIStable programmatic coreTyped imports, fetch/config primitives, chunking, pack loading, and local search helpers
MCPCurated agent-safe tool surfaceStructured schemas, safe fetch/cache/search/read flows, source aliases, bounded pack actions

Parity Classes

ClassMeaning
Core-alignedThe capability should have a clear path across CLI, SDK/API, and MCP, even when names and options differ.
AdaptedThe capability exists across more than one surface, but each surface exposes the form that fits its user.
Surface-specificThe capability intentionally belongs to one surface and should not be forced everywhere for symmetry.

DocPull targets capability alignment, not 1:1 flag parity. MCP should not mirror every CLI flag, and the SDK should not grow convenience wrappers only to match MCP tool names.

Capability Matrix

CapabilityCLIPython SDK/APIMCPContract
Fetch one URLdocpull <url> --single or workflow_run(fetch)fetch_one, fetch_blocking, Fetcher, run_workflowfetch_url, workflow_runCore-aligned
Optional renderingdocpull <url> --render ..., docpull render ... --runtime local|vercel|e2b, trusted-target acknowledgement, cloud controls for live smoke, budget caps, prebuilt agent-browser templates, and E2B templatesRenderConfig, Renderer, AgentBrowserRenderer, VercelSandboxRenderer, E2BSandboxRenderer, estimate_cloud_render_cost_usd, render_url, render_url_to_directory, fetch configrender_url with runtime controls; fetch_url stays browser-freeCore-aligned
Crawl public web/sourcedocpull <url> with crawl/output flags and run-scoped resultFetcher, config models, run_workflow(crawl)ensure_docs, workflow_runCore-aligned
Output Markdown / NDJSON / SQLite / OKFCLI output flagsPipeline/config primitivesIndirect through fetched Markdown and pack toolsAdapted
List configured sourcesNot a primary CLI commanddocpull.mcp.sources internals, not public SDKlist_sourcesMCP-focused
List cached/indexed sourcesNot a primary CLI commandLocal filesystem/search helperslist_indexedMCP-focused
Project lifecycledocpull init, add, install, deps, sources, sync, diff, status, history, review, release context-pack, watch with explicit crawl boundsdocpull.project helpersNot exposed yetCore-aligned
Search cached sourcesSQLite/local search helpers where applicablesearch_sqlite_documentsgrep_docsAdapted
Read cached source by path/rangeFilesystem responsibilityFilesystem responsibilityread_docMCP-specific
Add/remove source aliasesPlugin/MCP workflow, not core CLISource internals, not public SDKadd_source, remove_sourceMCP-specific
Refresh/score/diff/audit context packsdocpull refresh, docpull pack score, docpull pack sources, docpull pack diff, docpull pack auditPack helper modules, refresh_pack, audit_packrefresh_pack, pack_score, pack_diff, audit_packCore-aligned
Build pack citations/entities/search/briefsdocpull pack citations, docpull pack entities, docpull pack search, docpull pack briefbuild_citation_map, extract_pack_entities, search_pack, build_research_briefpack_citations, pack_entities, pack_search, pack_briefCore-aligned
Prepare full pack intelligence bundledocpull pack prepareprepare_pack in docpull.pack_toolspack_prepareCore-aligned
Evidence-pack workflow protocolwebsite-pack, brand-pack, product-pack, styleguide-pack, image-pack, screenshot-pack, policy-pack, relationship-pack, dataset-packconcrete build_*_pack builders plus WorkflowRequest, run_workflow, async_run_workflowworkflow_run plus dedicated evidence tools including website_packCore-aligned
Tracker import bundledocpull pack intelligence-bundle (company-brain alias)build_intelligence_bundle (build_company_brain_bundle alias)intelligence_bundleCore-aligned
Context CI and eval-grade contextdocpull ci, docpull pack prepare --eval-grade, docpull pack validate --level evalrun_context_ci, validate_pack_contract, pack preparation helpersNot exposed yetCore-aligned
Build/query local source graphsdocpull graph build, docpull graph status, docpull graph query, docpull graph neighbors, docpull graph refreshbuild_graph, load_graph, graph_status, query_graph, graph_neighbors, refresh_graphgraph_build, graph_status, graph_query, graph_neighbors, graph_refreshCore-aligned
Local document/API/feed/typed ingestiondocpull parse, docpull openapi-pack, docpull feed-pack, docpull paper-pack, docpull repo-pack, docpull package-pack, docpull standards-pack, docpull dataset-pack, docpull transcript-pack, docpull wiki-packparse_documents, parse_one_document, build_openapi_pack, build_feed_pack, typed build_*_pack and async_build_*_pack helpersEvidence workflow lanes are exposed; other typed lanes remain SDK/CLI adaptedAdapted
Source policy filesdocpull policy validate, docpull policy explain, and policy-aware core workflowsPolicyConfig in docpull.policyvalidate_policy over the same typed configCore-aligned
Budget/accounting policy--budget, --explain-route, run.accounting.json, policy budget.maximum_paid_cost_usdBudgetConfig, accounting helpers, PolicyConfig.budgetbudget on explicit cloud rendering toolsCore-aligned
Exports, local pack server, and report sharingdocpull export for JSONL, Sheets CSV/TSV, n8n JSON, Vercel AI JSON, CrewAI JSON, warehouse NDJSON, Parquet, and agent references; docpull serve; docpull share for Markdown/HTML report URLsexport_pack, create_pack_app, create_report_server, render_report_document, load_packexport_pack, serve_pack_statusAdapted
Monitorsdocpull monitor init/run/trigger/pause/unpause/list/report/scheduler-snippetmonitor helpersNot exposed; monitor runs remain CLI/operator-ownedSurface-specific
Doctor diagnosticsdocpull --doctor, docpull render --checkDiagnostic module, check_agent_browser_availabilityNot exposedCLI/operator-specific
Real-data acceptance smokepython scripts/release_a_plus_check.py --strict; python scripts/real_feature_smoke.py --json --full-mcp --strict-ci --auth-matrix --monitor-soak-minutes 10 with optional --include-cloudNot public SDKNot exposedCLI/operator-specific

Stability Rules

  • Runtime behavior should not change only to make surfaces look symmetric.
  • New core workflows should first define the durable capability, then choose the right form for each surface.
  • Legacy provider, parity, and benchmark modules are private experiments unless they are listed in this contract.
  • Public docs should say "CLI, Python SDK/API, and MCP" when describing local OSS surfaces.
  • MCP tool additions should be agent-safe, schema-first, and narrower than the CLI unless there is a clear agent use case.