feat(schema): add active_parsers + active_chunkers arrays to schema.v1.models (Bug #13)
이전: schema.v1.models 가 parser_version / chunker_version 단일 값만 보고 → multi-medium corpus (md + pdf + code Rust/Python + dockerfile + k8s + manifest) 의 version cascade audit 누락 risk. 이후: additive minor — Models struct 에 active_parsers + active_chunkers Vec<String> 추가. backward compat: 기존 단일 field 보존 (markdown default), 신규 array 는 optional (#[serde(default)] + JSON schema required 미포함). source: - kebab_store_sqlite::fetch_distinct_parser_versions() 가 documents.parser_version DISTINCT + ORDER BY 반환. - fetch_distinct_chunker_versions() 가 chunks.chunker_version 동일 pattern. - collect_models 가 매 schema 호출마다 재계산 (cache 없음 — R-3 자동 해결). wire schema additive only — 메이저 bump 불필요. v0.20.1 minor 로 충분. integrations/claude-code/kebab/SKILL.md 동기 갱신. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -961,6 +961,51 @@ impl SqliteStore {
|
||||
}
|
||||
Ok(out)
|
||||
}
|
||||
|
||||
/// p20-bugfix3 Bug #13: schema.v1.models.active_parsers 의 source.
|
||||
/// `documents.parser_version` 컬럼의 DISTINCT 값을 정렬해 반환.
|
||||
/// 빈 corpus → 빈 Vec.
|
||||
pub fn fetch_distinct_parser_versions(&self) -> anyhow::Result<Vec<String>> {
|
||||
use anyhow::Context;
|
||||
let conn = self.read_conn();
|
||||
let mut stmt = conn
|
||||
.prepare(
|
||||
"SELECT DISTINCT parser_version FROM documents \
|
||||
WHERE parser_version IS NOT NULL AND parser_version != '' \
|
||||
ORDER BY parser_version",
|
||||
)
|
||||
.context("prepare fetch_distinct_parser_versions")?;
|
||||
let rows = stmt
|
||||
.query_map([], |row| row.get::<_, String>(0))
|
||||
.context("query fetch_distinct_parser_versions")?;
|
||||
let mut out = Vec::new();
|
||||
for r in rows {
|
||||
out.push(r.context("read parser_version row")?);
|
||||
}
|
||||
Ok(out)
|
||||
}
|
||||
|
||||
/// p20-bugfix3 Bug #13: schema.v1.models.active_chunkers 의 source.
|
||||
/// `chunks.chunker_version` 컬럼의 DISTINCT 값을 정렬해 반환.
|
||||
pub fn fetch_distinct_chunker_versions(&self) -> anyhow::Result<Vec<String>> {
|
||||
use anyhow::Context;
|
||||
let conn = self.read_conn();
|
||||
let mut stmt = conn
|
||||
.prepare(
|
||||
"SELECT DISTINCT chunker_version FROM chunks \
|
||||
WHERE chunker_version IS NOT NULL AND chunker_version != '' \
|
||||
ORDER BY chunker_version",
|
||||
)
|
||||
.context("prepare fetch_distinct_chunker_versions")?;
|
||||
let rows = stmt
|
||||
.query_map([], |row| row.get::<_, String>(0))
|
||||
.context("query fetch_distinct_chunker_versions")?;
|
||||
let mut out = Vec::new();
|
||||
for r in rows {
|
||||
out.push(r.context("read chunker_version row")?);
|
||||
}
|
||||
Ok(out)
|
||||
}
|
||||
}
|
||||
|
||||
/// Apply the design §5 / task-spec pragmas. Called once per connection.
|
||||
|
||||
Reference in New Issue
Block a user