Skip to content

feat(knowledge): add knowledge ingest CLI, ledger, and notes sink (#5016, #5017, #5018)#5040

Merged
bug-ops merged 2 commits into
mainfrom
5016-knowledge-ingest-ledger-cli
Jun 7, 2026
Merged

feat(knowledge): add knowledge ingest CLI, ledger, and notes sink (#5016, #5017, #5018)#5040
bug-ops merged 2 commits into
mainfrom
5016-knowledge-ingest-ledger-cli

Conversation

@bug-ops

@bug-ops bug-ops commented Jun 7, 2026

Copy link
Copy Markdown
Owner

Summary

Implements the knowledge-ingest feature foundation (spec-067, M29):

  • IngestLedger (zeph-memory, knowledge ingest: ingest ledger table + IngestLedger repository (re-read guard) #5016) — idempotency re-read guard shared by both ingest sinks. Dual migrations (sqlite/102, postgres/103). ingested_at stored as ISO-8601 TEXT in both dialects to avoid the TIMESTAMPTZ→String decode bug. INV-5 semantics (cost guard only, not drift guard) documented in rustdoc and surfaced to operators.
  • CLI scaffold + config (knowledge ingest: zeph knowledge CLI scaffold + [knowledge] config + init/migrate-config #5017) — zeph knowledge ingest|rollback|status with KnowledgeSource ValueEnum (specs, changelog, handoff, coverage, git-log). [knowledge] config section with #[serde(default)] on all fields. Migration step 60 adds the section idempotently. --init wizard emits [knowledge] only for non-default values.
  • Notes sink (knowledge ingest: static artifacts -> semantic notes via existing IngestionPipeline #5018) — ingests static project artifacts into Qdrant via the existing IngestionPipeline (no new loader, DRY). Ledger skip prevents re-embedding unchanged files. --dry-run reports file count, projected chunks, and estimated embed tokens without writing anything. source_uri threaded into Qdrant payload (M1). INV-1 (no graph writes), INV-6 (path allowlist enforced on both sides). Tracing spans on all I/O paths (CLAUDE.md compliance).

Key invariants held

  • INV-1: zero graph writes (entities=0, edges=0 in mark_ingested, no graph_edges/graph_entities touched)
  • INV-5: IngestLedger is a cost guard only — stale Qdrant points on content change are a documented MVP limitation
  • INV-6: both project root and each source path canonicalized before starts_with() check (macOS /private symlink-safe)

Test plan

  • cargo nextest run -p zeph-memory --lib -E 'test(ingest)' — 8/8 IngestLedger unit tests
  • cargo nextest run -p zeph-db --test migration_parity — 3/3 parity guard (sqlite/102 ↔ postgres/103)
  • cargo nextest run -p zeph-config --lib — 536+ config + migrate step 60 tests
  • cargo nextest run --workspace --lib --bins — 10738 tests, all pass
  • cargo clippy --workspace -- -D warnings — clean
  • RUSTFLAGS="-D warnings" cargo check --workspace --all-targets --features desktop,ide,server,chat,pdf,scheduler --locked — clean
  • zeph knowledge --help lists ingest, rollback, status
  • zeph knowledge ingest --source specs --dry-run (live test: Qdrant not required)
  • zeph knowledge status (live test: works without API key)

Closes #5016, #5017, #5018

@github-actions github-actions Bot added documentation Improvements or additions to documentation memory zeph-memory crate (SQLite) rust Rust code changes enhancement New feature or request size/XL Extra large PR (500+ lines) labels Jun 7, 2026
@bug-ops
bug-ops enabled auto-merge (squash) June 7, 2026 18:08
bug-ops added 2 commits June 7, 2026 20:11
Implements the knowledge-ingest feature foundation (spec-067):

- IngestLedger (#5016): idempotency re-read guard in zeph-memory.
  Dual migrations sqlite/102 + postgres/103. ingested_at stored as
  ISO-8601 TEXT in both dialects. INV-5 semantics (cost guard only,
  not drift guard) documented in rustdoc.

- CLI scaffold (#5017): `zeph knowledge ingest|rollback|status`
  with KnowledgeSource ValueEnum, [knowledge] config section,
  migrate step 60, and --init wizard step_knowledge().

- Notes sink (#5018): ingest specs/changelog/handoff/coverage/git-log
  into Qdrant via existing IngestionPipeline. Ledger skip prevents
  re-embedding unchanged files. --dry-run reports without writing.
  INV-1 (no graph writes), INV-6 (path allowlist) enforced.
  Tracing spans on all I/O paths.

Closes #5016, #5017, #5018
Step 61 was added for MigrateKnowledgeConfig after main added step 60
(MigrateShellCheckpointsConfig). Two test assertions had the old count.
@bug-ops
bug-ops force-pushed the 5016-knowledge-ingest-ledger-cli branch from 1f883b2 to b4eada4 Compare June 7, 2026 18:14
@bug-ops
bug-ops merged commit 92d31c5 into main Jun 7, 2026
35 checks passed
@bug-ops
bug-ops deleted the 5016-knowledge-ingest-ledger-cli branch June 7, 2026 18:22
bug-ops added a commit that referenced this pull request Jun 7, 2026
MIGRATIONS registry now contains 62 steps: 61 (knowledge) added in
main via #5040, plus 62 (deep_link) from this branch.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation enhancement New feature or request memory zeph-memory crate (SQLite) rust Rust code changes size/XL Extra large PR (500+ lines)

Projects

None yet

1 participant