From 61aae1c1d59ebb6494b964997a56be430359d2c2 Mon Sep 17 00:00:00 2001
From: th-kim0823
Date: Thu, 7 May 2026 11:58:06 +0900
Subject: [PATCH] =?UTF-8?q?=F0=9F=8F=97=EF=B8=8F=20refactor(kebab-app):=20?=
=?UTF-8?q?consolidate=20PARSER=5FVERSION=20+=20clarify=20intent=20(fb-27)?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Replace kebab-app's private `KEBAB_PARSE_MD_VERSION` literal with a
direct reference to `kebab_parse_md::PARSER_VERSION` so the parser
version cascade has a single source of truth (design §9 invariant).
Add maintenance comment on schema.rs WIRE_SCHEMAS const pointing to
docs/wire-schema/v1/ + kebab-cli wire helpers as the authoritative
sources to keep in sync.
Tighten open_existing doc comment to match the actual SQLITE_OPEN_READ_WRITE
flag (needed for WAL pragma application) — callers should still avoid
issuing mutations through this connection.
Co-Authored-By: Claude Opus 4.7 (1M context)
---
crates/kebab-app/src/lib.rs | 17 +----------------
crates/kebab-app/src/schema.rs | 2 ++
crates/kebab-store-sqlite/src/store.rs | 6 +++---
3 files changed, 6 insertions(+), 19 deletions(-)
diff --git a/crates/kebab-app/src/lib.rs b/crates/kebab-app/src/lib.rs
index 69ea5fb..180f17d 100644
--- a/crates/kebab-app/src/lib.rs
+++ b/crates/kebab-app/src/lib.rs
@@ -74,21 +74,6 @@ pub use schema::{Capabilities, Models, SchemaV1, Stats, WireBlock, schema_with_c
/// compatibility break.
pub const NO_EXT_SENTINEL: &str = "";
-/// Parser-version label persisted in `documents.parser_version` for
-/// every Markdown file ingested through the `kb-parse-md` pipeline.
-/// Kept in lock-step with the literal used in the `kb-store-sqlite`
-/// idempotency / round-trip tests so the version label written by the
-/// app and the one used in cross-crate fixtures match.
-///
-/// p9-fb-07 bumped this from `pulldown-cmark-0.x` to `md-frontmatter-v2`
-/// because `kebab-normalize::derive_title` now applies a fallback chain
-/// (frontmatter → H1 → H2 → first paragraph → file stem) when the
-/// frontmatter title is blank. The bump invalidates `doc_id` for every
-/// pre-existing Markdown document, so a re-ingest is required for the
-/// new titles to land — this is the documented cascade behavior per
-/// design §9.
-const KEBAB_PARSE_MD_VERSION: &str = "md-frontmatter-v2";
-
/// Caller-supplied knobs for one [`ask`] invocation.
///
/// Re-exported from [`kebab_rag::AskOpts`] (P4-3 owns the type) so kb-cli's
@@ -333,7 +318,7 @@ pub fn ingest_with_config_opts(
.context("kb-app::ingest: ensure Lance table")?;
}
- let parser_version = ParserVersion(KEBAB_PARSE_MD_VERSION.to_string());
+ let parser_version = ParserVersion(kebab_parse_md::PARSER_VERSION.to_string());
let chunk_policy = chunk_policy_from_config(&app.config);
// P6-4: build OCR / caption adapters once per ingest invocation,
diff --git a/crates/kebab-app/src/schema.rs b/crates/kebab-app/src/schema.rs
index c1f9ae0..80e2185 100644
--- a/crates/kebab-app/src/schema.rs
+++ b/crates/kebab-app/src/schema.rs
@@ -54,6 +54,8 @@ pub struct Stats {
const KEBAB_VERSION: &str = env!("CARGO_PKG_VERSION");
+// Authoritative list of wire schemas this binary emits. Keep in sync with
+// `docs/wire-schema/v1/*.schema.json` and `kebab-cli::wire::wire_*` helpers.
const WIRE_SCHEMAS: &[&str] = &[
"answer.v1",
"search_hit.v1",
diff --git a/crates/kebab-store-sqlite/src/store.rs b/crates/kebab-store-sqlite/src/store.rs
index d5f7b48..13691b3 100644
--- a/crates/kebab-store-sqlite/src/store.rs
+++ b/crates/kebab-store-sqlite/src/store.rs
@@ -79,9 +79,9 @@ impl SqliteStore {
///
/// Unlike [`Self::open`], this does NOT create the file — if it is
/// missing, returns a [`NotIndexed`] signal suitable for `error.v1`
- /// translation. Stores returned by this method are intended for read-only
- /// introspection (`schema_with_config`); use [`Self::open`] for any path
- /// that calls `put_asset_with_bytes`.
+ /// translation. Opens read-write to support WAL pragmas; callers should
+ /// not issue mutations through this connection — use [`Self::open`] for
+ /// ingest paths.
///
/// **Does not run migrations** — call [`Self::run_migrations`] next if
/// you need the schema initialised.