🏗️ refactor(fb-27): apply round 1 review nits
- schema.rs: extract `SCHEMA_V1_ID` const + re-export via kebab-app::lib.rs. wire.rs::wire_schema 의 2 literal 도 import 해서 single source of truth. - schema.rs::collect_models: parser_version 가 markdown 만 surface 함을 주석으로 명시 (PDF/image extractor 의 자체 version 은 SchemaV1.models 가 multi-medium map 으로 진화 시 surface). - main.rs::print_schema_text: 헤더 줄 끝의 `\n` 제거 + `println!()` 추가 — 다른 section 들과 패턴 일관. - error_classify.rs::llm_unreachable_classifies: timeout 50ms → 500ms (10x headroom) + 접근 방식 + 한계 주석 추가. - HOTFIXES: open_existing 의 RW flag + 주석-only enforcement 갭을 Known-limitation 에 명시. Round 1 review summary: #104 (comment) Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -65,7 +65,7 @@ pub mod schema;
|
||||
pub use app::App;
|
||||
pub use ingest_progress::{AggregateCounts, IngestEvent, render_skipped_breakdown};
|
||||
pub use reset::{ResetReport, ResetScope};
|
||||
pub use schema::{Capabilities, Models, SchemaV1, Stats, WireBlock, schema_with_config};
|
||||
pub use schema::{Capabilities, Models, SCHEMA_V1_ID, SchemaV1, Stats, WireBlock, schema_with_config};
|
||||
|
||||
/// p9-fb-25: sentinel for files without an extension in
|
||||
/// `IngestReport.skipped_by_extension` keys + `IngestItem.warnings`
|
||||
|
||||
@@ -54,6 +54,10 @@ pub struct Stats {
|
||||
|
||||
const KEBAB_VERSION: &str = env!("CARGO_PKG_VERSION");
|
||||
|
||||
/// Wire schema id for [`SchemaV1`]. Single source of truth — `kebab-cli`
|
||||
/// re-uses this via `kebab_app::schema::SCHEMA_V1_ID` when wrapping.
|
||||
pub const SCHEMA_V1_ID: &str = "schema.v1";
|
||||
|
||||
// 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] = &[
|
||||
@@ -83,7 +87,7 @@ pub fn schema_with_config(cfg: &Config) -> anyhow::Result<SchemaV1> {
|
||||
let stats = collect_stats(&store)?;
|
||||
let models = collect_models(cfg, &store);
|
||||
Ok(SchemaV1 {
|
||||
schema_version: "schema.v1".to_string(),
|
||||
schema_version: SCHEMA_V1_ID.to_string(),
|
||||
kebab_version: KEBAB_VERSION.to_string(),
|
||||
wire: WireBlock {
|
||||
schemas: WIRE_SCHEMAS.iter().map(|s| (*s).to_string()).collect(),
|
||||
@@ -131,6 +135,9 @@ fn collect_stats(store: &kebab_store_sqlite::SqliteStore) -> anyhow::Result<Stat
|
||||
|
||||
fn collect_models(cfg: &Config, store: &kebab_store_sqlite::SqliteStore) -> Models {
|
||||
Models {
|
||||
// markdown parser only — pdf-page-v1 (P7) / image extractors (P6)
|
||||
// maintain their own versions; surface those when SchemaV1.models
|
||||
// becomes a multi-medium map (P+).
|
||||
parser_version: kebab_parse_md::PARSER_VERSION.to_string(),
|
||||
chunker_version: cfg.chunking.chunker_version.clone(),
|
||||
// EmbeddingModelCfg uses `.model` (not `.id`) — adapt from plan.
|
||||
|
||||
Reference in New Issue
Block a user