Skip to content

Phase 1c: recall index command (incremental, batch persist) #201

Description

@edheltzel

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

  1. src/commands/index-code.ts + wire in src/index.ts (per AGENTS.md "add a CLI command").
  2. recall index [--changed]: full index, and incremental via code_files.content_hash (skip unchanged files — design §1.2 / no-daemon constraint).
  3. 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).
  4. 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.

Metadata

Metadata

Assignees

Labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions