From aa2a6ea7fc7f8fb453b5fdd007c4de082b3345f2 Mon Sep 17 00:00:00 2001 From: altair823 Date: Mon, 4 May 2026 17:43:52 +0000 Subject: [PATCH] =?UTF-8?q?feat(kebab-core):=20p9-fb-23=20task=201=20?= =?UTF-8?q?=E2=80=94=20IngestItemKind::Unchanged=20+=20IngestReport.unchan?= =?UTF-8?q?ged?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude Opus 4.7 (1M context) --- crates/kebab-app/src/ingest_progress.rs | 4 ++++ crates/kebab-app/src/lib.rs | 6 ++++++ crates/kebab-core/src/ingest.rs | 10 ++++++++++ crates/kebab-tui/src/ingest_progress.rs | 3 +++ docs/wire-schema/v1/ingest_report.schema.json | 6 ++++++ 5 files changed, 29 insertions(+) diff --git a/crates/kebab-app/src/ingest_progress.rs b/crates/kebab-app/src/ingest_progress.rs index 06c959e..1ff6e45 100644 --- a/crates/kebab-app/src/ingest_progress.rs +++ b/crates/kebab-app/src/ingest_progress.rs @@ -28,6 +28,10 @@ pub struct AggregateCounts { pub new: u32, pub updated: u32, pub skipped: u32, + /// p9-fb-23: assets whose checksum + all version inputs matched the + /// existing DB record — parse / chunk / embed / vector upsert all + /// skipped. + pub unchanged: u32, pub errors: u32, pub chunks_indexed: u32, pub embeddings_indexed: u32, diff --git a/crates/kebab-app/src/lib.rs b/crates/kebab-app/src/lib.rs index 87cfa01..4220af9 100644 --- a/crates/kebab-app/src/lib.rs +++ b/crates/kebab-app/src/lib.rs @@ -347,6 +347,7 @@ pub fn ingest_with_config_cancellable( let mut new_count: u32 = 0; let mut updated_count: u32 = 0; let mut skipped_count: u32 = 0; + let mut unchanged_count: u32 = 0; let mut error_count: u32 = 0; // Aggregate counts surfaced into `ingest_runs` (and tracing). Not // exposed on `IngestReport` today — `kebab_core::IngestReport` is a @@ -445,6 +446,9 @@ pub fn ingest_with_config_cancellable( kebab_core::IngestItemKind::Skipped => { skipped_count = skipped_count.saturating_add(1) } + kebab_core::IngestItemKind::Unchanged => { + unchanged_count = unchanged_count.saturating_add(1) + } kebab_core::IngestItemKind::Error => { error_count = error_count.saturating_add(1) } @@ -585,6 +589,7 @@ pub fn ingest_with_config_cancellable( new: new_count, updated: updated_count, skipped: skipped_count, + unchanged: unchanged_count, errors: error_count, chunks_indexed, embeddings_indexed, @@ -626,6 +631,7 @@ pub fn ingest_with_config_cancellable( new: new_count, updated: updated_count, skipped: skipped_count, + unchanged: unchanged_count, errors: error_count, duration_ms, items: if summary_only { None } else { Some(items) }, diff --git a/crates/kebab-core/src/ingest.rs b/crates/kebab-core/src/ingest.rs index 7636a95..02e1e69 100644 --- a/crates/kebab-core/src/ingest.rs +++ b/crates/kebab-core/src/ingest.rs @@ -13,7 +13,11 @@ pub struct IngestReport { pub scanned: u32, pub new: u32, pub updated: u32, + /// Media-type / source filter (`kb://`, unsupported types). pub skipped: u32, + /// p9-fb-23: assets whose checksum + all version inputs matched — + /// parse / chunk / embed / vector upsert all skipped. + pub unchanged: u32, pub errors: u32, pub duration_ms: u32, /// `None` ↔ wire `items: null` (`--summary-only`). @@ -40,6 +44,12 @@ pub struct IngestItem { pub enum IngestItemKind { New, Updated, + /// Media-type filter / kb:// URI / non-supported source — never made + /// it into the parse step. Skipped, + /// p9-fb-23: blake3 checksum + parser_version + chunker_version + + /// embedding_version all matched the existing record. Parse / chunk + /// / embed / vector upsert all skipped. + Unchanged, Error, } diff --git a/crates/kebab-tui/src/ingest_progress.rs b/crates/kebab-tui/src/ingest_progress.rs index c120a8a..974a13d 100644 --- a/crates/kebab-tui/src/ingest_progress.rs +++ b/crates/kebab-tui/src/ingest_progress.rs @@ -131,6 +131,9 @@ fn apply_event(state: &mut IngestState, event: IngestEvent) { kebab_core::IngestItemKind::Skipped => { state.counts.skipped = state.counts.skipped.saturating_add(1); } + kebab_core::IngestItemKind::Unchanged => { + state.counts.unchanged = state.counts.unchanged.saturating_add(1); + } kebab_core::IngestItemKind::Error => { state.counts.errors = state.counts.errors.saturating_add(1); } diff --git a/docs/wire-schema/v1/ingest_report.schema.json b/docs/wire-schema/v1/ingest_report.schema.json index be25ad0..4cfb394 100644 --- a/docs/wire-schema/v1/ingest_report.schema.json +++ b/docs/wire-schema/v1/ingest_report.schema.json @@ -11,6 +11,7 @@ "new", "updated", "skipped", + "unchanged", "errors", "duration_ms" ], @@ -21,6 +22,11 @@ "new": { "type": "integer", "minimum": 0 }, "updated": { "type": "integer", "minimum": 0 }, "skipped": { "type": "integer", "minimum": 0 }, + "unchanged": { + "type": "integer", + "minimum": 0, + "description": "p9-fb-23: assets whose checksum + parser_version + chunker_version + embedding_version all matched the existing record. Parse / chunk / embed / vector upsert all skipped." + }, "errors": { "type": "integer", "minimum": 0 }, "duration_ms": { "type": "integer", "minimum": 0 }, "items": { "type": ["array", "null"] }