Previously total_chunks counted from process_file return (num_chunks)
which could differ from actual stored count if upsert silently failed.
Now using stored count returned by upsert_chunks.
Also fixes cli._index to skip progress yields when building result.
reindex() was consuming the full_index() generator but never calling
_write_sync_result(), leaving sync-result.json stale while CLI output
showed correct indexed_files/total_chunks.
Python's _resolve_data_dir() uses 'obsidian-rag' (no dot).
TypeScript was using '.obsidian-rag' (with dot) — mismatch caused
sync-result.json to never be found by the agent plugin.
Both readSyncResult() and probeAll() now mirror Python's
_resolve_data_dir() logic: dev detection (cwd/.obsidian-rag
or cwd/KnowledgeVault) then home dir fallback.
Previously readSyncResult always used cwd/.obsidian-rag (wrong for
server deployments) and probeAll resolved sync-result.json relative
to db path (wrong for absolute paths like /home/san/.obsidian-rag/).
- Section-split first for structured notes
- Large sections (>max_section_chars) broken via sliding-window
- Small sections stay intact with heading preserved
- Adds max_section_chars config (default 4000)
- 2 new TDD tests for hierarchical chunking
UUID-based chunk_ids caused merge_insert to treat same content as new rows
on each re-index run. Now uses SHA1(content_hash + index) for deterministic
chunk_ids — same section/text always produces same chunk_id.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
64 work packages across 5 phases and 15 work areas, organized
bottom-up through the layered protocol architecture. Includes
dependency map, critical path, parallelizable work, effort
estimates, and risk items.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add the original design spec (obsidian-rag-design.md) and the
comprehensive Technical Design Document covering the layered
protocol model (Transport, Session, Tool, Data), OpenClaw
interaction protocol, security layers, testing strategy, and
Windows development notes.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>