> **For agentic workers:** REQUIRED SUB-SKILL: Use superpowers:subagent-driven-development or superpowers:executing-plans. Complete each task's RED/GREEN checks and record evidence.
**Goal:** Dispatch ready jobs FIFO across idle GPUs and run the workspace with 384 GiB RAM.
**Architecture:** One scheduler owns FIFO claims and persistent per-GPU leases, while independent execution monitors own task process groups. Business orchestration feeds independent ready leaves into that queue within quotas. Aggregated resource state drives the web UI.
Files: `inference/llm_services/{store,worker,gpu_policy,api}.py`, `inference/scripts/service.py`, new scheduler/resource helpers if useful, related inference tests.
Interfaces: scheduler JSON schema_version=2; `active_jobs` entries carry `job_id`, `attempt_count`, `gpu_index`, `gpu_uuid`, `stage`, `state`, `reason`; top-level `running_count`, `queued_count`, `state`, `policy`, `updated_at`. States `running/waiting/idle/blocked`, with per-entry preempting allowed. Settings keys live in worker config/settings.json, never runtime-policy.json. `max_gpu_jobs=4`, `cpu_threads_per_job=2`, initial host-memory estimates GiB: image=88, video=64, defect=24, audio=12; global headroom=16. These conservative estimates are configurable and updated by real measurements. Admission accounts for current cgroup working memory, active reservations and SHM, without counting reclaimable inactive file cache as permanently consumed.
- [x] Write and run failing tests: three UUIDs launch A/B/C FIFO while D waits; concurrent claims never duplicate UUID/job; mixed modes use eligible queue_seq; old-attempt writes rejected; one cancellation or external preemption leaves other runners alive; multiple markers block unsafe recovery; old schema migration preserves jobs; memory shortage queues head job.
- [x] Implement one event dispatcher with per-job monitors and markers. Claims/spawns ordered, monitor/cleanup independent, status single writer. Keep `run_once` compatibility for meaningful legacy fixtures or update callers deliberately.
- [x] Add attempt CAS to terminal and requeue writes, bounded all-runner shutdown, per-runner env/CPU threads, max slot and memory admission.
- [x] Run inference suite on Windows for portable parts, then complete Linux process/guard/service suite in isolated server scratch. Record RED/GREEN and commit scoped files after review.
Files: `backend/app/{coordinator,workflow_engine,batches,workflows,jobs}.py` as needed and corresponding backend tests. Do not edit providers.py (Task 4 owner).
Interfaces: reuse existing upstream scheduling protocol/job IDs and attempt fences. Independent ready steps enqueue in stable step order within remaining per-owner quota (8 interactive GPU jobs). Multiple active batch members allowed; preserve existing current_item_index compatibility while providing active item list/count if needed. Separate new-submit FIFO from next_action_at retry polling. Bound background preparation/collection and continue querying existing upstream executions.
- [x] Write RED tests for three independent shot submissions, 12/20-shot quota replenishment, two batch members in flight, compose waiting all chosen outputs, cancelling one child, stable FIFO ready submission despite polling timestamps.
- [x] Implement bounded per-leaf persistence and replenish; remove only unique-active-member gate, preserve run/user quotas, hold controls, permissions and dependencies.
- [x] Ensure long preparation/result imports do not starve ready submissions; retain CPU/Qwen pool limits and persisted outcomes.
- [x] Run full backend tests, report any baseline unrelated failures separately; scoped review/commit.
### Task 3: GPU monitor disappearing-PID handling and diagnostics
Files: `inference/admin/gpu_guard.py`, `inference/tests/test_gpu_guard.py` (and only narrowly related tests).
Interfaces: preserve guard status schema v1, ownership and global failure behavior. A missing PID can be dropped only after one fresh NVIDIA sample confirms disappearance; permission/identity ambiguity stays fail-closed. Logs record failed PID, stage, error category without dumping command/env/secrets.
- [x] RED tests: sampled PID exits before /proc read then absent on bounded resample -> no global error; still-present unknown PID/permission failure -> fail closed; new external process in refreshed sample is retained; sample retry bounded and existing watchdog identity tests pass.
- [x] Implement one bounded resample and structured diagnostics; retain root-only policy and pidfd signaling.
- [x] Run guard suite portable then Linux, review and scoped commit. Root deploys root-owned script only after full verification.
### Task 4: Aggregated UI resources, documentation and integration
Files: `backend/app/providers.py`, `backend/tests/test_resource_status*.py` or existing resource tests, frontend resource types/components/text/tests, help manuals, README and deployment checks. Root owns these files.
- [x] RED tests for multiple active_jobs, single-card preemption with another card running/ready, schema-v1 compatibility, no sensitive process detail in public resource state.
- [x] Adapt provider resource summary and frontend types/counts/card information; remove current single-task wording, preserve history reports.
- [x] Run backend full suite, frontend full tests/typecheck/build, inference full Linux suite; independently review integration. Resolve important findings with focused RED/GREEN checks.
- [x] Recheck host available RAM and target container identity; save old configuration; docker update memory and memory-swap to384g; verify exact cgroup limit412316860416 and unchanged container start time.
- [x] Compare canonical files to baseline manifest; integrate only this feature's delta with three-way preservation of concurrent edits, then retest combined source. Do not stage or deploy unrelated incomplete work.
- [x] Drain existing jobs before coordinated API/worker schema switch; retain queued jobs. Back up SQLite using backup API, configurations, service identities and touched source.
- [x] Deploy consistent inference/API/UI versions, root guard source and operator config; check readiness and Qwen/other container identity.
- [x] Submit four low-cost real GPU jobs across three free cards; prove FIFO starts, overlapping execution, fourth waiting then filling a released card, outputs decoded, per-card cleanup, single-card controlled external preemption, RAM/SHM peaks, no duplicate attempts or unexplained requeue. Do not consume GPU0 external service.
- [x] Restore prior test-only inputs/policy after validation; leave production concurrency enabled and384 GiB. Record final tests, changed service bindings, source commit and limitations.