Skip to content

feat: lat.md integration, knowledge cross-references, and integrity checking#65

Merged
BYK merged 1 commit intomainfrom
feat/lat-md-integration
Apr 13, 2026
Merged

feat: lat.md integration, knowledge cross-references, and integrity checking#65
BYK merged 1 commit intomainfrom
feat/lat-md-integration

Conversation

@BYK
Copy link
Copy Markdown
Owner

@BYK BYK commented Apr 13, 2026

Summary

  • lat.md/ reader: Automatically indexes sections from lat.md knowledge graph files. Sections are FTS5-indexed and included in recall results via RRF fusion. Relevant sections are injected into the system prompt alongside LTM entries. Content-hash-based change detection skips unchanged files on re-scan.

  • Knowledge cross-references: Entries can link to each other with [[uuid]] (curator — O(1) lookup) or [[Title Text]] (human AGENTS.md edits — FTS5 search). Tracked in knowledge_refs join table. Dead refs are auto-cleaned when entries are deleted or consolidated.

  • Integrity checking: ltm.check() detects duplicate entries (by FTS5 title similarity), oversized content (>1200 chars), and empty entries. Runs after curation/consolidation on idle.

Changes

File What
src/lat-reader.ts NEW — lat.md parser, section extraction, FTS indexing, scored search
src/db.ts Migration 10: lat_sections + FTS5 + knowledge_refs tables
src/reflect.ts lat-section source in RRF fusion
src/ltm.ts resolveRef, extractRefs, syncRefs, cascadeRefReplace, cleanDeadRefs, check(), lat.md sections in forSession()
src/index.ts Startup + idle lat-reader refresh, dead-ref cleanup
src/curator.ts syncRefs after create/update
src/prompt.ts Cross-reference guidance in curator prompt
src/search.ts Export filterTerms()
README.md lat.md compatibility section, cross-references
package.json Version bump 0.7.1 → 0.8.0
test/lat-reader.test.ts 10 tests
test/refs.test.ts 11 tests
test/integrity.test.ts 4 tests

329 tests pass, 0 failures.

…hecking

Add three new capabilities inspired by lat.md's knowledge graph approach:

1. lat.md/ directory reader — automatically indexes sections from lat.md/
   files into FTS5, includes them in recall results via RRF fusion, and
   injects relevant sections into the system prompt alongside LTM entries.
   Content-hash-based change detection skips unchanged files.

2. Knowledge cross-references — entries can link to each other via [[uuid]]
   (curator, O(1) lookup) or [[Title Text]] (human edits, FTS5 search).
   Refs are tracked in a knowledge_refs join table. Dead refs are cleaned
   automatically when entries are deleted or consolidated.

3. Integrity checking — ltm.check() detects duplicate entries, oversized
   content, and empty entries. Runs after curation/consolidation on idle.

DB migration 10 adds lat_sections + FTS5 and knowledge_refs tables.
Bumps version to 0.8.0.
@BYK BYK enabled auto-merge (squash) April 13, 2026 21:36
@BYK BYK merged commit 7fa809f into main Apr 13, 2026
1 check passed
@BYK BYK deleted the feat/lat-md-integration branch April 13, 2026 21:36
@craft-deployer craft-deployer bot mentioned this pull request Apr 13, 2026
2 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant