import type { EngramClient } from "../clients/engram.js"; /** * `cortex backfill workspace --slug ` — audit Phase 1b workspace * filter coverage. * * Phase 1b's `_workspace-filter.ts` excludes memories whose * `metadata.workspace` doesn't match the per-request workspace slug, * including memories with NO workspace stamp at all (legacy ingests * pre-session-scoping). Without a way to stamp those rows, they're * permanently invisible to workspace-scoped widgets. * * This CLI quantifies that population: counts how many memories lack * a workspace stamp and would benefit from a backfill, samples a few * for spot-check, and reports. * * Why it doesn't actually mutate yet: Engram exposes no * memory_update / memory_add_tag tool. The CLI's write path is gated * on an engram-side additive API (per north-star: engram changes are * generic non-breaking additions, not Cortex-specific hooks). When * that ships, this command flips from audit-only to actually-stamp * with the same flag surface — `--dry-run` already false-by-default. * * Until then: `--dry-run` is the only behavior, even when omitted. * The audit output is enough to plan the cutover (decide whether * legacy memories matter for your workflow before pushing for the * engram tool). */ export interface BackfillCliOptions { slug: string; dryRun: boolean; limit: number; searchQuery?: string; } export declare function parseBackfillArgs(argv: readonly string[]): BackfillCliOptions | { error: string; }; export interface BackfillReport { totalScanned: number; unstamped: number; alreadyStamped: { matchesSlug: number; differentSlug: number; }; sample: Array<{ id: string; preview: string; date?: string; project?: string; }>; } /** * Pure logic — separated from runBackfillCli so tests can drive it * with a mock engram client without the cortex config / LLM router / * memory bootstrap dance. */ export declare function buildBackfillReport(engram: Pick, opts: { slug: string; limit: number; query?: string; }): Promise; export declare function runBackfillCli(argv: readonly string[]): Promise; //# sourceMappingURL=backfill.d.ts.map