Ctrl-C / Esc 가 ingest 를 즉시 중단. 현재 in-flight asset 마무리 후
이후 asset 미실행, IngestEvent::Aborted { partial_counts } 발신,
Ok(IngestReport) 정상 반환 (Err 아님). 부분 commit 보존, 다음 ingest
가 idempotent 재개.
신규 facade: kebab-app::ingest_with_config_cancellable(.., progress,
cancel: Option<Arc<AtomicBool>>). 기존 _progress 가 cancel=None
forwarding wrapper. asset loop 시작 boundary 마다 atomic load —
true 면 break + Aborted emit + 정상 종료. Lock 없음.
CLI: ctrlc crate 신규 dep. SIGINT handler 가 첫 신호에 cancel.store(true)
+ stderr hint, 두 번째 신호에 std::process::exit(130) (canonical SIGINT
exit code). install_sigint_cancel() helper 가 Arc<AtomicBool> 반환,
Cmd::Ingest 가 facade 에 전달.
TUI: IngestState 에 cancel: Arc<AtomicBool> field 추가 (회차 1 review
결과의 reshape 정확). start_ingest 가 둘 다 만들어 worker 에 clone
move. cancel_running_ingest(&app) helper — Esc / Ctrl-C 가
ingest 진행 중일 때만 cancel 우선, 그 외에는 quit.
Test:
- 3 facade integration (cancel-before / cancel-mid / no-cancel
default).
- 3 tui lib unit (cancel_running_ingest no-state / in-flight /
terminated).
Plan 갱신: p9-fb-04 status planned → in_progress. 머지 후 한 줄
commit 으로 completed flip.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
46 lines
1.7 KiB
TOML
46 lines
1.7 KiB
TOML
[package]
|
|
name = "kebab-cli"
|
|
version = { workspace = true }
|
|
edition = { workspace = true }
|
|
rust-version = { workspace = true }
|
|
license = { workspace = true }
|
|
repository = { workspace = true }
|
|
description = "kb command-line interface"
|
|
|
|
[[bin]]
|
|
name = "kebab"
|
|
path = "src/main.rs"
|
|
|
|
[dependencies]
|
|
kebab-core = { path = "../kebab-core" }
|
|
kebab-config = { path = "../kebab-config" }
|
|
kebab-app = { path = "../kebab-app" }
|
|
# kb-eval re-exports `compute_aggregate` / `compare_runs` /
|
|
# `render_report_md` (P5-2). The DoD calls for these to be reached
|
|
# "via kb-app", but kb-eval already depends on kb-app (P5-1 runner
|
|
# uses the App facade) — routing the CLI through kb-app would
|
|
# require kb-app → kb-eval, forming a cycle. We therefore wire
|
|
# kb-cli → kb-eval directly; documented in
|
|
# `tasks/p5/p5-2-metrics-compare.md`.
|
|
kebab-eval = { path = "../kebab-eval" }
|
|
# P9-1: Ratatui shell. UI consumes `kebab-app` only — `kebab-tui`
|
|
# enforces the §8 boundary in its own Cargo.toml; kb-cli just
|
|
# launches it.
|
|
kebab-tui = { path = "../kebab-tui" }
|
|
anyhow = { workspace = true }
|
|
serde_json = { workspace = true }
|
|
clap = { version = "4", features = ["derive"] }
|
|
# p9-fb-02: ingest progress UI.
|
|
# - TTY 사람 모드: indicatif spinner + bar (stderr).
|
|
# - --json 모드 / non-TTY: indicatif 끄고 raw line emit.
|
|
# - timestamp formatting (RFC 3339) 은 time crate.
|
|
indicatif = "0.17"
|
|
time = { workspace = true }
|
|
# p9-fb-04: SIGINT handler for `kebab ingest` cooperative cancel.
|
|
# `ctrlc` registers a single cross-platform handler; we count signal
|
|
# arrivals to implement spec §10's "second Ctrl-C is a hard exit".
|
|
ctrlc = "3"
|
|
|
|
[dev-dependencies]
|
|
tempfile = { workspace = true }
|