Repository navigation
Description
Priority: P2 | Area: area:runtime | Labels: chore,P2,area:runtime | Milestone: 0.0.25 | RFC: W-132 / W-140, bitty-execution#14 | Task: pending
Current state
bitty-execution already owns the accepted job model and is independently verified (JobRegistry + monotonic JobId, JobLifetime × JobKind, hard/idle/retention clocks, bounded newest-wins output + OutputIndex, dual-channel delivery, per-principal per-operation authorization, persistence, sidecar supervision).
Core does not link that crate. Its plugin/tool spawn path uses bitty_ipc::execution::{ExecutionRequest, RawExecutionOutput, ExecutionStatus} and keeps a duplicate supervisor in crates/bitty-runtime/src/plugin_runtime/spawn.rs (validate → six-gate dispatch → spawn/kill/reap/drain); crates/bitty-runtime/src/component/ keeps a second one. bitty-execution#14 (audit F4) recorded exactly this duplication and is closed with the contract published, not with the routing done.
Consequence
Plugin-visible bitty.process.spawn is a request/response execution: no JobId, no list/attach/cancel, no background lifetime, no Critical/Observation delivery. “Put it in the background and check later” exists in the model but is not reachable from a plugin.
Proposed scope (two phases)
- Extraction/retirement: route Core component and plugin spawn paths through the
bitty-executionsupervisor, preserving the current six-gate authorization and the fail-closed spawn contract; delete the duplicate supervisor only after parity + W-147 fence tests pass. - Plugin job surface (separate accepted API decision): expose bounded
spawn_as/list_as/read_output_as/cancel_as/attach_asunder per-operation capabilities, keeping the v1process.spawnLua signature unchanged until a new API version accepts the additions.
Phase 2 must not invent a second model; it maps onto the existing registry.
Acceptance
- No second supervisor in Core; parity tests for spawn/cancel/reap/drain and crash policy.
- Plugin spawns obtain real JobIds and bounded tail reads.
- Capability denials and stale/cross-principal job handles are tested.
- No change to v1 Lua surface without an accepted API decision.
Activity
[CTX-1403] feat(runtime): route tool/plugin spawns through bitty-exec…
[CTX-1403] feat(runtime): route tool/plugin spawns through bitty-exec…
[CTX-1403] feat(runtime): route tool/plugin spawns through bitty-exec…
[CTX-1403] feat(runtime): route tool/plugin spawns through bitty-exec…
[CTX-1403] feat(runtime): route tool/plugin spawns through bitty-exec…
[CTX-1403] feat(runtime): route tool/plugin spawns through bitty-exec…
[CTX-1403] feat(runtime): route tool/plugin spawns through bitty-exec…
[CTX-1403] feat(runtime): route tool/plugin spawns through bitty-exec…
[CTX-1403] feat(runtime): route tool/plugin spawns through bitty-exec…
[0.0.25] feat(runtime): route tool/plugin spawns through bitty-execut…