Description
Playbook-Scoped Search converts an invoked Power-Up Playbook's source definition into a closed, access-filtered row set before retrieval begins. It can combine explicitly named rows, whole readable Dotabases, saved vault queries, and bounded knowledge-graph expansion. The resulting rowIds set is passed into Universal Search and the vault tool policy, making the same scope wall apply to both direct search and agentic retrieval.
The resolver treats scope as an authority-bearing decision. An unreadable source, access-resolution failure, query failure, whole-Dotabase enumeration failure, or graph-expansion failure returns an empty scope and reports the error; it never falls back to the full corpus or a partial authoritative set. Successful resolution reports counts, truncation, emptiness, and duration for operational visibility.
Selling Points
- A Playbook can promise that its retrieval stays inside named knowledge sources, not merely suggest that boundary in a prompt.
- Human search and agent tools share the same materialized row wall, reducing behavioral drift between interactive and automated use.
- Fail-closed resolution prevents a broken source query from silently widening an agent's reach.
- Bounded query, expansion, and total-row caps keep complex scopes predictable under large workspaces.
- Readable-Dotabase filtering is applied before members enter the final set, preserving the caller's access boundary.
User Story
A team invokes a due-diligence Playbook configured to use only a particular research Dotabase and the rows connected to its approved sources. The resolver materializes that scope, search returns only those members, and the agent's vault tools receive the same restriction. The team walks away with an answer whose retrieval boundary matches the Playbook they selected.
Extension Surface
Configurable is the first true rung because users shape the capability through Playbook source declarations consumed by packages/search/src/internal/scope/playbook-scope-resolver.ts. The implementation has injected query, row, access, graph, and observability seams, but there is no public registration point for a new source kind; extending the source vocabulary requires code.
Capabilities & Limits
- Resolves explicit rows, whole Dotabases, vault queries, and graph-expanded members into one deduplicated set.
- Distinguishes absent scope from present-empty scope in both filter normalization and execution.
- Suppresses the ordinary search graph-expansion stage because expansion has already been authority-resolved.
- Limits: vault-query members are capped at 200 and the resolved row set at 2,000; truncation is reported.
- Limits: any materialization-leg failure produces an empty scope, so availability is intentionally traded for boundary safety.
Implementation Map
packages/search/src/internal/scope/playbook-scope-resolver.tsapps/web/src/composition/playbook-scope-wiring.tspackages/search/src/internal/types.tsrowIdspackages/api/src/schemas/search.tspackages/mcp/src/tools.ts