Structure kernel create stage with event delivery guarantee
- Dominant language
- Python
- Stars
- 670
- Forks
- 183
- Avg merge
- 15h 13m
- Merged PRs (30d)
- 368
Description
Refactor the create phase of create_kernel() into a CreateStageHandler under agent/stage/kernel_lifecycle/docker/. The handler runs create_container -> start_container and RETURNS A RESPONSE ONLY - it does not emit lifecycle events. Local phase transitions: -> CREATING, CREATING -> RUNNING.
The handler calls BEP-1057 ComputeBackend for instance creation. It must be idempotent: detect an existing instance via the kernel-id correlation key and avoid duplicate creation.
Do NOT emit KernelCreatingAnycastEvent from the handler - status transitions are reported by the separate transition-event layer (BA-6851).
Success Criteria:
- [ ] Container creation runs through CreateStageHandler, not inline in create_kernel()
- [ ] Handler returns a response only (no event emission)
- [ ] Re-run detects an existing instance and does not double-create
- [ ] pants test passes for affected packages
JIRA Issue: BA-6077
Contributor guide
Assessment
This issue has not been assessed yet.