Files
aios/docs/superpowers/specs/2026-08-17-r42-p2b-fleet-runtime-integration.md
T

1.4 KiB

R4.2 P2-B Fleet Runtime Integration

P2-B connects the verified P2 fleet primitives to the existing TaskPlane pull scheduler without replacing its security or ownership logic.

The integration uses two stages. FleetScheduler.rank_for_worker() performs only read-only capacity/fairness/fault-isolation ranking. The original TaskScheduler.next_queued_task() is then run over that ordered list and remains the fail-closed security oracle for worker liveness, capabilities, data classification, execution zone and other existing policy checks. Only a task accepted by the original scheduler receives a short durable fleet reservation.

The original TaskScheduler.schedule_for_worker() remains the sole claim path and continues to call the existing TaskPlane claim_task CAS. After a successful claim, the claim ID is bound to the fleet reservation. A claim error releases the reservation. A fleet reservation is never treated as task ownership.

P2-B also makes the reservation capacity check atomic inside the fleet SQLite transaction so two concurrent pullers cannot oversubscribe the same worker slot. Circuit and task/worker quarantine state are enforced on the real pull path. Explicit execution-failure signals can be recorded through the integrated scheduler's failure/success/quarantine methods; policy/claim failures are not automatically mislabeled as worker crashes.

No new daemon, database or production write path is introduced.