Worker extraction (Plan 2)#16
Conversation
… from worker Relocate the worker pipeline modules into kronos-embedded-worker so the poller, pipeline, dispatcher (with http/kafka/redis_stream submodules), and backoff helpers live in the embeddable crate. Module contents are unchanged; the existing crate::backoff and crate::dispatcher sibling imports continue to resolve. kronos-worker keeps a thin lib.rs shim that re-exports kronos_embedded_worker::poller so main.rs's call to kronos_worker::poller::run still resolves; the kafka/redis-stream features and their optional deps are kept on the worker manifest as no-op feature surface until Task 6 collapses them into feature pass-through. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
…rl_c and start/handle
Adds Drop impl that aborts the spawned task (matching the documented contract; tokio::JoinHandle::drop alone detaches rather than aborts). Tightens the oneshot send-error comment and notes the mid-claim drain test gap covered by Task 7.
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Tip 💬 Introducing Slack Agent: The best way for teams to turn conversations into code.Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.
Built for teams:
One agent for your entire SDLC. Right inside Slack. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Summary
poller,pipeline,backoff,dispatcher) fromcrates/worker/intocrates/embedded-worker/.Worker::builder(pool)+WorkerHandle, with library defaultssystem_schema = "kronos"/tenant_schema_prefix = "kronos_"and binary-sidefrom_app_config(&AppConfig)preserving service-modepublic/"".kronos-workerbecomes a binary-only crate (~15 lines).Worker::build()validatesSchemaConfigand probes the system schema'sorganizationsandworkspacestables, failing fast on misconfiguration.Stacked PR context
This PR targets
feat/embedded-mode(Plan 1). It will be merged after the Plan 1 PR; reviewers should diff againstfeat/embedded-mode, notmain.Test plan
cargo build --workspace --all-features(with--exclude kronos-dashboard; the dashboard--all-featuresfailure is pre-existing onfeat/embedded-mode)cargo test --workspace --lib(with--test-threads=1andkronos-mock-serverrunning on :9999; both requirements pre-existing)cargo test -p kronos-embedded-worker --test builder -- --ignored --test-threads=1cargo test -p kronos-embedded-worker --test shutdown -- --ignored --test-threads=1just test-immediatejust test-delayedjust test-cronjust test-e2e— pre-existing failure:kronos-schedulercrate not yet in workspace on this branch (identical on parentfeat/embedded-mode); not a Plan 2 regression.Spec
docs/superpowers/specs/2026-04-29-kronos-embedded-mode-design.md— Plan 2.