Skip to content

0.1.2 LF3: the local driver caps agents at OPENWIZ_LOCAL_MAX and answers full #3032

Backlog

Description

@jparker2006

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: read OPENWIZ_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, as running() 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): next exactly this host is full: start on the next host, or wait for a free place, and error like local 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.
  • wake and stop never check the cap. A wake at the cap still runs its turn.
  • adapters/local/README.md: one line under Effort:, Cap: \OPENWIZ_LOCAL_MAX` agents running at once (unset: no cap)`, plus one bullet on what counts as running.
  • changes/3032.md: one added line (the fleet's standing supporting-edit rule covers it).

Owned paths

  • adapters/local/driver
  • adapters/local/README.md
  • adapters/local/test_driver.py
  • adapters/local/evidence/ (shared: this ticket's red-first receipt only)
  • changes/3032.md (new)

Relies on: kernel/driver.v1.md

Links

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.py passes, red first in adapters/local/evidence/

Proof

P2 (drivers): the fixture tests, red first.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions