/** * Bundle builder for get_symbol_context. * * Accepts a resolved SymbolId plus options and assembles the fused * bundle by pulling from: storage (intent + git), the adapter (refs, * types, diagnostics), and a test-file classifier (tests bucket). * * Returns the `SymbolContextBundle` shape from src/types.ts; compact * rendering happens downstream in src/formatters/compact.ts. */ import type { DatabaseInstance } from "../storage/db.js"; import type { BundleDepth, BundleSignal, LanguageAdapter, Symbol as AtlasSymbol, SymbolContextBundle } from "../types.js"; export declare const ALL_SIGNALS: readonly BundleSignal[]; /** * Default set applied when the caller does not pass `include`. * All five signals. ADR-11 wires git into the default set: with the * index-time git extractor populated, the primitive's "return * everything in one call" philosophy finally covers every axis. */ export declare const DEFAULT_SIGNALS: readonly BundleSignal[]; export interface BuildBundleDeps { db: DatabaseInstance; adapter: LanguageAdapter; /** * Pre-computed flag indicating atlas substrate is consistent with * current git HEAD. When true + scope is atlas-only-safe (per * {@link isAtlasOnlySafeScope}), buildBundle skips all adapter calls * (~500ms-per-query optimization). * * Optional with default false for backward compatibility; handler * computes via {@link detectAtlasOnlyAvailable} per-request and * threads through. Per A4 (v0.5-candidates #4 fix shape; v0.6 Step * 3.1 implementation per Q3.0.4 + Q3.0.6 locks). */ atlasOnlyAvailable?: boolean; } /** * Classifies whether the requested bundle scope can be answered without * adapter calls (atlas-only-safe) vs requires LSP-live data * (lsp-live-required). Per A4 + Q3.0.4 lock at v0.6 Step 3.0: * refs/types/tests need adapter; intent/git satisfied by db alone. */ export declare function isAtlasOnlySafeScope(options: BuildBundleOptions): boolean; export interface BuildBundleOptions { symbol: AtlasSymbol; depth: BundleDepth; include: readonly BundleSignal[]; maxRefs: number; /** * Threshold for the `hot` flag + `recentCommits` cap. Mirrors * `config.git.recentCommits` — same knob, same meaning (ADR-11). * Optional so existing callers that never include the "git" signal * don't have to thread a value through. Defaults to * {@link DEFAULT_GIT_BUNDLE_RECENT} when absent. */ gitRecentCommits?: number; /** * Optional BM25 query string for ranking the intent block (ADR-16, * v0.3 Theme 1.2 Fix 3; v0.8 Step 1 activation amendment). When * present, claims attached to the symbol are FTS5 BM25-ranked * against this query, then tiebroken by severity → source → * claim_id. When absent, falls back to v0.2 deterministic * ordering (severity → source → claim_id). * * **API-level contract.** This option's presence at the * `buildBundle` boundary tracks the actual ranking path: option * present → BM25; option absent → v0.2 fallback. Guarded by the * v0.2-equivalence canary in * `src/queries/symbol-context.test.ts` (CANARY 1). * * **Handler-layer gating** (see HandlerDeps in * `src/mcp/handlers/get-symbol-context.ts`): pre-v0.8 the handler * applied two-layer gating (server flag AND caller query both * required); v0.8 Step 1 amends to server-flag-only with * symbol-name synthesis when caller-query absent. This option's * API-level contract is unchanged — only the handler's decision * about WHEN to set this option moved. Callers that build * bundles directly (tests, scripts) retain full control over * BM25 vs v0.2 path via option presence. * * Differs from find_by_intent's BM25 chain: NO name-overlap * tiebreaker, since all claims for a single symbol share the same * symbol name (the tiebreaker would be degenerate). See ADR-16 * Decision section. */ bm25Query?: string; } /** * Fallback used when the caller omits `gitRecentCommits`. Matches * `DEFAULT_GIT_RECENT_COMMITS` in config/defaults.ts — same knob, same * meaning — kept as its own constant to avoid an import cycle between * query and config layers. */ export declare const DEFAULT_GIT_BUNDLE_RECENT = 5; export declare function buildBundle(deps: BuildBundleDeps, options: BuildBundleOptions): Promise; export declare function moduleKeyForPath(path: string): string; //# sourceMappingURL=symbol-context.d.ts.map