Skip to content

Policy and holds

Policy is your list of what exists and what is allowed. A hold is a recorded reason not to start work. Both can stop a command with exit 3, held, and neither means anything is wrong.

Policy lives in .nuf/config/policy.yaml. One project folder has one Policy, shared by every repository in it. It holds:

  • the providers and their pools, the machines a job may run on, with their caps;
  • budgets and limits;
  • the guard classes, which name the checks each kind of change needs;
  • the numbers the board uses.

nuf policy shows Policy with its hash, and whether that Policy is adopted. nuf pool list shows the pools with their usual minutes. nuf spend shows money per provider against its caps, today and this month.

The local machine is a place a job can run, with memory as its budget. Its memory limit is in the machine’s own settings, config/local/machine.yaml.

Git is a second way for policy.yaml to change: a pull, a checkout or a merge. So nuf uses a Policy only once it is adopted.

Adoption is recorded by hash. The hash is of the parsed data, so a comment or the order of keys changes nothing. Every act and follow-up answers 3, held, and writes nothing in two cases:

  • the file differs from the last adopted Policy;
  • no adoption is recorded, as in a fresh clone of the nuf folder.

Reads still answer, and so do dry runs, with 3.

Terminal window
nuf policy change --by you

nuf policy change adopts the file as it stands. It edits no file and writes one record. It is your command, never an agent’s: its permission pattern is in no agent’s allowance. Planned: a policy guard on the hub agent’s session that asks you first.

Some commands still run while Policy is held:

  • the stops and releases: nuf job stop, nuf job stop-all, nuf job release-all and nuf lab stop;
  • the runner of a job already started.

So a pull never strands work that spends money.

A hold is a recorded reason not to start work, with who set it, why and since when. nuf hold list shows the open holds. While a hold that blocks a command is open, that command answers 3.

  • nuf job stop-all stops every running job and opens a hold. The jobs go back in the queue.
  • nuf hold lift lifts a hold. The requests that waited then start, in the order they were made.

Both belong to the jobs desk: the role whose commands act on every job. --by names who acts, as a name, not proof: nuf cannot yet tell one session from another.

nuf’s own guide for agents says what a 3 asks of them. From a hold: wait in the background and say nothing. From Policy: tell you once, and leave the adoption to you.