Parent epic: #196 · Phase 1 · Depends on #1a + #1b. Spec: .agents/atlas/plans/2026-06-25-kg-schema-design.md §4 + §9 R1.
Goal
The recall index [--changed] command — the authoritative, no-daemon, on-demand indexing entrypoint (design §4: command-first; optional spawn-hook deferred to Phase 2+).
Scope
src/commands/index-code.ts + wire in src/index.ts (per AGENTS.md "add a CLI command").
recall index [--changed]: full index, and incremental via code_files.content_hash (skip unchanged files — design §1.2 / no-daemon constraint).
- Batch persist (R1 — the spike only persisted ONE file; full-tree batch is unproven). Persist nodes/edges for the whole tree in a transaction, routing any input-scaled
IN(...)/multi-row VALUES through src/lib/chunk.ts chunked() (AGENTS.md invariant; chunk-audit guard).
- Repo-root detection (
git rev-parse --show-toplevel, fallback explicit root) for path sanitization (§6).
Required
/ce-worktree then /ce-work · ground codebase questions in /codegraph · /KarpathyGuidelines.
Success criteria (Themis RedTeam-gates)
recall index indexes Recall's src/ end-to-end and persists a full graph (all files, not one) — verified by row counts vs file count.
recall index --changed re-indexes only content-hash-changed files (demonstrated by touching one file).
- chunked() used for any input-scaled bind list;
bun test + chunk-audit green; no daemon/watcher introduced.
Parent epic: #196 · Phase 1 · Depends on #1a + #1b. Spec:
.agents/atlas/plans/2026-06-25-kg-schema-design.md§4 + §9 R1.Goal
The
recall index [--changed]command — the authoritative, no-daemon, on-demand indexing entrypoint (design §4: command-first; optional spawn-hook deferred to Phase 2+).Scope
src/commands/index-code.ts+ wire insrc/index.ts(per AGENTS.md "add a CLI command").recall index [--changed]: full index, and incremental viacode_files.content_hash(skip unchanged files — design §1.2 / no-daemon constraint).IN(...)/multi-rowVALUESthroughsrc/lib/chunk.tschunked()(AGENTS.md invariant; chunk-audit guard).git rev-parse --show-toplevel, fallback explicit root) for path sanitization (§6).Required
/ce-worktreethen/ce-work· ground codebase questions in/codegraph·/KarpathyGuidelines.Success criteria (Themis RedTeam-gates)
recall indexindexes Recall'ssrc/end-to-end and persists a full graph (all files, not one) — verified by row counts vs file count.recall index --changedre-indexes only content-hash-changed files (demonstrated by touching one file).bun test+ chunk-audit green; no daemon/watcher introduced.