Files
kebab/crates/kebab-parse-image/Cargo.toml
altair823 2d68827cf5 refactor(core): 빈 re-export shim crate kebab-embed/kebab-llm → kebab-core 흡수
kebab-embed/kebab-llm 은 "새 type 없음"을 자처한 순수 re-export 셸이었다
(trait 은 이미 kebab-core 소유, mock + test helper 만 보유). "kebab-core
재구성 시 안정 surface" 라는 명분은 1인 RAG 엔 speculative YAGNI. 흡수:

- kebab-core 에 default-OFF `mock` feature + src/mock.rs (MockEmbedder,
  MockLanguageModel, assert_vector_shape/assert_unit_norm/assert_finish_chunk
  을 kebab_core:: → crate:: import 만 바꿔 verbatim 이동).
- production import 2곳(kebab-embed-local, kebab-llm-local) +
  test import 다수(search/rag/parse-image/embed-local) 를 kebab_core 로 repoint.
  mock 쓰는 crate 는 dev-dep 에 features=["mock"] (default 빌드 무영향).
- shim 자체 테스트: mock 동작 테스트는 kebab-core/tests/ 로 이동,
  reexports.rs(셸 재수출 테스트)는 폐기.
- crates/kebab-embed, crates/kebab-llm 삭제 + workspace member/deps 정리.
- ARCHITECTURE/HANDOFF/component README 의 crate 그래프·표·rationale 갱신
  (22 → 20 crates). llm-local 의 broken intra-doc link 2건도 정리.

trait surface·동작 불변 (test-only + import-rename). workspace build 는 mock
default-OFF 라 mock 코드 미컴파일. 적대적 검증 3렌즈(build-test-integrity +
behavior-identity[mock byte-identical] + dead-crate-completeness) 통과,
clippy --workspace -D warnings 클린.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012Mc6W1fgsrbFKTsqA6P8La
2026-06-27 01:06:14 +00:00

76 lines
3.8 KiB
TOML

[package]
name = "kebab-parse-image"
version = { workspace = true }
edition = { workspace = true }
rust-version = { workspace = true }
license = { workspace = true }
repository = { workspace = true }
description = "Image extractor + EXIF + OCR (Ollama-vision) for the kebab pipeline (P6-1, P6-2)"
[dependencies]
kebab-core = { path = "../kebab-core" }
kebab-config = { path = "../kebab-config" }
# The caption adapter consumes any `dyn LanguageModel` (the trait lives in
# `kebab-core`). We do NOT depend on `kebab-llm-local` (forbidden by p6-3
# design §8) — the trait abstraction is exactly what spec requires.
anyhow = { workspace = true }
serde = { workspace = true }
serde_json = { workspace = true }
time = { workspace = true }
tracing = { workspace = true }
# `image` ships a wide format menagerie under default features (BMP, DDS,
# Farbfeld, …). We only need PNG / JPEG / WebP / GIF / TIFF for v1 (per
# task spec out-of-scope HEIC/RAW). Trim defaults to keep the dep
# closure small.
image = { version = "0.25", default-features = false, features = ["png", "jpeg", "webp", "gif", "tiff"] }
# kamadak-exif: pure-Rust EXIF reader. Used for the whitelisted tag
# extraction (DateTimeOriginal, GPS, Make, Model, Orientation, Software).
kamadak-exif = "0.6"
# Ollama-vision OCR adapter (P6-2) talks HTTP directly. We keep the
# feature surface identical to `kebab-llm-local` (blocking + json +
# rustls-tls) so both crates share the same TLS backend and the
# transitive tokio runtime is brought in once.
reqwest = { version = "0.12", default-features = false, features = ["blocking", "json", "rustls-tls"] }
base64 = { workspace = true }
thiserror = { workspace = true }
# paddle-onnx OCR engine (PP-OCRv5, in-process). We reuse the workspace ort
# pin (=2.0.0-rc.9) so the ONNX Runtime native lib stays single-versioned with
# fastembed / kebab-nli (oar-ocr is intentionally NOT a dep — it would pull
# ort rc.12 + ndarray 0.17, splitting the native `links` and threatening the
# embedding stack). `download-binaries` extends the pin the same way
# `kebab-nli/Cargo.toml:23` does: this crate isn't in fastembed's build graph,
# so a standalone `cargo test -p kebab-parse-image` needs it to link onnxruntime.
ort = { workspace = true, features = ["ndarray", "download-binaries"] }
ndarray = { workspace = true }
# blake3: engine_version hash over the bundled det/rec/dict assets (computed
# once at OnnxPaddleOcr construction, cached — `ingest_config_signature` calls
# engine_version() per asset).
blake3 = { workspace = true }
# imageproc: connected-components / contours for DBNet det post-processing.
# min-area rotated-rect (rotating calipers) and polygon unclip are implemented
# in pure Rust (clipper2 is C++ FFI — would break the single-binary guarantee).
imageproc = "0.25"
[dev-dependencies]
tempfile = { workspace = true }
blake3 = { workspace = true }
# Shared test infrastructure with `kebab-llm-local`: wiremock under
# tokio for HTTP fixtures.
wiremock = { workspace = true }
tokio = { workspace = true, features = ["rt-multi-thread"] }
# Used by `tests/common/mod.rs` to render the opt-in OCR integration
# fixture. Only loaded for tests; the production crate doesn't need
# font rendering.
ab_glyph = "0.2"
base64 = { workspace = true }
# `kebab-core`'s `mock` feature exposes `MockLanguageModel` for hermetic
# caption tests. Real adapters (Ollama) live in `kebab-llm-local`, which is
# only allowed at the dev-dep level here — the runtime crate stays
# trait-only, so the §8 forbidden-deps rule (no `kebab-llm-local`
# at runtime) is preserved.
kebab-core = { path = "../kebab-core", features = ["mock"] }
kebab-llm-local = { path = "../kebab-llm-local" }
[lints]
workspace = true