sdl.slice.build
Builds a task-scoped dependency subgraph from entry symbols, returning the most relevant symbols for a given task within a token budget. Starting from one or more entry symbols (or a natural-languagetaskText for auto-discovery), performs a BFS/beam search across the dependency graph. Edges are weighted by type: call (1.0) > config (0.8) > import (0.6). The search expands outward, scoring each symbol by relevance, and stops when the token budget is reached or the confidence threshold drops below minConfidence.
The result is a slice containing symbol cards, their interconnecting edges, a frontier of symbols just outside the slice boundary, and a handle for subsequent refresh operations.
taskText alone is sufficient to build a slice — it triggers auto-discovery of relevant symbols via hybrid retrieval (FTS + vector + RRF) or legacy full-text search. Adding entrySymbols improves precision.Parameters
Repository identifier.
Natural language task description. Can be used alone (without
entrySymbols) to auto-discover relevant symbols.Symbol IDs to start the BFS from. Maximum 100.
Recently edited file paths whose symbols (and callers) are forced into the slice. Maximum 100.
Stack trace to bias the slice toward call-path symbols.
Path to a failing test file to bias toward code under test.
Token and card budget constraints.
Drop edges below this confidence threshold. Default:
0.5. Range: 0–1.Filter call edges specifically below this confidence. Range: 0–1.
Map of
symbolId → ETag. Matching cards return as cardRefs instead of full cards, reducing token cost.Detail level for cards in the slice. Leave unset for mixed adaptive detail.
Let the system choose detail level per card based on relevance.
Response encoding. Default:
"compact".Compact format version. Default:
2. V2 deduplicates file paths and edge types into lookup tables; V3 adds grouped edge encoding.Include call resolution details on cards.
Include related development memories in the response.
Maximum memories to include. Default:
5.Include retrieval evidence showing how start-node seeds were discovered.
Response
Handle for refresh and spillover operations.
The ledger version this slice is based on.
Slice validity window:
{expiresAt, minVersion, maxVersion}.{handle, version, sliceHash} for conditional refresh.The graph slice content.
Present when
includeRetrievalEvidence: true.Token Guidance
- Start with
budget: {maxCards: 30, maxEstimatedTokens: 4000} - Use
knownCardEtagson subsequent calls to avoid re-sending unchanged cards - Raise
minConfidenceto 0.8+ for precision-focused work; keep at 0.5 for broader recall - Use
editedFilesto bias the slice toward recently changed code
Examples
sdl.slice.refresh
Incrementally updates an existing slice handle, returning only the delta (changed symbols) since the last known version. If nothing changed, returnsnotModified: true. This avoids rebuilding the entire slice from scratch after code changes.
Parameters
Handle from a previous
sdl.slice.build.The ledger version your client last saw.
Response
The same handle.
The version you sent.
The current ledger version.
True if nothing changed since
knownVersion.A delta pack scoped to the slice’s symbols. Present when changes exist.
Updated lease.
Example
sdl.slice.spillover.get
Fetches overflow symbols that didn’t fit within the slice’s token budget, via paginated access. When a slice is truncated, the truncation metadata includes aspilloverHandle. This tool uses that handle to page through the remaining symbols.
Parameters
Handle from
sdl.slice.build truncation metadata.Pagination cursor from the previous page.
Number of symbols per page. Range: 1–100. Default:
20.Response
Same handle.
Cursor for the next page.
Whether more pages exist.
Array of full symbol cards.
Example
sdl.delta.get
Computes a semantic diff between two ledger versions, including blast radius analysis. Compares two versions of the ledger and returns all changed symbols with their signature diffs, invariant diffs, and side-effect diffs. For each changed symbol, computes a blast radius — the set of dependent symbols that may be affected, ranked by distance, fan-in, test proximity, and process participation.Parameters
Repository identifier.
Starting version ID.
Ending version ID.
Constrain output size:
{maxCards, maxEstimatedTokens}.Response
The delta pack.
Symbols with rapidly growing fan-in:
{symbolId, growthRate, previous, current}. These symbols amplify blast radius as more dependents accrue.Example
sdl.context.summary
Generates a structured, token-bounded context briefing for any query against the codebase. Assembles a budget-constrained context package from four sections: key symbols, dependency graph, risk areas, and files touched. Results are cached byrepoId + indexVersion + query.
Scope is auto-detected from the query:
- Contains
/,\, or a file extension →"file" - Contains 3+ words or task-related words →
"task" - Otherwise →
"symbol"
Parameters
Repository identifier.
Natural-language query, file path, or symbol name.
Token budget for the summary. Default:
2000.Output format. Default:
"markdown".Query scope. Auto-detected if omitted.
Response
Repository identifier.
Output format used.
The rendered summary string (markdown or JSON).
Structured summary data.
Example
sdl.pr.risk.analyze
Analyzes the risk of a code change between two versions, producing a scored risk assessment with findings, blast radius, and test recommendations. Computes a delta between two versions, then analyzes changes for risk patterns: high-fan-in symbol modifications, signature changes on widely-used interfaces, side-effect changes, missing test coverage, and more.Parameters
Repository identifier.
Starting version ID.
Ending version ID.
Only return findings above this risk score. Range: 0–100.
Response
Risk analysis results.
Whether the risk level warrants review escalation.
{decision, deniedReasons, auditHash}.