Repository navigation
Backlog
Milestone
Description
Parent
Ticket LF3 of spec #3028 (0.1.2): the local driver's cap, OPENWIZ_LOCAL_MAX. Size: S.
What to build
adapters/local/driver: readOPENWIZ_LOCAL_MAX, a whole number from 1 to 1000, and leave it uncapped when unset (today's behaviour). Any other value is refused under D3 before anything is saved or started.- Before a start saves its run, count this machine's live runs in
$OPENWIZ_LOCAL_STATE. A run is live while it is starting or while its last turn is still running, asrunning()sees it. A run whose turn ended and is waiting for a wake doesn't count, and neither does a stopped run. - At the cap, refuse with driver v1's full refusal (0.1.2 LF1: driver v1 says a host is full, and the host setting lists hosts in order #3029):
nextexactlythis host is full: start on the next host, or wait for a free place, anderrorlikelocal is full: 2 of 2 agents are running. Nothing is cloned, saved or started. - Take one driver-wide lock file in the state folder for the count and the save together, so two starts at once never both take the last place. The per-run locks stay as they are.
wakeandstopnever check the cap. A wake at the cap still runs its turn.adapters/local/README.md: one line underEffort:,Cap: \OPENWIZ_LOCAL_MAX` agents running at once (unset: no cap)`, plus one bullet on what counts as running.changes/3032.md: oneaddedline (the fleet's standing supporting-edit rule covers it).
Owned paths
adapters/local/driveradapters/local/README.mdadapters/local/test_driver.pyadapters/local/evidence/(shared: this ticket's red-first receipt only)changes/3032.md(new)
Relies on: kernel/driver.v1.md
Links
- 0.1.2 LF1: driver v1 says a host is full, and the host setting lists hosts in order #3029 real: the full refusal's exact text and the start-only rule this driver answers with
Acceptance criteria
- With
OPENWIZ_LOCAL_MAX=2, a third start while two turns run answers the exact full refusal and starts no clone or turn - When one turn ends, the next start goes ahead
- A wake at the cap runs
- Two starts at once with one place left: exactly one runs, and the other answers full
- Unset keeps every existing test passing, and a bad value is refused before anything starts
-
python3 -I adapters/local/test_driver.pypasses, red first inadapters/local/evidence/
Proof
P2 (drivers): the fixture tests, red first.
Metadata
Metadata
Assignees
Labels
No labels
Activity