/** * `dim bootstrap` — instant brain on day one (kills the cold-start problem). * * Surveys the repo (README/docs/ADRs, manifests, directory shape, git churn) * and LLM-extracts an initial set of falsifiable memory candidates, each with * a suggested STATIC_CHECK where one makes sense. Everything lands in the * proposal queue (source `bootstrap`) — `dim review` remains the trust gate. */ import type { MemoryStore } from "../db/store.js"; export interface BootstrapResult { proposed: number; duplicates: number; provider: string | null; surveyedFiles: string[]; alreadyBootstrapped: boolean; } /** Top-level directory listing, two levels deep — enough shape without noise. */ export declare function surveyTree(repoRoot: string): string; /** Most-changed files in recent history — where the action (and the gotchas) live. */ export declare function surveyChurn(repoRoot: string, maxCommits?: number, top?: number): string; export declare const BOOTSTRAP_INSTRUCTIONS = "You are bootstrapping a \"repo brain\" for an AI coding assistant memory system. Below is a survey of a codebase: its docs, manifests, directory shape, and most-changed files.\n\nExtract the durable, project-specific knowledge as FALSIFIABLE claims. Rules:\n\n1. PRIORITIZE ARCHITECTURE AND TECH STACK. The most valuable claims describe what the project IS and how it's built: \"This is a React + TypeScript SPA that wraps a D3.js graph visualization for a memory-verification tool, with a Node.js/Express API server in src/ui/server.ts and a SQLite-backed store in src/db/store.ts\". Start with 1-3 ARCHITECTURE claims about the project's purpose, tech stack, and component layout before drilling into conventions.\n2. BE SPECIFIC but NOT TRIVIAL. Every claim must explain WHY something matters, not just THAT it exists. Bad: \"The project uses a specific directory structure, with separate directories for api, db, knowledge, and src\" (just parroting the tree \u2014 every repo has directories). Good: \"All DB access goes through src/db/store.ts which wraps better-sqlite3; no other file imports better-sqlite3 directly\". Bad: \"Code completion is configured via Copilot in .vscode/settings.json with telemetry disabled\" (trivial config). Bad: \"The project has no verified memories yet\" (transient state). Bad: \"The project uses a specific file format for README files\" (trivial).\n3. REJECT generic statements. If a claim could apply to any repo, discard it. \"Uses TypeScript\" is useless. \"All API handlers in src/api/ must extend BaseHandler and register via src/api/registry.ts\" is useful. If your claim is just listing what directories exist, discard it \u2014 describe what the code IN those directories does and how the pieces connect.\n4. Only facts THIS survey supports \u2014 architecture, conventions, decisions, invariants, build/deploy procedures (SKILL), behavioral rules (GUARDRAIL with guardrail_level never|ask-first|always). Do NOT invent or pad.\n5. Write each claim as a checkable statement scoped with the actual paths from the survey.\n6. Where possible, include \"static_check\": a cheap shell command (grep/test/ls) that exits 0 iff the claim holds. Omit it when no honest check exists.\n7. kinds: DECISION, CONVENTION, GOTCHA, FAILED_APPROACH, ARCHITECTURE, INVARIANT, GUARDRAIL, SKILL, TODO_CONTEXT.\n8. Extract 3\u201320 claims. Quality over quantity. If the survey has little real signal, return fewer \u2014 zero is acceptable.\n\nRespond with ONLY a JSON object:\n{\"claims\":[{\"kind\":\"ARCHITECTURE\",\"claim\":\"This is a React + TypeScript SPA that renders a D3.js force-directed graph of memory nodes; the UI is a single HTML file generated from src/ui/page.ts, served by an Express API in src/ui/server.ts backed by SQLite in src/db/store.ts\",\"paths\":[\"src/ui/page.ts\",\"src/ui/server.ts\",\"src/db/store.ts\"],\"symbols\":[],\"guardrail_level\":null,\"rationale\":\"from package.json deps + directory structure\",\"static_check\":\"grep -q 'd3' package.json && test -f src/ui/page.ts && test -f src/ui/server.ts\"}]}"; /** Turn a repo survey into an initial proposal set. */ export declare function bootstrapRepo(store: MemoryStore, repoRoot: string, opts?: { force?: boolean; }): Promise;