Skip to content

itdove/lore#16: Ingester framework: LoreIngester ABC + adapters - #81

Merged
itdove merged 1 commit into
mainfrom
16
Jul 26, 2026
Merged

itdove merged 1 commit into
mainfrom
16

Conversation

@itdove

@itdove itdove commented Jul 26, 2026

Copy link
Copy Markdown
Owner

Got full context. Here's the filled template:

Description

Implements the ingester framework (#16): LoreIngester ABC with ETL pipeline (extract → transform → dedup → load), a plugin registry with auto-detection, and two concrete adapters (OpenWolf, ReasonsForge).

Key changes:

  • LoreIngester ABC (ingest/base.py) — defines detect(), extract_delta(), transform(), load(), and a run() orchestrator with cosine-distance dedup at ingest time
  • Ingester registry (ingest/registry.py) — @register decorator, detect_ingesters() for auto-detection, get_ingester() for named lookup
  • OpenWolf adapter (ingest/openwolf.py) — ingests .wolf/cerebrum.md and .wolf/buglog.json, hook-triggered
  • ReasonsForge adapter (ingest/reasonsforge.py) — ingests reasons.db SQLite entries, hook+manual triggered
  • CLI expanded: lore ingest --source <name> [--since], --list, --detect
  • Session-end hook (lore hook capture) auto-detects and runs hook-triggered ingesters
  • Config model gains IngestConfig with enabled toggle and disabled_sources list
  • Provenance tracking via ingested_from metadata on every entry

Assisted-by: Claude

Testing

Steps to test

  1. Pull down the PR
  2. Run unit tests: python -m pytest tests/unit/test_ingest_*.py -v
  3. List available ingesters: lore ingest --list
  4. In a project with .wolf/ directory: lore ingest --detect (should show openwolf)
  5. Ingest from a specific source: lore ingest --source openwolf
  6. Ingest with date filter: lore ingest --source reasonsforge --since 2026-01-01
  7. Run session-end hook in a project with .wolf/: lore hook capture (should auto-detect and ingest)

Scenarios tested

  • Registry lists all registered ingesters and detects only those present in project directory
  • OpenWolf adapter parses cerebrum.md sections and buglog.json entries into KnowledgeEntry objects
  • ReasonsForge adapter reads from reasons.db with optional --since filtering
  • Dedup skips entries with cosine distance below threshold at same knowledge level
  • Dedup gracefully degrades when no embedding provider configured
  • Disabled sources in config are excluded from auto-detection
  • CLI error cases: unknown source name, source not detected in directory, missing args

Deployment considerations

  • This code change is ready for deployment on its own
  • This code change requires the following considerations before being deployed:

- Add ingester registry with detect/list/get pattern and plugin architecture
- Add OpenWolf and ReasonsForge ingesters with hook-triggered capture
- Integrate hook-triggered ingesters into capture command flow
- Add dedup logic to base ingester to skip already-stored entries
- Expand CLI ingest command with --source, --since, --list, --detect flags
- Add config model for ingest settings (enabled, disabled_sources)

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
@itdove
itdove marked this pull request as ready for review July 26, 2026 14:31
@itdove
itdove merged commit dc9e778 into main Jul 26, 2026
6 checks passed
@itdove
itdove deleted the 16 branch July 26, 2026 14:31
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