feat(knowledge): add knowledge ingest CLI, ledger, and notes sink (#5016, #5017, #5018)#5040
Merged
Merged
Conversation
This was
linked to
issues
Jun 7, 2026
Closed
bug-ops
enabled auto-merge (squash)
June 7, 2026 18:08
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
force-pushed
the
5016-knowledge-ingest-ledger-cli
branch
from
June 7, 2026 18:14
1f883b2 to
b4eada4
Compare
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Implements the knowledge-ingest feature foundation (spec-067, M29):
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_atstored 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.zeph knowledge ingest|rollback|statuswithKnowledgeSourceValueEnum (specs,changelog,handoff,coverage,git-log).[knowledge]config section with#[serde(default)]on all fields. Migration step 60 adds the section idempotently.--initwizard emits[knowledge]only for non-default values.IngestionPipeline(no new loader, DRY). Ledger skip prevents re-embedding unchanged files.--dry-runreports file count, projected chunks, and estimated embed tokens without writing anything.source_urithreaded 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
entities=0, edges=0inmark_ingested, nograph_edges/graph_entitiestouched)starts_with()check (macOS/privatesymlink-safe)Test plan
cargo nextest run -p zeph-memory --lib -E 'test(ingest)'— 8/8 IngestLedger unit testscargo 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 testscargo nextest run --workspace --lib --bins— 10738 tests, all passcargo clippy --workspace -- -D warnings— cleanRUSTFLAGS="-D warnings" cargo check --workspace --all-targets --features desktop,ide,server,chat,pdf,scheduler --locked— cleanzeph knowledge --helplistsingest,rollback,statuszeph knowledge ingest --source specs --dry-run(live test: Qdrant not required)zeph knowledge status(live test: works without API key)Closes #5016, #5017, #5018